/* ⚠ 복사본 — 원본은 저장소 맨 위 design/sovasta-ui.css 이다. 여기를 고치지 말고 원본을 고친 뒤 node tools/sync-design.mjs */
/* Sovasta UI — 표준 디자인 v3 (2026-11-25, v1 2026-11-17 · v2 Compass 크기)
 *
 * 원본은 이 파일 하나다: design/sovasta-ui.css
 * 각 사이트의 public/sovasta-ui.css 는 node tools/sync-design.mjs 가 복사한 것이다.
 * 사이트 쪽 복사본을 고치지 말 것 — 다음 동기화 때 덮어써지고, --check 가 실패한다.
 *
 * 기준: sova.sovasta.com 의 틀(14px 본문, 종이색 바탕, 1px 선, 진한 초록 한 가지 강조색).
 * 솔루션은 대부분 Sova 가운데 창 안에서 보이므로, 틀과 같은 크기·색·간격이어야 한 회사로 읽힌다.
 * 규칙은 design/DESIGN.md 에 있다.
 *
 * 쓰는 법: 사이트 index.html 에서 자기 styles.css 보다 **먼저** 링크한다.
 *   <link rel="stylesheet" href="/sovasta-ui.css?v=2">
 *   <link rel="stylesheet" href="/styles.css?v=…">
 * 부품 규칙은 :where() 로 감싸 우선순위가 0 이다. 사이트 CSS 가 필요한 곳만 덮을 수 있다.
 * 단, 토큰(:root 의 --*)과 글자 크기 단계는 사이트에서 바꾸지 않는다 (sync-design --check 가 본다).
 */

:root {
  /* 색 — Sova 틀에서 그대로 가져왔다 */
  --ui-bg: #fafbfc;
  --ui-surface: #ffffff;
  --ui-sunken: #f3f6f6;
  --ui-ink: #1f3543;
  --ui-muted: #5c6c77;
  --ui-line: #dfe6e7;
  --ui-line-strong: #c9d3d5;
  --ui-brand: #0a5c45;
  --ui-brand-ink: #ffffff;
  --ui-brand-pale: #edf5f1;
  --ui-navy: #163749;
  --ui-gold: #b58328;
  --ui-good: #1a7f45;
  --ui-bad: #b3261e;
  --ui-bad-pale: #fdeceb;
  --ui-warn-pale: #fff6df;
  --ui-warn-ink: #5c4300;
  --ui-focus: color-mix(in srgb, var(--ui-brand) 55%, transparent);
  /* v3: 두 번째 색(동작 아닌 표시용 — 새 소식 · 강조 숫자 · 보조 단추) */
  --ui-accent: #b58328;
  --ui-accent-pale: color-mix(in srgb, var(--ui-accent) 10%, var(--ui-surface));

  /* 글자 — 7단계만 쓴다 */
  --ui-font: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans", "Noto Sans KR", sans-serif;
  --ui-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* v3: 제목 글꼴 · 굵기 · 자간 (성격마다 다르다) — 기본은 본문과 같다 */
  --ui-display: var(--ui-font);
  --ui-head-weight: 600;
  --ui-head-track: -.005em;
  --ui-num: inherit;               /* 숫자(통계) 글꼴 */
  --ui-hero-bg: none;              /* 머리 판 무늬 */
  --ui-hero-ink: inherit;
  --ui-hero-muted: var(--ui-muted);
  --ui-hero-pad: 0;
  --ui-hero-line: transparent;
  --ui-eyebrow: var(--ui-muted);
  --ui-fs-xs: 11px;
  --ui-fs-sm: 12px;
  --ui-fs-base: 13px;
  --ui-fs-md: 14px;
  --ui-fs-lg: 15px;
  --ui-fs-xl: 17px;
  --ui-fs-2xl: 19px;
  --ui-lh: 1.55;
  --ui-lh-tight: 1.3;

  /* 간격 — 4 의 배수 */
  --ui-s1: 4px; --ui-s2: 8px; --ui-s3: 12px; --ui-s4: 16px; --ui-s5: 20px; --ui-s6: 24px; --ui-s8: 32px;

  /* 모양 */
  --ui-r-sm: 8px;
  --ui-r: 12px;
  --ui-r-pill: 999px;
  --ui-control: 34px;
  --ui-control-sm: 28px;
  --ui-shadow: 0 1px 2px rgba(22, 55, 73, .05);
  --ui-max: 1080px;
  --ui-measure: 60ch;
  --ui-t: 140ms;

  color-scheme: light;
}

