/* Pikkola Seed: ink on paper, one amber accent, and a specimen card that looks
   like a printed table whatever the theme. Weights stay at 400, 500, 600, 700. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/tools/seed/fonts/inter.woff2) format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/tools/seed/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: 21ch; font-size: clamp(1.85rem, 3.6vw, 2.9rem); }

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: #7a5a12;
  --accent-ink: #fdf9ee;
  --accent-soft: #efe4c6;
  --laser: #b6432e;
  --laser-soft: #f4ded6;
  --paper: #ffffff;
  --shadow: 0 24px 60px -32px rgba(40, 32, 12, 0.38);
  --shadow-sm: 0 10px 24px -18px rgba(40, 32, 12, 0.42);
  --header: rgba(242, 240, 232, 0.86);
  --dot: rgba(21, 24, 26, 0.16);
}
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: #e0b964;
  --accent-ink: #171205;
  --accent-soft: #322a17;
  --laser: #e08169;
  --laser-soft: #3a241f;
  --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);
  --dot: rgba(238, 241, 236, 0.2);
}
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; }
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;
  overflow-wrap: break-word;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(720px 460px at 88% -8%, rgba(122, 90, 18, 0.10), transparent 70%),
    radial-gradient(560px 380px at 2% 6%, rgba(182, 67, 46, 0.05), transparent 72%);
}
html[data-theme="dark"] body::before {
  background:
    radial-gradient(720px 460px at 88% -8%, rgba(224, 185, 100, 0.10), transparent 70%),
    radial-gradient(560px 380px at 2% 6%, rgba(224, 129, 105, 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; }
code { font-family: var(--mono); font-size: 0.9em; }

.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; }
.small { font-size: 12px; color: var(--ink-3); }
.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.05rem, 4.2vw, 3.3rem); line-height: 1.03; letter-spacing: -0.035em; max-width: 17ch; }
.hero-lede { margin-top: 22px; font-size: 17px; color: var(--ink-2); max-width: 56ch; }
.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: 330px; padding-bottom: 36px; }

/* the specimen card: a slice of the table, printed */

.spec-card {
  position: relative; width: min(430px, 100%); padding: 20px 20px 14px;
  background: var(--paper); color: #15181a;
  border-radius: 6px; box-shadow: var(--shadow); transform: rotate(-1deg);
}
.spec-card::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px dashed rgba(21, 24, 26, 0.14); border-radius: 3px; pointer-events: none;
}
.art-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.art-head .art-name { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #5d6366; }
.art-chip {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em;
  border: 1px solid rgba(21, 24, 26, 0.28); border-radius: 999px; padding: 2px 7px; color: #15181a;
}
.art-table { width: 100%; border-collapse: collapse; font-size: 10.5px; line-height: 1.5; }
.art-table th {
  text-align: left; font-weight: 500; font-size: 9px; letter-spacing: 0.06em;
  color: #767c7e; text-transform: uppercase; padding: 0 4px 6px;
  border-bottom: 1px solid rgba(21, 24, 26, 0.2);
}
.art-table td { padding: 6px 4px; border-bottom: 1px dashed rgba(21, 24, 26, 0.12); white-space: nowrap; }
.art-table td:last-child { text-align: right; }
.art-table tr.is-ghost td { opacity: 0.42; }
.art-table td.is-null { color: #b6432e; }
.art-table td.is-null::before { content: ""; }
.art-foot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(21, 24, 26, 0.16);
  font-size: 10px; color: #5d6366;
}
.art-verdict {
  font-size: 9.5px; letter-spacing: 0.06em; color: #7a5a12;
  border: 1px solid rgba(122, 90, 18, 0.4); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.art-caption {
  position: absolute; bottom: 2px; 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: 62px 0; border-top: 1px solid var(--line); }
.section.wrap { padding-left: 28px; padding-right: 28px; }
.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);
}
.card-label { display: block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 0; }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin-top: 10px; }
.empty-note { font-size: 13px; color: var(--ink-3); padding: 12px 2px; }

/* ---------- controls ---------- */

.controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 26px;
  padding: 16px 20px 14px; margin-bottom: 18px;
}
.ctl { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ctl-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.ctl-input {
  width: 128px; padding: 9px 10px; min-height: 38px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-family: var(--mono); font-size: 14px;
}
.ctl-input:focus { outline: none; border-color: var(--accent); }
.ctl-btns { flex-direction: row; align-items: center; gap: 8px; }
.ctl-pair { display: flex; align-items: center; gap: 12px; }
.ctl-pair .ctl-input { width: 92px; }
.ctl-status { margin-left: auto; font-size: 11px; color: var(--ink-3); align-self: center; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 150px; height: 18px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-2); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
}

/* ---------- presets ---------- */

.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.presets-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.chip {
  height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); background: var(--surface-2); }
.chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- buttons ---------- */

