/* =========================================================================
   Coupon Inspector — design system
   Neutral stone base · indigo accent · single-line borders · tight type
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

/* Guard against flex/grid containers overriding the [hidden] attribute */
[hidden] { display: none !important; }

/* -------------------------------------------------------------- gate */
.gate {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, var(--surface-2), var(--bg) 70%);
  padding: 24px;
  animation: gateFade 0.25s var(--ease);
}
.gate.is-leaving { animation: gateLeave 0.3s var(--ease) forwards; }
@keyframes gateFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes gateLeave {
  from { opacity: 1; }
  to   { opacity: 0; transform: scale(0.98); }
}

.gate__card {
  width: 360px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px 26px 22px;
  display: flex; flex-direction: column; gap: 12px;
  text-align: center;
}
.gate__brand {
  width: 44px; height: 44px;
  margin: 0 auto 4px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.gate__brand svg { width: 22px; height: 22px; }
.gate__title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.gate__lede { margin: 0 0 6px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.gate__field { display: flex; gap: 6px; }
.gate__input {
  flex: 1; min-width: 0;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 0 12px;
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.gate__input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.gate__submit { height: 38px; padding: 0 16px; flex: none; }
.gate__submit.shake { animation: shake 0.4s var(--ease); }
@keyframes shake {
  0%, 100% { transform: none; }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.gate__hint { margin-top: 4px; font-size: 11px; color: var(--text-subtle); }
.gate__hint[data-tone="error"] { color: var(--invalid); }

:root {
  --bg: #f7f6f4;
  --surface: #ffffff;
  --surface-2: #f3f2ef;
  --surface-3: #ecebe7;
  --border: #e6e4df;
  --border-strong: #d6d3cb;
  --text: #1c1b18;
  --text-2: #4d4a45;
  --text-muted: #8a857c;
  --text-subtle: #b3aea3;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;

  --valid: #047857;
  --valid-soft: #ecfdf5;
  --valid-border: #a7f3d0;
  --invalid: #b91c1c;
  --invalid-soft: #fef2f2;
  --invalid-border: #fecaca;
  --pending: #b45309;
  --pending-soft: #fffbeb;
  --pending-border: #fde68a;
  --error: #b91c1c;
  --error-soft: #fef2f2;

  --radius-xs: 3px;
  --radius: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --shadow-sm: 0 1px 2px rgba(20, 18, 14, 0.04);
  --shadow: 0 6px 24px -8px rgba(20, 18, 14, 0.12), 0 2px 6px rgba(20, 18, 14, 0.04);
  --shadow-lg: 0 20px 60px -12px rgba(20, 18, 14, 0.22);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --row-h: 44px;
  --topbar-h: 56px;
  --detail-w: 400px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0d0c0a;
  --surface: #16151202;
  --surface: #18170f98;
  --surface: #161410;
  --surface-2: #1f1d18;
  --surface-3: #28251f;
  --border: #2c2922;
  --border-strong: #3d3930;
  --text: #f5f3ee;
  --text-2: #c9c5bc;
  --text-muted: #8e8a7e;
  --text-subtle: #5b584f;

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1e1b4b;
  --accent-border: #3730a3;

  --valid: #34d399;
  --valid-soft: #052e2b;
  --valid-border: #064e3b;
  --invalid: #fb7185;
  --invalid-soft: #4c0519;
  --invalid-border: #831843;
  --pending: #fbbf24;
  --pending-soft: #451a03;
  --pending-border: #78350f;
  --error: #fb7185;
  --error-soft: #4c0519;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 24px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px -12px rgba(0, 0, 0, 0.7);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

::selection { background: var(--accent-soft); color: var(--accent-hover); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(140%) blur(8px);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.brand__mark svg { width: 18px; height: 18px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name {
  font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
  color: var(--text);
}
.brand__tag {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.02em;
}

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.iconbtn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--text-2);
  border: 1px solid transparent;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.iconbtn svg { width: 16px; height: 16px; }
.i-moon { display: none; }
[data-theme="dark"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: block; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.chip:hover { background: var(--surface-2); border-color: var(--border-strong); }
.chip__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-subtle);
  box-shadow: 0 0 0 3px var(--surface);
}
.chip__dot[data-state="ok"]    { background: var(--valid); }
.chip__dot[data-state="warn"]  { background: var(--pending); }
.chip__dot[data-state="error"] { background: var(--invalid); }
.chip__label { font-family: var(--mono); font-size: 11.5px; letter-spacing: -0.01em; }

/* ---------------------------------------------------------------- layout */
.workbench {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--detail-w);
  min-height: 0;
}

.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.pane--list {
  border-right: 1px solid var(--border);
  background: var(--bg);
  overflow-y: auto;
  padding: 16px;
  gap: 12px;
}

.pane--detail {
  background: var(--surface);
  overflow-y: auto;
  position: relative;
}

/* ----------------------------------------------------------------- zone */
.zone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.zone--input { padding: 14px 16px 12px; }
.zone__header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.zone__title { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.zone__hint { font-size: 11px; color: var(--text-muted); }

.input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-subtle); }

.input__bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; gap: 8px; flex-wrap: wrap;
}
.input__meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 11.5px; }
.kv__k { color: var(--text-muted); }
.kv__v { color: var(--text); font-family: var(--mono); font-weight: 500; }
.sep { color: var(--text-subtle); }

.input__actions { display: flex; align-items: center; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500;
  border: 1px solid transparent;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), opacity 0.15s var(--ease), transform 0.1s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(0.5px); }
