/* 매매 복기: 글 본문(.csth)과 목록 페이지(.csth-app). 상승·수익은 빨강, 하락·손실은 파랑 (한국 시세 관례) */
.csth,
.csth-app {
	--ink: #17202c;
	--muted: #687284;
	--line: #e3e6eb;
	--wash: #f4f6f9;
	--ground: #fff;
	--up: #d2352c;
	--up-wash: #fdf1f0;
	--down: #2257c4;
	--down-wash: #eef3fc;
	--hold: #fff6d8;
	font-variant-numeric: tabular-nums;
	word-break: keep-all;
	color: var(--ink);
}
.csth *, .csth-app * { box-sizing: border-box; }
.csth-up { color: var(--up); }
.csth-down { color: var(--down); }
.csth-muted { color: var(--muted); font-size: 0.9em; }

/* 글 본문 */
.csth { font-size: 16px; line-height: 1.65; }
.csth h2 { font-size: 1.2em; margin: 1.8em 0 0.5em; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.csth h3 { font-size: 1.02em; margin: 1.4em 0 0.4em; }
.csth p { margin: 0 0 0.8em; }
.csth-lead { font-size: 1.05em; font-weight: 600; }
.csth-facts { display: flex; flex-wrap: wrap; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.csth-facts div { flex: 1 1 8em; padding: 8px 10px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.csth-facts dt { font-size: 0.78em; color: var(--muted); margin: 0; }
.csth-facts dd { margin: 0; font-weight: 600; white-space: nowrap; }
.csth-rule { margin: 0 0 1em; font-size: 0.92em; background: var(--wash); border-radius: 8px; padding: 8px 12px; }
.csth-rule summary { cursor: pointer; font-weight: 600; }
.csth-rule p { margin: 0.5em 0 0; }
.csth-reason { margin: 0 0 1em; padding: 10px 14px; border-left: 3px solid var(--down); background: var(--down-wash); border-radius: 0 8px 8px 0; font-style: normal; }
.csth-reason p { margin: 0; }
.csth-chart { margin: 0 0 1.2em; }
.csth-chart img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.csth-chart figcaption { font-size: 0.8em; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.csth-after { margin: 0 0 0.6em; padding-left: 1.2em; }
.csth-verdict { display: inline-block; font-weight: 600; font-size: 0.93em; padding: 4px 10px; border-radius: 999px; background: var(--wash); }
.csth-v-early { background: var(--up-wash); color: var(--up); }
.csth-v-good { background: var(--down-wash); color: var(--down); }
.csth-wait { color: var(--muted); background: var(--wash); border-radius: 8px; padding: 8px 12px; font-size: 0.93em; }
.csth-foot { margin-top: 2em !important; font-size: 0.82em; color: var(--muted); }

/* 목록 페이지 */
.csth-app {
	font-family: "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	font-size: 15px;
	line-height: 1.55;
	max-width: 1200px;
	margin: 0 auto;
}
.csth-app p { margin: 0; }
.csth-head { padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.csth-title { margin: 0; font-size: 1.75em; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.csth-sub { color: var(--muted); margin-top: 4px !important; }
.csth-filter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 14px 0 0; }
.csth-filter label span { display: block; font-size: 0.78em; color: var(--muted); margin-bottom: 2px; }
.csth-filter input,
.csth-filter select {
	font: inherit; font-size: 0.93em; padding: 6px 8px; border: 1px solid #cfd4dc; border-radius: 6px; background: #fff; color: var(--ink); min-width: 0;
}
.csth-filter input[type="search"] { width: 11em; }
.csth-app button {
	font: inherit; font-size: 0.9em; font-weight: 600; padding: 6px 12px; border-radius: 6px; border: 1px solid #cfd4dc; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.csth-app button:hover { border-color: var(--ink); }
.csth-app button:focus-visible, .csth-app input:focus-visible, .csth-app select:focus-visible, .csth-item:focus-visible { outline: 2px solid var(--down); outline-offset: 2px; }
.csth-period { display: inline-flex; }
.csth-period button { border-radius: 0; margin-left: -1px; }
.csth-period button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.csth-period button:last-child { border-radius: 0 6px 6px 0; }
.csth-period button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; position: relative; }
.csth-stats { margin: 12px 0 0 !important; padding: 10px 14px; background: var(--wash); border-radius: 8px; font-size: 0.93em; }
.csth-stats b { font-weight: 700; }
.csth-body { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; margin-top: 14px; align-items: start; }
.csth-list { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; overscroll-behavior: contain; }
.csth-month { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 6px 12px; font-size: 0.8em; font-weight: 600; color: var(--muted); background: var(--wash); border-bottom: 1px solid var(--line); }
.csth-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; background: #fff; font-weight: 400 !important; white-space: normal !important; }
.csth-item:hover { background: #fafbfc; }
.csth-item[aria-current="true"] { background: var(--hold); box-shadow: inset 3px 0 0 var(--ink); }
.csth-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.csth-item-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csth-item-name small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.csth-item-pct { font-weight: 700; white-space: nowrap; }
.csth-item-sub { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 0.8em; color: var(--muted); margin-top: 2px; }
.csth-tag { display: inline-block; font-size: 0.75em; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--wash); color: var(--ink); margin-right: 6px; vertical-align: 1px; font-style: normal; }
.csth-badge { font-weight: 600; }
.csth-badge.early { color: var(--up); }
.csth-badge.good { color: var(--down); }
.csth-list .csth-muted { padding: 16px 12px; }
.csth-view { min-height: 320px; border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px 20px; background: #fff; }
.csth-view:focus { outline: none; }
.csth-view-head { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.csth-view-head h3 { margin: 0; font-size: 1.3em; letter-spacing: -0.01em; }
.csth-view-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.csth-view-tools a { font-size: 0.88em; }
.csth-back { display: none; }
.csth-app .csth-foot { margin-top: 18px !important; font-size: 0.82em; color: var(--muted); }
@media (max-width: 900px) {
	.csth-body { grid-template-columns: 1fr; }
	.csth-list { position: static; max-height: none; }
	.csth-app.is-reading .csth-list { display: none; }
	.csth-app:not(.is-reading) .csth-view { display: none; }
	.csth-back { display: inline-block; }
	.csth-view { padding: 12px 14px 16px; }
}
@media (max-width: 640px) {
	.csth-app { font-size: 14px; }
	.csth-filter label { flex: 1 1 40%; }
	.csth-filter input, .csth-filter select, .csth-filter input[type="search"] { width: 100%; }
	.csth-period { flex: 1 1 100%; }
	.csth-period button { flex: 1; padding: 6px 4px; }
}

/* 신호 · AI 의견 · 매매 */
.csth-signals, .csth-trades { margin: 0 0 0.8em; padding-left: 1.2em; }
.csth-signals li, .csth-trades li { margin: 2px 0; }
.csth-ai { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 1em; }
.csth-ai ul { margin: 0 0 0.6em; padding-left: 1.2em; }
.csth-ai p { margin: 0 0 0.4em; }
.csth-ai-head { font-size: 1.02em; }
.csth-ai-k { font-size: 0.8em; color: var(--muted); font-weight: 600; margin: 0.6em 0 0.2em !important; }
.csth-ai-op { display: inline-block; padding: 1px 10px; border-radius: 999px; margin-right: 6px; font-size: 0.9em; background: var(--wash); }
.csth-ai-buy { background: var(--up-wash); color: var(--up); }
.csth-ai-avoid { background: var(--down-wash); color: var(--down); }
.csth-ai-wait { background: #f1f3f5; color: #495057; }
