:root {
  --bg: #f6f4f1;
  --surface: #fcfcfb;
  --surface-2: #efebe6;
  --ink: #26221f;
  --ink-2: #5f5751;
  --muted: #8d837b;
  --line: #e4ded7;
  --accent: #6b4f3a;
  --accent-ink: #ffffff;
  --pos: #2a78d6;
  --neg: #e34948;
  --ok: #0b7a0b;
  --warn: #9a6200;
  --err: #c0322f;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --surface: #1a1a19; --surface-2: #24231f; --ink: #f1ede8; --ink-2: #c5bdb5;
    --muted: #958c84; --line: #34322e; --accent: #d2b49c; --accent-ink: #1a1a19;
    --pos: #3987e5; --neg: #e66767; --ok: #4cc24c; --warn: #f0b84a; --err: #f07a77;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141413; --surface: #1a1a19; --surface-2: #24231f; --ink: #f1ede8; --ink-2: #c5bdb5;
  --muted: #958c84; --line: #34322e; --accent: #d2b49c; --accent-ink: #1a1a19;
  --pos: #3987e5; --neg: #e66767; --ok: #4cc24c; --warn: #f0b84a; --err: #f07a77;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.narrow { max-width: 720px; }

.topbar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.brand { font-weight: 700; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0; font-size: 14px; }
.lede { font-size: 17px; margin: 12px 0 0; }

.flash { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; margin: 0 0 18px; }
.problem { border-left-color: var(--err); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.section { margin-top: 28px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .note { font-size: 12px; color: var(--ink-2); }

.point { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin-bottom: 14px; }
.point.pos { border-left-color: var(--pos); }
.point.neg { border-left-color: var(--neg); }
.point p { margin: 2px 0 6px; color: var(--ink-2); }
.quote { font-size: 13px; color: var(--muted); margin: 0 0 4px; }

/* 발산형 막대: 왼쪽 아쉬움, 오른쪽 긍정 */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dv { display: grid; grid-template-columns: minmax(6.5em, max-content) 1fr 1fr; align-items: center; gap: 2px 0; font-size: 13px; }
.dv .name { color: var(--ink-2); padding-right: 8px; }
.dv .neg-side, .dv .pos-side { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.dv .neg-side { flex-direction: row-reverse; border-right: 1px solid var(--line); padding-right: 2px; }
.dv .pos-side { padding-left: 2px; }
.dv .bar { height: 14px; min-width: 0; }
.dv .neg-side .bar { background: var(--neg); border-radius: 4px 0 0 4px; }
.dv .pos-side .bar { background: var(--pos); border-radius: 0 4px 4px 0; }
.dv .num { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.dv .row { display: contents; }
.dv .row:hover .name { color: var(--ink); font-weight: 600; }

/* 월별 리뷰 수 */
.months { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 18px; }
.months .m { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--muted); }
.months .b { width: 100%; max-width: 28px; background: var(--pos); border-radius: 4px 4px 0 0; }
.months .n { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.review { padding: 14px 0; border-top: 1px solid var(--line); }
.review:first-child { border-top: 0; padding-top: 0; }
.review .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.review .body { white-space: pre-line; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; color: var(--ink-2); }
.chip.pos { border-color: var(--pos); }
.chip.neg { border-color: var(--neg); }
.chip.pos::before { content: "＋ "; color: var(--pos); }
.chip.neg::before { content: "－ "; color: var(--neg); }

form.stack { display: grid; gap: 10px; }
label { font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
input[type=text], input[type=email], input[type=month], input[type=number], input[type=time], select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; width: 100%;
}
textarea { min-height: 140px; resize: vertical; }
button, .btn {
  font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hint { font-size: 12px; color: var(--muted); margin: 0; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.status.success, .status.done, .status.sent { color: var(--ok); }
.status.success::before, .status.done::before, .status.sent::before { content: "✓ "; }
.status.failed { color: var(--err); }
.status.failed::before { content: "✕ "; }
.status.running, .status.processing, .status.pending, .status.dry_run, .status.skipped { color: var(--warn); }
.status.running::before, .status.processing::before, .status.pending::before { content: "… "; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink-2); word-break: break-all; }
.empty { color: var(--muted); font-size: 14px; }
.footer { margin-top: 48px; font-size: 12px; color: var(--muted); }

/* 대표 강점: 단일 계열 가로 막대(값은 직접 표기) */
.bars { display: grid; gap: 12px; }
.bar-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.bar-head .num { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 4px; margin-top: 4px; }
.bar-fill { height: 100%; background: var(--pos); border-radius: 4px; min-width: 2px; }
.bar-row .quote { margin: 4px 0 0; }

/* 접을 수 있는 카드 */
details.fold > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--muted); width: 1em; transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold .fold-title { font-size: 17px; font-weight: 700; }

/* 메인 페이지 */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.25; margin: 6px 0 12px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; margin: 0; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-link { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.btn-link:hover { color: var(--ink); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.preview-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }

/* 대표 강점 강조 */
.hero-strengths { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.hero-strength { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg); }
.hero-strength.accent { border-color: var(--pos); }
.hero-strength .label { margin: 0; font-size: 12px; color: var(--muted); }
.hero-strength .big { margin: 2px 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.hero-strength .sub { margin: 0; }
.up { color: var(--pos); font-weight: 600; }
.down { color: var(--neg); font-weight: 600; }
.chip.svc { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.bar-fill.svc { background: var(--accent); }
