/* Pikkola UUID: a card catalogue of identifiers. Cool paper, one indigo accent,
   and fields that keep their own colour from the hero card down to the nibble
   strip in the parser. Weights stay between 400 and 700. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/tools/uuid/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/uuid/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: #eff1f5;
  --bg-2: #e7eaf0;
  --surface: #fbfcfd;
  --surface-2: #f4f6f9;
  --ink: #131720;
  --ink-2: #444b59;
  --ink-3: #737b8a;
  --line: #dde1e8;
  --line-2: #c5cbd6;
  --accent: #2f4bbf;
  --accent-ink: #f7f9ff;
  --accent-soft: #e3e8fb;
  --hot: #b23a4b;
  --hot-soft: #f7e2e6;
  --ok: #2f6b4f;
  --ok-soft: #e0efe6;
  --paper: #ffffff;
  --seg-time: #2f4bbf;
  --seg-ver: #b23a4b;
  --seg-count: #2f6b4f;
  --seg-var: #8a5a10;
  --seg-rand: #5a6472;
  --shadow: 0 24px 60px -32px rgba(18, 24, 42, 0.42);
  --shadow-sm: 0 10px 24px -18px rgba(18, 24, 42, 0.4);
  --header: rgba(239, 241, 245, 0.86);
}
html[data-theme="dark"] {
  --bg: #0e1016;
  --bg-2: #141822;
  --surface: #171c26;
  --surface-2: #1d232f;
  --ink: #eef1f7;
  --ink-2: #bcc4d2;
  --ink-3: #8b94a5;
  --line: #262d3a;
  --line-2: #39424f;
  --accent: #9aa8ff;
  --accent-ink: #101534;
  --accent-soft: #232a4a;
  --hot: #e5808f;
  --hot-soft: #3a2229;
  --ok: #8fd0aa;
  --ok-soft: #1d2f26;
  --paper: #fbfbfd;
  --seg-time: #93a2ff;
  --seg-ver: #e5808f;
  --seg-count: #8fd0aa;
  --seg-var: #e0b062;
  --seg-rand: #a8b2c4;
  --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(14, 16, 22, 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(47, 75, 191, 0.12), transparent 70%),
    radial-gradient(560px 380px at 2% 6%, rgba(47, 75, 191, 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: 27px; height: 27px; 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.04fr) minmax(0, 0.96fr);
  gap: 46px; align-items: center;
  padding-top: 72px; padding-bottom: 58px;
}
.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; text-wrap: balance; }
.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; }
.id-card {
  width: min(440px, 100%); padding: 20px 22px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); transform: rotate(-0.6deg);
  position: relative;
}
.id-card::before {
  content: ""; position: absolute; left: 18px; top: -7px;
  width: 34px; height: 14px; border-radius: 3px 3px 0 0;
  background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0;
}
.id-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.id-tag { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.id-pill {
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--seg-count); background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--seg-count) 30%, transparent);
  border-radius: 999px; padding: 3px 9px;
}
.id-value { font-size: 14.5px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.id-value b { font-weight: 700; color: var(--seg-ver); background: color-mix(in srgb, var(--seg-ver) 14%, transparent); border-radius: 3px; padding: 0 1px; }
.id-strip { display: flex; height: 26px; margin: 14px 0 12px; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.id-strip .seg { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; border-right: 1px solid var(--surface); }
.id-strip .seg-time { flex: 48 1 0; }
.id-strip .seg-ver { flex: 4 1 0; }
.id-strip .seg-count { flex: 12 1 0; }
.id-strip .seg-var { flex: 2 1 0; }
.id-strip .seg-rand { flex: 62 1 0; }
.id-strip .seg:last-child { border-right: 0; }
.id-strip i { font-family: var(--mono); font-style: normal; font-size: 8.5px; opacity: 0.72; }
.id-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: -4px 0 12px; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.id-legend span { background: none; display: inline-flex; align-items: center; gap: 4px; }
.id-legend i { width: 7px; height: 7px; border-radius: 2px; background: currentColor; display: inline-block; }
.seg-time { background: color-mix(in srgb, var(--seg-time) 18%, var(--surface)); color: var(--seg-time); }
.seg-ver { background: color-mix(in srgb, var(--seg-ver) 22%, var(--surface)); color: var(--seg-ver); }
.seg-count { background: color-mix(in srgb, var(--seg-count) 20%, var(--surface)); color: var(--seg-count); }
.seg-var { background: color-mix(in srgb, var(--seg-var) 22%, var(--surface)); color: var(--seg-var); }
.seg-rand { background: color-mix(in srgb, var(--seg-rand) 18%, var(--surface)); color: var(--seg-rand); }
.id-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.id-rows div { border-top: 1px solid var(--line); padding-top: 7px; }
.id-rows dt { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.id-rows dd { margin: 2px 0 0; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.id-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.id-foot span { font-size: 9.5px; letter-spacing: 0.05em; color: var(--ink-3); }
.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; }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin-top: 10px; }
.hint.is-bad { color: var(--hot); }

.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: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: 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); }

/* ---------- 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.18fr) minmax(0, 0.82fr); }
.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; }

/* ---------- generate ---------- */

