/* Pikkola Font: ink on paper, one burnt-sienna accent, and specimen boxes that
   keep a baseline where it belongs. Weights stay between 400 and 700. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/tools/font/fonts/inter.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Pikkola Specimen";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/tools/font/fonts/specimen-serif.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/tools/font/fonts/jetbrains-mono.woff2) format("woff2");
}

:root {
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --r: 14px;
  --r-sm: 8px;
}
html[lang="ko"] {
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
}
html[lang="ja"] {
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  word-break: normal;
}
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] p,
html[lang="ja"] li,
html[lang="ja"] summary { line-break: strict; overflow-wrap: break-word; word-break: auto-phrase; }
html[lang="ja"] .hero h1 { max-width: 14ch; font-size: clamp(1.95rem, 3.9vw, 3.1rem); }

html[data-theme="light"] {
  --bg: #f2f0e8;
  --bg-2: #e9e6dc;
  --surface: #fdfcf7;
  --surface-2: #f6f4ec;
  --ink: #15181a;
  --ink-2: #444a4d;
  --ink-3: #767c7e;
  --line: #dedacd;
  --line-2: #c6c1b2;
  --accent: #9a4f22;
  --accent-ink: #fdf8f3;
  --accent-soft: #f5e3d2;
  --hot: #b6432e;
  --hot-soft: #f6ded6;
  --ok: #2f6b4f;
  --ok-soft: #e2efe7;
  --paper: #ffffff;
  --shadow: 0 24px 60px -32px rgba(34, 26, 18, 0.38);
  --shadow-sm: 0 10px 24px -18px rgba(34, 26, 18, 0.42);
  --header: rgba(242, 240, 232, 0.86);
}
html[data-theme="dark"] {
  --bg: #101314;
  --bg-2: #171b1c;
  --surface: #1a1f20;
  --surface-2: #202627;
  --ink: #eef1ec;
  --ink-2: #c0c8c4;
  --ink-3: #8e9793;
  --line: #2b3233;
  --line-2: #3d4647;
  --accent: #e3a97a;
  --accent-ink: #201409;
  --accent-soft: #34251a;
  --hot: #e08169;
  --hot-soft: #3a241f;
  --ok: #8fd0aa;
  --ok-soft: #1d2f26;
  --paper: #fbfaf6;
  --shadow: 0 28px 70px -30px rgba(0, 0, 0, 0.8);
  --shadow-sm: 0 12px 28px -18px rgba(0, 0, 0, 0.8);
  --header: rgba(16, 19, 20, 0.86);
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(720px 460px at 88% -8%, rgba(154, 79, 34, 0.11), transparent 70%),
    radial-gradient(560px 380px at 2% 6%, rgba(154, 79, 34, 0.05), transparent 72%);
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 40;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; font-size: 14px;
}
.skip-link:focus { top: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 26px; height: 66px; }
.brand { display: inline-flex; align-items: baseline; gap: 7px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; color: var(--accent); align-self: center; }
.brand-name { font-size: 17px; }
.brand-tool {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); border-left: 1px solid var(--line-2); padding-left: 8px;
}
.site-nav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ink-3); }
.header-tools { display: flex; align-items: center; gap: 10px; }
.lang-field { position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.lang-globe { width: 16px; height: 16px; margin-left: 6px; pointer-events: none; position: absolute; left: 0; }
.lang-field select {
  appearance: none; background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--ink-2); font-size: 12.5px; padding: 6px 10px 6px 26px; cursor: pointer;
}
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn svg { width: 17px; height: 17px; }
html[data-theme="light"] .ico-sun { display: none; }
html[data-theme="dark"] .ico-moon { display: none; }

/* ---------- hero ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 46px; align-items: center;
  padding-top: 72px; padding-bottom: 60px;
}
.eyebrow {
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.1rem, 4.3vw, 3.4rem); line-height: 1.03; letter-spacing: -0.035em; max-width: 19ch; }
.hero-lede { margin-top: 22px; font-size: 17px; color: var(--ink-2); max-width: 54ch; }
.facts { display: flex; gap: 34px; margin: 34px 0 0; padding: 0; flex-wrap: wrap; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--ink); }
.facts dd { margin: 0; font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }

.hero-art { position: relative; display: grid; place-items: center; min-height: 340px; padding-bottom: 30px; }
.art-block {
  width: min(430px, 100%); padding: 22px 22px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); transform: rotate(-0.7deg);
}
.art-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.art-head .art-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--ink-3); text-transform: uppercase; }
.art-cidr { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: -0.01em; }
.art-specimen { position: relative; height: 136px; padding: 6px 0 0; overflow: hidden; }
.art-specimen .sa-glyph {
  font-family: "Pikkola Specimen", Georgia, "Times New Roman", serif;
  display: inline-block; font-size: 104px; line-height: 1; letter-spacing: -0.03em; color: var(--ink);
  position: relative; z-index: 1;
}
.art-specimen .sa-alt { color: var(--accent); font-style: italic; margin-left: -2px; }
.art-specimen .sa-rule { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.art-specimen .sa-xh { top: 45px; }
.art-specimen .sa-base { top: 95px; background: var(--line-2); }
.art-specimen .sa-rule span {
  position: absolute; right: 0; top: -14px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.08em; color: var(--ink-3);
  background: var(--surface); padding-left: 6px;
}
.art-rows { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 4px; font-size: 11px; }
.art-rows dt { color: var(--ink-3); font-family: var(--mono); letter-spacing: 0.02em; }
.art-rows dd { margin: 0; font-family: var(--mono); color: var(--ink-2); text-align: right; }
.art-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.art-foot span { font-size: 9.5px; letter-spacing: 0.05em; color: var(--ink-3); font-family: var(--mono); }
.art-caption {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
  white-space: nowrap;
}

/* ---------- sections ---------- */

