:root {
  --ink: #0b0f14;
  --panel: #111821;
  --panel-2: #172231;
  --paper: #f6f2ea;
  --paper-2: #ede6d8;
  --line: rgba(255, 255, 255, 0.12);
  --line-dark: rgba(11, 15, 20, 0.12);
  --green: #2fd17c;
  --gold: #f5b942;
  --blue: #55a7ff;
  --coral: #ff776a;
  --muted: #9ca8b4;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--paper);
  background: var(--ink);
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar,
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 15, 20, 0.76);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #07100c;
  font-size: 13px;
  border-radius: 6px;
}

.nav,
.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav a {
  color: rgba(246, 242, 234, 0.72);
  font-size: 14px;
}

.nav a:hover {
  color: var(--paper);
}

.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 750;
  cursor: pointer;
}

.button.primary,
.nav-cta {
  background: var(--green);
  color: #05100b;
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
}

.button.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.landing-page {
  min-height: 100vh;
}

.market-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  background: #080b0f;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 36px;
  min-height: calc(100vh - 72px);
  align-items: center;
  padding: 68px 6vw 92px;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-copy h1,
.app-hero h1 {
  margin-bottom: 22px;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  max-width: 920px;
}

.hero-subtitle,
.body-copy,
.app-hero p {
  color: rgba(246, 242, 234, 0.72);
  font-size: 18px;
  line-height: 1.7;
  max-width: 760px;
}

.hero-terminal {
  align-self: end;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 11, 15, 0.72);
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

.terminal-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-row:last-child {
  border-bottom: 0;
}

.terminal-row span,
.terminal-row em {
  color: var(--muted);
  font-style: normal;
}

.terminal-row strong {
  color: var(--green);
  text-transform: uppercase;
}

.section-band {
  padding: 88px 6vw;
}

.light-band {
  color: var(--ink);
  background: var(--paper);
}

.dark-band {
  background: #0d131a;
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading h2,
.split-section h2,
.final-cta h2 {
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
}

.three-up {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  min-height: 250px;
  padding: 26px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fffaf0;
}

.feature-index {
  color: var(--coral);
  font-weight: 850;
}

.feature-card h3 {
  margin-top: 44px;
  font-size: 24px;
}

.feature-card p {
  color: rgba(11, 15, 20, 0.68);
  line-height: 1.6;
}

.split-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.pricing-list {
  display: grid;
  gap: 12px;
}

.pricing-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.pricing-list em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
}

.final-cta {
  text-align: center;
}

.final-cta .section-inner {
  max-width: 820px;
}

.disclaimer {
  max-width: 620px;
  margin: 22px auto 0;
  color: rgba(11, 15, 20, 0.58);
  font-size: 14px;
  line-height: 1.6;
}

.app-page {
  background: #0a0f14;
}

.mode-pill,
.signal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(47, 209, 124, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.app-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: end;
  padding: 26px 0 30px;
}

.app-hero h1 {
  margin-bottom: 12px;
}

.market-summary {
  display: grid;
  gap: 10px;
}

.market-summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
}

.market-summary strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.app-hero > *,
.dashboard-grid > *,
.panel {
  min-width: 0;
}

.agent-panel {
  margin-bottom: 16px;
}

.agent-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.agent-card {
  min-width: 0;
  padding: 18px;
  background: rgba(13, 19, 26, 0.9);
}

.agent-card h3 {
  margin-bottom: 14px;
  color: var(--paper);
  font-size: 14px;
}

.why-chain {
  display: grid;
  gap: 12px;
  padding-left: 18px;
}

.why-chain li {
  margin: 0;
}

.why-chain strong,
.why-chain span,
.rule-item strong,
.rule-item span,
.journal-item strong,
.journal-item span {
  display: block;
}

.why-chain span,
.rule-item span,
.journal-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.rules-list,
.journal-list,
.psychology-scores,
.rules-check-result {
  display: grid;
  gap: 10px;
}

.rule-item,
.journal-item,
.rules-check-result > div {
  padding: 11px;
  border-left: 3px solid rgba(85, 167, 255, 0.58);
  background: rgba(255, 255, 255, 0.04);
}