.panel-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.75fr); gap: 22px; }
.field-label { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
.kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kind-btn {
  text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; align-items: baseline;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; color: var(--ink-2);
  transition: border-color 0.14s, background 0.14s;
}
.kind-btn b { font-size: 13px; font-weight: 600; color: var(--ink); }
.kind-btn span { font-size: 9.5px; color: var(--ink-3); }
.kind-btn small { grid-column: 1 / -1; font-size: 10.5px; color: var(--ink-3); }
.kind-btn:hover { border-color: var(--ink-3); }
.kind-btn.is-on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.kind-btn.is-on b { color: var(--accent); }

.count-row { display: flex; align-items: center; gap: 8px; }
.count-unit { font-size: 11px; color: var(--ink-3); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; margin-top: 6px; }

.option-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.option-row .hint { flex: 1 1 260px; margin-top: 0; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 8px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.toggle-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: transparent; }
.toggle.is-on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink); background: var(--accent-soft); }
.toggle.is-on .toggle-dot { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.inline-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.inline-field select {
  appearance: none; height: 30px; padding: 0 26px 0 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 12px; cursor: pointer;
}

.nano-box { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.nano-grid { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.self-end { align-self: end; }

.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; display: block; }
.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: 104px; resize: vertical; display: block;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); font-size: 13px; line-height: 1.7; padding: 10px 12px;
}
textarea.text-area:focus { outline: none; border-color: var(--accent); }

.chip-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.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-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.code-out {
  margin: 0; padding: 13px 14px 16px; min-height: 148px; max-height: 380px; 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; }
.code-tools .btn { margin-left: 0; }

/* ---------- parse ---------- */

.parse-list { display: grid; gap: 5px; }
.parse-empty { color: var(--ink-3); font-size: 13px; }
.parse-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px; align-items: center;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px;
  color: var(--ink-2);
}
.parse-row:hover { border-color: var(--line-2); }
.parse-row.is-on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.parse-row.is-bad { border-color: color-mix(in srgb, var(--hot) 35%, transparent); background: var(--hot-soft); }
.parse-idx { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); }
.parse-val { font-family: var(--mono); font-size: 11.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parse-meta { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); white-space: nowrap; }
.parse-row.is-bad .parse-meta { color: var(--hot); }

