/* ══════════════════════════════════════════════════════════════════
   Barova 1.2 — "Framed sheet" redesign
   Direction: design-taste-frontend / tasteskill v2 (framed-sheet)
   Stone frame · white sheet · ink chrome · one teal data accent
   ══════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Pretendard";
  src: url("fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --font-ui: "Pretendard", "Pretendard Variable", "Segoe UI", -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --font-display: "Pretendard", "Pretendard Variable", "Segoe UI", -apple-system, "Malgun Gothic", sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", "SF Mono", "Consolas", monospace;

  --bg: #f4f5f3;
  --bg-2: #eeefec;
  --surface: #ffffff;
  --surface-2: #f8f9f7;
  --surface-3: #f1f2ef;
  --ink: #151615;
  --ink-2: #363835;
  --muted: #5e605c;
  --faint: #6f716b;
  --line: #e3e2dd;
  --line-2: #d2d1ca;

  /* One data hue. The barcode stays pure black; teal is used only for
     measurement marks (scale, quiet zone) and the active tab underline. */
  --accent: #1b6c80;
  --accent-2: #2b8398;
  --accent-soft: #e9eae7;
  --accent-ink: #242624;
  --accent-ring: rgba(27, 108, 128, .16);
  --data: #1b6c80;
  --data-soft: #e6eef0;

  --ok: #1e7b4f;
  --ok-soft: #e3f0e8;
  --warn: #92400e;
  --warn-soft: #f7eedf;
  --bad: #c4242a;
  --bad-soft: #fbe9e7;

  --primary-bg: #151615;
  --primary-ink: #ffffff;

  --stage-bg: #f1f2ef;
  --paper: #ffffff;
  --checker: #f0f0ec;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 24px 60px -24px rgba(20, 22, 19, .28), 0 2px 6px rgba(20, 22, 19, .06);

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-xl: 16px;

  --left-w: 252px;
  --right-w: 336px;
  --gap: 12px;
  --top-h: 48px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e0f0f;
  --bg-2: #111212;
  --surface: #151616;
  --surface-2: #1a1b1b;
  --surface-3: #1f2020;
  --ink: #f2f2ef;
  --ink-2: #d0d1cb;
  --muted: #a1a39d;
  --faint: #8b8d87;
  --line: #2a2b2b;
  --line-2: #3a3b3a;

  --accent: #75b9c9;
  --accent-2: #92cbd8;
  --accent-soft: #222323;
  --accent-ink: #f2f2ef;
  --accent-ring: rgba(117, 185, 201, .2);
  --data: #75b9c9;
  --data-soft: #18282c;

  --ok: #72c99a;
  --ok-soft: #15251c;
  --warn: #e0b165;
  --warn-soft: #2a2317;
  --bad: #ee8b7e;
  --bad-soft: #2d1b18;

  --primary-bg: #f2f2ef;
  --primary-ink: #111212;

  --stage-bg: #101111;
  --paper: #ffffff;
  --checker: #1b1c1c;

  --shadow-lg: 0 28px 70px -24px rgba(0, 0, 0, .8), 0 2px 8px rgba(0, 0, 0, .5);
}

/* ── foundation ───────────────────────────────────────────────── */
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] body { background: var(--bg); }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 5px; }
input[type="text"]:focus-visible,
input[type="number"]:focus-visible,
input[type="color"]:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: none; }

.app {
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  background: var(--bg);
  background-image: none;
}

