/* =================================================================
   CSP COMPOSER — style.css
   The Lab · dark arcade / retro-terminal. Dark only.
   Pixel type (Press Start 2P) for the masthead, HUD labels and panel
   numbers; mono for the working header text, code and chips; sans for
   reading copy. Cyan = structure, magenta = catalog/accent,
   gold = values/warnings, green = success/enabled.
   ================================================================= */

/* ---------- fonts (self-hosted, shared with the lab root) ---------- */
@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap; src: url("/press-start-2p.woff2") format("woff2"); }
@font-face { font-family: "Press Start 2P Fallback"; src: local("Courier New"); size-adjust: 166.64%; ascent-override: 60%; descent-override: 0%; line-gap-override: 0%; }

/* ---------- tokens ---------- */
:root {
  --bg: #0a0a12;
  --surface: #12121d;
  --surface-2: #1a1a2a;
  --surface-3: #20203200;
  --line: #28283c;
  --line-soft: #1f1f30;
  --control-line: #5e5e80;       /* >=3:1 against surface for inputs */
  --control-line-hover: #8484ad;
  --text: #e9e9f2;
  --dim: #9aa0b5;
  --dimmer: #6b7186;
  --cyan: #45f0ff;
  --magenta: #ff3d8b;
  --gold: #ffc857;
  --green: #41ff8b;
  --red: #ff5560;

  --pixel: "Press Start 2P", "Press Start 2P Fallback", "Courier New", monospace;
  --sans: -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur-norm: 280ms;

  --glow-cyan: 0 0 14px rgba(69, 240, 255, 0.4);
  --glow-magenta: 0 0 14px rgba(255, 61, 139, 0.42);
  --glow-gold: 0 0 14px rgba(255, 200, 87, 0.4);

  --shell-max: 78rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html {
  color-scheme: dark;
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(1100px 480px at 50% -8%, rgba(69, 240, 255, 0.07), transparent 70%),
    radial-gradient(800px 520px at 100% 12%, rgba(255, 61, 139, 0.05), transparent 72%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 3rem;
}

::selection { background: rgba(69, 240, 255, 0.3); color: var(--text); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--cyan);
  background: rgba(69, 240, 255, 0.08);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(69, 240, 255, 0.16);
  border-radius: 3px;
}

/* ---------- global texture: faint CRT scanlines ---------- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(0, 0, 0, 0.13) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  opacity: 0.6;
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: 12px; top: -56px;
  z-index: 200;
  background: var(--cyan);
  color: #05050d;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(68px); }

/* ---------- back to lab ---------- */
.lab-link {
  position: fixed;
  top: clamp(0.75rem, 2.4vw, 1.25rem);
  left: clamp(0.75rem, 2.4vw, 1.25rem);
  z-index: 120;
  display: inline-flex;
  align-items: center;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  background: rgba(10, 10, 18, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    text-shadow var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.lab-link:hover,
.lab-link:focus-visible {
  color: var(--cyan);
  border-color: var(--cyan);
  text-shadow: var(--glow-cyan);
  transform: translateX(-2px);
}

/* ---------- masthead ---------- */
.masthead {
  position: relative;
  z-index: 2;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 6.5rem) var(--gutter) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.masthead__level {
  margin: 0 0 1.1rem;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--gold);
  text-shadow: var(--glow-gold);
}

.masthead__title {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(1.45rem, 0.7rem + 4.6vw, 3.35rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  color: var(--text);
  text-shadow: 0 0 18px rgba(69, 240, 255, 0.45), 0 0 54px rgba(69, 240, 255, 0.18);
}
/* chromatic-aberration ghosts */
.masthead__title::before,
.masthead__title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  text-shadow: none;
}
.masthead__title::before { color: var(--magenta); transform: translate(-2px, 0); clip-path: inset(0 0 55% 0); }
.masthead__title::after  { color: var(--cyan);    transform: translate(2px, 0);  clip-path: inset(55% 0 0 0); }

.masthead__tag {
  max-width: 42rem;
  margin: clamp(1.25rem, 3vw, 1.75rem) auto 0;
  color: var(--dim);
  font-size: clamp(0.95rem, 0.9rem + 0.4vw, 1.15rem);
}

.masthead__privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.4rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--green);
  border: 1px solid rgba(65, 255, 139, 0.32);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  background: rgba(65, 255, 139, 0.06);
}
.masthead__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.35; } }

