/* Pikkola Barcode: ink on paper, one green accent, and a preview that is always
   a sheet of paper whatever the theme. Weights stay at 400, 500, 600 and 700. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/tools/barcode/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/barcode/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: 15ch; 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: #1f6a5b;
  --accent-ink: #f7fbf8;
  --accent-soft: #d9e8e1;
  --laser: #b6432e;
  --laser-soft: #f4ded6;
  --paper: #ffffff;
  --shadow: 0 24px 60px -32px rgba(22, 30, 26, 0.38);
  --shadow-sm: 0 10px 24px -18px rgba(22, 30, 26, 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: #6cc0aa;
  --accent-ink: #0d1714;
  --accent-soft: #21332e;
  --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;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(720px 460px at 88% -8%, rgba(31, 106, 91, 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(108, 192, 170, 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; }

.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.08fr) minmax(0, 0.92fr);
  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: 16ch; }
.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: 320px; padding-bottom: 36px; }
.art-label {
  position: relative; width: min(400px, 100%); padding: 26px 26px 20px;
  background: var(--paper); color: #15181a;
  border-radius: 4px;
  box-shadow: var(--shadow);
  transform: rotate(-1.2deg);
  overflow: hidden;
}
.art-label::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px dashed rgba(21, 24, 26, 0.16); border-radius: 2px; pointer-events: none;
}
.art-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.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-bars { position: relative; background: #fff; }
.art-bars svg { width: 100%; height: auto; }
.art-scan {
  position: absolute; left: 26px; right: 26px; top: 44px; height: 2px;
  background: linear-gradient(90deg, rgba(182, 67, 46, 0), rgba(182, 67, 46, 0.85), rgba(182, 67, 46, 0));
  animation: scan 3.6s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { transform: translateY(0); opacity: 0.15; }
  45% { transform: translateY(96px); opacity: 0.9; }
  55% { transform: translateY(96px); opacity: 0.9; }
}
.art-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; }
.art-foot .art-note { font-size: 10px; letter-spacing: 0.06em; color: #767c7e; }
.art-foot .art-price { font-family: var(--mono); font-size: 13px; color: #15181a; }
.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[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: 12px; }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin-top: 10px; }
.hint.dim { opacity: 0.86; }

/* ---------- studio ---------- */

.deck { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.studio-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.studio-panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px 280px at 60% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%);
}
.types { display: flex; gap: 6px; flex-wrap: wrap; position: relative; z-index: 1; }
.type-tab {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-size: 12.5px; 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); }

.field { display: block; margin-top: 20px; position: relative; z-index: 1; }
.field-label { display: block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.value-input {
  width: 100%; padding: 12px 0 10px;
  font-family: var(--mono); font-size: 22px; letter-spacing: 0.04em; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1.5px solid var(--line-2); border-radius: 0;
}
.value-input::placeholder { color: var(--ink-3); font-size: 15px; letter-spacing: 0; }
.value-input:focus { outline: none; border-bottom-color: var(--accent); }

.status { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); min-height: 20px; }
.status.is-ok { color: var(--accent); }
.status.is-bad { color: var(--laser); }