.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: 13.5px; font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.small { height: 36px; font-size: 12.5px; padding: 0 13px; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  font-weight: 600; box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ---------- builder ---------- */

.deck { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 20px; align-items: start; }
.builder { display: flex; flex-direction: column; min-width: 0; padding: 18px 18px 16px; }
.fields-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.fields-head .btn { margin-left: auto; }
.fields-count { font-size: 10.5px; color: var(--ink-3); }
.fields { display: flex; flex-direction: column; gap: 10px; }
.field-row {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px 11px;
}
.fr-head {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: 20px minmax(0, 1fr) 150px auto;
  grid-template-areas: "num name type tools";
}
.fr-num { grid-area: num; font-size: 10px; color: var(--ink-3); }
.fr-name {
  grid-area: name; width: 100%; min-width: 0;
  background: transparent; border: 0; border-bottom: 1px solid var(--line-2);
  color: var(--ink); font-family: var(--mono); font-size: 13.5px; padding: 4px 2px;
}
.fr-name:focus { outline: none; border-bottom-color: var(--accent); }
.fr-name.is-bad { border-bottom-color: var(--laser); color: var(--laser); }
.fr-type {
  grid-area: type; width: 100%;
  appearance: none; background: var(--surface); border: 1px solid var(--line); border-radius: 7px;
  color: var(--ink); font-family: var(--mono); font-size: 12px; padding: 6px 7px; cursor: pointer;
}
.fr-type:focus { outline: none; border-color: var(--accent); }
.fr-tools { grid-area: tools; display: flex; gap: 2px; }
.chip-x {
  border: 1px solid transparent; background: none; color: var(--ink-3); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 5px 6px; border-radius: 6px;
}
.chip-x:hover { color: var(--ink); background: var(--surface); border-color: var(--line-2); }
.chip-x[data-act="del"]:hover { color: var(--laser); background: var(--laser-soft); border-color: var(--laser-soft); }

.fr-opts { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; align-items: flex-end; }
.opt { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; }
.opt > span { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.opt-input {
  width: 88px; min-width: 0; padding: 5px 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); font-family: var(--mono); font-size: 12px;
}
.opt-input:focus { outline: none; border-color: var(--accent); }
.opt-input[type="date"] { width: 136px; }
.opt-wide { flex: 1 1 220px; }
.opt-wide .opt-input { width: 100%; }

/* ---------- the output pane ---------- */

.out-pane { position: sticky; top: 84px; min-width: 0; }
.out-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden;
}
.out-tabs { display: flex; gap: 6px; padding: 12px 12px 0; flex-wrap: wrap; }
.type-tab {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 12px; color: var(--ink-2); cursor: pointer;
  font-family: var(--mono);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.type-tab:hover { border-color: var(--line-2); color: var(--ink); }
.type-tab.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.out-opt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.out-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg-btn {
  border: 0; background: transparent; border-radius: 999px; padding: 4px 11px;
  font-size: 11.5px; color: var(--ink-3); cursor: pointer; font-family: var(--mono);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.out-opt .opt { flex-direction: row; align-items: center; gap: 7px; }
.out-opt .opt > span { font-size: 9.5px; }
.out-opt .opt-input { width: 130px; }

.out-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.file-name { font-size: 11.5px; color: var(--ink-2); letter-spacing: 0.02em; }
.out-stats { font-size: 10px; color: var(--ink-3); }
.file-actions { margin-left: auto; display: flex; gap: 6px; }
.code-body { background: var(--bg-2); }
.code-out {
  margin: 0; padding: 12px 14px 14px; max-height: 430px; overflow: auto;
  font-size: 11.5px; line-height: 1.72; color: var(--ink-2);
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}
.out-card > .hint { padding: 0 12px 12px; margin-top: 8px; }

/* ---------- field types ---------- */

.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.type-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 16px 14px; min-width: 0;
}
.tc-name { display: block; font-size: 10.5px; letter-spacing: 0.06em; color: var(--accent); }
.tc-sample {
  display: block; margin: 7px 0 9px; font-size: 12.5px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.type-card p { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }

/* ---------- 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: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.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:first-child { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.format-table td:nth-child(3) { font-family: var(--mono); color: var(--ink-2); white-space: nowrap; }
.format-table td:last-child { color: var(--ink-3); }
.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: 78ch; }

/* ---------- 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; }

/* ---------- 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; }
  .deck { grid-template-columns: 1fr; }
  .out-pane { position: static; }
  .code-out { max-height: 360px; }
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 16px; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .section.wrap { padding-left: 18px; padding-right: 18px; }
  .site-nav { display: none; }
  .header-inner { height: 60px; }
  .header-tools { margin-left: auto; }
  .section { padding: 44px 0; }
  .section-head { gap: 12px; margin-bottom: 22px; }
  .section-lede { font-size: 14.5px; }
  .hero h1 { max-width: none; }
  .facts { gap: 24px; }
  .controls { gap: 12px 16px; padding: 14px 14px 12px; }
  .ctl-status { margin-left: 0; flex: 1 1 100%; }
  input[type="range"] { width: 110px; }
  .builder { padding: 14px 12px 12px; }
  .fr-head { grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-areas: "num name tools" ". type type"; row-gap: 6px; }
  .fr-opts { gap: 6px 10px; }
  .opt-input { width: 78px; }
  .opt-input[type="date"] { width: 124px; }
  .opt-wide { flex: 1 1 100%; }
  .out-tabs { padding: 10px 10px 0; }
  .out-opt { padding: 9px 10px; }
  .out-bar { padding: 9px 10px; }
  .file-actions { width: 100%; margin-left: 0; }
  .file-actions .btn { flex: 1 1 auto; }
  .code-out { font-size: 10.5px; padding: 10px 11px 12px; }
  .spec-card { padding: 16px 14px 12px; }
  .art-table { font-size: 9px; }
  .type-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .doc { padding: 36px 0 54px; }
  .format-table table { font-size: 12.5px; table-layout: fixed; }
  .format-table { overflow-x: visible; }
  .format-table td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; }
  .format-table td:last-child { overflow-wrap: anywhere; }
  .format-table th, .format-table td { padding: 8px 9px; }
}
@media (max-width: 460px) {
  .ctl-input { width: 100px; }
  .ctl-pair .ctl-input { width: 74px; }
  .controls { gap: 10px 12px; }
  .ctl-btns { flex: 1 1 100%; }
  .type-tab { padding: 6px 10px; font-size: 11.5px; }
  .art-table th, .art-table td { padding: 5px 3px; }
  .art-table { font-size: 8.4px; }
}

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