/* ---------- stage layout ---------- */
.stage {
  position: relative;
  z-index: 2;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.6rem);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  align-items: start;
}

/* ---------- console (rendered header) ---------- */
.console {
  position: relative;
  background:
    linear-gradient(180deg, var(--surface-2), var(--surface) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.console::after {
  /* top accent rule */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta) 60%, transparent);
  opacity: 0.7;
}

.console__bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.console__lights { display: inline-flex; gap: 0.4rem; flex: 0 0 auto; }
.dot { width: 11px; height: 11px; border-radius: 50%; opacity: 0.9; }
.dot--red { background: var(--red); box-shadow: 0 0 7px rgba(255, 85, 96, 0.6); }
.dot--gold { background: var(--gold); box-shadow: 0 0 7px rgba(255, 200, 87, 0.6); }
.dot--green { background: var(--green); box-shadow: 0 0 7px rgba(65, 255, 139, 0.6); }

.console__head {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(0.82rem, 0.78rem + 0.3vw, 0.95rem);
  display: inline-flex;
  align-items: baseline;
  overflow-wrap: anywhere;
}
.console__key { color: var(--cyan); font-weight: 600; text-shadow: 0 0 8px rgba(69, 240, 255, 0.3); }
.console__colon { color: var(--dim); }

.console__output {
  display: block;
  width: 100%;
  min-height: 6.5rem;
  resize: vertical;
  border: 0;
  border-top: 1px dashed var(--line);
  background:
    repeating-linear-gradient(0deg, rgba(69,240,255,0.025) 0 1px, transparent 1px 28px),
    #0c0c16;
  color: var(--green);
  padding: 1rem 1.1rem;
  font-family: var(--mono);
  font-size: clamp(0.85rem, 0.8rem + 0.3vw, 0.98rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
}
.console__output::selection { background: rgba(65, 255, 139, 0.28); }
.console__output:focus-visible { outline-offset: -2px; }

.console__status {
  margin: 0;
  min-height: 1.4rem;
  padding: 0.6rem 1.1rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
}

/* ---------- warnings ---------- */
.warnings {
  list-style: none;
  margin: 0;
  padding: 0.55rem 1.1rem 1.1rem;
  display: grid;
  gap: 0.5rem;
}
.warnings:empty { padding: 0; }
.warnings li {
  position: relative;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--gold);
  background: rgba(255, 200, 87, 0.07);
  border: 1px solid rgba(255, 200, 87, 0.28);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem 0.55rem 2.1rem;
}
.warnings li::before {
  content: "\26A0";          /* ⚠ */
  position: absolute;
  left: 0.7rem; top: 0.5rem;
  font-family: var(--mono);
}