.preview {
  margin-top: 18px; position: relative; z-index: 1;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 20px 18px; display: grid; place-items: center; min-height: 190px;
  background-image:
    linear-gradient(90deg, rgba(21, 24, 26, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(21, 24, 26, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  overflow: auto;
}
.preview svg { max-width: 100%; height: auto; }
.preview .preview-empty { color: #767c7e; font-size: 13px; }
.preview .preview-caption {
  margin-top: 10px; font-family: var(--mono); font-size: 11px; color: #767c7e;
  letter-spacing: 0.06em;
}

.readout {
  display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px;
  font-size: 12px; color: var(--ink-3); position: relative; z-index: 1;
}
.readout b { font-weight: 500; color: var(--ink-3); margin-right: 6px; }
.readout span.val { font-family: var(--mono); color: var(--ink); font-size: 13px; }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px;
  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.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  min-width: 150px; height: 46px; font-size: 14px; 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: 36px; font-size: 12.5px; padding: 0 13px; }
.btn.tiny { height: 30px; font-size: 11.5px; padding: 0 10px; border-radius: 8px; }

.scale-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); }
.scale-field select {
  appearance: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-family: var(--mono); font-size: 12.5px; padding: 7px 9px; cursor: pointer;
}

.side { display: flex; flex-direction: column; gap: 14px; }
.range-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-3); }
.range-field + .range-field { margin-top: 14px; }
.range-field .range-top { display: flex; justify-content: space-between; align-items: baseline; }
.range-field output { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.range-field input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer;
}
.range-field input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line-2); }
.range-field input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-2); }
.range-field 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);
}
.range-field input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
}
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.ink-row { display: flex; gap: 10px; }
.ink-swatch { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--ink-3); }
.ink-swatch input[type="color"] {
  width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); cursor: pointer;
}
.contrast-meter { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.contrast-meter i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.contrast-meter.is-low i { background: var(--laser); }
.contrast-meter.is-low { color: var(--laser); }
.ink-presets { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.ink-presets button {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  font-size: 11.5px; color: var(--ink-2); padding: 5px 10px; cursor: pointer;
}
.ink-presets button:hover { border-color: var(--line-2); }
.ink-presets i { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line-2); flex: none; }
.sw-ink { background: #15181a; }
.sw-black { background: #000000; }
.sw-navy { background: #1b2a41; }

.samples { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.samples button {
  text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 11px; cursor: pointer; font-size: 12px; color: var(--ink-2); line-height: 1.35;
}
.samples button:hover { border-color: var(--accent); color: var(--ink); }
.samples button b { display: block; font-size: 12px; color: var(--ink); font-weight: 600; }
.samples button span { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }

/* ---------- batch ---------- */

.batch-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.batch-input textarea {
  width: 100%; min-height: 230px; resize: vertical;
  font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 13px;
}
.batch-input textarea:focus { outline: none; border-color: var(--accent); }
.batch-opts { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.select-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.select-field select {
  appearance: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-family: var(--mono); font-size: 12.5px; padding: 7px 9px; cursor: pointer;
}
.batch-actions { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.batch-status { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); min-height: 20px; }
.batch-status.is-bad { color: var(--laser); }
.batch-warn { margin-top: 8px; font-size: 11.5px; color: var(--laser); line-height: 1.5; }
.batch-warn ul { margin: 4px 0 0; padding-left: 16px; }

.sheet-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-sm); }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.sheet {
  background: #efeee9; border-radius: 8px; padding: 12px;
  display: grid; gap: 8px; min-height: 260px; align-content: start;
  max-height: 560px; overflow: auto;
}
.sheet .label {
  background: #fff; border: 1px dashed #c9c6b9; border-radius: 3px;
  padding: 6px 7px 5px; display: flex; flex-direction: column; justify-content: center; gap: 3px;
  min-height: 72px; overflow: hidden;
}
.sheet .label svg { width: 100%; height: auto; max-height: 52px; }
.sheet .label .label-note { font-size: 8.5px; line-height: 1.3; color: #5d6366; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .label.is-bad { border-color: #d6a99f; background: #fdf5f3; color: #b6432e; font-size: 9px; padding: 8px; }
.sheet-empty { grid-column: 1 / -1; color: #5d6366; font-size: 12.5px; padding: 6px 2px; }

/* ---------- 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); }
.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(2), .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; }

/* ---------- print ---------- */

.print-only { display: none; }

@media print {
  @page { size: A4; margin: 8mm; }
  html, body { background: #fff !important; }
  body::before { display: none !important; }
  .site-header, main, .site-footer, .toast, .skip-link { display: none !important; }
  .print-only { display: block; }
  #printSheet {
    display: grid;
    gap: 3mm;
    width: 194mm;
    margin: 0 auto;
  }
  #printSheet .plabel {
    border: 0.2mm dashed #bbb;
    border-radius: 0;
    padding: 2mm 2mm 1.5mm;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    overflow: hidden;
    break-inside: avoid;
  }
  #printSheet .plabel svg { width: 100%; height: auto; max-height: none; }
  #printSheet .plabel .pnote { font-size: 7pt; line-height: 1.2; color: #333; margin-top: 1mm; text-align: center; }
}

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

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 52px; padding-bottom: 48px; }
  .hero-art { min-height: 260px; order: -1; }
  .deck { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side .card:last-child { grid-column: 1 / -1; }
  .batch-grid { grid-template-columns: 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; }
  .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; }
  .studio-panel { padding: 18px 15px 20px; }
  .value-input { font-size: 18px; }
  .preview { padding: 16px 12px 14px; min-height: 160px; }
  .side { grid-template-columns: 1fr; }
  .samples { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .doc { padding: 36px 0 54px; }
  .readout { gap: 14px; }
}
@media (max-width: 460px) {
  .type-tab { padding: 6px 10px; font-size: 11.5px; }
  .actions .btn.primary { flex: 1 1 100%; }
  .format-table th, .format-table td { padding: 8px 8px; font-size: 12.5px; }
}

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