/* style.css — English site base (sites-hq/templates/en). Palette and the one bold result card live in sites-hq/design/themes/<id>.css, appended by tools/apply-design.mjs. */
:root {
  --bg: #f5f5fa; --surface: #ffffff; --surface-2: #f8f9fb; --line: #e6e9ee; --line-2: #d5dae1;
  --text: #191f28; --text-2: #4e5968; --muted: #8b95a1;
  --brand: #5b47e0; --brand-strong: #4532c2; --brand-ink: #ffffff; --brand-soft: #f0edff; --brand-line: #ddd6ff;
  --up: #e03a3e; --up-bg: #fff0f0; --down: #2f6fe8; --down-bg: #edf3ff;
  --danger: #d92d20; --danger-bg: #fff1f0; --warn: #b54708; --warn-bg: #fff6e6; --info: #2f5fe8; --info-bg: #edf2ff; --ok: #079455; --ok-bg: #e7f8ef;
  --radius: 20px; --radius-md: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
  --shadow-lg: 0 2px 8px rgba(16, 24, 40, .06), 0 24px 56px rgba(16, 24, 40, .12);
  --wrap: 1080px;
  --font: var(--font-body, "Source Sans 3"), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f17; --surface: #161a22; --surface-2: #1b2029; --line: #262c37; --line-2: #333a47;
    --text: #e9edf2; --text-2: #b7c0cc; --muted: #8893a2;
    --brand: #a796ff; --brand-strong: #c4b8ff; --brand-ink: #120d2b; --brand-soft: #221c42; --brand-line: #3a3170;
    --up: #ff8a8c; --up-bg: #3a1a1c; --down: #8fb4ff; --down-bg: #182540;
    --danger: #ff8b80; --danger-bg: #3a1b19; --warn: #f7b955; --warn-bg: #3a2b12; --info: #8fb0ff; --info-bg: #1a2440; --ok: #5bd69b; --ok-bg: #12301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, .4), 0 24px 56px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.7; letter-spacing: -0.005em; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.3; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 100; background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.skip:focus { left: 16px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: 0.92rem; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── 머리말 ── */
.site-header {
  position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.03em; font-size: 1.05rem; min-width: 0; }
.logo:hover { color: var(--text); }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo-mark .lm-bg { fill: var(--brand); }
.logo-mark .lm-doc { fill: #fff; }
.logo-mark .lm-line { stroke: var(--brand); stroke-width: 3.6; stroke-linecap: round; fill: none; }
.logo-mark .lm-ok { fill: #12b76a; stroke: #fff; stroke-width: 3; }
.logo-mark .lm-tick { fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.logo-text { white-space: nowrap; }
.tag { font-size: 0.7rem; font-weight: 700; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; white-space: nowrap; }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 0.94rem; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
@media (max-width: 600px) {
  .nav a.nav-optional { display: none; }
  .nav a { padding: 8px 10px; font-size: 0.9rem; }
  .logo { font-size: 0.98rem; gap: 7px; }
  .logo-mark { width: 26px; height: 26px; }
}
@media (max-width: 380px) { .nav a[href="/#tool"] { display: none; } }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  border-radius: var(--radius-md); padding: 14px 22px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand-strong); color: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn-sm { padding: 8px 13px; font-size: 0.9rem; border-radius: var(--radius-sm); font-weight: 600; }
.btn-block { width: 100%; }

/* ── 첫 화면 ── */
.hero { padding: 56px 0 28px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%);
}
.hero-grid { position: relative; display: grid; gap: 40px; align-items: center; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: 1.08fr 0.92fr; } .hero { padding: 72px 0 40px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 6px 12px; border-radius: 999px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px color-mix(in srgb, #12b76a 22%, transparent); }
.hero h1 { font-size: clamp(2.05rem, 6vw, 3.35rem); line-height: 1.2; letter-spacing: -0.045em; margin: 18px 0 16px; font-weight: 800; }
.hero h1 .hl { color: var(--brand); }
.lead { font-size: clamp(1.03rem, 2.4vw, 1.16rem); color: var(--text-2); margin: 0 0 26px; max-width: 33em; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 20px; list-style: none; padding: 0; margin: 24px 0 0; color: var(--text-2); font-size: 0.93rem; font-weight: 600; }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust .icon { width: 18px; height: 18px; color: var(--ok); stroke-width: 2.4; }

/* 첫 화면 오른쪽 — 검사 결과 미리보기 그림 */
.mock { position: relative; display: none; }
@media (min-width: 720px) { .mock { display: block; } }
.mock-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 18px; transform: rotate(-1.2deg); }
.mock-top { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.mock-top i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.mock-top span { margin-left: 8px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.mock-post { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 0.9rem; color: var(--text-2); margin-bottom: 12px; line-height: 1.6; }
.mock-post b { color: var(--text); }
.mock-post mark { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border-radius: 4px; padding: 0 3px; }
.mock-verdict { display: flex; align-items: center; gap: 8px; background: var(--danger-bg); color: var(--danger); font-weight: 800; border-radius: 12px; padding: 10px 12px; font-size: 0.95rem; margin-bottom: 10px; }
.mock-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px dashed var(--line); font-size: 0.9rem; font-weight: 600; }
.mock-float {
  position: absolute; right: -6px; bottom: -18px; display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 14px; box-shadow: var(--shadow-lg); font-size: 0.86rem; font-weight: 700; transform: rotate(1.5deg);
}
.mock-float .icon { width: 17px; height: 17px; color: var(--ok); stroke-width: 2.4; }

/* ── 구역·카드 ── */
.section { padding: 28px 0; }
.section-head { margin: 0 0 18px; }
.section-head h2 { font-size: clamp(1.4rem, 3.4vw, 1.75rem); margin: 0 0 6px; font-weight: 800; }
.section-head p { margin: 0; color: var(--text-2); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0 0 6px; font-size: 1.18rem; font-weight: 800; }
.card p { margin: 0 0 10px; }
.card-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.card-icon .icon { width: 22px; height: 22px; }
.card-icon.red { background: var(--danger-bg); color: var(--danger); }
.card-icon.amber { background: var(--warn-bg); color: var(--warn); }
.card-icon.green { background: var(--ok-bg); color: var(--ok); }
.grid-2, .grid-4, .grid-3 { display: grid; gap: 14px; }
@media (max-width: 539px) {
  .feature { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 18px; }
  .feature .card-icon { grid-row: span 2; margin: 0; }
}
@media (min-width: 540px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.feature p { color: var(--text-2); font-size: 0.95rem; margin: 0; }

/* ── 검사 도구 ── */
.tool { padding: 26px; border-radius: 24px; box-shadow: var(--shadow-lg); }
@media (max-width: 600px) { .tool { padding: 18px; border-radius: 20px; } }
.tool-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tool-head h2 { font-size: 1.45rem; margin: 0; }
.tool-head p { margin: 0; color: var(--muted); font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; }
.tool-head p .icon { width: 16px; height: 16px; color: var(--ok); }
.step { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 0 0 10px; padding: 0; }
.step-no { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-size: 0.8rem; font-weight: 800; flex: none; }
fieldset.chips-field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.95rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); transition: all .12s ease; }
.chips label:hover span { border-color: var(--line-2); color: var(--text); }
.chips input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 28%, transparent); }
.chips input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 20px; font-size: 0.95rem; cursor: pointer; color: var(--text-2); }
.check input, .manual input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--surface); margin: 3px 0 0; flex: none; cursor: pointer; display: grid; place-items: center; transition: all .12s ease; }
.check input:checked, .manual input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after, .manual input:checked::after { content: ""; width: 10px; height: 6px; border: 2.5px solid var(--brand-ink); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.editor { border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); margin-bottom: 14px; transition: border-color .12s ease, box-shadow .12s ease; }
.editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
textarea {
  display: block; width: 100%; min-height: 210px; resize: vertical; padding: 16px; border: 0; border-radius: 16px 16px 0 0;
  background: transparent; color: var(--text); font: inherit; line-height: 1.7;
}
textarea:focus { outline: none; }
textarea::placeholder { color: var(--muted); }
.editor-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line); }
.grow { flex: 1; }
.counter { font-size: 0.88rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger); }