.btn svg { width: 14px; height: 14px; }
.btn kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 1px 2px rgba(79, 70, 229, 0.3);
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--sm { height: 28px; padding: 0 10px; font-size: 11.5px; }

/* -------------------------------------------------------------- stats */
.zone--stats { padding: 0; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.2fr;
  align-items: stretch;
}
.stat {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  background: transparent;
  position: relative;
  transition: background-color 0.15s var(--ease);
  text-align: left;
}
.stat:last-child { border-right: 0; }
.stat:hover { background: var(--surface-2); }
.stat[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0;
  height: 2px; background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.stat__num {
  font-family: var(--mono);
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}
.stat__num--valid   { color: var(--valid); }
.stat__num--invalid { color: var(--invalid); }
.stat__num--error   { color: var(--error); }
.stat__label { font-size: 11px; color: var(--text-muted); margin-top: 4px; letter-spacing: 0.02em; }

.stats__progress {
  position: relative; align-self: center;
  margin: 0 16px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.stats__progress.is-active { opacity: 1; }
.stats__progress-fill {
  display: block; height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--valid));
  border-radius: 99px;
  transition: width 0.4s var(--ease);
}

/* ------------------------------------------------------------- toolbar */
.zone--toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  background: var(--surface);
}
.search {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.search:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 14px; height: 14px; color: var(--text-muted); flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 12.5px; color: var(--text);
}
.search input::placeholder { color: var(--text-subtle); }
.search__clear {
  width: 18px; height: 18px; border-radius: 50%;
  color: var(--text-muted);
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
}
.search__clear:hover { background: var(--surface-3); color: var(--text); }

.copilot {
  display: flex; align-items: center; gap: 8px;
  flex: none;
}
.copilot__hint { font-size: 11.5px; color: var(--text-muted); }

/* --------------------------------------------------------------- list */
.results {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.results:empty { display: none; }

.row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  height: var(--row-h);
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: background-color 0.12s var(--ease);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.row.is-animating { animation: rowIn 0.25s var(--ease); }

@keyframes rowIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.row__status {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-subtle);
  position: relative;
  flex: none;
}
.row__status[data-s="valid"]   { background: var(--valid); }
.row__status[data-s="invalid"] { background: var(--invalid); }
.row__status[data-s="pending"] { background: var(--pending); box-shadow: 0 0 0 3px var(--pending-soft); animation: pulse 1.2s var(--ease) infinite; }
.row__status[data-s="error"]   { background: var(--error); }
.row__status[data-s="unknown"] { background: var(--text-subtle); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--pending-soft); }
  50%      { box-shadow: 0 0 0 4px transparent; }
}

