:root {
  --ink: #09090a;
  --ink-2: #111114;
  --ink-3: #19191e;
  --paper: #f4f1e8;
  --muted: rgba(244, 241, 232, 0.55);
  --line: rgba(244, 241, 232, 0.12);
  --gold: #d8ae63;
  --lime: #c9ff57;
  --lavender: #b9a3ff;
  --danger: #ff9b8d;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ink); }
body { min-height: 100vh; margin: 0; color: var(--paper); background: var(--ink); font-family: "Manrope", system-ui, sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--lime); }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--paper); text-decoration: none; font-size: 12px; letter-spacing: .18em; font-weight: 800; }
.brand__mark { display: inline-flex; gap: 2px; align-items: end; width: 18px; height: 20px; transform: skew(-11deg); }
.brand__mark span { width: 4px; background: var(--paper); border-radius: 1px; }
.brand__mark span:nth-child(1) { height: 10px; }
.brand__mark span:nth-child(2) { height: 16px; background: var(--gold); }
.brand__mark span:nth-child(3) { height: 20px; background: var(--lime); }
.eyebrow { margin: 0; font: 400 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 28px; overflow: hidden; background: radial-gradient(circle at 75% 15%, rgba(185,163,255,.14), transparent 36%), radial-gradient(circle at 18% 78%, rgba(216,174,99,.1), transparent 32%), var(--ink); }
.gate::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .28; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom, #000, transparent 82%); }
.gate__panel { position: relative; width: min(100%, 520px); padding: 42px; border: 1px solid var(--line); border-radius: 28px; background: rgba(17,17,20,.86); backdrop-filter: blur(22px); box-shadow: 0 40px 140px rgba(0,0,0,.55); }
.gate__panel .eyebrow { margin-top: 76px; }
.gate__panel h1 { margin: 16px 0; font-size: clamp(42px, 7vw, 64px); line-height: .96; letter-spacing: -.06em; font-weight: 550; }
.gate__panel > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.gate form { margin-top: 32px; }
.gate label span { display: block; margin-bottom: 9px; font: 400 10px "DM Mono", monospace; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.gate input { width: 100%; height: 54px; padding: 0 17px; color: var(--paper); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; outline: none; }
.gate input:focus { border-color: rgba(201,255,87,.55); box-shadow: 0 0 0 4px rgba(201,255,87,.06); }
.gate button[type="submit"] { width: 100%; height: 54px; margin-top: 12px; border: 0; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; padding: 0 19px; color: var(--ink); background: var(--lime); font-weight: 800; }
.gate__error { min-height: 22px; margin: 9px 0 0; color: var(--danger) !important; font-size: 12px; }
.gate__notice { margin-top: 23px; padding-top: 19px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.gate__notice strong { font-size: 11px; }
.gate__notice span { color: rgba(244,241,232,.42); font-size: 10px; line-height: 1.5; }

.app { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; background: radial-gradient(circle at 88% 0%, rgba(185,163,255,.075), transparent 26%), var(--ink); }
.rail { position: fixed; inset: 0 auto 0 0; width: 260px; padding: 28px 22px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(9,9,10,.88); backdrop-filter: blur(18px); }
.rail__product { margin-top: 55px; display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.rail__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 6px rgba(201,255,87,.09); }
.rail__product strong, .rail__product span { display: block; }
.rail__product strong { font-size: 12px; }
.rail__product span { margin-top: 2px; color: rgba(244,241,232,.38); font: 400 9px "DM Mono", monospace; }
.rail__section { margin-top: 34px; }
.rail__label { margin: 0 0 12px; color: rgba(244,241,232,.35); font: 400 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .14em; }
.sample-list { display: grid; gap: 7px; }
.sample-list button { width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: 10px; text-align: left; color: rgba(244,241,232,.58); background: transparent; font-size: 11px; transition: .18s; }
.sample-list button:hover, .sample-list button.active { color: var(--paper); border-color: var(--line); background: rgba(255,255,255,.035); transform: translateX(2px); }
.rail__footer { margin-top: auto; display: grid; gap: 14px; }
.rail__footer div { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); font: 400 9px "DM Mono", monospace; color: rgba(244,241,232,.35); }
.rail__footer strong { color: var(--lime); font-weight: 400; }
.rail__footer button { border: 0; padding: 0; text-align: left; color: rgba(244,241,232,.42); background: transparent; font-size: 10px; }
.rail__footer button:hover { color: var(--paper); }

.workspace { grid-column: 2; width: min(100%, 1360px); margin: 0 auto; padding: 34px 46px 28px; }
.topbar { display: flex; align-items: end; justify-content: space-between; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 9px 0 0; font-size: clamp(28px, 4vw, 44px); line-height: 1; letter-spacing: -.045em; font-weight: 550; }
.topbar__badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: rgba(244,241,232,.48); font: 400 9px "DM Mono", monospace; }
.topbar__badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }

.composer, .results { margin-top: 26px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(25,25,30,.9), rgba(13,13,15,.92)); box-shadow: 0 25px 80px rgba(0,0,0,.18); overflow: hidden; }
.composer__header, .results__header { min-height: 73px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.composer__header > div, .results__header > div:first-child { display: flex; align-items: center; gap: 13px; }
.step { color: rgba(244,241,232,.3); font: 400 9px "DM Mono", monospace; }
.composer h2, .results h2 { margin: 0; font-size: 15px; font-weight: 650; }
.text-button { border: 0; color: rgba(244,241,232,.4); background: transparent; font-size: 10px; }
.text-button:hover { color: var(--paper); }
.composer__field { display: block; padding: 22px 24px; }
.composer__field > span { display: block; margin-bottom: 10px; color: rgba(244,241,232,.4); font: 400 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .12em; }
.composer textarea { width: 100%; min-height: 160px; resize: vertical; padding: 18px; color: var(--paper); border: 1px solid var(--line); border-radius: 13px; outline: none; background: rgba(0,0,0,.16); font-size: 14px; line-height: 1.75; }
.composer textarea:focus { border-color: rgba(185,163,255,.5); box-shadow: 0 0 0 4px rgba(185,163,255,.055); }
.composer textarea::placeholder { color: rgba(244,241,232,.22); }
.composer__footer { min-height: 74px; padding: 12px 18px 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
.composer__footer p { margin: 0; color: rgba(244,241,232,.34); font-size: 10px; }
.composer__footer p strong { color: var(--danger); }
.generate { min-width: 182px; height: 48px; padding: 0 12px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 0; border-radius: 11px; color: var(--ink); background: var(--lavender); font-size: 11px; font-weight: 800; transition: .18s; }
.generate:hover { transform: translateY(-1px); background: #c7b7ff; }
.generate:disabled { cursor: wait; opacity: .65; }
.generate__key { padding: 5px 7px; border-radius: 6px; background: rgba(9,9,10,.1); font: 500 9px "DM Mono", monospace; }
.composer__error { min-height: 0; margin: 0; padding: 0 24px; color: var(--danger); font-size: 11px; }
.composer__error:not(:empty) { padding-bottom: 16px; }

.results { min-height: 370px; }
.results__empty { min-height: 368px; display: grid; place-items: center; align-content: center; gap: 18px; color: rgba(244,241,232,.28); text-align: center; font-size: 12px; }
.results__glyph { width: 48px; height: 48px; display: flex; align-items: end; justify-content: center; gap: 4px; transform: skew(-10deg); }
.results__glyph span { width: 8px; border-radius: 2px; background: rgba(244,241,232,.11); }
.results__glyph span:nth-child(1) { height: 20px; }
.results__glyph span:nth-child(2) { height: 32px; background: rgba(216,174,99,.26); }
.results__glyph span:nth-child(3) { height: 43px; background: rgba(201,255,87,.2); }
.confidence { padding: 6px 9px; border: 1px solid rgba(201,255,87,.2); border-radius: 999px; color: var(--lime); background: rgba(201,255,87,.045); font: 400 9px "DM Mono", monospace; }
.tabs { height: 54px; padding: 0 24px; display: flex; align-items: end; gap: 24px; border-bottom: 1px solid var(--line); }
.tabs button { height: 100%; padding: 0; border: 0; border-bottom: 2px solid transparent; color: rgba(244,241,232,.38); background: transparent; font-size: 10px; }
.tabs button.active { color: var(--paper); border-color: var(--gold); }
.output-panel { display: none; }
.output-panel.active { display: block; }
.output-panel__toolbar { min-height: 53px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; color: rgba(244,241,232,.32); font: 400 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--line); }
.output-panel__toolbar button { border: 0; padding: 7px 9px; border-radius: 7px; color: rgba(244,241,232,.58); background: rgba(255,255,255,.045); font-size: 9px; text-transform: none; letter-spacing: 0; }
.output-panel pre { margin: 0; min-height: 280px; padding: 25px; white-space: pre-wrap; color: rgba(244,241,232,.78); font: 400 12px/1.8 "DM Mono", monospace; }
.code-list { padding: 8px 24px; }
.code-row { min-height: 72px; display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.code-row:last-child { border-bottom: 0; }
.code-row__code { color: var(--lime); font: 500 15px "DM Mono", monospace; }
.code-row__label { color: rgba(244,241,232,.6); font-size: 11px; }
.code-row__units { color: rgba(244,241,232,.32); font: 400 9px "DM Mono", monospace; }
.warning-list { padding: 0 24px 18px; }
.warning { margin-top: 8px; padding: 11px 13px; border: 1px solid rgba(255,155,141,.18); border-radius: 9px; color: rgba(255,197,188,.74); background: rgba(255,155,141,.035); font-size: 10px; }
.reason-list, .handoff-list { min-height: 280px; margin: 0; padding: 22px 24px 25px 56px; }
.reason-list li, .handoff-list li { padding: 10px 0 10px 8px; color: rgba(244,241,232,.64); font-size: 12px; line-height: 1.7; border-bottom: 1px solid var(--line); }
.reason-list li::marker { color: var(--gold); font: 400 10px "DM Mono", monospace; }
.handoff-list li::marker { color: var(--lavender); }
.approval-bar { min-height: 76px; padding: 12px 18px 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.02); }
.approval-bar strong, .approval-bar span { display: block; }
.approval-bar strong { font-size: 10px; }
.approval-bar span { margin-top: 3px; color: rgba(244,241,232,.34); font-size: 9px; }
.approval-bar button { padding: 12px 15px; border: 0; border-radius: 10px; color: var(--ink); background: var(--paper); font-size: 10px; font-weight: 800; }
.workspace__footer { padding: 22px 4px 0; display: flex; justify-content: space-between; gap: 20px; color: rgba(244,241,232,.25); font: 400 8px "DM Mono", monospace; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--paper); background: rgba(25,25,30,.95); box-shadow: 0 18px 60px rgba(0,0,0,.35); font-size: 10px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 880px) {
  .app { display: block; }
  .rail { position: static; width: 100%; height: auto; padding: 18px 20px; flex-direction: row; align-items: center; gap: 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail__product { margin: 0; margin-left: auto; }
  .rail__section, .rail__footer { display: none; }
  .workspace { padding: 25px 18px; }
  .topbar { align-items: start; gap: 14px; }
  .topbar__badge { display: none; }
  .composer__footer, .approval-bar { align-items: stretch; flex-direction: column; }
  .generate, .approval-bar button { width: 100%; }
  .workspace__footer { flex-direction: column; }
}

@media (max-width: 560px) {
  .gate { padding: 14px; }
  .gate__panel { padding: 29px 22px; border-radius: 20px; }
  .gate__panel .eyebrow { margin-top: 48px; }
  .rail__product { display: none; }
  .topbar h1 { font-size: 31px; }
  .composer__header, .results__header { padding: 0 17px; }
  .composer__field { padding: 17px; }
  .tabs { padding: 0 16px; gap: 17px; overflow-x: auto; }
  .output-panel pre, .code-list, .warning-list { padding-left: 17px; padding-right: 17px; }
  .code-row { grid-template-columns: 92px 1fr; }
  .code-row__units { grid-column: 2; }
}