/* 결과 */
#result { margin-top: 20px; }
.verdict { display: flex; align-items: flex-start; gap: 12px; border-radius: 16px; padding: 16px 18px; }
.verdict > .icon { width: 26px; height: 26px; margin-top: 1px; stroke-width: 2.2; }
.verdict-body { flex: 1; min-width: 0; }
.verdict-body strong { display: block; font-size: 1.08rem; font-weight: 800; letter-spacing: -0.02em; }
.verdict-body span { display: block; font-size: 0.92rem; opacity: 0.9; margin-top: 2px; }
.verdict-counts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.verdict.danger { background: var(--danger-bg); color: var(--danger); }
.verdict.warn { background: var(--warn-bg); color: var(--warn); }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.findings { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.finding { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: 14px; padding: 14px 16px; }
.finding.danger { border-left-color: var(--danger); }
.finding.warn { border-left-color: var(--warn); }
.finding.info { border-left-color: var(--info); }
.finding .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.finding .title { font-weight: 700; }
.badge { display: inline-flex; align-items: center; font-size: 0.74rem; font-weight: 800; border-radius: 999px; padding: 3px 9px; white-space: nowrap; letter-spacing: 0; }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.plain { background: var(--surface); color: inherit; border: 1px solid currentColor; opacity: 0.85; }
.finding .match { margin: 10px 0 0; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; font-size: 0.93rem; color: var(--text-2); }
.finding .detail { margin: 8px 0 0; color: var(--text-2); }
.finding .src { margin: 8px 0 0; font-size: 0.84rem; color: var(--muted); }

/* 권장 문구·직접 확인 */
.quote { position: relative; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 14px; padding: 16px 18px; font-weight: 700; color: var(--text); margin: 12px 0 12px; }
.copy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.manual { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.manual label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 10px 8px; border-radius: 12px; }
.manual label:hover { background: var(--surface-2); }
.manual .why { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.manual input:checked + span > span:first-child { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--text-2); }

/* 표 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin: 12px 0; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.93rem; }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tr:last-child > * { border-bottom: 0; }
thead th { background: var(--surface-2); font-size: 0.85rem; color: var(--text-2); font-weight: 700; }
tbody th { text-align: center; width: 56px; }
.grade { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-weight: 800; }
.grade.a { background: var(--danger-bg); color: var(--danger); }
.grade.b { background: var(--warn-bg); color: var(--warn); }
.grade.c { background: var(--danger); color: var(--surface); }
table.compact { min-width: 0; }
table.compact td:first-child { white-space: nowrap; font-weight: 700; }

/* 자주 걸리는 다섯 가지 */
.reasons { list-style: none; counter-reset: r; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 820px) { .reasons { grid-template-columns: 1fr 1fr; } .reasons li:last-child { grid-column: 1 / -1; } }
.reasons li { counter-increment: r; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 18px 62px; box-shadow: var(--shadow); color: var(--text-2); }
.reasons li::before { content: counter(r); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.reasons strong { display: block; color: var(--text); margin-bottom: 2px; }

/* 주제 카드 */
.topic-grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .topic-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .topic-grid { grid-template-columns: repeat(3, 1fr); } }
.topic { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.topic:hover { transform: translateY(-2px); border-color: var(--brand-line); box-shadow: var(--shadow-lg); color: var(--text); }
.topic .card-icon { margin-bottom: 8px; }
.topic strong { font-size: 1.05rem; letter-spacing: -0.02em; }
.topic .topic-desc { color: var(--text-2); font-size: 0.92rem; }
.topic em { margin-top: auto; padding-top: 8px; font-style: normal; font-weight: 700; font-size: 0.9rem; color: var(--brand); }

/* ── 글 페이지 ── */
.prose { max-width: 760px; margin: 0 auto; padding: 28px 20px 56px; }
.crumb { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }
.crumb a { color: var(--text-2); text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--brand); }
.prose h1 { font-size: clamp(1.85rem, 5.4vw, 2.6rem); line-height: 1.25; letter-spacing: -0.04em; margin: 12px 0 12px; font-weight: 800; }
.prose h1 + .muted { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; }
.prose h2 { font-size: clamp(1.22rem, 3vw, 1.42rem); margin: 48px 0 14px; font-weight: 800; padding-top: 4px; }
.prose h2::before { content: ""; display: block; width: 28px; height: 4px; border-radius: 4px; background: var(--brand); margin-bottom: 12px; }
.prose .card h2::before, .prose .summary h2::before { display: none; }
.prose p, .prose li { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li::marker { color: var(--brand); }
.prose strong { font-weight: 700; }
.prose .src { font-size: 0.85rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 14px 0 0; line-height: 1.8; }
.prose .src a { color: var(--text-2); }
.prose .src a:hover { color: var(--brand); }
.prose code { font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; word-break: break-all; }
.summary { background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--radius); padding: 20px 22px 10px; margin: 20px 0 12px; }
.summary > strong:first-child { display: flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 800; margin-bottom: 10px; }
.summary > strong:first-child::before { content: ""; width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask: var(--i-bolt) center / contain no-repeat; mask: var(--i-bolt) center / contain no-repeat; }
.summary ul { margin: 0; }
.summary li { margin-bottom: 10px; }
:root { --i-bolt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.example { margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); }
.example figcaption { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 800; border-radius: 999px; padding: 3px 10px; margin-bottom: 12px; }
.example.good figcaption { background: var(--ok-bg); color: var(--ok); }
.example.bad figcaption { background: var(--danger-bg); color: var(--danger); }
.example.good figcaption::before { content: "✓"; }
.example.bad figcaption::before { content: "✕"; }
.example pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: 0.95rem; line-height: 1.7; color: var(--text); padding-left: 52px; position: relative; min-height: 40px; }
.example pre::before { content: ""; position: absolute; left: 0; top: 2px; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-line), var(--brand)); }
.faq { margin: 0; display: grid; gap: 10px; }
.faq dt { font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; padding: 14px 16px 4px 50px; position: relative; margin-top: 4px; }
.faq dt::before { content: "Q"; position: absolute; left: 16px; top: 13px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-size: 0.8rem; font-weight: 800; }
.faq dd { margin: -10px 0 0; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; padding: 4px 16px 14px 50px; color: var(--text-2); }
.prose .card.soft {
  margin-top: 40px; border: 0; color: #fff; border-radius: 22px; padding: 26px;
  background: radial-gradient(120% 140% at 100% 0%, #8f7dff 0%, transparent 55%), linear-gradient(135deg, #5b47e0, #3d2bb0);
  box-shadow: 0 18px 40px color-mix(in srgb, #5b47e0 30%, transparent);
}
.prose .card.soft h2 { color: #fff; margin: 0 0 8px; font-size: 1.3rem; }
.prose .card.soft p { color: rgba(255, 255, 255, .88); }
.prose .card.soft a { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: #3d2bb0; font-weight: 800; text-decoration: none; padding: 11px 18px; border-radius: 12px; margin-top: 4px; }
.prose .card.soft a:hover { background: #eef2ff; }
.topics { list-style: none; padding: 0 !important; margin: 0 0 10px; display: grid; gap: 10px; }
@media (min-width: 640px) { .prose .topics { grid-template-columns: 1fr 1fr; } }
.topics li { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--text-2); font-size: 0.93rem; transition: border-color .12s ease, transform .12s ease; }
.topics li:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.topics li::marker { content: ""; }
.topics a { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1rem; }
.topics a::after { content: " →"; color: var(--brand); }
.summary .topics { grid-template-columns: 1fr; }
.summary .topics li { background: var(--surface); }

/* ── 꼬리말 ── */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; gap: 28px; padding-top: 36px; padding-bottom: 24px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-about p { color: var(--muted); font-size: 0.88rem; margin: 12px 0 0; max-width: 36em; }
.footer-links { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.footer-links strong { font-size: 0.85rem; color: var(--text); margin-bottom: 4px; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 28px; color: var(--muted); font-size: 0.84rem; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ── 물타기 계산기 ── */
.calc-hero { padding: 36px 0 10px; position: relative; }
.calc-hero h1 { font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.2; letter-spacing: -0.045em; margin: 14px 0 10px; font-weight: 800; }
.calc-hero h1 .hl { color: var(--brand); }
.calc-hero .lead { margin-bottom: 0; }
.calc { display: grid; gap: 16px; align-items: start; }
@media (min-width: 940px) { .calc { grid-template-columns: 1.12fr 0.88fr; } .calc-result { position: sticky; top: 84px; } }
.calc-input { padding: 22px; border-radius: 24px; }
@media (max-width: 600px) { .calc-input { padding: 16px; border-radius: 20px; } }
.tabs { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--text-2); padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.group { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0 0 12px; background: var(--surface); }
.group-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; font-size: 0.98rem; margin: 0 0 12px; }
.group-title small { font-weight: 600; color: var(--muted); font-size: 0.82rem; }
.fields { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.field { min-width: 0; }
.field label { display: block; font-size: 0.84rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 0 12px; transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease; }
.input:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.input input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: inherit; font-size: 1.05rem; font-weight: 600; padding: 11px 0; color: var(--text); font-variant-numeric: tabular-nums; }
.input input:focus { outline: none; }
.input input::placeholder { color: var(--muted); font-weight: 500; }
.input .unit { color: var(--muted); font-size: 0.88rem; font-weight: 600; margin-left: 6px; white-space: nowrap; }
.buy-row { display: grid; grid-template-columns: 1fr 1fr 1fr 44px; gap: 8px; align-items: end; padding: 12px 0 0; margin-top: 12px; border-top: 1px dashed var(--line); }
.buy-row:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.buy-row .row-no { grid-column: 1 / -1; font-size: 0.8rem; font-weight: 800; color: var(--brand); margin-bottom: -2px; }
@media (max-width: 560px) { .buy-row { grid-template-columns: 1fr 1fr; } .buy-row .field-amount { grid-column: 1 / 2; } .buy-row .remove { justify-self: end; } }
.remove { width: 44px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.remove:hover { color: var(--up); border-color: var(--line-2); }
.remove .icon { width: 18px; height: 18px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.settings { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.settings .chips span { padding: 7px 14px; font-size: 0.9rem; }
details.more { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--text-2); font-size: 0.92rem; }
details.more .fields { margin-top: 12px; }
.hint { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; }

.calc-result { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: var(--shadow-lg); }
.result-label { font-size: 0.9rem; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.result-big { font-size: clamp(2.1rem, 6.5vw, 2.7rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; margin: 6px 0 8px; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.result-big small { font-size: 0.5em; font-weight: 700; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 0.92rem; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.delta.down { color: var(--down); background: var(--down-bg); }
.delta.up { color: var(--up); background: var(--up-bg); }
.delta.flat { color: var(--text-2); background: var(--surface-2); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.stat span { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.stat strong { display: block; font-size: 1.06rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.stat.up strong { color: var(--up); }
.stat.down strong { color: var(--down); }
.stat.wide { grid-column: 1 / -1; }
.compare { margin-top: 16px; display: grid; gap: 8px; }
.compare-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 14px; padding: 12px 14px; font-size: 0.94rem; }
.compare-row b { font-variant-numeric: tabular-nums; }
.compare-row .arrow { color: var(--brand); font-weight: 800; }
.empty { text-align: center; color: var(--muted); padding: 26px 8px 18px; }
.empty .icon { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--brand); display: block; }
.warn-box { background: var(--warn-bg); color: var(--warn); border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: 0.93rem; margin-top: 12px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.note { font-size: 0.8rem; color: var(--muted); margin: 14px 0 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); color: var(--text-2); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 800; margin-bottom: 10px; }
.steps strong { display: block; color: var(--text); margin-bottom: 2px; }
.formula { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; font-weight: 700; text-align: center; font-size: 1.02rem; margin: 12px 0; box-shadow: var(--shadow); }
.formula small { display: block; font-weight: 500; color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.logo-mark .lm-drop { fill: #fff; }
.logo-mark .lm-wave { fill: none; stroke: var(--brand); stroke-width: 3.2; stroke-linecap: round; }

/* family-links: 꼬리말 4칸 */
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }

/* design-v2 */
/* design-v2 · base — 조용한 틀. 입력·표·글은 담백하게 두고, 힘은 결과 카드(사이트별 서식) 한 곳에만 쓴다.
   sites-hq/tools/apply-design.mjs 가 각 사이트 style.css 끝의 design-v2 표시 사이에 넣는다. 여기서 고치고 다시 돌린다. */
:root { --radius: 14px; --radius-md: 12px; --radius-sm: 10px; --shadow: none; --shadow-lg: none; }

/* 첫 화면: 한 단어 색 강조·알약 라벨·점 장식을 걷어 낸다 */
.hero::before { display: none; }
.hero h1 .hl, .calc-hero h1 .hl { color: inherit; }
.eyebrow { display: block; background: none; border: 0; padding: 0; border-radius: 0; color: var(--text-2); font-weight: 600; font-size: 0.92rem; }
.eyebrow .dot { display: none; }
.calc-hero { padding: 44px 0 14px; }
.calc-hero h1 { font-size: clamp(2.05rem, 6.2vw, 3.1rem); line-height: 1.16; letter-spacing: -0.055em; margin: 10px 0 12px; }
.lead { max-width: 30em; }
.crumb { font-size: 0.88rem; }
.hero-split { display: grid; gap: 28px; align-items: end; }
@media (min-width: 900px) { .hero-split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 48px; } }
.hero-split .lead { margin-bottom: 0; }

/* 계산기 목록: 똑같은 카드 대신 줄로 나뉜 색인 */
.topic-grid { display: block; border-top: 1px solid var(--text); }
@media (min-width: 760px) { .topic-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 44px; } }
.topic { display: block; background: none; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; padding: 16px 2px 15px; box-shadow: none; transform: none; color: var(--text); }
.topic:hover { transform: none; box-shadow: none; border-color: var(--line-2); }
.topic .card-icon, .topic em { display: none; }
.topic strong { display: block; font-size: 1.1rem; letter-spacing: -0.03em; }
.topic .topic-desc { display: block; margin-top: 3px; font-size: 0.92rem; line-height: 1.55; }
.topic:hover strong, .topic:focus-visible strong { color: var(--brand-strong); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* 입력: 카드 안의 카드를 없애고 묶음만 남긴다 */
.calc-input.card { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
.group { border-radius: var(--radius); border-color: var(--line-2); }
.chips input:checked + span { box-shadow: none; }
.btn-primary { box-shadow: none; }
.tabs button[aria-selected="true"] { box-shadow: 0 0 0 1px var(--line-2); }

/* 결과: 사이트별 서식이 덮어쓰기 전의 공통 바탕 — 서식의 ::before/::after 가 붙도록 늘 위치 지정 요소로 둔다 */
.calc-result { box-shadow: none; position: relative; }
@media (min-width: 940px) { .calc-result { position: sticky; } }
.calc > #result { margin-top: 0; }
.delta { background: none !important; padding: 0; border-radius: 0; font-weight: 700; font-size: 0.95rem; }
.delta.flat { color: var(--text-2); }

/* 설명 구역 */
.steps li { background: none; border: 0; border-top: 2px solid var(--text); border-radius: 0; padding: 14px 0 0; box-shadow: none; }
.steps li::before { width: auto; height: auto; background: none; border-radius: 0; color: var(--muted); font-size: 0.85rem; justify-content: start; margin-bottom: 4px; }
.formula { box-shadow: none; text-align: left; }
.faq { gap: 0; border-top: 1px solid var(--text); }
.faq dt { background: none; border: 0; border-radius: 0; padding: 16px 0 4px; margin: 0; }
.faq dt::before { display: none; }
.faq dd { background: none; border: 0; border-radius: 0; margin: 0; padding: 0 0 16px; border-bottom: 1px solid var(--line-2); }
.prose h2::before { display: none; }
.prose h1 + .muted { display: block; background: none; border: 0; padding: 0; border-radius: 0; }
.mock-card, .mock-float { box-shadow: 0 1px 0 var(--line-2); }
.table-wrap { border-radius: 10px; }

/* design-v2 · English overrides — Latin type wants far less negative tracking than Hangul, and numbers must never split. */
body { letter-spacing: 0; }
h1, h2, h3, .logo, .topic strong, .verdict-body strong { letter-spacing: -0.01em; }
.hero h1, .calc-hero h1, .prose h1 { letter-spacing: -0.02em; }
.calc-hero h1 { line-height: 1.1; }
.result-big { letter-spacing: -0.02em; }
.stat strong, .result-big, .delta { overflow-wrap: normal; }
.stat strong { white-space: nowrap; }

/* family-links-en: calculators and games stacked in one footer column */
.footer-family { display: grid; gap: 22px; align-content: start; }

/* design-v2 · Smash Room — the game canvas is the hero: a dim room seen through a heavy dark frame, lit in the middle.
   Everything around it stays quiet and gray. Bebas Neue only where it carries weight (h1, section heads, the burst counter);
   Barlow for everything else. One red for actions. */
:root {
  --font-body: "Barlow";
  --font-display: "Bebas Neue";
  --bg: #f1f0f0; --surface: #ffffff; --surface-2: #e8e6e5; --text: #1b1716; --text-2: #4a4341; --muted: #6b6461;
  --line: #e0dcda; --line-2: #cbc5c2;
  --brand: #c92a2a; --brand-strong: #a51d1d; --brand-ink: #ffffff; --brand-soft: #fbe6e4; --brand-line: #efb8b2;
  --danger: #b42318;
  --frame: #1d1918; --frame-edge: #3a3330;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141111; --surface: #1e1a19; --surface-2: #272221; --text: #f3efed; --text-2: #cfc6c2; --muted: #a39a96;
    --line: #2e2827; --line-2: #403836;
    --brand: #ff6b5e; --brand-strong: #ff9289; --brand-ink: #2a0705; --brand-soft: #3a1714; --brand-line: #6e2a24;
    --danger: #ff8b80;
    --frame: #0b0909; --frame-edge: #2c2523;
  }
}
:root[data-theme="dark"] {
  --bg: #141111; --surface: #1e1a19; --surface-2: #272221; --text: #f3efed; --text-2: #cfc6c2; --muted: #a39a96;
  --line: #2e2827; --line-2: #403836;
  --brand: #ff6b5e; --brand-strong: #ff9289; --brand-ink: #2a0705; --brand-soft: #3a1714; --brand-line: #6e2a24;
  --frame: #0b0909; --frame-edge: #2c2523;
}
body { background: var(--bg); }

/* frame */
a { color: var(--brand-strong); }
a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--brand-strong); }
.logo-mark .lm-fg { fill: none; stroke: #fff; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.play-intro h1, .prose h1, .section-head h2, .calc-hero h1 { font-family: var(--font-display), var(--font); font-weight: 400; letter-spacing: 0.01em; }
.section-head h2 { font-size: clamp(1.7rem, 4.4vw, 2.2rem); }
.prose h1 { font-size: clamp(2.2rem, 7vw, 3rem); line-height: 1; }
.prose h2 { font-weight: 700; }

/* play: the room first */
.play { padding: 14px 0 30px; }
.play-stage { display: grid; gap: 12px; grid-template-areas: "intro" "col" "side"; }
.play-intro { grid-area: intro; }
.play-col { grid-area: col; min-width: 0; }
.play-side { grid-area: side; min-width: 0; display: grid; gap: 14px; align-content: start; }
.play-intro h1 { font-size: clamp(2.2rem, 9vw, 3.6rem); line-height: 0.95; margin: 0 0 6px; }
.play-intro .lead { margin: 0; font-size: 1rem; color: var(--text-2); max-width: 34em; }
@media (min-width: 900px) {
  .play { padding: 28px 0 40px; }
  .play-stage { grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.75fr); grid-template-areas: "col intro" "col side"; grid-template-rows: auto 1fr; column-gap: 36px; row-gap: 18px; }
  .play-intro { padding-top: 4px; }
}

/* the room window: the one bold thing on the page */
.room { position: relative; height: clamp(400px, min(124vw, 62svh), 620px); border-radius: 18px; overflow: hidden; background: #2a2220; border: 6px solid var(--frame); box-shadow: 0 0 0 1px var(--frame-edge), 0 18px 40px rgba(20, 10, 8, 0.28); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (min-width: 900px) { .room { height: clamp(500px, 76vh, 680px); } }
.room canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; -webkit-tap-highlight-color: transparent; cursor: crosshair; }
.room .room-floor { pointer-events: none; will-change: transform; }
.room canvas:focus { outline: none; }
.room canvas:focus-visible { outline: 3px solid #ffd23f; outline-offset: -4px; border-radius: 12px; }
.start { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; border: 0; padding: 0; margin: 0; background: rgba(15, 10, 9, 0.38); color: #fff; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.start-pill { display: grid; justify-items: center; min-width: 210px; padding: 14px 30px 12px; border-radius: 999px; background: #c92a2a; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.start-pill strong { font-family: var(--font-display), var(--font); font-weight: 400; font-size: 1.9rem; line-height: 1; letter-spacing: 0.02em; }
.start-pill span { font-size: 0.9rem; font-weight: 600; opacity: 0.92; }
.start:focus-visible .start-pill { outline: 3px solid #ffd23f; outline-offset: 3px; }
.room-label { position: absolute; left: 10px; top: 10px; margin: 0; max-width: calc(100% - 20px); padding: 3px 12px; border-radius: 999px; background: rgba(15, 10, 9, 0.62); color: #fff; font-weight: 700; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.burst-count { position: absolute; right: 10px; top: 42px; margin: 0; max-width: 70%; padding: 2px 12px; border-radius: 10px; background: rgba(201, 42, 42, 0.92); color: #fff; font-family: var(--font-display), var(--font); font-size: 1.4rem; line-height: 1.2; text-align: right; pointer-events: none; font-variant-numeric: tabular-nums; }
.replay-tag { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); margin: 0; padding: 4px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-weight: 700; font-size: 0.85rem; white-space: nowrap; pointer-events: none; }
.toast { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); margin: 0; width: max-content; max-width: calc(100% - 24px); padding: 6px 14px; border-radius: 12px; background: #ffd23f; color: #241c00; font-weight: 700; font-size: 0.88rem; text-align: center; pointer-events: none; }
.debug { position: absolute; left: 10px; bottom: 10px; margin: 0; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; font: 12px/1.5 ui-monospace, Consolas, monospace; pointer-events: none; }
.status { min-height: 3.1em; margin: 10px 2px 0; color: var(--text-2); font-weight: 500; font-size: 0.97rem; line-height: 1.5; }

/* tools: a row of chunky buttons under the room */
.toolbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 12px 0 0; padding: 0; }
@media (min-width: 560px) { .toolbar { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.tool-btn { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 56px; padding: 6px 2px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: inherit; font-size: 0.74rem; font-weight: 700; line-height: 1.1; cursor: pointer; text-align: center; }
.tool-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn:hover { border-color: var(--brand-line); color: var(--text); }
.tool-btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.tool-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* side panel */
.panel-block { display: grid; gap: 8px; }
.panel-label { margin: 0; font-weight: 700; font-size: 0.88rem; color: var(--text-2); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer; }
.seg button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.seg button:focus-visible, .room-swatch:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.pick-row { display: flex; gap: 8px; align-items: center; }
.pick-row select { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem; }
.pick-row .btn { min-height: 44px; white-space: nowrap; }
.rooms { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.room-swatch { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 64px; padding: 6px 2px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: inherit; font-size: 0.72rem; font-weight: 700; line-height: 1.1; cursor: pointer; }
.room-swatch i { display: block; width: 100%; max-width: 46px; height: 28px; border-radius: 6px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.room-swatch[aria-pressed="true"] { border: 2px solid var(--text); color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { min-height: 44px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.share-msg { min-height: 1.4em; margin: 0; color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.settings-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.toggle { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 14px 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; }
.toggle::before { content: ""; flex: none; width: 30px; height: 18px; border-radius: 999px; background: radial-gradient(circle at 9px 9px, var(--surface) 0 6px, transparent 6.5px), var(--line-2); }
.toggle[aria-pressed="true"] { color: var(--text); border-color: var(--brand-line); background: var(--brand-soft); }
.toggle[aria-pressed="true"]::before { background: radial-gradient(circle at 21px 9px, #fff 0 6px, transparent 6.5px), var(--brand); }
.toggle:disabled { opacity: 0.55; cursor: not-allowed; }
.toggle:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.side-note { margin: 0; font-size: 0.9rem; color: var(--muted); }
.link-btn { border: 0; padding: 0; margin: 0; background: none; font: inherit; color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.safety { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-weight: 600; }

/* how to play, lists */
.howto-section { padding-top: 26px; }
.narrow { max-width: 760px; }
.howto { list-style: none; counter-reset: step; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.howto li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line-2); color: var(--text-2); line-height: 1.55; }
.howto li::before { content: counter(step); font-family: var(--font-display), var(--font); font-size: 1.4rem; line-height: 1.1; color: var(--brand-strong); }
.howto strong { color: var(--text); }
.keys { margin: 14px 0 0; font-size: 0.9rem; color: var(--muted); }
.kbd { font: inherit; font-size: 0.85em; font-weight: 700; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--surface); color: var(--text-2); white-space: nowrap; }
.mat-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 0.93rem; }
.mat-table th, .mat-table td { text-align: left; vertical-align: top; padding: 10px; border-bottom: 1px solid var(--line); }
.mat-table thead th { color: var(--text-2); font-weight: 700; }
.mat-table td.num, .mat-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mat-table td.wrap { white-space: normal; }

/* items index and item pages */
.item-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.item-jump a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 700; font-size: 0.85rem; text-decoration: none; }
.item-jump a:hover { border-color: var(--brand); }
.item-group { scroll-margin-top: 80px; margin-bottom: 26px; }
.item-group h2 { font-family: var(--font-display), var(--font); font-weight: 400; font-size: 1.8rem; margin: 0 0 4px; }
.item-group > p { margin: 0 0 12px; color: var(--text-2); }
.item-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.item-card { display: grid; gap: 6px; height: 100%; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.item-card:hover { border-color: var(--brand-line); }
.item-card .icon-box { display: grid; place-items: center; height: 92px; border-radius: 10px; background: #2f2725; }
.item-card svg, .item-card img { display: block; max-width: 86%; max-height: 84px; object-fit: contain; }
.item-card strong { font-size: 0.98rem; line-height: 1.25; }
.item-card span { color: var(--muted); font-size: 0.84rem; }
.item-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 760px) { .item-detail { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; } }
.item-figure { display: grid; place-items: center; height: 200px; border-radius: 16px; background: #2f2725; }
.item-figure svg, .item-figure img { max-width: 80%; max-height: 180px; object-fit: contain; }
.item-text p { color: var(--text-2); max-width: 42em; }

/* daily crate */
.crate-box { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.crate-box h2 { font-family: var(--font-display), var(--font); font-weight: 400; font-size: 1.6rem; margin: 0 0 2px; }
.crate-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.crate-list li { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.crate-check { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--line-2); }
.crate-list li.done { color: var(--muted); text-decoration: line-through; }
.crate-list li.done .crate-check { background: var(--brand); border-color: var(--brand); }
.streak-num { margin: 10px 0 8px; color: var(--text-2); font-weight: 600; }
.streak-num strong { font-family: var(--font-display), var(--font); font-weight: 400; font-size: 2.2rem; color: var(--text); line-height: 1; }
.week { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.week li { display: grid; justify-items: center; gap: 2px; min-width: 30px; font-size: 0.78rem; color: var(--muted); }
.week .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); }
.week li.done .dot { background: var(--brand); border-color: var(--brand); }
.week li.today .wd { color: var(--text); font-weight: 700; }

/* the shelf (collection) */
.shelf-wall { padding: 14px; border-radius: 18px; background: #3a2c25; border: 6px solid var(--frame); }
.shelf-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px 10px; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.shelf-slot { display: grid; gap: 4px; justify-items: center; align-content: start; text-align: center; padding-bottom: 8px; border-bottom: 8px solid #a77b52; color: #f3ece6; font-size: 0.78rem; line-height: 1.2; }
.shelf-slot img, .shelf-slot .ghost { display: block; width: 92px; height: 92px; border-radius: 10px; object-fit: cover; background: #2a201c; }
.shelf-slot .ghost { display: grid; place-items: center; }
.shelf-slot .ghost img { width: 78%; height: 78%; object-fit: contain; background: none; }
.shelf-slot.locked { color: #c9bbb1; }
.shelf-slot.locked .ghost img { opacity: 0.28; filter: grayscale(1); }
.shelf-slot b { font-weight: 700; }
.shelf-slot b span { font-weight: 500; color: #c9bbb1; }
.shelf-slot a { display: block; border-radius: 10px; }
.shelf-slot a:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
.coll-empty { margin: 0 0 14px; color: var(--text-2); }
.coll-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 14px; padding: 0; list-style: none; color: var(--text-2); }
.coll-stats strong { font-family: var(--font-display), var(--font); font-weight: 400; font-size: 1.8rem; color: var(--text); margin-right: 4px; }
.badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.badge-item { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); }
.badge-item strong { color: var(--text-2); }
.badge-item span { font-size: 0.9rem; }
.badge-item.got { border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--text-2); }
.badge-item.got strong { color: var(--text); }
.prose table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 0.93rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }

/* phones: every menu item stays reachable as a swipeable second row */
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; row-gap: 0; }
  .site-header .nav { order: 2; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 2px 0 8px; }
  .site-header .nav::-webkit-scrollbar { display: none; }
  .nav a.nav-optional { display: inline-block; }
  .nav a { padding: 7px 10px; font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* /design-v2 */