.row__code {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted);
  font-family: var(--mono);
}
.row__meta b { color: var(--text-2); font-weight: 500; }
.row__pill {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.row__pill[data-s="valid"]   { background: var(--valid-soft);   color: var(--valid);   border-color: var(--valid-border); }
.row__pill[data-s="invalid"] { background: var(--invalid-soft); color: var(--invalid); border-color: var(--invalid-border); }
.row__pill[data-s="pending"] { background: var(--pending-soft); color: var(--pending); border-color: var(--pending-border); }
.row__pill[data-s="error"]   { background: var(--error-soft);   color: var(--error);   border-color: var(--invalid-border); }
.row__pill[data-s="unknown"] { background: var(--surface-2);    color: var(--text-muted); border-color: var(--border); }

/* -------------------------------------------------------------- detail */
.detail {
  height: 100%;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.detail--empty {
  align-items: center; justify-content: center;
  text-align: center;
  color: var(--text-muted);
  min-height: 60vh;
}
.detail__art {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-subtle);
  margin-bottom: 6px;
}
.detail__art svg { width: 22px; height: 22px; }
.detail__title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.detail__desc { font-size: 12px; max-width: 280px; line-height: 1.6; }

.detail__header {
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.detail__code-row { display: flex; align-items: center; gap: 10px; }
.detail__code {
  font-family: var(--mono);
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  word-break: break-all;
}
.detail__badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid transparent;
}
.detail__badge[data-s="valid"]   { background: var(--valid-soft);   color: var(--valid);   border-color: var(--valid-border); }
.detail__badge[data-s="invalid"] { background: var(--invalid-soft); color: var(--invalid); border-color: var(--invalid-border); }
.detail__badge[data-s="pending"] { background: var(--pending-soft); color: var(--pending); border-color: var(--pending-border); }
.detail__badge[data-s="error"]   { background: var(--error-soft);   color: var(--error);   border-color: var(--invalid-border); }
.detail__badge[data-s="unknown"] { background: var(--surface-2);    color: var(--text-muted); border-color: var(--border); }

.detail__actions { display: flex; flex-wrap: wrap; gap: 6px; }

.detail__section { display: flex; flex-direction: column; gap: 8px; }
.detail__h {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.detail__grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px 12px;
  font-size: 12.5px;
}
.detail__grid dt { color: var(--text-muted); }
.detail__grid dd { margin: 0; color: var(--text); font-family: var(--mono); font-weight: 500; }

.detail__raw {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  overflow: auto;
  max-height: 280px;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail__raw .k { color: var(--accent); }
.detail__raw .s { color: var(--valid); }
.detail__raw .n { color: var(--pending); }
.detail__raw .b { color: var(--invalid); }

/* ----------------------------------------------------------- states */
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.state[hidden] { display: none; }
.state__art { color: var(--text-subtle); margin-bottom: 14px; }
.state__art svg { width: 64px; height: 64px; }
.state__title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.state__desc { font-size: 12.5px; max-width: 360px; line-height: 1.7; }
.state__desc code { font-family: var(--mono); font-size: 11px; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }

/* -------------------------------------------------------------- sheet */
.sheet {
  position: fixed; inset: 0; z-index: 80;
  pointer-events: none;
}
/* Topbar stays above sheet so its chip stays clickable; sheet sits under it */
.sheet .sheet__overlay { top: var(--topbar-h); }
.sheet .sheet__panel { top: var(--topbar-h); }
.sheet[hidden] { display: none; }
.sheet__overlay {
  position: absolute; inset: 0;
  background: rgba(20, 18, 14, 0.4);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  pointer-events: auto;
}
.sheet__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 440px; max-width: 90vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(16px);
  opacity: 0;
  transition: transform 0.28s var(--ease), opacity 0.2s var(--ease);
  pointer-events: auto;
}
.sheet.is-open { pointer-events: auto; }
.sheet.is-open .sheet__overlay { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; opacity: 1; }

.sheet__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.sheet__header h2 { margin: 0; font-size: 14px; font-weight: 600; }
.sheet__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.sheet__lede {
  font-size: 12.5px; line-height: 1.7; color: var(--text-muted);
  margin: 0 0 18px;
}
.sheet__lede code { font-family: var(--mono); font-size: 11px; color: var(--text-2); background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.sheet__footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field__label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field__input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  width: 100%;
}
.field__input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.field__input--mono { font-family: var(--mono); font-size: 11.5px; resize: vertical; }
.field__hint { font-size: 11px; color: var(--text-muted); }
.field__hint code { font-family: var(--mono); font-size: 10.5px; background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }

/* --------------------------------------------------------------- toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 12px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 100;
  pointer-events: none;
  max-width: 90vw;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="error"]   { background: var(--invalid); color: white; }
.toast[data-tone="success"] { background: var(--valid); color: white; }

/* -------------------------------------------------------- responsiveness */
@media (max-width: 960px) {
  .workbench { grid-template-columns: 1fr; }
  .pane--list { border-right: 0; border-bottom: 1px solid var(--border); }
  .pane--detail {
    position: fixed; inset: var(--topbar-h) 0 0 0;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .pane--detail.is-open { transform: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 12px; }
  .pane--list { padding: 12px; gap: 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2n) { border-right: 0; }
  .stats__progress { display: none; }
  .brand__tag { display: none; }
  .row { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .row__meta { display: none; }
}

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

/* ------------------------------------------------------------- scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
