:root {
  color-scheme: dark;
  --ink: #ecf4ff;
  --muted: #91a3bd;
  --dim: #62728b;
  --panel: #101f39;
  --panel-2: #132744;
  --line: #263b58;
  --sea: #5ee6c4;
  --sea-dark: #153e44;
  --sky: #7ab7ff;
  --warn: #ffc96b;
  --bg: #07111f;
  --bg-soft: #0b1830;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: radial-gradient(circle at 80% 0%, #133259 0, transparent 32rem), var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.site-header, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header { height: 74px; display: flex; align-items: center; gap: 32px; border-bottom: 1px solid rgba(145,163,189,.2); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #3e6581; border-radius: 10px; color: var(--sea); background: #0d2039; font-size: 24px; }
nav { display: flex; gap: 26px; color: var(--muted); font-size: .9rem; }
nav a:hover { color: var(--ink); }
.local-badge { margin-left: auto; padding: 7px 11px; border: 1px solid #27546a; border-radius: 999px; color: var(--sea); background: rgba(21,62,68,.55); font-size: .78rem; font-weight: 650; }

.intro { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; padding: 62px 0 34px; }
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--sea); font-size: .75rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 760px; margin: 0; overflow-wrap: anywhere; font-size: clamp(2.55rem, 6vw, 5.3rem); line-height: .98; letter-spacing: -.065em; }
.lede { max-width: 720px; margin: 23px 0 0; color: #a8b7cb; font-size: 1.1rem; }
.signal-card { width: 190px; padding: 18px; border: 1px solid #2b4969; border-radius: 16px; background: linear-gradient(150deg, rgba(22,48,79,.94), rgba(12,29,50,.94)); box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.signal-card span { display: block; color: var(--muted); font-size: .78rem; }
.signal-card .signal-label { color: var(--sea); text-transform: uppercase; letter-spacing: .08em; }
.signal-card strong { display: block; margin: 10px 0 0; font-size: 2rem; letter-spacing: -.05em; }

.workbench { display: grid; grid-template-columns: 215px minmax(0, 1fr); min-height: 650px; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: rgba(12,28,49,.94); box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.rail { padding: 18px 12px; background: #0a172a; border-right: 1px solid var(--line); }
.rail-step { position: relative; width: 100%; display: grid; grid-template-columns: 28px 1fr; gap: 1px 8px; padding: 15px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.rail-step span { grid-row: 1 / 3; color: var(--dim); font: 700 .7rem/1.5 ui-monospace, monospace; }
.rail-step strong { font-size: .95rem; }
.rail-step small { color: var(--dim); line-height: 1.35; }
.rail-step.active { background: #132944; }
.rail-step.active::before { content: ""; position: absolute; inset: 13px auto 13px 0; width: 3px; border-radius: 4px; background: var(--sea); }
.rail-step.active span, .rail-step.active small { color: #8ebfb7; }
.workspace { padding: 31px; min-width: 0; }
.workspace-head, .action-row, .preview-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 0; font-size: 1.55rem; letter-spacing: -.03em; }
h3 { margin-bottom: 0; font-size: .95rem; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--sky); cursor: pointer; }
.input-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; margin-top: 26px; }
.field { display: grid; gap: 8px; color: #c3d1e3; font-size: .86rem; font-weight: 650; }
.field, .campaign-fields { min-width: 0; }
.field em { color: var(--dim); font-size: .72rem; font-style: normal; font-weight: 500; }
.field small { color: var(--dim); font-weight: 450; line-height: 1.35; }
textarea, input { width: 100%; border: 1px solid #2a405e; border-radius: 9px; outline: 0; background: #0a1729; color: var(--ink); }
select { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #2a405e; border-radius: 9px; outline: 0; background: #0a1729; color: var(--ink); }
textarea { min-height: 190px; resize: vertical; padding: 13px 14px; font: .82rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
input { height: 43px; padding: 0 12px; }
textarea:focus, input:focus { border-color: #4cae9e; box-shadow: 0 0 0 3px rgba(94,230,196,.1); }
.campaign-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field-span { grid-column: 1 / -1; }
.action-row { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.rule-summary { color: var(--muted); font-size: .82rem; }
.rule-summary span { margin-right: 8px; color: var(--sea); }
.primary-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 9px; background: var(--sea); color: #06241f; font-weight: 750; cursor: pointer; box-shadow: 0 9px 26px rgba(94,230,196,.17); }
.primary-button:hover { background: #7cf1d4; }
.secondary-button { min-height: 40px; padding: 0 14px; border: 1px solid #365370; border-radius: 9px; background: #132944; color: #cfe1f4; font-weight: 700; cursor: pointer; }
.secondary-button:hover { border-color: #5d7d9f; background: #183250; }
.preview-block { margin-top: 25px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.preview-head { padding: 13px 15px; background: #12233b; }
.health { color: var(--muted); font-size: .75rem; }
.health i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--sea); box-shadow: 0 0 8px rgba(94,230,196,.7); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
th, td { padding: 12px 15px; border-top: 1px solid #203550; text-align: left; white-space: nowrap; }
th { color: var(--dim); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
td { color: #b7c6d9; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.status.clean { color: var(--sea); background: rgba(21,62,68,.75); }
.status.review { color: var(--warn); background: rgba(90,61,20,.75); }
.status.error { color: #ff9d9d; background: rgba(88,30,38,.75); }
.flow-panel[hidden] { display: none; }
.panel-intro { max-width: 680px; margin: 14px 0 25px; color: var(--muted); }
.audit-input { margin-top: 25px; }
.audit-input textarea { min-height: 225px; }
.audit-tally, .saved-note, .copy-status { min-height: 20px; color: var(--muted); font-size: .84rem; }
.audit-list { max-height: 440px; overflow: auto; }
.audit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 13px; padding: 15px; border-top: 1px solid var(--line); }
.audit-row:first-child { border-top: 0; }
.audit-url { min-width: 0; color: #c4d4e6; font: .78rem/1.45 ui-monospace, monospace; overflow-wrap: anywhere; }
.issue-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.issue-chip { padding: 4px 7px; border-radius: 5px; background: #1d304a; color: #9eb0c7; font-size: .7rem; }
.issue-chip.error { background: #4b222c; color: #ffb6b6; }
.issue-chip.fix { background: #483a1f; color: #ffd68f; }
.issue-chip.warning { background: #26374f; color: #a9c7e8; }
.audit-row .row-number { color: var(--dim); font: 700 .7rem/1.5 ui-monospace, monospace; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rule-grid textarea { min-height: 98px; }
.toggle-card { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #0b192c; cursor: pointer; }
.toggle-card input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--sea); }
.toggle-card span, .toggle-card strong, .toggle-card small { display: block; }
.toggle-card small { margin-top: 4px; color: var(--muted); font-weight: 450; line-height: 1.4; }
.danger-text { color: #ffadad; }
.export-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 25px 0; border: 1px solid var(--line); background: var(--line); }
.export-summary div { padding: 18px; background: #0c1a2e; }
.export-summary strong, .export-summary span { display: block; }
.export-summary strong { font-size: 1.8rem; letter-spacing: -.05em; }
.export-summary span { color: var(--muted); font-size: .78rem; }
.export-actions > div { display: flex; gap: 9px; }
.history-block { margin-top: 28px; padding-top: 23px; border-top: 1px solid var(--line); }
.history-list { display: grid; gap: 8px; margin-top: 13px; }
.history-list p { color: var(--muted); }
.history-item { display: flex; justify-content: space-between; gap: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #0a1729; color: var(--muted); font-size: .8rem; }
.history-item strong { color: #c7d6e7; }
.proof-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 48px 0; border: 1px solid var(--line); background: var(--line); }
.proof-strip article { padding: 25px; background: var(--bg); }
.proof-strip strong, .proof-strip span { display: block; }
.proof-strip span { margin-top: 7px; color: var(--muted); font-size: .88rem; }
.content-section, .faq-section { padding: 42px 0 54px; border-top: 1px solid var(--line); }
.content-section h2, .faq-section h2 { max-width: 720px; margin: 0 0 25px; font-size: clamp(1.8rem, 4vw, 3.2rem); letter-spacing: -.045em; }
.content-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 55px; }
.content-columns p { color: #aab9cc; }
code { padding: 2px 5px; border-radius: 5px; background: #11233c; color: #bce8df; font: .85em ui-monospace, monospace; }
.definition-list { margin: 0; border-top: 1px solid var(--line); }
.definition-list div { display: grid; grid-template-columns: 140px 1fr; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.definition-list dt { color: var(--sea); font: .78rem ui-monospace, monospace; }
.definition-list dd { margin: 0; color: var(--muted); font-size: .86rem; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.faq-grid details { padding: 17px 19px; border: 1px solid var(--line); border-radius: 10px; background: #0b192c; }
.faq-grid summary { cursor: pointer; font-weight: 700; }
.faq-grid p { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px 0 45px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
footer p { margin: 0; }
.footer-links { display: flex; gap: 18px; }
.footer-links a:hover { color: var(--ink); }

@media (max-width: 820px) {
  .site-header { width: min(100% - 28px, 1180px); }
  nav { display: none; }
  main, footer { width: min(100% - 24px, 1180px); }
  .intro { grid-template-columns: 1fr; padding-top: 42px; }
  .signal-card { display: none; }
  .workbench { grid-template-columns: 1fr; }
  .rail { display: grid; grid-template-columns: repeat(4,1fr); padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .rail-step { display: block; min-width: 78px; padding-inline: 8px; text-align: center; }
  .rail-step span, .rail-step small { display: none; }
  .rail-step.active::before { inset: auto 20px 0; width: auto; height: 3px; }
  .workspace { padding: 21px 16px; }
  .input-grid { grid-template-columns: 1fr; }
  .action-row { align-items: flex-end; }
  .rule-summary { max-width: 56%; }
  .proof-strip { grid-template-columns: 1fr; }
  .content-columns { grid-template-columns: 1fr; gap: 25px; }
  .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  h1 { font-size: 2.4rem; letter-spacing: -.05em; }
  .intro { padding-bottom: 24px; }
  .workspace-head { display: grid; align-items: flex-start; }
  .workspace-head .text-button { justify-self: start; }
  .campaign-fields { grid-template-columns: 1fr; }
  .field-span { grid-column: auto; }
  .rule-grid { grid-template-columns: 1fr; }
  .action-row { display: grid; }
  .rule-summary { max-width: none; }
  .primary-button { width: 100%; }
  .export-summary { grid-template-columns: 1fr 1fr 1fr; }
  .export-summary div { padding: 13px 10px; }
  .export-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  footer { display: block; }
  footer p { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