.rule-item p,
.journal-item p,
.psychology-summary p,
.rules-check-result p {
  margin: 4px 0;
  color: rgba(246, 242, 234, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.psychology-summary {
  margin-bottom: 12px;
}

.psychology-summary strong,
.rules-check-result > strong {
  color: var(--gold);
}

.psychology-scores {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.psychology-scores div {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.psychology-scores span {
  color: var(--muted);
  font-size: 12px;
}

.journal-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.journal-form select {
  min-height: 42px;
}

.rules-check-result {
  margin-top: 14px;
}

.rules-check-result .pass {
  border-left-color: var(--green);
}

.rules-check-result .review {
  border-left-color: var(--gold);
}

.rules-check-result .block {
  border-left-color: var(--coral);
}

.decision-panel {
  margin-bottom: 16px;
}

.decision-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr) minmax(280px, 0.75fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.decision-layout > * {
  min-width: 0;
  padding: 18px;
  background: rgba(13, 19, 26, 0.9);
}

.decision-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.decision-form select {
  min-height: 42px;
}

.decision-rationale,
.decision-form .button {
  grid-column: 1 / -1;
}

.decision-plan-result:empty::before {
  display: block;
  color: var(--muted);
  content: "Generate a plan to see the mocked decision ticket, rules verdict, invalidation level, and alert to arm.";
  line-height: 1.6;
}

.plan-card,
.decision-item {
  padding: 13px;
  border-left: 3px solid var(--blue);
  background: rgba(255, 255, 255, 0.045);
}

.plan-card.journal_required,
.plan-card.needs_size_review {
  border-left-color: var(--gold);
}

.plan-card.blocked_by_rules {
  border-left-color: var(--coral);
}

.plan-card.ready_to_execute_mock {
  border-left-color: var(--green);
}

.plan-card strong,
.decision-item strong {
  display: block;
  margin-bottom: 6px;
}

.plan-card p,
.decision-item p {
  margin: 0 0 10px;
  color: rgba(246, 242, 234, 0.72);
  line-height: 1.5;
}

.plan-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.plan-card dl div {
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.plan-card dt {
  color: var(--muted);
  font-size: 12px;
}

.plan-card dd {
  margin: 4px 0 0;
  color: var(--paper);
  line-height: 1.45;
}

.decision-list {
  display: grid;
  gap: 10px;
}

.decision-layout h3 {
  margin-bottom: 14px;
  font-size: 14px;
}

.decision-item span {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.panel-heading p,
.panel-heading span {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.watchlist {
  display: grid;
}

.watch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: var(--paper);
  text-align: left;
  cursor: pointer;
}

.watch-row:hover,
.watch-row.active {
  background: rgba(85, 167, 255, 0.12);
}

.watch-row strong {
  font-size: 15px;
}

.watch-row small,
.watch-row span {
  color: var(--muted);
}

.watch-row .change-positive {
  color: var(--green);
}

.watch-row .change-negative {
  color: var(--coral);
}

.report-panel {
  min-height: 700px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.metric-strip div {
  padding: 18px;
  background: rgba(13, 19, 26, 0.92);
}

.metric-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.report-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.report-columns > div,
.scenario-table-wrap {
  padding: 18px;
  background: rgba(13, 19, 26, 0.88);
}

.report-columns h3,
.scenario-table-wrap h3,
.alert-panel h3 {
  margin-bottom: 12px;
  color: var(--paper);
  font-size: 14px;
}

ul {
  padding-left: 18px;
}

li {
  margin-bottom: 10px;
  color: rgba(246, 242, 234, 0.72);
  line-height: 1.5;
}

.scenario-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.scenario-table th,
.scenario-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.scenario-table th {
  color: var(--muted);
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  padding: 8px 10px;
  border: 1px solid rgba(47, 209, 124, 0.3);
  border-radius: 999px;
  background: rgba(47, 209, 124, 0.08);
  color: #bff8d6;
  font-size: 12px;
}

.tag-list.danger span {
  border-color: rgba(255, 119, 106, 0.35);
  background: rgba(255, 119, 106, 0.08);
  color: #ffd1cc;
}

.alert-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--paper);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
  text-transform: none;
}

select {
  min-height: 88px;
}

.icon-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
}

.alerts-list-panel {
  grid-column: 1 / 2;
}

.feed-panel {
  grid-column: 2 / 3;
}

.business-panel {
  grid-column: 3 / 4;
}

.alerts-list,
.event-feed,
.business-metrics,
.moat-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.alert-item,
.event-item,
.business-metric,
.moat-list div {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.16);
}

.alert-item strong,
.event-item strong,
.business-metric strong {
  display: block;
  margin-bottom: 4px;
}

.alert-item p,
.event-item p,
.business-metric span,
.moat-list div {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.event-item.fire {
  border-color: rgba(245, 185, 66, 0.42);
  background: rgba(245, 185, 66, 0.08);
}

.doc-page {
  background: var(--paper);
  color: var(--ink);
}

.doc-shell {
  width: min(900px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 44px 0 80px;
}

.doc-shell h1 {
  font-size: 48px;
}

.doc-shell h2 {
  margin-top: 34px;
}

.doc-shell p,
.doc-shell li {
  color: rgba(11, 15, 20, 0.74);
  line-height: 1.65;
}

.back-link {
  display: inline-flex;
  margin-bottom: 28px;
  color: #0f6e43;
  font-weight: 800;
}

@media (max-width: 1080px) {
  .hero-section,
  .app-hero,
  .split-section,
  .agent-layout,
  .decision-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding-top: 44px;
  }

  .three-up,
  .report-columns,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .alerts-list-panel,
  .feed-panel,
  .business-panel {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .topbar,
  .app-header {
    gap: 10px;
    padding: 0 16px;
  }

  .app-header .brand {
    min-width: 0;
  }

  .app-header .brand span {
    font-size: 15px;
  }

  .header-actions {
    flex-shrink: 0;
    gap: 8px;
  }

  .app-header .button.compact {
    display: none;
  }

  .mode-pill {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .nav {
    display: none;
  }

  .hero-copy h1,
  .app-hero h1 {
    max-width: 100%;
    font-size: 38px;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .section-band {
    padding: 60px 18px;
  }

  .app-shell {
    width: 100%;
    padding: 24px 10px 42px;
    overflow: hidden;
  }

  .app-hero {
    gap: 16px;
    padding-top: 20px;
  }

  .app-hero p {
    font-size: 17px;
  }

  .market-summary div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .market-summary strong {
    text-align: left;
  }

  .decision-form,
  .plan-card dl {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .watch-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .watch-row > div {
    min-width: 0;
  }

  .watch-row small {
    overflow-wrap: anywhere;
  }
}
