:root {
  --bg: #090b10;
  --bg-soft: #0e1118;
  --panel: rgba(18, 22, 31, .86);
  --panel-solid: #12161f;
  --panel-2: #171c27;
  --input: #0c1017;
  --text: #f4f0e8;
  --muted: #999eaa;
  --muted-2: #6f7581;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --accent: #d9aa68;
  --accent-2: #69c3bb;
  --accent-3: #b787d5;
  --danger: #f28282;
  --success: #72d6a4;
  --shadow: 0 24px 90px rgba(0,0,0,.38);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: Georgia, 'Times New Roman', serif;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1500px;
}

html[data-theme="light"] {
  --bg: #f1eee7;
  --bg-soft: #e9e5dd;
  --panel: rgba(255,255,255,.82);
  --panel-solid: #fffdfa;
  --panel-2: #f4f0e8;
  --input: #faf8f3;
  --text: #202126;
  --muted: #686b73;
  --muted-2: #888b92;
  --line: rgba(30,32,38,.10);
  --line-strong: rgba(30,32,38,.18);
  --shadow: 0 24px 90px rgba(82,71,49,.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
  font-size: 15px;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(circle at 14% 10%, rgba(72, 127, 154, .18), transparent 30%),
    radial-gradient(circle at 78% 4%, rgba(146, 101, 162, .13), transparent 25%),
    radial-gradient(circle at 72% 76%, rgba(182, 130, 66, .11), transparent 30%),
    linear-gradient(160deg, var(--bg-soft), var(--bg) 42%, var(--bg));
}
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  padding: 0 clamp(18px, 3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px);
}
.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  border-radius: 11px;
  border: 1px solid rgba(217,170,104,.24);
  background: linear-gradient(145deg, rgba(217,170,104,.17), rgba(105,195,187,.08));
}
.brand-mark span { width: 3px; border-radius: 99px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 14px; }
.brand-mark span:nth-child(4) { height: 18px; }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-family: var(--font-display); font-size: 16px; font-weight: 500; letter-spacing: .02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .19em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 9px; }