/* ---------- panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 2vw, 1.4rem);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel__title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--cyan);
  text-shadow: 0 0 9px rgba(69, 240, 255, 0.35);
}
.panel__num {
  font-size: 9px;
  color: var(--bg);
  background: var(--cyan);
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(69, 240, 255, 0.4);
}
.panel--catalog .panel__title { color: var(--magenta); text-shadow: 0 0 9px rgba(255, 61, 139, 0.4); }
.panel--catalog .panel__num { background: var(--magenta); box-shadow: var(--glow-magenta); }

.panel__lead,
.panel__num + * { }
.panel__lead {
  margin: -0.4rem 0 0;
  color: var(--dim);
  font-size: 0.88rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--control-line);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) ease, color var(--dur-fast) ease,
    background-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.btn:hover { border-color: var(--control-line-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--dim);
}
.btn--ghost:hover { color: var(--text); border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(69,240,255,0.25); }

.btn--primary {
  border-color: var(--cyan);
  background: rgba(69, 240, 255, 0.1);
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(69, 240, 255, 0.25);
}
.btn--primary:hover {
  background: var(--cyan);
  color: var(--bg);
  text-shadow: none;
  box-shadow: var(--glow-cyan);
}

.btn--copy {
  flex: 0 0 auto;
  border-color: var(--gold);
  background: rgba(255, 200, 87, 0.1);
  color: var(--gold);
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.85rem;
}
.btn--copy:hover { background: var(--gold); color: var(--bg); box-shadow: var(--glow-gold); }
.btn--copy.is-copied {
  border-color: var(--green);
  background: var(--green);
  color: var(--bg);
  box-shadow: 0 0 16px rgba(65, 255, 139, 0.5);
}
.btn__glyph { font-size: 1.05em; line-height: 1; }

/* ---------- fields ---------- */
.field { display: grid; gap: 0.4rem; }
.field__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.field__control {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background: #0c0c16;
  color: var(--text);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.field__control--mono { font-family: var(--mono); font-size: 0.9rem; }
.field__control::placeholder { color: var(--dimmer); }
.field__control:hover { border-color: var(--control-line-hover); }
select.field__control { cursor: pointer; }

/* ---------- custom directive form ---------- */
.custom-directive-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  align-items: end;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- directive list ---------- */
.directive-list {
  display: grid;
  gap: 0.55rem;
  max-height: min(62vh, 40rem);
  overflow: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.directive-list::-webkit-scrollbar { width: 8px; }
.directive-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.directive-list:focus-visible { outline-offset: 4px; }

.directive-card {
  position: relative;
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  background: #0e0e18;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out);
}
.directive-card:hover { border-color: var(--control-line); transform: translateX(2px); }
.directive-card.is-selected {
  border-color: var(--magenta);
  border-left-color: var(--magenta);
  background: rgba(255, 61, 139, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 61, 139, 0.18);
}

.directive-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.directive-summary {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.1rem 0;
  text-align: left;
  display: grid;
  gap: 0.2rem;
}
.directive-summary__name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  overflow-wrap: anywhere;
  transition: color var(--dur-fast) ease;
}
.directive-card.is-selected .directive-summary__name,
.directive-summary:hover .directive-summary__name { color: var(--magenta); }
.directive-summary__description {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--dim);
}

.directive-card__meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--dimmer);
}

/* inline on/off toggle (rendered by JS as label.inline-toggle > input + span) */
.inline-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: var(--dimmer);
  cursor: pointer;
  user-select: none;
}
.inline-toggle input,
.switch input {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--control-line);
  position: relative;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
  flex: 0 0 auto;
}
.inline-toggle input::after,
.switch input::after {
  content: "";
  position: absolute;
  top: 50%; left: 2px;
  width: 12px; height: 12px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--dim);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) ease;
}
.inline-toggle input:checked,
.switch input:checked {
  background: rgba(65, 255, 139, 0.22);
  border-color: var(--green);
}
.inline-toggle input:checked::after,
.switch input:checked::after {
  transform: translate(16px, -50%);
  background: var(--green);
  box-shadow: 0 0 8px rgba(65, 255, 139, 0.7);
}
.inline-toggle input:checked + span { color: var(--green); }

/* ---------- editor head ---------- */
.editor__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}
.editor__title-wrap { min-width: 0; }
.editor__category {
  margin: 0 0 0.35rem;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.editor__name {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.2rem, 1rem + 1.2vw, 1.7rem);
  line-height: 1.15;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* big switch in the editor */
.switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}
.switch input { position: relative; }   /* track styled above via shared rule */
.switch__track { display: none; }       /* native input is styled directly */
.switch__thumb { display: none; }
.switch__text {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--dim);
  transition: color var(--dur-fast) ease;
}
.switch input:checked ~ .switch__text { color: var(--green); }

.editor__description {
  margin: 0;
  max-width: 64ch;
  color: var(--dim);
  font-size: 0.95rem;
}