/* 손가락으로 누르는 화면에서는 단추를 키운다 */
@media (pointer: coarse) {
  :root { --ui-control: 44px; --ui-control-sm: 40px; }
}

/* 어두운 화면은 사이트가 명시적으로 켤 때만 (Sova 틀이 밝기만 해서, 틀 안에서 혼자 어두워지지 않게) */
:root[data-theme="dark"] {
  --ui-bg: #111a1f; --ui-surface: #17232a; --ui-sunken: #0d1519; --ui-ink: #e4ecef; --ui-muted: #9fb0b8;
  --ui-line: #2a3a42; --ui-line-strong: #3a4e58; --ui-brand: #5fc29c; --ui-brand-ink: #062b20; --ui-brand-pale: #16342b;
  --ui-good: #6fd19a; --ui-bad: #ff8a80; --ui-bad-pale: #3a1d1b; --ui-warn-pale: #3a3018; --ui-warn-ink: #f3dc9b;
  --ui-shadow: none; color-scheme: dark;
}

/* ───────── v3 성격 (persona) — 2026-11-25 ─────────
 * Jake: "모든 사이트가 너무 단조롭다, 사이트마다 개성을". 크기 · 간격 · 부품은 그대로 두고 (Sova 틀 안에서 한 회사로 읽히게),
 * 색 · 제목 글꼴 · 모서리 · 머리 판 무늬 · 숫자 글꼴을 성격마다 바꾼다. 사이트는 <html data-persona="vault"> 한 줄로 고른다.
 * 색은 UI UX Pro Max(github nextlevelbuilder/ui-ux-pro-max-skill, MIT) 제품 유형별 팔레트에서 골라 흰 바탕 대비 4.5:1 이상으로 맞췄다.
 * 글꼴은 내려받지 않는다 (CSP font-src 'self') — 기기 글꼴 묶음만 쓴다. 표는 design/DESIGN.md 의 "성격" 절. */
