/* T8 (2026-09-20) — pdf2hwpx 디자인 시스템.
   색은 시험지의 물성에서 가져왔다: 칠판 녹색(주색), 채점 빨간 펜(경고),
   종이의 따뜻한 회색(중립). 라이트/다크 모두 토큰으로만 칠한다. */

:root {
  --ink: #16211f;
  --ink-2: #3d4b47;
  --muted: #5e6b67;
  --accent: #0f6b5c;
  --accent-ink: #0d5c4f;
  --accent-soft: #eef4f2;
  --accent-line: #bcd5ce;
  --pen: #b8432f;
  --pen-soft: #fbeeeb;
  --ok: #1a7f4b;
  --ok-soft: #e7f5ec;
  --warn: #9a6b12;
  --warn-soft: #fdf3e0;
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-2: #fafcfb;
  --line: #d7e0dd;
  --shadow: 0 1px 2px rgba(22, 33, 31, .05), 0 8px 24px -16px rgba(22, 33, 31, .25);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}
:root { --accent-ink: #0d5c4f; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8efec; --ink-2: #c3d0cb; --muted: #94a5a0;
    --accent: #4fb79f; --accent-ink: #7fd0bc; --accent-soft: #16302a; --accent-line: #24493f;
    --pen: #e58b76; --pen-soft: #33201c;
    --ok: #59c98d; --ok-soft: #15301f; --warn: #d8ab5a; --warn-soft: #31260f;
    --bg: #0e1513; --surface: #16201d; --surface-2: #1b2723; --line: #2a3a35;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* display:flex 가 hidden 을 이기는 함정 */
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.3; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 12px; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ── 껍데기 ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand {
  font-weight: 800; letter-spacing: -.03em; font-size: 17px;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.brand .mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.tabs { display: flex; gap: 4px; margin-left: 4px; flex: 1; flex-wrap: wrap; }
.tabs a {
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-size: 14px; font-weight: 600;
}
.tabs a:hover { background: var(--accent-soft); }
.tabs a.on { background: var(--accent); color: #fff; }
.who { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.who a { color: var(--muted); }
/* 상단바의 muted 링크 색이 버튼 글자까지 덮어 "Google로 시작하기" 가
   초록 배경에 어두운 글씨로 나왔다 — 버튼은 제 색을 유지한다. */
.who a.btn { color: #fff; }
main { max-width: 1080px; margin: 0 auto; padding: 26px 20px 80px; }
.narrow { max-width: 760px; }
footer.foot {
  max-width: 1080px; margin: 0 auto; padding: 0 20px 40px;
  color: var(--muted); font-size: 12.5px;
}

/* ── 카드·표 ────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card + .card, .card + .grid, .grid + .card { margin-top: 16px; }
.card h2 { margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat.accent .v { color: var(--accent-ink); }
.stat.pen .v { color: var(--pen); }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.compact th, table.compact td { padding: 7px 10px; }

/* ── 버튼·배지·입력 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14.5px;
  text-decoration: none; cursor: pointer; font-family: inherit;
  transition: filter .12s ease, transform .12s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.btn.danger { background: var(--pen); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 24px; font-size: 16px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: var(--accent-soft); color: var(--muted); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.pen { background: var(--pen-soft); color: var(--pen); }

label.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; padding: 7px 0; }
label.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
label.check .t { font-weight: 600; }
label.check .d { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
input[type=number], input[type=text], select {
  font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}

/* ── 업로드 ─────────────────────────────────────────────────────── */
.drop {
  border: 2px dashed var(--accent-line); border-radius: var(--radius);
  background: var(--surface-2); padding: 34px 22px; text-align: center;
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.drop .hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.drop input[type=file] { display: none; }
.filechip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-ink); border-radius: 999px; padding: 6px 14px;
  font-size: 13.5px; font-weight: 600; max-width: 100%;
}
.filechip .x { cursor: pointer; opacity: .6; font-weight: 800; }
.filechip .x:hover { opacity: 1; }

.progress { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin-top: 14px; display: none; }
.progress.show { display: block; }
.progress .bar {
  height: 100%; width: 0; background: var(--accent); border-radius: 999px;
  transition: width .3s ease;
  background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%,
    transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%);
  background-size: 22px 22px; animation: stripe 1s linear infinite;
}
@keyframes stripe { to { background-position: 22px 0; } }
@media (prefers-reduced-motion: reduce) { .progress .bar { animation: none; } }

.status { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.status.err { color: var(--pen); font-weight: 600; }
.status.ok { color: var(--ok); font-weight: 600; }

.gauge { height: 7px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin: 8px 0 4px; }
.gauge .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.gauge .fill.warn { background: var(--warn); }
.gauge .fill.pen { background: var(--pen); }

/* ── 막대그래프 ─────────────────────────────────────────────────
   SVG + preserveAspectRatio:none 은 카드 폭에 맞춰 늘어나면서 글자와
   모서리를 옆으로 뭉갰다. 막대는 상자일 뿐이므로 그냥 상자로 그린다. */
.chart { --plot-h: 168px; --gutter: 46px; }
.chart-plot { position: relative; padding-left: var(--gutter); }
.chart-y {
  position: absolute; left: 0; width: calc(var(--gutter) - 10px);
  transform: translateY(-50%); text-align: right;
  font-size: 11px; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-cols {
  display: flex; align-items: flex-end; gap: 3px;
  height: var(--plot-h); border-bottom: 1px solid var(--line);
  background:                                   /* 0 · 절반 · 최고 눈금선 */
    linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat;
}
.chart-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.chart-col i {
  display: block; width: 100%; min-height: 2px;
  background: var(--accent); border-radius: 3px 3px 0 0;
}
.chart-col:hover i { background: var(--accent-ink); }
.chart-axis {
  display: flex; gap: 3px; margin-top: 7px; padding-left: var(--gutter);
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.chart-axis span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; }
/* 양 끝 눈금은 가운데 정렬하면 카드 밖으로 반쯤 나간다 — 안쪽으로 붙인다 */
.chart-axis span:first-child { text-align: left; }
.chart-axis span:last-child { text-align: right; }
@media (max-width: 720px) { .chart-axis span.thin { visibility: hidden; } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 30px; margin-bottom: 8px; }

.notice {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px; font-size: 13.5px; color: var(--ink-2);
}
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice.pen { border-left-color: var(--pen); background: var(--pen-soft); }

/* ── 랜딩 ───────────────────────────────────────────────────────── */
.hero { padding: 56px 0 30px; text-align: center; }
.hero .eyebrow { color: var(--accent-ink); font-weight: 700; font-size: 13.5px; letter-spacing: .02em; }
.hero h1 { font-size: 40px; margin: 10px 0 14px; }
.hero p.lede { font-size: 17px; color: var(--ink-2); max-width: 620px; margin: 0 auto 24px; }
@media (max-width: 560px) { .hero { padding: 34px 0 20px; } .hero h1 { font-size: 30px; } }
.steps { counter-reset: s; display: grid; gap: 12px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 800;
  display: grid; place-items: center;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 13px; font-size: 13px; color: var(--ink-2);
}

/* 좁은 화면: 상단바가 줄바꿈되며 겹치던 문제 — 브랜드/계정 한 줄, 탭은 아랫줄 */
@media (max-width: 620px) {
  .topbar .inner { flex-wrap: wrap; gap: 6px 12px; padding: 9px 14px; }
  .brand { order: 1; }
  .who { order: 2; margin-left: auto; }
  .tabs { order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .tabs a { white-space: nowrap; }
  main { padding: 18px 14px 60px; }
  .card { padding: 18px 16px; }
  h1 { font-size: 22px; }
}