.shell { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.hero {
  min-height: 490px;
  padding: 74px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  gap: clamp(36px, 7vw, 110px);
  align-items: center;
}
.hero-copy { max-width: 760px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  max-width: 850px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 6vw, 86px);
  letter-spacing: -.045em;
  line-height: .98;
}
.hero h1 em { color: var(--accent); font-weight: 400; }
.hero-text { max-width: 710px; margin: 26px 0 0; color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-visual {
  position: relative;
  min-height: 360px;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 35% 34%, rgba(217,170,104,.18), transparent 25%),
    radial-gradient(circle at 68% 58%, rgba(105,195,187,.16), transparent 28%),
    linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  box-shadow: var(--shadow);
}
.orb { position: absolute; border-radius: 50%; filter: blur(8px); animation: float 8s ease-in-out infinite alternate; }
.orb-one { width: 180px; height: 180px; left: 13%; top: 13%; background: radial-gradient(circle at 30% 30%, rgba(237,201,148,.72), rgba(164,93,82,.12) 58%, transparent 70%); }
.orb-two { width: 210px; height: 210px; right: 9%; bottom: 8%; background: radial-gradient(circle at 36% 32%, rgba(101,204,192,.55), rgba(53,83,140,.12) 60%, transparent 72%); animation-delay: -2s; }
@keyframes float { to { transform: translate3d(12px,-11px,0) scale(1.06); } }
.waveform { position: absolute; left: 9%; right: 9%; top: 46%; height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 5px; opacity: .6; }
.waveform span { width: 3px; border-radius: 99px; background: linear-gradient(var(--accent-2), var(--accent)); animation: wave 2.6s ease-in-out infinite; }
.waveform span:nth-child(3n+1) { height: 21%; animation-delay: -.2s; }
.waveform span:nth-child(3n+2) { height: 55%; animation-delay: -.6s; }
.waveform span:nth-child(3n) { height: 92%; animation-delay: -1s; }
@keyframes wave { 0%,100%{ transform:scaleY(.55); opacity:.55; } 50%{ transform:scaleY(1); opacity:1; } }
.visual-card {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(8,11,17,.64);
  backdrop-filter: blur(18px);
}
html[data-theme="light"] .visual-card { background: rgba(255,255,255,.7); }
.mini-label { display: block; color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.visual-card strong { display: block; margin-top: 5px; font-family: var(--font-display); font-size: 24px; font-weight: 400; }
.visual-meta { display: flex; gap: 8px; margin-top: 14px; }
.visual-meta span { padding: 5px 9px; border-radius: 99px; background: rgba(255,255,255,.07); color: var(--muted); font-size: 11px; }

button { cursor: pointer; }
.primary, .secondary, .icon-button, .status-pill, .text-button, .danger-text, .copy-button {
  border: 0;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
}
.primary, .secondary {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.primary { background: var(--accent); color: #17110a; box-shadow: 0 8px 26px rgba(217,170,104,.16); }
.primary:hover, .secondary:hover, .icon-button:hover, .status-pill:hover { transform: translateY(-1px); }
.primary:hover { background: #e7b978; }
.primary.glow { box-shadow: 0 12px 40px rgba(217,170,104,.24); }
.secondary { color: var(--text); border: 1px solid var(--line-strong); background: rgba(255,255,255,.035); }
.secondary:hover { background: rgba(255,255,255,.07); }
.compact { min-height: 38px; padding: 0 14px; font-size: 13px; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.icon-button.tiny { width: 32px; height: 32px; border-radius: 8px; }
.status-pill { min-height: 38px; padding: 0 13px; display: inline-flex; align-items: center; gap: 8px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(242,130,130,.10); }
.status-pill.configured .status-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(114,214,164,.10); }
.text-button, .danger-text { padding: 0; background: none; font-size: 12px; font-weight: 700; }
.text-button { color: var(--accent); }
.danger-text { color: var(--danger); }
.text-button:hover, .danger-text:hover { opacity: .72; }

.workflow-nav {
  position: sticky;
  top: 76px;
  z-index: 20;
  margin-bottom: 22px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(22px);
}
.workflow-step {
  min-height: 70px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-content: center;
  text-align: left;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
}
.workflow-step > span { grid-row: 1 / 3; align-self: center; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font-size: 10px; }
.workflow-step strong { color: var(--text); font-size: 13px; }
.workflow-step small { font-size: 11px; }
.workflow-step.active { background: rgba(255,255,255,.06); }
.workflow-step.active > span { background: var(--accent); color: #1b130a; border-color: transparent; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.editor-column { min-width: 0; }
.step-panel { display: none; }
.step-panel.active { display: block; animation: panelIn .3s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } }
.panel-card, .summary-card, .readiness-card, .legal-mini, .results {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 50px rgba(0,0,0,.10);
}
.panel-card { padding: clamp(22px, 3vw, 34px); border-radius: var(--radius); margin-bottom: 16px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.panel-heading h2 { margin: 0; font-family: var(--font-display); font-size: clamp(25px, 3vw, 35px); font-weight: 400; letter-spacing: -.02em; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-footer-actions { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 40px; }

.preset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.preset-card {
  min-height: 128px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.preset-card:hover { border-color: rgba(217,170,104,.38); background: rgba(217,170,104,.06); }
.preset-card.active { border-color: var(--accent); background: rgba(217,170,104,.10); box-shadow: inset 0 0 0 1px rgba(217,170,104,.16); }
.preset-icon { font-size: 24px; }
.preset-card strong { font-size: 13px; }
.preset-card small { color: var(--muted); font-size: 11px; line-height: 1.35; }

.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-two { grid-column: span 2; }
.span-three { grid-column: span 3; }
.field { display: grid; gap: 8px; }
.field > span, .control-group > legend {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .015em;
}
.field > span small, .control-group > legend small { color: var(--muted-2); font-weight: 500; }
.field input, .field select, .field textarea, .range-value input, .output-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--input);
  color: var(--text);
}
.field input, .field select { min-height: 47px; padding: 0 13px; }
.field textarea { min-height: 98px; padding: 13px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field select:focus, .field textarea:focus, .output-card textarea:focus { border-color: rgba(217,170,104,.55); box-shadow: 0 0 0 3px rgba(217,170,104,.08); outline: 0; }
.field-hint { color: var(--muted-2); font-size: 10px; text-align: right; }
.control-group { margin: 25px 0 0; padding: 0; border: 0; }
.control-group legend { margin-bottom: 11px; }
.compact-field { margin-top: 14px; }

.pill-grid, .pill-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.pill {
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.pill:hover { color: var(--text); border-color: rgba(217,170,104,.35); }
.pill.active { color: #17110a; background: var(--accent); border-color: var(--accent); }
.pill-grid .pill { border-radius: 11px; }

.conditional-card { margin-top: 18px; padding: 18px; border: 1px solid rgba(105,195,187,.22); border-radius: 14px; background: rgba(105,195,187,.055); }
.conditional-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.conditional-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(105,195,187,.12); color: var(--accent-2); font-size: 20px; }
.conditional-heading div { display: grid; }
.conditional-heading small { color: var(--muted); }

.range-card { margin: 22px 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.022); }
.range-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.range-heading > div:first-child { display: grid; }
.range-heading span { font-size: 12px; font-weight: 700; }
.range-heading small { color: var(--muted); }
.range-value { display: flex; align-items: center; gap: 6px; }
.range-value input { width: 64px; min-height: 38px; padding: 0 6px; text-align: center; font-weight: 800; }
.range-value span { color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-labels { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted-2); font-size: 10px; }

.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 24px; }
.toggle-card { position: relative; min-height: 82px; padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.022); cursor: pointer; }
.toggle-card input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 37px; height: 21px; position: relative; border-radius: 99px; background: rgba(255,255,255,.12); transition: background .2s ease; }
.toggle-ui::after { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.toggle-card input:checked + .toggle-ui { background: var(--accent-2); }
.toggle-card input:checked + .toggle-ui::after { transform: translateX(16px); }
.toggle-card > span:last-child { display: grid; }
.toggle-card small { color: var(--muted); line-height: 1.35; }
.toggle-card.horizontal { min-height: 68px; margin-top: 10px; }

.timeline-summary { margin: 20px 0 12px; padding: 14px; display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 13px; }
.timeline-summary > div { display: grid; }
.timeline-summary span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.timeline-summary strong { margin-top: 2px; font-size: 14px; }
.timeline-strip { height: 92px; padding: 10px; display: flex; gap: 4px; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--input); }
.timeline-block { min-width: 30px; position: relative; padding: 9px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; border-radius: 9px; background: linear-gradient(140deg, rgba(105,195,187,.20), rgba(217,170,104,.14)); border: 1px solid rgba(255,255,255,.07); }
.timeline-block:nth-child(3n+2) { background: linear-gradient(140deg, rgba(183,135,213,.19), rgba(105,195,187,.11)); }
.timeline-block:nth-child(3n) { background: linear-gradient(140deg, rgba(217,170,104,.20), rgba(181,93,100,.11)); }
.timeline-block strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.timeline-block small { color: var(--muted); font-size: 9px; }
.timeline-editor { display: grid; gap: 8px; margin-top: 12px; }
.timeline-row { padding: 10px; display: grid; grid-template-columns: 34px minmax(110px,.8fr) 90px minmax(180px,1.5fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.drag-handle { color: var(--muted-2); text-align: center; cursor: grab; }
.timeline-row input { min-width: 0; min-height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--input); color: var(--text); }
.timeline-row .duration-input { text-align: center; }
.remove-section { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--danger); }
.arrange-notes { margin-top: 20px; }

.guardrail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 22px; }
.guardrail-list label { min-height: 90px; padding: 15px; display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.022); cursor: pointer; }
.guardrail-list input { margin-top: 3px; accent-color: var(--accent); }
.guardrail-list span { display: grid; }
.guardrail-list small { color: var(--muted); line-height: 1.4; }
.generation-summary { margin-top: 22px; padding: 16px; display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--input); }
.generation-summary span { padding: 6px 10px; border-radius: 99px; background: rgba(255,255,255,.05); color: var(--muted); font-size: 11px; }
.generate-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 11px; margin-top: 16px; }
.primary.large, .secondary.large { min-height: 82px; display: flex; align-items: center; justify-content: center; gap: 12px; text-align: left; }
.primary.large span:last-child, .secondary.large span:last-child { display: grid; }
.primary.large small, .secondary.large small { font-weight: 500; opacity: .72; }
.button-icon { font-size: 21px; }
.cost-note { margin: 12px 0 0; color: var(--muted-2); font-size: 10px; text-align: center; }

