:root {
  color-scheme: dark;
  --ink: #05070d;
  --ink-2: #0b1020;
  --panel: #11182a;
  --line: #263452;
  --text: #f7f9ff;
  --muted: #aab5cc;
  --cyan: #39e7ff;
  --pink: #ff4fc6;
  --lime: #b8ff38;
  --yellow: #ffd75e;
  --danger: #ff6f81;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .24;
  background-image:
    linear-gradient(rgba(57, 231, 255, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 79, 198, .10) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
a { color: inherit; }
p { color: var(--muted); line-height: 1.6; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { overflow-wrap: anywhere; }

.signal-stage {
  min-height: 100svh;
  overflow: hidden;
  border-top: 5px solid var(--cyan);
  background:
    linear-gradient(90deg, transparent 0 24%, rgba(255, 79, 198, .08) 24% 24.2%, transparent 24.2% 72%, rgba(184, 255, 56, .07) 72% 72.2%, transparent 72.2%),
    #050816;
}
.signal-stage::after {
  content: "";
  display: block;
  height: 8px;
  margin-top: -8px;
  background: repeating-linear-gradient(90deg, var(--cyan) 0 42px, var(--pink) 42px 78px, var(--lime) 78px 116px, transparent 116px 136px);
}

.topbar {
  width: min(1500px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 900; }
.brand-mark {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  clip-path: polygon(50% 0, 100% 100%, 70% 82%, 50% 48%, 29% 82%, 0 100%);
  font-size: 12px;
}
.system-strip { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.status-pill, .mode-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #0a0f1c;
  font-size: 12px;
  font-weight: 800;
}
.status-pill.live { border-color: #1d7d6e; color: #74ffd8; }
.status-pill.fallback { border-color: #725f22; color: var(--yellow); }
.status-pill.failed { border-color: #7a2837; color: #ff9aaa; }
.quiet-button, .result-tools button, .outcome-form button, .saved-run button, #googleSignInButton, .dialog-close {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--text);
  background: #11182a;
  font-weight: 800;
}

.hero-copy {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 24px;
  position: relative;
}
.hero-copy::before {
  content: "SOURCE  /  SCORE  /  DECIDE  /  PUBLISH";
  position: absolute;
  top: 22px;
  right: 0;
  color: #283650;
  font-size: 12px;
  font-weight: 900;
}
.eyebrow {
  margin-bottom: 10px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}
.hero-copy h1 {
  max-width: 1100px;
  margin-bottom: 18px;
  font-size: 64px;
  line-height: .98;
  letter-spacing: 0;
}
.hero-summary { max-width: 830px; margin-bottom: 20px; font-size: 20px; }
.signal-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.signal-tags span { padding: 8px 12px; border-left: 3px solid var(--cyan); color: #dce5f7; background: #0b1222; font-size: 13px; font-weight: 800; }
.signal-tags span:nth-child(2) { border-color: var(--pink); }
.signal-tags span:nth-child(3) { border-color: var(--lime); }
.signal-tags span:nth-child(4) { border-color: var(--yellow); }

.cockpit {
  width: min(1500px, calc(100% - 40px));
  min-height: 620px;
  margin: 0 auto 56px;
  display: grid;
  grid-template-columns: minmax(310px, .72fr) minmax(620px, 1.58fr);
  border: 1px solid #324467;
  border-radius: 8px;
  background: #0a0f1c;
  box-shadow: 0 28px 100px rgba(0, 0, 0, .55), 0 0 40px rgba(57, 231, 255, .08);
}
.composer-panel { padding: 28px; border-right: 1px solid var(--line); background: #080d18; }
.proof-board { min-width: 0; padding: 28px; background: #0d1424; }
.section-heading, .board-header, .lane-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.section-heading h2, .board-header h2 { margin-bottom: 0; font-size: 30px; line-height: 1.08; }
label { display: grid; gap: 8px; color: #dce5f7; font-size: 13px; font-weight: 850; }
textarea, input {
  width: 100%;
  border: 1px solid #2c3a59;
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: #050914;
}
textarea { resize: vertical; line-height: 1.55; }
.composer-panel > label { margin-top: 28px; }
.inline-advanced { margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
summary { cursor: pointer; color: #dce5f7; font-weight: 850; }
.inline-advanced summary { padding: 14px 0; }
.context-grid { display: grid; gap: 12px; padding-bottom: 16px; }
.primary-button {
  width: 100%;
  min-height: 58px;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  color: #031016;
  background: linear-gradient(90deg, var(--lime), var(--cyan));
  font-weight: 950;
  box-shadow: 0 8px 34px rgba(57, 231, 255, .2);
}
.primary-button[disabled] { cursor: wait; opacity: .68; }
.operation-status { min-height: 44px; margin: 12px 0 0; font-size: 13px; }
.operation-status.error { color: #ff9aaa; }

.board-header { align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.score-disc {
  width: 92px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-content: center;
  border-radius: 50%;
  color: var(--text);
  background: conic-gradient(var(--lime) calc(var(--score) * 1%), #26314a 0);
  box-shadow: inset 0 0 0 9px #0d1424;
}
.score-disc strong { font-size: 28px; line-height: 1; }
.score-disc span { color: var(--muted); font-size: 11px; text-align: center; }
.decision-summary { max-width: 920px; margin: 18px 0; }
.proof-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 14px; }
.proof-grid > section, .brief-output-grid > section { min-width: 0; border-top: 3px solid var(--cyan); padding: 16px 0; }
.proof-grid > section:nth-child(2) { border-color: var(--pink); }
.lane-heading { align-items: center; margin-bottom: 12px; }
.lane-heading h2, .lane-heading h3 { margin: 0; font-size: 16px; }
.lane-heading span { color: var(--muted); font-size: 12px; }
.evidence-list { display: grid; gap: 8px; }
.evidence-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #24314c;
  border-radius: 8px;
  background: #0a101e;
}
.source-type { width: 34px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; color: var(--ink); background: var(--cyan); font-size: 11px; font-weight: 950; }
.evidence-item.paper .source-type { background: var(--pink); }
.evidence-item.note .source-type { background: var(--yellow); }
.evidence-item strong, .evidence-item small { display: block; }
.evidence-item p { margin: 4px 0; color: #aebbd1; font-size: 12px; line-height: 1.45; }
.evidence-item small { color: #71809d; font-size: 11px; }
.evidence-score { color: var(--lime); font-size: 18px; font-weight: 950; }
.decision-lane { display: grid; gap: 10px; align-content: start; }
.decision-block { padding: 12px 14px; border-left: 3px solid var(--cyan); background: #0a101e; }
.decision-block.accent-pink { border-color: var(--pink); }
.decision-block span { color: var(--cyan); font-size: 11px; font-weight: 950; text-transform: uppercase; }
.decision-block.accent-pink span { color: var(--pink); }
.decision-block p { margin: 5px 0 0; color: #dce5f7; font-size: 13px; line-height: 1.45; }
.brief-output-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.brief-output-grid > section:first-child { border-color: var(--yellow); }
.brief-output-grid > section:last-child { border-color: var(--lime); }
#outlineList { margin: 0; padding-left: 24px; color: #dce5f7; }
#outlineList li { margin: 9px 0; padding-left: 5px; line-height: 1.45; }
.task-list { display: grid; gap: 7px; }
.task-item { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; padding: 9px 10px; border-bottom: 1px solid #24314c; color: #dce5f7; font-size: 13px; }
.task-item input { width: 16px; height: 16px; accent-color: var(--lime); }
.task-item.done span { color: #71809d; text-decoration: line-through; }
.task-item small { color: #71809d; }

.result-tools { margin-top: 16px; border-top: 1px solid var(--line); }
.result-tools > summary { padding: 16px 0; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; }
.launch-copy { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.launch-copy article { padding: 12px; border: 1px solid #24314c; border-radius: 8px; background: #080d18; }
.launch-copy strong { display: block; margin-bottom: 6px; color: var(--pink); font-size: 11px; text-transform: uppercase; }
.launch-copy p { margin: 0; font-size: 12px; white-space: pre-wrap; }
.outcome-form { display: grid; grid-template-columns: 1fr repeat(3, minmax(100px, .5fr)) auto; gap: 8px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.outcome-form h3 { margin: 0; font-size: 15px; }

.workflow-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #080c14;
}
.workflow-band div { min-height: 150px; padding: 28px; border-right: 1px solid var(--line); }
.workflow-band div:last-child { border-right: 0; }
.workflow-band span { color: var(--pink); font-weight: 950; }
.workflow-band strong { display: block; margin-top: 10px; font-size: 20px; }
.workflow-band p { margin: 6px 0 0; font-size: 13px; }

.product-section, .saved-section, footer { width: min(1320px, calc(100% - 40px)); margin: 0 auto; }
.product-section { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: 54px; padding: 100px 0; }
.section-intro h2 { max-width: 480px; font-size: 44px; line-height: 1.05; }
.section-intro p { max-width: 520px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.method-grid article { min-height: 180px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-grid strong { display: block; color: var(--cyan); font-size: 42px; }
.method-grid span { font-weight: 900; }
.method-grid p { margin: 8px 0 0; font-size: 13px; }
.pricing-section { border-top: 1px solid var(--line); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: stretch; }
.pricing-grid article { min-height: 230px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: #090e19; }
.pricing-grid article.recommended { border-color: var(--lime); background: #111827; }
.pricing-grid span, .pricing-grid strong { display: block; }
.pricing-grid span { color: var(--muted); font-weight: 850; }
.pricing-grid strong { margin-top: 18px; color: var(--lime); font-size: 30px; }
.pricing-grid small { color: var(--yellow); font-weight: 850; }

.saved-section { margin-bottom: 80px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.saved-section > summary { padding: 24px 0; font-size: 18px; }
.saved-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; padding: 0 0 30px; }
.saved-runs { display: grid; gap: 8px; margin-top: 14px; }
.saved-empty { padding: 22px 0; border-top: 1px solid var(--line); color: var(--muted); }
.saved-run { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.saved-run strong, .saved-run small { display: block; }
.saved-run small { margin-top: 4px; color: var(--muted); }
.saved-run button[data-action="delete"] { color: #ff9aaa; }
.advanced-systems, .model-lab { padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: #090e19; }
.advanced-systems h2 { font-size: 20px; }
.advanced-systems dl { margin: 0; }
.advanced-systems dl div { display: grid; grid-template-columns: .6fr 1.4fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.advanced-systems dt { color: var(--muted); }
.advanced-systems dd { margin: 0; color: #dce5f7; }
.model-lab { grid-column: 1 / -1; }
.model-lab h2 { margin: 0; font-size: 20px; }
#modelLabStatus { color: var(--yellow); font-size: 12px; font-weight: 850; text-align: right; }
.model-search-row { display: grid; gap: 8px; margin: 18px 0; }
.model-search-row > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.model-search-row button, .model-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #11182a;
  font-weight: 850;
}
.model-search-row button { color: #031016; border-color: transparent; background: var(--lime); }
.model-search-row button[disabled], .model-actions button[disabled] { cursor: wait; opacity: .62; }
.model-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.model-columns > section { min-width: 0; border-top: 3px solid var(--cyan); padding-top: 14px; }
.model-columns > section:nth-child(2) { border-color: var(--lime); }
.model-list { display: grid; gap: 8px; }
.model-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #24314c;
  border-radius: 8px;
  background: #0a101e;
}
.model-card.loaded { border-color: var(--lime); background: #101a20; }
.model-card strong, .model-card p { overflow-wrap: anywhere; }
.model-card p { margin: 4px 0 0; font-size: 12px; line-height: 1.45; }
.model-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.model-actions button[data-delete-model] { color: #ff9aaa; }
.model-progress {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #202b42;
}
.model-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--lime), var(--cyan)); }

footer { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
footer p { margin: 0; }

dialog { width: min(480px, calc(100% - 32px)); border: 1px solid #3b4e75; border-radius: 8px; padding: 0; color: var(--text); background: #0b1120; }
dialog::backdrop { background: rgba(2, 4, 10, .84); backdrop-filter: blur(8px); }
.auth-card { display: grid; gap: 14px; padding: 28px; }
.auth-card h2 { margin: 0; font-size: 30px; }
.dialog-close { justify-self: end; min-height: 34px; }
.auth-card .primary-button { margin-top: 4px; }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: 1fr auto; }
  .system-strip { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; padding-bottom: 14px; }
  .cockpit { grid-template-columns: 1fr; }
  .composer-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .product-section { grid-template-columns: 1fr; gap: 28px; }
  .outcome-form { grid-template-columns: repeat(3, 1fr); }
  .outcome-form h3 { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .topbar, .hero-copy, .cockpit { width: min(100% - 24px, 1500px); }
  .hero-copy { padding-top: 44px; }
  .hero-copy::before { display: none; }
  .hero-copy h1 { font-size: 46px; }
  .hero-summary { font-size: 17px; }
  .cockpit { margin-bottom: 34px; }
  .composer-panel, .proof-board { padding: 18px; }
  .proof-grid, .brief-output-grid, .launch-copy, .workflow-band, .method-grid, .pricing-grid, .saved-layout, .model-columns { grid-template-columns: 1fr; }
  .workflow-band div { min-height: 116px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workflow-band div:last-child { border-bottom: 0; }
  .product-section { width: min(100% - 24px, 1320px); padding: 70px 0; }
  .section-intro h2 { font-size: 36px; }
  .method-grid { border-left: 0; }
  .method-grid article { min-height: 130px; border-left: 1px solid var(--line); }
  .saved-section, footer { width: min(100% - 24px, 1320px); }
  .saved-run { grid-template-columns: 1fr auto; }
  .saved-run button[data-action="delete"] { grid-column: 2; }
  .outcome-form { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (max-width: 480px) {
  .topbar { gap: 10px; }
  .brand span:last-child { max-width: 150px; }
  .quiet-button { padding: 0 11px; }
  .hero-copy h1 { font-size: 39px; }
  .section-heading, .board-header { align-items: flex-start; }
  .board-header h2 { font-size: 24px; }
  .score-disc { width: 76px; }
  .evidence-item { grid-template-columns: 30px minmax(0, 1fr); }
  .evidence-score { grid-column: 2; }
  .tool-row button { width: 100%; }
  .model-search-row > div, .model-card { grid-template-columns: 1fr; }
  .model-actions { justify-content: stretch; }
  .model-actions button { flex: 1; }
}