/* ── shell / top bar ──────────────────────────────────────────── */
.topbar {
  height: var(--top-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 0;
  background: var(--bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  position: relative;
  z-index: 40;
}
.brand { grid-column: 1; justify-self: start; gap: 8px; padding-right: 0; }
.logo { width: 28px; height: 28px; filter: none; }
.brand-text { line-height: 1; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.012em;
}
.brand-text small { display: none; }

.command {
  grid-column: 2;
  justify-self: center;
  position: static;
  transform: none;
  flex: 0 1 460px;
  width: 460px;
  max-width: 460px;
  height: 32px;
  margin: 0;
  padding: 0 9px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: none;
  transition: border-color .14s, background .14s;
}
.command:hover {
  border-color: var(--line-2);
  background: var(--surface);
  box-shadow: none;
}
.command-text { font-size: 12px; color: var(--muted); }
.command .icon { width: 15px; height: 15px; color: var(--faint); }
kbd {
  min-width: 0;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
.topbar-actions { grid-column: 3; justify-self: end; gap: 4px; margin-left: 0; }
.fmt-chip {
  height: 30px;
  padding: 0 8px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.fmt-chip:hover { border-color: var(--line-2); background: var(--surface); box-shadow: none; }
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  color: var(--muted);
  box-shadow: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); box-shadow: none; }
.vsep { height: 18px; margin: 0 4px; background: var(--line); }

.btn {
  height: 32px;
  padding: 0 11px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-2); box-shadow: none; }
.btn.primary {
  border-color: transparent;
  background: var(--primary-bg);
  color: var(--primary-ink);
  box-shadow: none;
  font-weight: 600;
}
.btn.primary:hover { background: var(--primary-bg); opacity: .9; filter: none; border-color: transparent; box-shadow: none; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.topbar .btn.primary { height: 32px; padding: 0 13px; font-size: 12px; }
.btn.small { height: 30px; font-size: 11.5px; }
button, .btn, .icon-btn, .tool, .tab, .quick-chip, .format-card, .color-card, .pal-item, .preset-item { box-shadow: none !important; }

/* ── workspace / panels ──────────────────────────────────────── */
.workspace {
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
  gap: var(--gap);
  padding: 0 8px 8px;
  min-height: 0;
}
.column { min-height: 0; gap: 0; }
.column.left {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow-y: auto;
  padding: 0;
  margin: 0;
}
.column.right {
  background: transparent;
  border: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

/* Left rail: one panel, sections divided by hairlines — not five cards. */
.column.left .card {
  flex: none;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.column.left .card:last-of-type { border-bottom: 0; }
.column.left .card.guide { padding: 0; }
.column.left .guide summary { padding: 13px 16px; }
.column.left .guide-body { padding: 0 16px 14px; }
.column.left .left-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.column.left .left-actions .btn { height: 32px; font-size: 11.5px; background: var(--surface); }

.card-head { align-items: baseline; margin-bottom: 9px; gap: 8px; }
.card-head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.card-note {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--faint);
}
.text-btn { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.text-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── picker ───────────────────────────────────────────────────── */
.picker-btn {
  min-height: 46px;
  padding: 7px 10px;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: none;
}
.picker-btn:hover { border-color: var(--ink); background: var(--surface); }
.picker-btn[aria-expanded="true"] { border-color: var(--ink); box-shadow: none; }
.picker-mark { display: none; }
.picker-text { gap: 1px; min-width: 0; flex: 1; }
.picker-text b { font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.picker-text small { font-size: 11.5px; letter-spacing: 0; color: var(--muted); }
.picker-hint { margin-top: 8px; }
.popover { border-radius: var(--r-md); border-color: var(--line); box-shadow: var(--shadow-lg); }
.pop-search { height: 38px; border-bottom: 1px solid var(--line); }
.pop-search input { font-size: 12.5px; }
.pop-list { padding: 6px; }
.sym-group { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--faint); }
.sym-item { min-height: 38px; border-radius: var(--r-sm); padding: 7px 8px; }
.sym-item:hover { background: var(--surface-3); }
.sym-item.is-active { background: var(--accent-soft); }
.sym-item-main b { font-size: 12px; font-weight: 500; }
.sym-item-main small { font-size: 11px; color: var(--faint); }

/* ── data / fields ────────────────────────────────────────────── */
.input-wrap { border-radius: var(--r-sm); border-color: var(--line-2); background: var(--surface); }
.input-wrap:focus-within { border-color: var(--ink); box-shadow: none; }
.data-input { height: 42px; padding: 0 34px 0 10px; font-family: var(--font-mono); font-size: 14px; letter-spacing: -.01em; }
.input-x { width: 26px; height: 26px; right: 5px; }
.data-meta { margin-top: 7px; gap: 6px; font-size: 11.5px; color: var(--faint); }
.data-ok { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--ok); font-size: 11.5px; }
.data-ok:empty { display: none; }
.data-ok::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.msg { margin-top: 7px; font-size: 11.5px; line-height: 1.45; color: var(--bad); }

.field > span {
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.slider-row > label,
.format-card small,
.file-preview span,
.pal-item-kind,
.color-card-text small,
.contrast-head span,
.dim,
.tool.wide,
.card-note,
.card-head h2,
.group-head h3,
.badge,
.unit-tag,
.value-chip,
.guide-sample span,
.about h3,
.picker-text small,
.quick-chip small {
  letter-spacing: 0;
  text-transform: none;
}
.field em { font-size: 11px; letter-spacing: 0; color: var(--faint); }
.field input, .field select, .field textarea,
input[type="text"], input[type="number"], select {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  box-shadow: none;
}
.field input:focus, .field select:focus, input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--ink);
  box-shadow: none;
  outline: none;
}
.field-grid { gap: 10px 12px; }
.hint { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--faint); }
.hint b { color: var(--muted); font-weight: 500; }
.stepper > input[type="number"] { padding-right: 28px; }
.step-btn { border-radius: 4px; background: var(--surface-3); }
.step-btn:hover { background: var(--active, var(--surface-3)); color: var(--ink); }

.facts {
  display: flex;
  flex-direction: column;
  margin-top: 11px;
  border-top: 1px solid var(--line);
}
.facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { font-size: 13px; letter-spacing: 0; color: var(--faint); }
.facts dd { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ── guide / quick start ──────────────────────────────────────── */
.guide-ico { display: none; }
.guide summary { min-height: 44px; gap: 8px; }
.guide-title { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.guide summary .chev { color: var(--faint); }
.guide-body { border-top: 0; }
.guide-body p { font-size: 13px; line-height: 1.55; color: var(--muted); }
.guide-sample { margin-top: 8px; padding: 7px 9px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.guide-sample span { font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--faint); }
.guide-sample code { font-size: 12px; }
.guide-facts > div { font-size: 11.5px; }
.guide-facts dt { color: var(--faint); }
.guide-facts dd { color: var(--ink-2); }

.quick-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
.quick-chip {
  min-height: 34px;
  padding: 7px 9px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: none;
  transition: background .12s, border-color .12s;
}
.quick-chip:hover { border-color: var(--line-2); background: var(--surface-2); }
.quick-chip:active { transform: none; }
.quick-chip b { font-size: 13px; font-weight: 500; letter-spacing: 0; }
.quick-chip small { display: none; }
.quick-chip.is-active { border-color: var(--ink); background: var(--accent-soft); }
.quick-chip.is-active b { color: var(--ink); }

/* ── stage ────────────────────────────────────────────────────── */
.stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
  overflow: hidden;
}
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.stage-id { min-width: 0; }
.stage-sub { display: flex; align-items: center; gap: 7px; margin-bottom: 1px; }
.badge {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.bg-chip {
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}
.bg-chip::before { content: "·"; margin-right: 6px; }
.stage-id h1 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.stage-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.zoom-group { gap: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.zoom-label { height: 28px; padding: 0 7px; font-size: 11px; font-weight: 500; color: var(--muted); border: 0; border-radius: 0; }
.tool { height: 28px; min-width: 28px; padding: 0 6px; gap: 3px; border-radius: 0; font-size: 11px; color: var(--muted); }
.tool:hover { background: var(--surface-3); color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); }
.tool.wide { padding: 0 7px; font-size: 11px; letter-spacing: 0; }
.tool .icon { width: 14px; height: 14px; }
.stage-tools > .tool, .stage-tools > .vsep { border-radius: var(--r-sm); }
.stage-tools > .vsep { height: 16px; }

.stage-scroll {
  flex: 1;
  min-height: 0;
  padding: 40px 32px;
  background-color: var(--stage-bg);
  background-image: none;
  position: relative;
  display: flex;
  overflow: auto;
}
.stage-scroll.is-fit { overflow-x: hidden; }
.paper-wrap { margin: auto; }
.paper {
  background-color: #fff;
  background-image: none;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  box-shadow: none;
  overflow: hidden;
}
[data-theme="dark"] .paper { background: #fff; border-color: #d6d5ce; box-shadow: none; }
.dim { font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--faint); }
.dim-top { top: -26px; }
.dim-left { left: -24px; }
.dim-top i { width: 18px; background: var(--line-2); }
.dim-left::before, .dim-left::after { background: var(--line-2); }

.stage-empty {
  background: var(--stage-bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  gap: 7px;
}
.empty-ico {
  width: 24px;
  height: 24px;
  margin: 0 0 2px;
  border-radius: 0;
  background: none;
  color: var(--bad);
}
.empty-ico .icon { width: 18px; height: 18px; }
.stage-empty b { font-size: 13px; font-weight: 600; }
.stage-empty p { font-size: 12px; max-width: 320px; color: var(--muted); }

/* scale bar — a print-tool signature, in the one data hue */
.scalebar {
  position: absolute;
  left: 14px;
  bottom: 10px;
  width: 180px;
  height: 28px;
  pointer-events: none;
  opacity: .95;
}
.scalebar canvas { display: block; width: 180px; height: 28px; }

/* readiness strip — the screen's one question, in one line */
.stage-foot {
  display: block;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.readiness { display: flex; align-items: center; min-height: 58px; gap: 0; }
.readiness-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 204px;
  padding-right: 16px;
}
.readiness-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.readiness-copy b { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.readiness-copy small {
  display: block;
  max-width: 226px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.readiness.ok .dot { background: var(--ok); }
.readiness.warn .dot { background: var(--warn); }
.readiness.bad .dot { background: var(--bad); }
.readiness-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  flex: 1;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.readiness-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.readiness-metrics span { font-size: 12px; color: var(--faint); white-space: nowrap; }
.readiness-metrics b {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.safety {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  margin-left: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}
.safety:hover { color: var(--ink); }
.safety .icon { width: 14px; height: 14px; }

/* ── inspector ────────────────────────────────────────────────── */
.inspector {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
  overflow: hidden;
}
.tabs {
  display: flex;
  gap: 0;
  height: 44px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  flex: none;
}
.tab {
  flex: 1;
  height: 44px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  position: relative;
}
.tab:hover { color: var(--ink); background: none; }
.tab.is-active { color: var(--ink); background: none; font-weight: 600; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--data);
}
.tab-panels { flex: 1; min-height: 0; overflow-y: auto; padding: 0; }
.tab-panel { padding: 16px; }

.group-head { margin: 18px 0 9px; align-items: baseline; }
.group-head:first-child { margin-top: 0; }
.group-head h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.value-chip, .unit-tag {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.divider { height: 1px; margin: 14px 0; border: 0; background: var(--line); }
.switch-row { font-size: 13px; color: var(--ink-2); }
.switch-row small { font-size: 11.5px; color: var(--faint); }
.switch { accent-color: var(--ink); }
.check { font-size: 13px; color: var(--ink-2); }
.check input { accent-color: var(--ink); }
.range-row input[type="range"] { accent-color: var(--ink); }
.num { width: 64px; }
.type-preview { border-color: var(--line); background: var(--surface-2); font-size: 16px; }
.hint { color: var(--muted); }

/* colour / spec / output */
.color-targets { gap: 8px; }
.color-card { border-color: var(--line); border-radius: var(--r-md); box-shadow: none; }
.color-card.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.color-card-text b { font-size: 12px; }
.color-card-text small { font-size: 11px; letter-spacing: 0; text-transform: none; }
.swatch { border-radius: var(--r-sm); border: 1px solid var(--line); }
.picker-row > span { font-size: 12px; }
.picker-row code { font-size: 11.5px; }
.preset-swatches button { border-radius: var(--r-sm); }
.contrast-card { border-color: var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.contrast-head span { font-size: 11px; letter-spacing: 0; }
.contrast-card p { font-size: 11px; }
.format-grid { gap: 8px; }
.format-card { border-color: var(--line); border-radius: var(--r-md); box-shadow: none; }
.format-card.is-active { border-color: var(--ink); background: var(--accent-soft); box-shadow: none; }
.format-card b { font-size: 13px; }
.format-card small { font-size: 11.5px; }
.file-preview span { font-size: 11px; letter-spacing: 0; text-transform: none; }
.file-preview code { font-size: 11.5px; }
.link-list button { font-size: 12.5px; }
.inline-actions { gap: 8px; }

/* ── overlays / dialogs ──────────────────────────────────────── */
.dlg {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
dialog.dlg::backdrop {
  background: rgba(16, 18, 16, .34);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.dlg-head { border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.dlg-head p { font-size: 11.5px; color: var(--muted); }
.dlg-foot { border-top: 1px solid var(--line); background: var(--surface); }
.palette { border-radius: var(--r-md); }
.palette-search { border-bottom: 1px solid var(--line); }
.palette-list { padding: 6px; }
.pal-item { border-radius: var(--r-sm); min-height: 40px; }
.pal-item:hover { background: var(--surface-3); }
.pal-item.is-active { background: var(--accent-soft); }
.pal-item-icon { display: none; }
.pal-item-text b { font-size: 12.5px; font-weight: 500; }
.pal-item-text small { font-size: 11.5px; }
.pal-item-kind { font-size: 11.5px; letter-spacing: 0; text-transform: none; }
.palette-foot { font-size: 11.5px; }
.preset-item { border-color: var(--line); border-radius: var(--r-md); }
.preset-thumb { border: 1px solid var(--line); background: #fff; }
.preset-meta b { font-size: 12.5px; }
.preset-meta small { font-size: 11.5px; }
.safety-list { gap: 8px; }
.safety-item { border-color: var(--line); border-radius: var(--r-md); background: var(--surface); }
.safety-item .s-ico,
.toast .t-ico {
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: none !important;
}
.safety-item .s-ico .icon { width: 14px; height: 14px; }
.toast .t-ico .icon { width: 14px; height: 14px; }
.safety-item-text b { font-size: 12.5px; }
.safety-item-text p { font-size: 12px; }
.about h3 { font-size: 11.5px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.about p { font-size: 12px; }
.shortcut-grid { font-size: 12px; }
.toast { border-color: var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: 12.5px; }
.t-ico { width: 18px; height: 18px; border-radius: 0; background: none; }
.engine-note { display: none !important; }

/* ── responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --left-w: 238px; --right-w: 320px; --gap: 10px; }
  .command { width: 380px; max-width: 380px; flex-basis: 380px; }
  .readiness-status { min-width: 190px; }
  .readiness-metrics > div { padding: 0 9px; }
}
@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 8px 8px;
    overflow-y: auto;
  }
  .stage { order: 0; min-height: 500px; }
  .column.left { order: 1; overflow: visible; }
  .column.right { order: 2; overflow: visible; }
  .column.left .left-actions { position: static; }
  .inspector { min-height: 520px; }
  .stage-scroll { padding: 36px 28px; }
}
@media (max-width: 1000px) {
  .command { display: none; }
}
@media (max-width: 720px) {
  .topbar { display: flex; padding: 0 12px; gap: 8px; }
  .brand { margin-right: auto; }
  .topbar-actions { margin-left: auto; gap: 2px; }
  .icon-btn { width: 36px; height: 36px; }
  .btn { height: 40px; }
  .topbar .btn.primary { height: 36px; }
  .tool { height: 32px; min-width: 32px; }
  .zoom-label { height: 32px; }
  .field input, .field select, .field textarea,
  input[type="text"], input[type="number"], select { height: 40px; }
  .data-input { height: 44px; }
  .fmt-chip { padding: 0 7px; }
  .workspace { padding: 0 8px 8px; gap: 10px; }
  .stage { min-height: 440px; }
  .stage-head { flex-wrap: wrap; gap: 8px; padding: 9px 12px; }
  .stage-tools { width: 100%; gap: 4px; }
  .stage-scroll { padding: 28px 18px; }
  .stage-foot { padding: 0 12px; }
  .readiness { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .readiness-status { min-width: 100%; padding-right: 0; }
  .readiness-copy small { max-width: none; }
  .readiness-metrics {
    order: 2;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }
  .readiness-metrics > div { padding: 3px 0; border-right: 0; }
  .readiness-metrics > div:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 12px; }
  .readiness-metrics > div:nth-child(even) { padding-left: 12px; }
  .safety { order: 3; margin-left: 0; align-self: flex-end; }
  .scalebar { display: none; }
  .column.left .card { padding: 14px; }
  .column.left .left-actions { padding: 10px 14px; }
  .tab-panel { padding: 14px; }
  .tabs { padding: 0 6px; }
  .tab { font-size: 11.5px; }
  .dlg { border-radius: 14px; }
}
@media (max-width: 430px) {
  .brand-text strong { font-size: 14px; }
  .topbar .btn.primary span { display: none; }
  .topbar .btn.primary { width: 36px; padding: 0; justify-content: center; }
  .fmt-chip { border: 0; background: none; }
  .icon-btn { width: 36px; height: 36px; }
  .stage-id h1 { font-size: 17px; }
  .readiness-copy b { font-size: 12px; }
  .readiness-copy small { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