.sticky-stack { position: sticky; top: 174px; display: grid; gap: 12px; }
.summary-card { padding: 22px; border-radius: var(--radius); }
.summary-card-head { display: flex; justify-content: space-between; align-items: center; }
.summary-card h3 { margin: 13px 0 8px; font-family: var(--font-display); font-size: 28px; font-weight: 400; line-height: 1.05; }
.summary-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.summary-stats { margin: 21px 0 15px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.summary-stats div { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.summary-stats dt { color: var(--muted-2); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.summary-stats dd { margin: 4px 0 0; font-size: 12px; font-weight: 700; }
.summary-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.summary-tags span { padding: 4px 7px; border-radius: 99px; background: rgba(217,170,104,.08); color: var(--accent); font-size: 9px; }
.readiness-card { padding: 17px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; border-radius: 15px; }
.readiness-ring { width: 56px; height: 56px; display: flex; align-items: baseline; justify-content: center; place-content: center; border-radius: 50%; background: conic-gradient(var(--accent-2) var(--score,42%), rgba(255,255,255,.08) 0); position: relative; }
.readiness-ring::before { content:""; position:absolute; inset:5px; border-radius:50%; background:var(--panel-solid); }
.readiness-ring span, .readiness-ring small { position:relative; z-index:1; }
.readiness-ring span { font-weight:800; }
.readiness-ring small { font-size:9px; }
.readiness-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.legal-mini { padding: 17px; border-radius: 15px; }
.legal-mini p { margin: 5px 0 8px; color: var(--muted); font-size: 10px; }

.results { margin: 18px 0 70px; padding: clamp(20px, 3vw, 34px); border-radius: 24px; }
.results-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.result-title-row { display: flex; align-items: center; gap: 9px; }
.results-header h2 { margin: 0; font-family: var(--font-display); font-size: clamp(34px, 4vw, 54px); font-weight: 400; letter-spacing: -.03em; }
.results-header p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); }
.results-actions { position: relative; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.export-menu { position: absolute; top: 44px; right: 104px; z-index: 5; min-width: 150px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-solid); box-shadow: var(--shadow); }
.export-menu button { width: 100%; padding: 9px; text-align: left; border: 0; border-radius: 7px; background: transparent; color: var(--text); }
.export-menu button:hover { background: rgba(255,255,255,.06); }
.result-tabs { margin: 27px 0 16px; display: flex; gap: 5px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.result-tabs button { padding: 11px 14px; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.result-tabs button.active { color: var(--text); border-color: var(--accent); }
.result-pane { display: none; }
.result-pane.active { display: block; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.output-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.output-card.span-two { grid-column: span 2; }
.output-heading { min-height: 30px; margin-bottom: 9px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.output-heading > div { display: grid; }
.output-heading small { color: var(--muted-2); font-size: 9px; }
.output-card textarea { min-height: 120px; padding: 14px; resize: vertical; line-height: 1.62; }
.negative-card textarea { color: #d6a9a9; }
.copy-button { min-height: 31px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--muted); font-size: 10px; font-weight: 700; }
.copy-button:hover { color: var(--text); border-color: var(--line-strong); }
.alternative-grid { grid-column: span 2; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.alternative-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); }
.alternative-card h4 { margin: 4px 0 8px; font-family: var(--font-display); font-size: 18px; font-weight: 400; }
.alternative-card textarea { width: 100%; min-height: 150px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--text); font-size: 12px; line-height: 1.5; }
.generated-timeline { margin-bottom: 13px; display: flex; gap: 6px; overflow-x: auto; }
.generated-segment { min-width: 135px; flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(140deg, rgba(105,195,187,.10), rgba(217,170,104,.08)); }
.generated-segment strong { display:block; font-size:11px; }
.generated-segment small { color:var(--muted); }

.app-footer { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 24px 0 40px; display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.app-footer > div { display: grid; }
.app-footer strong { color: var(--text); }

.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.68); backdrop-filter: blur(8px); }
.modal, .drawer { position: fixed; z-index: 80; border: 1px solid var(--line-strong); background: var(--panel-solid); box-shadow: var(--shadow); }
.modal { top: 50%; left: 50%; width: min(680px, calc(100% - 28px)); max-height: min(840px, calc(100vh - 32px)); transform: translate(-50%,-50%); border-radius: 21px; overflow: auto; }
.drawer { top: 0; right: 0; width: min(450px, 94vw); height: 100vh; border-radius: 20px 0 0 20px; overflow: auto; }
.modal-head, .drawer-head { padding: 21px 23px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.modal-head h2, .drawer-head h2 { margin: 0; font-family: var(--font-display); font-size: 29px; font-weight: 400; }
.modal-head .eyebrow, .drawer-head .eyebrow { margin-bottom: 4px; }
.modal-body { padding: 22px 23px; }
.modal-foot { padding: 16px 23px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); }
.modal-foot > div { display: flex; gap: 8px; }
.security-note { margin-bottom: 18px; padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 12px; border: 1px solid rgba(105,195,187,.22); border-radius: 12px; background: rgba(105,195,187,.055); }
.security-note > span { color: var(--accent-2); font-size: 22px; }
.security-note p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.provider-tabs { display: flex; gap: 5px; margin-bottom: 17px; }
.provider-tabs button { flex: 1; min-height: 39px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; }
.provider-tabs button.active { color: #17110a; background: var(--accent); border-color: var(--accent); }
.provider-pane { display: none; }
.provider-pane.active { display: grid; gap: 14px; }
.secret-field { display: grid; grid-template-columns: 1fr auto; }
.secret-field input { border-radius: 11px 0 0 11px; }
.secret-field button { padding: 0 13px; border: 1px solid var(--line); border-left: 0; border-radius: 0 11px 11px 0; background: rgba(255,255,255,.04); color: var(--muted); }
.provider-help { color: var(--muted); font-size: 10px; }
.settings-grid { margin-top: 19px; }
.legal-copy h3 { margin: 24px 0 5px; font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.legal-copy h3:first-child { margin-top: 0; }
.legal-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.drawer-toolbar { padding: 12px 20px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.history-list { padding: 12px; display: grid; gap: 8px; }
.history-empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.history-item { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.02); }
.history-item-head { display: flex; justify-content: space-between; gap: 10px; }
.history-item h3 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 400; }
.history-item p { margin: 5px 0 12px; color: var(--muted); font-size: 10px; }
.history-item-actions { display: flex; gap: 7px; }
.history-item-actions button { min-height: 31px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; }
.title-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.title-option { padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.title-option:hover { border-color: rgba(217,170,104,.45); background: rgba(217,170,104,.06); }
.title-option strong { font-family: var(--font-display); font-size: 18px; font-weight: 400; }
.title-option small { grid-column: 1 / -1; color: var(--muted); }
.title-score { color: var(--accent); font-size: 11px; }

.loading-overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(7,9,14,.88); backdrop-filter: blur(16px); text-align: center; }
.loader-orbit { width: 88px; height: 88px; position: relative; margin-bottom: 22px; animation: rotate 8s linear infinite; }
.loader-orbit span { position: absolute; border-radius: 50%; }
.loader-orbit span:nth-child(1) { width: 88px; height: 88px; inset: 0; border: 1px solid rgba(217,170,104,.35); }
.loader-orbit span:nth-child(2) { width: 18px; height: 18px; top: -8px; left: 35px; background: var(--accent); box-shadow: 0 0 30px rgba(217,170,104,.6); }
.loader-orbit span:nth-child(3) { width: 42px; height: 42px; left: 23px; top: 23px; background: radial-gradient(circle at 30% 30%, var(--accent-2), transparent 70%); }
@keyframes rotate { to { transform: rotate(360deg); } }
.loading-overlay strong { font-family: var(--font-display); font-size: 28px; font-weight: 400; }
.loading-overlay p { color: var(--muted); }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 8px; }
.toast { min-width: 240px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--panel-solid); box-shadow: var(--shadow); color: var(--text); font-size: 12px; animation: toastIn .25s ease; }
.toast.error { border-color: rgba(242,130,130,.35); }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr .75fr; gap: 34px; }
  .workspace { grid-template-columns: minmax(0,1fr) 290px; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .pill-grid { grid-template-columns: repeat(3,1fr); }
  .timeline-row { grid-template-columns: 28px 1fr 76px; }
  .timeline-row input:nth-of-type(3) { grid-column: 2 / 4; }
  .timeline-row .remove-section { grid-column: 4; grid-row: 1; }
}