:root[data-persona] {
  --ui-brand-pale: color-mix(in srgb, var(--ui-brand) 8%, #fff);
  --ui-sunken: color-mix(in srgb, var(--ui-brand) 4%, var(--ui-bg));
  --ui-line: color-mix(in srgb, var(--ui-ink) 13%, var(--ui-bg));
  --ui-line-strong: color-mix(in srgb, var(--ui-ink) 22%, var(--ui-bg));
  --ui-navy: var(--ui-ink);
  --ui-hero-pad: var(--ui-s5) var(--ui-s5) var(--ui-s4);
  --ui-hero-line: var(--ui-line);
}
/* 금고 — Auth · Vault · Shield · Sec · Guard: 잠긴 방. 짙은 남색 머리 판(점 격자), 초록은 "안전" 표시에만, 숫자는 고정폭 */
:root[data-persona="vault"] {
  --ui-brand: #1e3a5f; --ui-accent: #047857; --ui-bg: #f5f7fa; --ui-ink: #0f1b2d; --ui-muted: #526175;
  --ui-r: 10px; --ui-r-sm: 6px; --ui-num: var(--ui-mono); --ui-head-track: -.01em;
  --ui-hero-bg: radial-gradient(color-mix(in srgb, #fff 14%, transparent) 1px, transparent 1.4px) 0 0 / 14px 14px, linear-gradient(160deg, #1e3a5f, #0f1b2d);
  --ui-hero-ink: #fff; --ui-hero-muted: color-mix(in srgb, #fff 78%, transparent); --ui-hero-eyebrow: #6ee7b7; --ui-hero-line: #0f1b2d;
}
/* 장부 — C-USD · AICOIN · Chain · Credit · Hub: 은행 남색 + 금, 가는 장부 줄, 숫자 고정폭 */
:root[data-persona="ledger"] {
  --ui-brand: #1e3a8a; --ui-accent: #92400e; --ui-bg: #f8fafc; --ui-ink: #0f172a; --ui-muted: #51607a;
  --ui-r: 8px; --ui-r-sm: 6px; --ui-num: var(--ui-mono);
  --ui-hero-bg: repeating-linear-gradient(180deg, transparent 0 23px, color-mix(in srgb, var(--ui-brand) 7%, transparent) 23px 24px), var(--ui-surface);
  --ui-eyebrow: var(--ui-accent);
}
/* 법정 — Legal · Learch · Partner · Trust · Folio: 상아 종이, 명조 제목, 버건디 + 금 */
:root[data-persona="counsel"] {
  --ui-brand: #7f1d1d; --ui-accent: #92400e; --ui-bg: #fbfaf6; --ui-ink: #1c1917; --ui-muted: #5f5750;
  --ui-r: 6px; --ui-r-sm: 4px; --ui-head-weight: 700; --ui-head-track: 0;
  --ui-display: "Iowan Old Style", "Palatino Linotype", Georgia, "Noto Serif KR", "Nanum Myeongjo", "Apple Myungjo", serif;
  --ui-hero-bg: linear-gradient(var(--ui-surface), var(--ui-surface)) padding-box, linear-gradient(90deg, var(--ui-brand), var(--ui-accent)) border-box;
  --ui-hero-line: transparent; --ui-eyebrow: var(--ui-brand);
}
/* 무대 — Podcast · Cartoon · Larts · Prompt · Godsword: 쪽빛 + 주황, 소리 물결 그라데이션, 둥근 모서리 */
:root[data-persona="studio"] {
  --ui-brand: #4338ca; --ui-accent: #c2410c; --ui-bg: #faf9ff; --ui-ink: #1e1b4b; --ui-muted: #5b5875;
  --ui-r: 16px; --ui-r-sm: 10px; --ui-head-weight: 750; --ui-head-track: -.02em;
  --ui-hero-bg: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--ui-accent) 16%, transparent), transparent 55%), radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--ui-brand) 14%, transparent), transparent 60%), var(--ui-surface);
}
/* 지도 — Travel · Odyssey · Sphere · Ground · Link: 바다 파랑 + 모험 주황, 등고선 무늬 */
:root[data-persona="atlas"] {
  --ui-brand: #075985; --ui-accent: #c2410c; --ui-bg: #f5fafd; --ui-ink: #0c2a3f; --ui-muted: #4f6577;
  --ui-r: 14px; --ui-r-sm: 8px;
  --ui-hero-bg: repeating-radial-gradient(circle at 85% 20%, transparent 0 18px, color-mix(in srgb, var(--ui-brand) 8%, transparent) 18px 19px), var(--ui-surface);
}
/* 숨 — Health · Mind · Hearth · Companion · Friend · Resonance: 라벤더 + 초록, 둥근 글꼴, 부드러운 판 */
:root[data-persona="pulse"] {
  --ui-brand: #6d28d9; --ui-accent: #047857; --ui-bg: #fbf9ff; --ui-ink: #2e1065; --ui-muted: #615a75;
  --ui-r: 18px; --ui-r-sm: 12px; --ui-display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", var(--ui-font);
  --ui-hero-bg: linear-gradient(135deg, color-mix(in srgb, var(--ui-brand) 10%, #fff), color-mix(in srgb, var(--ui-accent) 8%, #fff));
  --ui-hero-line: transparent;
}
/* 장터 — Shopping · Agora · Match · Affiliates · Naming: 초록 + 주황, 큼직한 단추, 가격 숫자 굵게 */
:root[data-persona="market"] {
  --ui-brand: #047857; --ui-accent: #c2410c; --ui-bg: #f6fcf9; --ui-ink: #052e22; --ui-muted: #4e6459;
  --ui-r: 12px; --ui-r-sm: 10px; --ui-head-weight: 750;
  --ui-hero-bg: linear-gradient(100deg, color-mix(in srgb, var(--ui-accent) 9%, #fff) 0 30%, var(--ui-surface) 30%);
}
/* 계기판 — Scout · Nexus · Survey · Chronos · Team · Compass: 남청 + 호박, 24px 모눈, 촘촘함 */
:root[data-persona="signal"] {
  --ui-brand: #1e40af; --ui-accent: #b45309; --ui-bg: #f7f9fc; --ui-ink: #111c3a; --ui-muted: #55607a;
  --ui-r: 8px; --ui-r-sm: 6px; --ui-num: var(--ui-mono);
  --ui-hero-bg: linear-gradient(color-mix(in srgb, var(--ui-brand) 6%, transparent) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, color-mix(in srgb, var(--ui-brand) 6%, transparent) 1px, transparent 1px) 0 0 / 24px 24px, var(--ui-surface);
}
/* 대장간 — SuperAI · AGI · Shell · Blueprint · Quantum · Router: 보라 + 청록, 고정폭 머리글, 회로 줄 */
:root[data-persona="forge"] {
  --ui-brand: #5b21b6; --ui-accent: #0e7490; --ui-bg: #faf8ff; --ui-ink: #1a1033; --ui-muted: #5d5670;
  --ui-r: 10px; --ui-r-sm: 6px; --ui-num: var(--ui-mono); --ui-head-track: -.015em;
  --ui-hero-bg: linear-gradient(115deg, transparent 0 62%, color-mix(in srgb, var(--ui-accent) 10%, transparent) 62% 63%, transparent 63% 70%, color-mix(in srgb, var(--ui-brand) 10%, transparent) 70% 71%, transparent 71%), var(--ui-surface);
  --ui-eyebrow: var(--ui-accent);
}
/* 꽃 — Social · Dating · Beauty 쪽: 장미 + 보라, 가장 둥근 모서리 */
:root[data-persona="bloom"] {
  --ui-brand: #be123c; --ui-accent: #6d28d9; --ui-bg: #fff8f9; --ui-ink: #3b0a1a; --ui-muted: #6d5560;
  --ui-r: 20px; --ui-r-sm: 12px; --ui-display: ui-rounded, "SF Pro Rounded", var(--ui-font);
  --ui-hero-bg: radial-gradient(110% 130% at 0% 0%, color-mix(in srgb, var(--ui-brand) 12%, transparent), transparent 60%), var(--ui-surface);
}
/* 숲 — Translate · Survey 대안 · Cook · 기후: 청록 + 호박, 잎맥 빗금 */
:root[data-persona="grove"] {
  --ui-brand: #0f766e; --ui-accent: #b45309; --ui-bg: #f4fbfa; --ui-ink: #0b2f2c; --ui-muted: #4d6461;
  --ui-r: 14px; --ui-r-sm: 8px;
  --ui-hero-bg: repeating-linear-gradient(135deg, transparent 0 16px, color-mix(in srgb, var(--ui-brand) 6%, transparent) 16px 17px), var(--ui-surface);
}
/* 성격이 있으면 단추도 그 모서리를 따른다 · 탭 밑줄 대신 알약을 쓰는 성격 */
:root:is([data-persona="studio"], [data-persona="pulse"], [data-persona="bloom"], [data-persona="market"]) :is(.tabs > a.on, .tabs > a[aria-current="page"], .tab.on) {
  background: var(--ui-brand-pale); border-bottom-color: transparent; border-radius: var(--ui-r-pill);
}

/* ───────── 바탕 ───────── */
:where(*, *::before, *::after) { box-sizing: border-box; }
:where(html, body) { margin: 0; overflow-x: hidden; }
:where(body) {
  background: var(--ui-bg); color: var(--ui-ink);
  font-family: var(--ui-font); font-size: var(--ui-fs-base); line-height: var(--ui-lh);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh;
}
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(:lang(ko)) { word-break: keep-all; overflow-wrap: break-word; }
:where(img, svg, video) { max-width: 100%; }
:where(a) { color: var(--ui-brand); text-underline-offset: 2px; }
:where(a:hover) { text-decoration-thickness: 2px; }
:where(h1, h2, h3, h4) { line-height: var(--ui-lh-tight); color: var(--ui-ink); letter-spacing: var(--ui-head-track); font-family: var(--ui-display); }
:where(h1) { font-size: var(--ui-fs-2xl); font-weight: var(--ui-head-weight); margin: 0 0 var(--ui-s2); }
:where(h2) { font-size: var(--ui-fs-lg); font-weight: 600; margin: 0 0 var(--ui-s3); }
:where(h3) { font-size: var(--ui-fs-md); font-weight: 600; margin: var(--ui-s4) 0 var(--ui-s2); }
:where(h4) { font-size: var(--ui-fs-base); font-weight: 700; margin: var(--ui-s3) 0 var(--ui-s1); }
:where(p) { margin: 0 0 var(--ui-s3); }
:where(p, li) { max-width: var(--ui-measure); text-wrap: pretty; }
:where(h1, h2, h3) { text-wrap: balance; }
:where(ul, ol) { margin: 0 0 var(--ui-s3); padding-inline-start: 20px; }
:where(li + li) { margin-top: var(--ui-s1); }
:where(small, .small) { font-size: var(--ui-fs-sm); }
:where(code, kbd, .mono) { font-family: var(--ui-mono); font-size: .92em; overflow-wrap: anywhere; }
:where(pre) { font-family: var(--ui-mono); font-size: var(--ui-fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: var(--ui-s3); border-radius: var(--ui-r-sm); background: var(--ui-sunken); border: 1px solid var(--ui-line); }
:where(hr) { border: 0; border-top: 1px solid var(--ui-line); margin: var(--ui-s4) 0; }
:where(:focus-visible) { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
:where(details > summary) { cursor: pointer; font-weight: 600; }
:where(::selection) { background: color-mix(in srgb, var(--ui-brand) 22%, transparent); }

:where(.muted) { color: var(--ui-muted); }
:where(.good, .ok) { color: var(--ui-good); }
:where(.bad, .err) { color: var(--ui-bad); }
:where(.center) { text-align: center; }
:where(.sr) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(.skip) { position: absolute; inset-inline-start: var(--ui-s4); top: var(--ui-s2); transform: translateY(-200%); z-index: 100; background: var(--ui-surface); padding: var(--ui-s2) var(--ui-s3); border-radius: var(--ui-r-sm); }
:where(.skip:focus) { transform: none; }
:where(.boot) { padding: 40px var(--ui-s4); text-align: center; color: var(--ui-muted); }

/* ───────── 머리 · 메뉴 ───────── */
:where(.top) {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--ui-s3); flex-wrap: wrap;
  padding: var(--ui-s2) var(--ui-s4); min-height: 52px;
  background: color-mix(in srgb, var(--ui-surface) 94%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--ui-line);
}
:where(.brand) { display: inline-flex; align-items: center; gap: var(--ui-s2); color: var(--ui-ink); text-decoration: none; font-size: var(--ui-fs-md); font-weight: 600; white-space: nowrap; }
:where(.brand img) { width: 24px; height: 24px; border-radius: 6px; }
:where(.brand b) { font-weight: 750; }
:where(.top-r) { margin-inline-start: auto; display: flex; align-items: center; gap: var(--ui-s2); flex-wrap: wrap; }

/* 탭 메뉴 — <nav class="tabs"><a class="tab on" aria-current="page"> (class 가 없어도 a 면 탭으로 보인다) */
:where(.tabs) {
  display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  padding: 0 12px; border-bottom: 1px solid var(--ui-line); background: var(--ui-bg);
}
:where(.tabs)::-webkit-scrollbar { display: none; }
:where(.tabs > a, .tab) {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 13px;
  color: var(--ui-muted); text-decoration: none; font-size: var(--ui-fs-sm); font-weight: 500; white-space: nowrap;
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; font-family: inherit; cursor: pointer; transition: color var(--ui-t);
}
:where(.tabs > a:hover, .tab:hover) { color: var(--ui-ink); }
:where(.tabs > a.on, .tabs > a[aria-current="page"], .tab.on) { font-weight: 600; color: var(--ui-brand); border-bottom-color: var(--ui-brand); }

/* 하위 메뉴 (알약) */
:where(.subtabs, .seg) { display: flex; flex-wrap: wrap; gap: var(--ui-s1); margin: 0 0 var(--ui-s4); }
:where(.subtabs > a, .subtabs > button, .seg > button) {
  display: inline-flex; align-items: center; min-height: var(--ui-control-sm); padding: 0 var(--ui-s3);
  border: 1px solid var(--ui-line); border-radius: var(--ui-r-pill); background: var(--ui-surface);
  color: var(--ui-ink); text-decoration: none; font-size: var(--ui-fs-sm); font-weight: 600; cursor: pointer;
}
:where(.subtabs > .on, .seg > .on, .subtabs > [aria-current="page"]) { background: var(--ui-brand-pale); border-color: color-mix(in srgb, var(--ui-brand) 40%, transparent); color: var(--ui-brand); }

/* ───────── 바깥 틀 ───────── */
:where(main, .wrap) { display: grid; gap: var(--ui-s4); max-width: var(--ui-max); margin: 0 auto; padding: var(--ui-s5) var(--ui-s4) var(--ui-s8); min-width: 0; }
:where(main:focus, .wrap:focus) { outline: none; }
:where(.foot) {
  display: flex; flex-wrap: wrap; gap: var(--ui-s2) var(--ui-s3); justify-content: center; align-items: center;
  padding: var(--ui-s5) var(--ui-s4) var(--ui-s8); border-top: 1px solid var(--ui-line);
  color: var(--ui-muted); font-size: var(--ui-fs-sm);
}
:where(.foot a) { color: inherit; }
:where(.foot select) { width: auto; min-height: var(--ui-control-sm); font-size: var(--ui-fs-sm); }
:where(.lang) { display: inline-flex; margin: 0; }

/* ───────── 표면 ───────── */
:where(.card) { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r); padding: 18px; box-shadow: var(--ui-shadow); min-width: 0; }
:where(.card > :last-child) { margin-bottom: 0; }
:where(.card .card) { box-shadow: none; background: var(--ui-bg); padding: var(--ui-s4); }
:where(.hero) { padding: var(--ui-s2) 0 0; }
:where(:root[data-persona] .hero:not(.card)) { padding: var(--ui-hero-pad); background: var(--ui-hero-bg); color: var(--ui-hero-ink); border: 1px solid var(--ui-hero-line); border-radius: var(--ui-r); margin-bottom: var(--ui-s4); }
:root[data-persona] .hero:not(.card) :is(h1, h2, p) { color: inherit; }
:root[data-persona] .hero:not(.card) :is(.lede, .muted, small) { color: var(--ui-hero-muted); }
:root[data-persona] .hero:not(.card) .eyebrow { color: var(--ui-hero-eyebrow, var(--ui-eyebrow)); }
:where(.card.hero) { padding: var(--ui-s5); }
:where(.eyebrow) { margin: 0 0 var(--ui-s2); color: var(--ui-muted); font-size: var(--ui-fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
:where(.eyebrow) { color: var(--ui-eyebrow); }
:where(.lede) { font-size: var(--ui-fs-md); color: var(--ui-muted); max-width: var(--ui-measure); }
:where(.note) { margin: var(--ui-s2) 0 0; color: var(--ui-muted); font-size: var(--ui-fs-sm); }
:where(.empty) { padding: var(--ui-s6) var(--ui-s4); text-align: center; color: var(--ui-muted); border: 1px dashed var(--ui-line-strong); border-radius: var(--ui-r); }

/* 알림 띠 (정보 · 주의 · 경고) — 왼쪽 굵은 띠 대신 옅은 바탕 + 1px 선 */
:where(.banner, .notice) { display: flex; gap: var(--ui-s2) var(--ui-s3); align-items: center; flex-wrap: wrap; padding: var(--ui-s3) var(--ui-s4); border-radius: var(--ui-r-sm); border: 1px solid var(--ui-line); background: var(--ui-sunken); }
:where(.banner.soft, .notice.info) { background: var(--ui-brand-pale); border-color: color-mix(in srgb, var(--ui-brand) 25%, transparent); }
:where(.banner.warn, .notice.warn, .banner:not(.soft):not(.bad)) { background: var(--ui-warn-pale); border-color: color-mix(in srgb, var(--ui-gold) 35%, transparent); color: var(--ui-warn-ink); }
:where(p.warn) { padding: var(--ui-s2) var(--ui-s3); border-radius: var(--ui-r-sm); background: var(--ui-warn-pale); color: var(--ui-warn-ink); border: 1px solid color-mix(in srgb, var(--ui-gold) 35%, transparent); }
:where(.banner.bad, .notice.bad) { background: var(--ui-bad-pale); border-color: color-mix(in srgb, var(--ui-bad) 30%, transparent); color: var(--ui-ink); }

/* ───────── 격자 ───────── */
:where(.row) { display: flex; gap: var(--ui-s2); flex-wrap: wrap; align-items: center; }
:where(.grow) { flex: 1 1 220px; }
:where(.two) { display: grid; gap: var(--ui-s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
:where(.grid2) { display: grid; gap: var(--ui-s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
:where(.grid3) { display: grid; gap: var(--ui-s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
:where(.grid2, .grid3, .two) > :where(.wide) { grid-column: 1 / -1; }
:where(form.grid2, form.grid3) { align-items: end; }
:where(form.grid2, form.grid3) > :where(label) { margin: 0; }

/* ───────── 숫자 칸 ───────── */
:where(.stats) { display: grid; gap: var(--ui-s2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); margin: 0; }
:where(.stats > div, .stat) { display: grid; gap: 2px; padding: var(--ui-s3) var(--ui-s4); border: 1px solid var(--ui-line); border-radius: var(--ui-r-sm); background: var(--ui-surface); min-width: 0; }
:where(.stats dt, .stats span, .stat span, .stat small) { color: var(--ui-muted); font-size: var(--ui-fs-xs); font-weight: 600; }
:where(.stats dd, .stats b, .stat b) { margin: 0; font-size: var(--ui-fs-xl); font-weight: 700; font-family: var(--ui-num); font-variant-numeric: tabular-nums; color: var(--ui-ink); overflow-wrap: anywhere; }
:where(.stat.hi b) { color: var(--ui-brand); }
:where(.stat.soft) { background: var(--ui-sunken); }
:where(.stat.accent b) { color: var(--ui-accent); }

/* ───────── 단추 ───────── */
:where(.btn) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--ui-control); padding: 0 var(--ui-s4); border: 1px solid var(--ui-brand); border-radius: var(--ui-r-sm);
  background: var(--ui-brand); color: var(--ui-brand-ink); font-size: var(--ui-fs-base); font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color var(--ui-t), border-color var(--ui-t);
}
:where(.btn:hover) { background: color-mix(in srgb, var(--ui-brand) 88%, #000); }
:where(.btn.accent) { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
:where(.btn.accent:hover) { background: color-mix(in srgb, var(--ui-accent) 88%, #000); }
:where(.btn.ghost) { background: var(--ui-surface); color: var(--ui-ink); border-color: var(--ui-line-strong); }
:where(.btn.ghost:hover) { background: var(--ui-sunken); }
:where(.btn.danger) { background: var(--ui-surface); color: var(--ui-bad); border-color: color-mix(in srgb, var(--ui-bad) 40%, transparent); }
:where(.btn.sm, .btn.small) { min-height: var(--ui-control-sm); padding: 0 var(--ui-s3); font-size: var(--ui-fs-sm); }
:where(.btn:disabled, .btn[aria-disabled="true"]) { opacity: .5; cursor: not-allowed; }
:where(.linklike) { background: none; border: 0; padding: 0; color: var(--ui-brand); text-decoration: underline; cursor: pointer; }

/* ───────── 입력 ───────── */
:where(label) { display: grid; gap: var(--ui-s1); margin: 0 0 var(--ui-s3); font-size: var(--ui-fs-xs); font-weight: 500; color: var(--ui-muted); min-width: 0; }
:where(label.check) { display: flex; gap: var(--ui-s2); align-items: flex-start; font-weight: 500; font-size: var(--ui-fs-base); }
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) {
  width: 100%; min-height: var(--ui-control); padding: 6px var(--ui-s3);
  border: 1px solid var(--ui-line-strong); border-radius: var(--ui-r-sm); background: var(--ui-surface);
  font-size: var(--ui-fs-base); font-weight: 400;
}
:where(textarea) { min-height: 88px; resize: vertical; line-height: 1.5; }
:where(input[type=checkbox], input[type=radio]) { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--ui-brand); flex: none; }
:where(input::placeholder, textarea::placeholder) { color: color-mix(in srgb, var(--ui-muted) 80%, transparent); }
:where(fieldset) { border: 1px solid var(--ui-line); border-radius: var(--ui-r-sm); padding: var(--ui-s3); margin: 0 0 var(--ui-s3); }
/* 카드 안의 묶음은 테두리 없이 (카드 안의 카드가 되지 않게) */
:where(.card) :where(fieldset) { border: 0; padding: 0; }
:where(.card) :where(legend) { padding: 0; font-weight: 600; margin-bottom: var(--ui-s1); }
:where(legend) { padding: 0 var(--ui-s1); font-size: var(--ui-fs-sm); font-weight: 600; }

/* ───────── 표 ───────── */
:where(.table-wrap) { overflow-x: auto; }
:where(.tbl) { width: 100%; border-collapse: collapse; font-size: var(--ui-fs-sm); font-variant-numeric: tabular-nums; }
:where(.tbl caption) { text-align: start; font-size: var(--ui-fs-base); font-weight: 700; padding-bottom: var(--ui-s2); }
:where(.tbl th) { text-align: start; color: var(--ui-muted); font-size: var(--ui-fs-xs); font-weight: 600; padding: var(--ui-s2) var(--ui-s3); border-bottom: 1px solid var(--ui-line-strong); white-space: nowrap; }
:where(.tbl td) { text-align: start; padding: var(--ui-s2) var(--ui-s3); border-bottom: 1px solid var(--ui-line); vertical-align: top; }
:where(.tbl td.num, .tbl th.num) { text-align: end; }
:where(.tbl tr:last-child td) { border-bottom: 0; }

/* ───────── 작은 표시 ───────── */
:where(.badge, .chip) {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px var(--ui-s2); border-radius: var(--ui-r-pill);
  background: var(--ui-sunken); border: 1px solid var(--ui-line); color: var(--ui-ink);
  font-size: var(--ui-fs-xs); font-weight: 600; line-height: 1.6; vertical-align: middle; white-space: nowrap;
}
:where(.badge.good, .chip.good) { background: color-mix(in srgb, var(--ui-good) 10%, var(--ui-surface)); color: var(--ui-good); border-color: color-mix(in srgb, var(--ui-good) 25%, transparent); }
:where(.badge.bad, .chip.bad, .chip.warn) { background: var(--ui-bad-pale); color: var(--ui-bad); border-color: color-mix(in srgb, var(--ui-bad) 25%, transparent); }
:where(.badge.accent, .chip.accent) { background: var(--ui-accent-pale); color: var(--ui-accent); border-color: color-mix(in srgb, var(--ui-accent) 30%, transparent); }
:where(.badge.brand) { background: var(--ui-brand-pale); color: var(--ui-brand); border-color: color-mix(in srgb, var(--ui-brand) 25%, transparent); }
:where(.dot) { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: var(--ui-r-pill); background: var(--ui-bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-style: normal; }
:where(.bar) { height: 6px; border-radius: var(--ui-r-pill); background: var(--ui-sunken); overflow: hidden; margin: var(--ui-s2) 0; }
:where(.bar > i) { display: block; height: 100%; background: var(--ui-brand); border-radius: inherit; }

/* ───────── 접이식 ───────── */
:where(.acc) { display: grid; gap: var(--ui-s2); }
:where(.acc-i) { border: 1px solid var(--ui-line); border-radius: var(--ui-r-sm); background: var(--ui-surface); }
:where(.acc-h) { width: 100%; display: flex; justify-content: space-between; gap: var(--ui-s2); align-items: center; min-height: 44px; padding: 0 var(--ui-s4); background: none; border: 0; text-align: start; font-weight: 600; cursor: pointer; }
:where(.acc-h)::after { content: "+"; color: var(--ui-muted); font-weight: 400; font-size: var(--ui-fs-lg); }
:where(.acc-i.open .acc-h)::after { content: "−"; }
:where(.acc-b) { display: none; padding: 0 var(--ui-s4) var(--ui-s4); }
:where(.acc-i.open .acc-b) { display: block; }

/* ───────── 토스트 ───────── */
:where(.toast) {
  position: fixed; inset-inline: var(--ui-s4); bottom: var(--ui-s4); z-index: 50; margin: 0 auto; max-width: 480px;
  padding: var(--ui-s3) var(--ui-s4); border-radius: var(--ui-r-sm); background: var(--ui-navy); color: #fff; font-size: var(--ui-fs-sm);
  box-shadow: 0 4px 16px rgba(22, 55, 73, .18); opacity: 0; transform: translateY(8px); transition: opacity var(--ui-t), transform var(--ui-t); pointer-events: none;
}
:where(.toast.show) { opacity: 1; transform: none; }
:where(.toast.bad) { background: var(--ui-bad); }
:where(.toast.good) { background: var(--ui-good); }

@media (prefers-reduced-motion: reduce) {
  :where(*, *::before, *::after) { transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media (max-width: 640px) {
  :where(.top) { padding: var(--ui-s2) var(--ui-s3); }
  :where(.tabs) { padding: 0 var(--ui-s2); }
  :where(main, .wrap) { padding: var(--ui-s4) var(--ui-s3) var(--ui-s6); }
  :where(.card) { padding: var(--ui-s4); }
  :where(h1) { font-size: var(--ui-fs-xl); }   /* 좁은 화면 17px */
}
@media print {
  :where(.top, .tabs, .foot, .toast) { display: none !important; }
  :where(.card) { box-shadow: none; }
}