.section { padding-top: 62px; padding-bottom: 62px; border-top: 1px solid var(--line); }
.section[id] { scroll-margin-top: 84px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.5rem, 2.7vw, 2.05rem); }
.section-lede { max-width: 46ch; color: var(--ink-2); font-size: 15.5px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin-top: 10px; }

.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 15px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  min-width: 140px; height: 44px; font-weight: 600;
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: var(--accent-ink); }
.btn.small { height: 34px; font-size: 12px; padding: 0 12px; }
.btn.tiny { height: 28px; font-size: 11px; padding: 0 9px; border-radius: 7px; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); }

/* ---------- rules ---------- */

.rule-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rule-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.rule-card .rule-num { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }
.rule-card h3 { margin-top: 8px; font-size: 16px; }
.rule-card p { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }

.format-table { margin-top: 22px; overflow-x: auto; }
.format-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.format-table caption { text-align: left; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 10px; }
.format-table th, .format-table td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); }
.format-table thead th { border-top: 0; border-bottom: 1px solid var(--line-2); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.format-table td { color: var(--ink-2); }
.format-table td:first-child { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.format-table tbody tr:hover { background: var(--surface-2); }

/* ---------- faq ---------- */

.faq-section { padding-top: 54px; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 18px 30px 18px 0; font-size: 15.5px; font-weight: 500;
  list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 16px; color: var(--ink-3);
}
.faq details[open] summary::after { content: "−"; color: var(--accent); }
.faq details p { padding: 0 0 20px; color: var(--ink-2); font-size: 14.5px; max-width: 80ch; }

/* ---------- related ---------- */

.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rel-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.rel-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.rel-kicker { font-size: 10px; letter-spacing: 0.1em; color: var(--accent); }
.rel-card h3 { font-size: 16px; }
.rel-card p { font-size: 13px; color: var(--ink-3); }
.rel-open { margin-top: auto; font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.rel-open::after { content: "→"; font-family: var(--mono); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 40px; padding: 40px 0 46px; position: relative; z-index: 1; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 30px; align-items: start; }
.footer-brand .brand-name { font-weight: 600; font-size: 16px; }
.footer-brand .brand-tool { margin-left: 8px; }
.footer-tagline { margin-top: 10px; font-size: 13px; color: var(--ink-3); max-width: 46ch; }
.footer-note { margin-top: 10px; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.footer-links { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { font-size: 12px; color: var(--ink-3); }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 999px; font-size: 13.5px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; z-index: 120;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- plain pages ---------- */

.doc { max-width: 780px; padding: 56px 0 70px; }
.doc h1 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); }
.doc .updated { margin-top: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; }
.doc-lede { margin-top: 20px; font-size: 17px; color: var(--ink-2); }
.doc h2 { margin-top: 36px; font-size: 1.22rem; }
.doc h3 { margin-top: 24px; font-size: 1.02rem; }
.doc p, .doc li { font-size: 15px; color: var(--ink-2); }
.doc p { margin-top: 12px; }
.doc ul { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.doc a { color: var(--accent); text-underline-offset: 3px; }
.doc code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.doc .doc-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }

.notfound { padding: 96px 0 110px; max-width: 620px; }
.notfound h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.notfound p { margin-top: 16px; color: var(--ink-2); }
.notfound .btn { margin-top: 26px; text-decoration: none; }

/* ---------- the studio shell ---------- */

.tool-shell { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px 24px; box-shadow: var(--shadow); position: relative; }
.tabbar { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: thin; }
.tabbar button {
  flex: 1 1 0; min-width: max-content; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 0; border-radius: 10px; padding: 10px 14px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.tabbar button:hover { color: var(--ink); }
.tabbar button.is-on { background: var(--accent-soft); color: var(--ink); box-shadow: var(--shadow-sm); }
.tabbar .t-num { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.08em; }
.tabbar button.is-on .t-num { color: var(--accent); }
html[data-theme="dark"] .tabbar button.is-on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent); }

.tabpanel { display: grid; gap: 18px; }
.tabpanel[hidden] { display: none !important; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.panel-head h2 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
.panel-head p { font-size: 13.5px; color: var(--ink-3); max-width: 66ch; margin-top: 6px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.two-col > * { min-width: 0; }
.wide-left { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.narrow-left { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.subpanel { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.subpanel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.subpanel-head b { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.subpanel-head span { font-size: 11.5px; color: var(--ink-3); }

.note { margin-top: 10px; font-size: 12px; color: var(--ink-3); line-height: 1.55; }
.note.is-bad { color: var(--hot); }
.note code { font-family: var(--mono); font-size: 0.94em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

.state-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft); border-radius: 999px; padding: 5px 11px;
}
.state-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state-pill.is-paused { color: var(--ink-3); background: var(--surface-2); border-color: var(--line-2); }
.state-pill.is-bad { color: var(--hot); background: var(--hot-soft); border-color: color-mix(in srgb, var(--hot) 42%, transparent); }

.res-table { display: grid; gap: 1px; margin-top: 4px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.res-row { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: baseline; gap: 10px; background: var(--surface); padding: 9px 13px; }
.res-row .tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-3); text-transform: uppercase; }
.res-row .val { font-family: var(--mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.res-row .val.plain { font-family: var(--sans); font-size: 13.5px; }
.res-row.is-primary { background: var(--accent-soft); }
.res-row.is-primary .val { font-weight: 600; }

/* ---------- the drop zone ---------- */

.drop-zone {
  display: grid; justify-items: center; gap: 8px; text-align: center;
  padding: 34px 22px 30px; margin-top: 4px;
  background: var(--surface-2);
  border: 1.5px dashed var(--line-2); border-radius: 16px;
  cursor: pointer; transition: border-color 0.16s, background 0.16s;
}
.drop-zone.is-loaded { padding: 16px 18px; gap: 4px; border-style: solid; }
.drop-zone.is-loaded svg { width: 22px; height: 22px; }
.drop-zone.is-loaded b { font-size: 13.5px; font-weight: 500; }
.drop-zone.is-loaded .dz-hint { display: none; }
.drop-zone:hover, .drop-zone:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone.is-over { border-color: var(--accent); background: var(--accent-soft); border-style: solid; }
.drop-zone svg { width: 34px; height: 34px; color: var(--accent); }
.drop-zone b { font-size: 15px; font-weight: 600; }
.dz-hint { font-size: 12.5px; color: var(--ink-3); max-width: 52ch; }
.dz-file { font-size: 10.5px; letter-spacing: 0.06em; color: var(--accent); min-height: 14px; }

/* ---------- coverage ---------- */

.cov-list { display: grid; gap: 9px; }
.cov-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 88px; gap: 10px; align-items: center; }
.cov-name { font-size: 12.5px; color: var(--ink-2); }
.cov-bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cov-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.3s ease; }
.cov-bar i.is-none { background: var(--line-2); }
.cov-count { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-align: right; }
.cov-count b { color: var(--ink); font-weight: 500; }

/* ---------- axes ---------- */

.axis-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 58px; gap: 10px; align-items: center; padding: 7px 0; }
.axis-tag { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.axis-ends { font-family: var(--mono); font-size: 10px; color: var(--ink-3); text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; }

/* ---------- the specimen ---------- */

.specimen {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; min-height: 120px; display: flex; align-items: center;
  overflow: hidden;
}
.specimen-line {
  margin: 0; width: 100%; color: var(--ink);
  line-height: 1.24; letter-spacing: -0.005em; overflow-wrap: anywhere;
  font-size: 44px;
}
.specimen-line.is-sub { color: var(--ink-3); font-size: 15px; line-height: 1.5; letter-spacing: 0; margin-top: 10px; }
.specimen-stack { display: grid; gap: 12px; }

.field { display: block; margin-top: 12px; }
.field:first-child { margin-top: 0; }
.field-label { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-value { font-family: var(--mono); font-size: 12px; color: var(--ink-2); min-width: 54px; text-align: right; }

.text-input, .num-input, .unit-select {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); font-family: var(--mono); font-size: 14px;
}
.text-input { font-family: var(--sans); }
.num-input { font-variant-numeric: tabular-nums; }
.text-input:focus, .num-input:focus, .unit-select:focus { outline: none; border-color: var(--accent); }
.unit-select { appearance: none; cursor: pointer; font-size: 13px; padding-right: 30px; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; pointer-events: none;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
}
textarea.text-area {
  width: 100%; min-height: 92px; resize: vertical; display: block;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.55; padding: 10px 12px;
}
textarea.text-area:focus { outline: none; border-color: var(--accent); }

/* ---------- the scale ---------- */

.scale-list { display: grid; gap: 0; }
.scale-row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 96px;
  gap: 14px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line);
}
.scale-row:first-child { border-top: 0; }
.scale-tag { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.scale-sample { color: var(--ink); line-height: 1.15; letter-spacing: -0.02em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.scale-row.is-body .scale-sample { font-weight: 400; letter-spacing: 0; }
.scale-row.is-small .scale-sample { font-weight: 400; letter-spacing: 0; color: var(--ink-2); }
.scale-size { font-family: var(--mono); font-size: 11px; color: var(--ink-2); text-align: right; }

.code-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.code-out {
  margin: 0; padding: 13px 14px 16px; min-height: 150px; max-height: 420px; overflow: auto;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.72; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 2;
}
.code-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 9px; }
.chip-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.chip-tabs button {
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-2); padding: 5px 10px; cursor: pointer;
}
.chip-tabs button:hover { border-color: var(--accent); color: var(--ink); }
.chip-tabs button.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.code-tools .btn { margin-left: auto; }

/* ---------- readability ---------- */

.read-preview {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 28px; overflow: hidden;
}
.read-article { color: var(--ink); }
.read-article h2 { margin: 0; font-size: 1.9em; line-height: 1.15; letter-spacing: -0.025em; }
.read-article p { margin: 0.9em 0 0; }
.read-article .read-meta {
  margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); display: flex; gap: 16px; flex-wrap: wrap;
}
.read-stats { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }

.contrast-panel { display: grid; gap: 12px; }
.color-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.color-field { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 8px; }
.color-field input[type="color"] {
  width: 34px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 6px;
}
.color-field input[type="text"] {
  width: 100%; border: 0; background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: 12.5px; text-transform: uppercase;
}
.color-field input[type="text"]:focus { outline: none; }
.color-field small { display: block; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.ratio-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ratio-value { font-family: var(--mono); font-size: 30px; font-weight: 500; color: var(--ink); }
.ratio-word { font-size: 12px; color: var(--ink-3); }
.pass-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pass-cell {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface);
  display: flex; flex-direction: column; gap: 3px;
}
.pass-cell span { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.pass-cell b { font-size: 12px; font-weight: 600; }
.pass-cell.is-ok b { color: var(--ok); }
.pass-cell.is-bad b { color: var(--hot); }
.swatch { height: 46px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 15px; font-weight: 600; }

/* ---------- empty state ---------- */

.empty-box {
  border: 1px dashed var(--line-2); border-radius: 14px; padding: 26px 20px;
  text-align: center; color: var(--ink-3); font-size: 13.5px;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 52px; padding-bottom: 48px; }
  .hero-art { min-height: 280px; order: -1; }
  .rule-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 16px; }
  .two-col, .wide-left, .three-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .site-nav { display: none; }
  .header-inner { height: 60px; }
  .header-tools { margin-left: auto; }
  .section { padding-top: 44px; padding-bottom: 44px; }
  .section-head { gap: 12px; margin-bottom: 22px; }
  .section-lede { font-size: 14.5px; }
  .hero h1 { max-width: none; }
  .facts { gap: 24px; }
  .related-grid { grid-template-columns: 1fr; }
  .doc { padding: 36px 0 54px; }
  .art-block { transform: none; }
  .art-specimen { height: 116px; }
  .art-specimen .sa-glyph { font-size: 88px; }
  .art-specimen .sa-xh { top: 33px; }
  .art-specimen .sa-base { top: 75px; }
  .tool-shell { padding: 16px 13px 18px; border-radius: 16px; }
  .tabbar { overflow: visible; }
  .tabbar button { flex: 1 1 0; min-width: 0; padding: 9px 4px; font-size: 11.5px; gap: 0; }
  .tabbar .t-num { display: none; }
  .read-article h2 { font-size: 1.5em; }
  .read-preview { padding: 18px 16px; }
  .res-row { grid-template-columns: 96px minmax(0, 1fr); padding: 8px 10px; }
  .cov-row { grid-template-columns: 88px minmax(0, 1fr) 72px; }
  .specimen-line { font-size: 32px; }
  .read-preview { padding: 18px 16px; }
  .scale-row { grid-template-columns: 64px minmax(0, 1fr) 78px; gap: 10px; }
  .code-out { font-size: 11px; }
  .color-row, .pass-grid { grid-template-columns: 1fr; }
  .drop-zone { padding: 26px 16px 22px; }
}
@media (max-width: 460px) {
  .actions .btn.primary { flex: 1 1 100%; }
  .format-table th, .format-table td { padding: 8px 8px; font-size: 12px; }
  .axis-row { grid-template-columns: 46px minmax(0, 1fr) 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- spacing helpers ---------- */

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.stack-12 { display: grid; gap: 12px; }
.stack-16 { display: grid; gap: 16px; }

/* Korean and Japanese set their own word spacing: the wide tracking that suits
   a Latin upper-case label tears a Korean phrase into pieces. */
html[lang="ko"] .eyebrow,
html[lang="ko"] .subpanel-head b,
html[lang="ko"] .field-label,
html[lang="ko"] .art-tag,
html[lang="ko"] .state-pill,
html[lang="ko"] .res-row .tag { letter-spacing: 0.03em; }
/* Upper case is a Latin habit; it turns em into EM in the middle of a Korean
   label, so the translation keeps its own case. */
html[lang="ko"] .res-row .tag,
html[lang="ko"] .field-label,
html[lang="ko"] .subpanel-head b,
html[lang="ko"] .art-tag,
html[lang="ko"] .state-pill,
html[lang="ja"] .res-row .tag,
html[lang="ja"] .field-label,
html[lang="ja"] .subpanel-head b,
html[lang="ja"] .art-tag,
html[lang="ja"] .state-pill { text-transform: none; }
html[lang="ja"] .eyebrow,
html[lang="ja"] .subpanel-head b,
html[lang="ja"] .field-label,
html[lang="ja"] .art-tag,
html[lang="ja"] .state-pill,
html[lang="ja"] .res-row .tag { letter-spacing: 0.06em; }