.bits-wrap { margin-top: 14px; }
.bit-bar { display: flex; height: 24px; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.bit-bar .seg { display: flex; align-items: center; justify-content: center; min-width: 0; border-right: 1px solid var(--surface); }
.bit-bar .w-2 { flex: 2 1 0; }
.bit-bar .w-4 { flex: 4 1 0; }
.bit-bar .w-12 { flex: 12 1 0; }
.bit-bar .w-14 { flex: 14 1 0; }
.bit-bar .w-16 { flex: 16 1 0; }
.bit-bar .w-32 { flex: 32 1 0; }
.bit-bar .w-48 { flex: 48 1 0; }
.bit-bar .w-62 { flex: 62 1 0; }
.bit-bar .w-80 { flex: 80 1 0; }
.bit-bar .w-128 { flex: 128 1 0; }
.bit-bar .w-full { flex: 1 1 100%; }
.bit-bar .seg:last-child { border-right: 0; }
.bit-bar i { font-family: var(--mono); font-style: normal; font-size: 8px; opacity: 0.75; overflow: hidden; white-space: nowrap; }
.bit-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; }
.bit-legend span { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); }
.bit-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; background: currentColor; }
.hex-line { margin-top: 6px; font-size: 12.5px; letter-spacing: 0.02em; line-height: 1.9; overflow-wrap: anywhere; }
.hex-line span { border-radius: 2px; padding: 1px 0; }
.hex-line .gap { padding: 0 3px; color: var(--ink-3); }
.hex-time { color: var(--seg-time); background: color-mix(in srgb, var(--seg-time) 12%, transparent); }
.hex-ver { color: var(--seg-ver); background: color-mix(in srgb, var(--seg-ver) 16%, transparent); }
.hex-count { color: var(--seg-count); background: color-mix(in srgb, var(--seg-count) 14%, transparent); }
.hex-var { color: var(--seg-var); background: color-mix(in srgb, var(--seg-var) 16%, transparent); }
.hex-rand { color: var(--seg-rand); }
.hex-clock { color: var(--seg-count); background: color-mix(in srgb, var(--seg-count) 10%, transparent); }
.hex-node { color: var(--seg-rand); background: color-mix(in srgb, var(--seg-rand) 10%, transparent); }
.hex-hash { color: var(--seg-var); background: color-mix(in srgb, var(--seg-var) 10%, transparent); }
.hex-time_low, .hex-time_mid, .hex-time_high { color: var(--seg-time); background: color-mix(in srgb, var(--seg-time) 12%, transparent); }
.code-out.is-empty { color: var(--ink-3); }

/* ---------- reference ---------- */

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 2px; }
.data-table caption { text-align: left; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 9px; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.data-table thead th { border-top: 0; border-bottom: 1px solid var(--line-2); font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.data-table td { color: var(--ink-2); }
.data-table td:first-child { color: var(--ink); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--surface); }
.data-table .num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.data-table .dim { color: var(--ink-3); }
.shape-table td:nth-child(2) { font-size: 11px; color: var(--ink); overflow-wrap: anywhere; }

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

/* ---------- 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; }
  .panel-grid { grid-template-columns: 1fr; 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-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; }
  .id-card { transform: none; }
  .id-value { font-size: 12.5px; }
  .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; }
  .res-row { grid-template-columns: 96px minmax(0, 1fr); padding: 8px 10px; }
  .code-out { font-size: 11px; }
  .kind-grid { grid-template-columns: 1fr; }
  .nano-grid { grid-template-columns: 1fr; }
  .inline-field { width: 100%; }
  .option-row { gap: 10px; }
  .id-strip em { display: none; }
  .parse-val { font-size: 10.5px; }
  .data-table th, .data-table td { padding: 7px 7px; font-size: 12px; }
}
@media (max-width: 460px) {
  .actions .btn.primary { flex: 1 1 100%; }
  .id-rows { grid-template-columns: 1fr 1fr; }
  .hex-line { font-size: 11px; }
}

@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"] .id-tag,
html[lang="ko"] .state-pill,
html[lang="ko"] .res-row .tag { letter-spacing: 0.03em; }
html[lang="ko"] .res-row .tag,
html[lang="ko"] .field-label,
html[lang="ko"] .subpanel-head b,
html[lang="ko"] .id-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"] .id-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"] .id-tag,
html[lang="ja"] .state-pill,
html[lang="ja"] .res-row .tag { letter-spacing: 0.06em; }