/* ---------- note ---------- */
.note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--cyan);
  background: rgba(69, 240, 255, 0.06);
  border: 1px solid rgba(69, 240, 255, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}
.note__icon { color: var(--cyan); }

/* ---------- source form ---------- */
.source-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  align-items: end;
}

/* ---------- blocks (quick values / current values) ---------- */
.block { display: grid; gap: 0.7rem; }
.block__title {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 0.45rem;
}
.block__hint { text-transform: none; letter-spacing: 0; color: var(--dimmer); font-size: 0.9em; }

.quick-value-list,
.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* quick value buttons */
.quick-value-button {
  min-height: 2.3rem;
  padding: 0.4rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--cyan);
  background: rgba(69, 240, 255, 0.06);
  border: 1px dashed rgba(69, 240, 255, 0.4);
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
}
.quick-value-button::before { content: "+ "; color: var(--dim); }
.quick-value-button:hover {
  background: rgba(69, 240, 255, 0.16);
  border-style: solid;
  transform: translateY(-1px);
}
.quick-value-button:active { transform: translateY(1px); }

/* current value chips */
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.3rem 0.3rem 0.3rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--gold);
  background: rgba(255, 200, 87, 0.08);
  border: 1px solid rgba(255, 200, 87, 0.35);
  border-radius: var(--radius-sm);
}
.source-chip__text { overflow-wrap: anywhere; }
.remove-value-button {
  display: inline-grid;
  place-items: center;
  width: 1.6rem; height: 1.6rem;
  min-width: 1.6rem;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 85, 96, 0.14);
  color: var(--red);
  font-size: 1.05rem;
  line-height: 1;
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.remove-value-button:hover { background: var(--red); color: var(--bg); transform: scale(1.08); }
.remove-value-button:active { transform: scale(0.94); }

/* ---------- empty states ---------- */
.empty-state {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--dimmer);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}

/* ---------- parser ---------- */
.parse-policy-form { display: grid; gap: 0.8rem; }
.parse-input {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background: #0c0c16;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
  transition: border-color var(--dur-fast) ease;
}
.parse-input::placeholder { color: var(--dimmer); }
.parse-input:hover { border-color: var(--control-line-hover); }
.parse-policy-form .btn { justify-self: start; }

/* ---------- colophon ---------- */
.colophon {
  position: relative;
  z-index: 2;
  max-width: var(--shell-max);
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  padding: 1.75rem var(--gutter) 0;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}
.colophon__line {
  margin: 1.5rem 0 0.6rem;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--dim);
}
.colophon__sub { margin: 0; font-size: 0.82rem; color: var(--dimmer); }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (min-width: 600px) {
  .custom-directive-form { grid-template-columns: 1fr auto; }
  .source-form__grid { grid-template-columns: minmax(9rem, 12rem) 1fr auto; }
}

@media (min-width: 980px) {
  .workspace {
    grid-template-columns: minmax(17rem, 0.85fr) minmax(0, 1.3fr);
  }
  .panel--catalog {
    grid-row: span 2;
    position: sticky;
    top: 1rem;
    max-height: calc(100svh - 2rem);
  }
  .directive-list { max-height: none; }
}

@media (min-width: 1240px) {
  .workspace {
    grid-template-columns: minmax(17rem, 0.8fr) minmax(0, 1.25fr) minmax(18rem, 0.85fr);
  }
  .panel--catalog { grid-row: span 1; }
  .panel--parser {
    position: sticky;
    top: 1rem;
    align-self: start;
  }
}

/* tighten for very small screens */
@media (max-width: 380px) {
  .console__bar { gap: 0.6rem; }
  .lab-link { font-size: 8px; padding: 0.45rem 0.55rem; }
  .masthead__privacy { font-size: 0.72rem; }
}

/* ===================================================================
   REDUCED MOTION
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .masthead__dot { animation: none; }
  .directive-card:hover,
  .lab-link:hover,
  .btn:hover,
  .quick-value-button:hover,
  .remove-value-button:hover { transform: none; }
}