@media (max-width: 900px) {
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 54px; }
  .hero-visual { min-height: 300px; }
  .workspace { grid-template-columns: 1fr; }
  .summary-column { order: -1; }
  .sticky-stack { position: static; grid-template-columns: 1fr 1fr; }
  .summary-card { grid-row: span 2; }
  .legal-mini { display: none; }
  .app-footer { grid-template-columns: 1fr; gap: 8px; }
  .alternative-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .app-header { height: 66px; padding: 0 14px; }
  .brand-copy small, .status-pill, .header-actions .primary { display: none; }
  .shell { width: min(100% - 22px, var(--max)); }
  .hero { padding: 42px 0 36px; }
  .hero h1 { font-size: clamp(42px, 14vw, 64px); }
  .workflow-nav { top: 66px; }
  .workflow-step { min-height: 54px; grid-template-columns: auto 1fr; padding: 7px; }
  .workflow-step small { display: none; }
  .workflow-step > span { width: 25px; height: 25px; }
  .form-grid.two, .form-grid.three, .toggle-grid, .guardrail-list, .generate-actions, .result-grid { grid-template-columns: 1fr; }
  .span-two, .span-three, .output-card.span-two, .alternative-grid { grid-column: auto; }
  .pill-grid { grid-template-columns: repeat(2, 1fr); }
  .sticky-stack { grid-template-columns: 1fr; }
  .summary-card { grid-row: auto; }
  .readiness-card { display: none; }
  .timeline-summary { grid-template-columns: repeat(3,1fr); }
  .timeline-summary .text-button { grid-column: 1 / -1; text-align: left; }
  .timeline-row { grid-template-columns: 24px 1fr 70px auto; }
  .timeline-row input:nth-of-type(3) { grid-column: 2 / 5; }
  .results-header { flex-direction: column; }
  .results-actions { justify-content: flex-start; }
  .export-menu { left: 90px; right: auto; }
  .title-results { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .brand-copy strong { font-size: 14px; }
  .hero-actions, .panel-footer-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions button, .panel-footer-actions button { width: 100%; }
  .preset-grid { grid-template-columns: 1fr 1fr; }
  .preset-card { min-height: 118px; }
  .pill-grid { grid-template-columns: 1fr 1fr; }
  .panel-card { padding: 18px; }
  .panel-heading { flex-direction: column; }
  .visual-card { left: 14px; right: 14px; bottom: 14px; }
  .modal-foot { align-items: stretch; flex-direction: column; }
  .modal-foot > div { display: grid; }
}
