/* Action Plan landing site — styled with the app's own design tokens.
   Source of truth: Action Plan Design System (colors_and_type.css, ui-tokens). */

:root {
  /* Surfaces */
  --bg-canvas: #0B0D14;
  --bg-panel: #11141D;
  --bg-card: #171B26;
  --bg-hover: #1E2330;
  --bg-selected: #262B3A;
  /* Text */
  --text-primary: #F4F5F8;
  --text-body: #C7CBD6;
  --text-secondary: #8B92A3;
  --text-tertiary: #5C6271;
  /* Brand + semantic */
  --indigo: #6366F1;
  --indigo-pressed: #4F46E5;
  --success: #10B981;
  --warning: #F59E0B;
  --critical: #F43F5E;
  --info: #06B6D4;
  /* Borders */
  --border-subtle: #1C2030;
  --border-default: #2A3043;
  --border-strong: #3A4159;
  /* Radii (sharp, app-accurate) */
  --r-sm: 3px;
  --r-md: 5px;
  --r-lg: 7px;
  --r-xl: 10px;
  --font-ui: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-canvas);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text-primary); line-height: 1.2; font-weight: 700; }

img { max-width: 100%; display: block; }

code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: 52px; padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-primary); font-weight: 800; font-size: 16px; letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand .logo-mark {
  width: 26px; height: 26px; flex: 0 0 26px;
  filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.55));
}
.pill {
  font-size: 11px; font-weight: 600; color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.45); border-radius: 999px;
  padding: 2px 8px; white-space: nowrap;
}

.topnav { display: flex; gap: 18px; margin-left: 12px; }
.topnav a { color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.topnav a:hover { color: var(--text-primary); text-decoration: none; }

.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600;
  border-radius: var(--r-lg); padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn.primary {
  background: var(--indigo); color: #fff;
  box-shadow: 0 0 0 1px rgba(99,102,241,0.4), 0 0 18px rgba(99,102,241,0.35);
}
.btn.primary:hover { background: var(--indigo-pressed); }
.btn.ghost {
  background: transparent; color: var(--text-body); border-color: var(--border-default);
}
.btn.ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ---------- App frame ---------- */

.frame { display: flex; min-height: calc(100vh - 52px); }

.iconrail {
  width: 60px; flex: 0 0 60px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 6px;
}
.iconrail .railitem {
  width: 40px; height: 40px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
}
.iconrail .railitem svg { width: 19px; height: 19px; }
.iconrail .railitem.active {
  color: var(--indigo);
  background: rgba(99,102,241,0.12);
  box-shadow: 0 0 10px rgba(99,102,241,0.25);
}
.iconrail .raillabel {
  font-size: 8.5px; color: var(--text-tertiary); margin-top: -4px; margin-bottom: 4px;
}

/* Conversation navigator = site nav */

.convlist {
  width: 292px; flex: 0 0 292px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  padding: 14px 10px 24px;
  overflow-y: auto;
}
.convlist-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); padding: 6px 10px 8px;
}
.convrow {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 10px; border-radius: var(--r-lg);
  color: var(--text-body);
}
.convrow:hover { background: var(--bg-hover); text-decoration: none; }
.convrow[aria-current="page"] { background: var(--bg-selected); }
.convrow .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  border: 1px solid var(--border-default); object-fit: cover;
}
.convrow .meta {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column;
}
.convrow .title {
  display: block;
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.convrow .snippet {
  display: block;
  font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.convrow .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--indigo);
  margin-left: auto; margin-top: 6px; flex: 0 0 8px;
  box-shadow: 0 0 6px rgba(99,102,241,0.7);
}

/* ---------- Main pane ---------- */

.main { flex: 1; min-width: 0; }
.main-inner { max-width: 880px; margin: 0 auto; padding: 36px 28px 80px; }

.kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--indigo); margin-bottom: 10px;
}

.hero h1 { font-size: 34px; letter-spacing: -0.02em; margin-bottom: 14px; }
.hero .sub { font-size: 16.5px; color: var(--text-body); max-width: 640px; margin-bottom: 26px; }

.section { margin-top: 64px; }
.section > h2 { font-size: 24px; letter-spacing: -0.01em; margin-bottom: 6px; }
.section > .lede { color: var(--text-secondary); max-width: 640px; margin-bottom: 22px; }

/* ---------- Chat ---------- */

.thread { display: flex; flex-direction: column; gap: 18px; margin-top: 10px; }

.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
  border: 1px solid var(--border-default); object-fit: cover;
}
.msg .avatar.you {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-selected); color: var(--text-secondary);
  font-size: 12px; font-weight: 700;
}
.msg .bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 12px 16px;
  max-width: 660px; min-width: 0;
}
.msg.user .bubble { background: var(--bg-selected); border-color: var(--border-default); }
.msg .author { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.msg .author .role { font-weight: 500; color: var(--text-tertiary); font-size: 12px; margin-left: 6px; }
.msg .bubble p { margin-bottom: 10px; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg .bubble ul, .msg .bubble ol { margin: 8px 0 10px 20px; }
.msg .bubble li { margin-bottom: 5px; }
.msg .bubble strong { color: var(--text-primary); }

.answer-highlight { border-left: 3px solid var(--indigo); }

/* In-chat artifact cards (plan card, ledger row, digest…) */

.artifact {
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 14px; margin-top: 10px;
}
.artifact .artifact-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px;
}
.artifact .tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.tag.plan { color: var(--indigo); border: 1px solid rgba(99,102,241,0.5); }
.tag.cost { color: var(--success); border: 1px solid rgba(16,185,129,0.5); }
.tag.review { color: var(--warning); border: 1px solid rgba(245,158,11,0.5); }
.artifact ul.steps { list-style: none; margin: 0; }
.artifact ul.steps li {
  display: flex; gap: 8px; align-items: baseline;
  padding: 5px 0; border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
}
.artifact ul.steps li:last-child { border-bottom: none; }
.artifact ul.steps .step-status { font-family: var(--font-mono); font-size: 11px; flex: 0 0 auto; }
.step-status.done { color: var(--success); }
.step-status.run { color: var(--info); }
.step-status.wait { color: var(--text-tertiary); }
.artifact .artifact-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-subtle);
  font-size: 12.5px; color: var(--text-secondary);
}
.artifact .cost-line { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.artifact .cost-line .ok { color: var(--success); }
.btn.mini { padding: 6px 12px; font-size: 12.5px; }

/* Pinned summary card (the crawlable article skeleton) */

.pinned {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--warning);
  border-radius: var(--r-lg);
  padding: 20px 22px; margin-top: 34px;
}
.pinned .pinned-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--warning); margin-bottom: 10px;
}
.pinned h2 { font-size: 19px; margin-bottom: 10px; }
.pinned h3 { font-size: 15px; margin: 16px 0 6px; }
.pinned ol, .pinned ul { margin: 6px 0 10px 20px; }
.pinned li { margin-bottom: 5px; }

/* ---------- Composer (waitlist form) ---------- */

.composer-wrap { margin-top: 34px; }
.composer {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: 14px;
}
.composer:focus-within {
  border-color: var(--indigo);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.5), 0 0 22px rgba(99,102,241,0.18);
}
.composer textarea {
  width: 100%; min-height: 76px; resize: vertical;
  background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-ui); font-size: 15px; line-height: 1.5;
}
.composer textarea::placeholder, .composer input::placeholder { color: var(--text-tertiary); }
.composer .composer-row {
  display: flex; gap: 10px; align-items: center; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border-subtle);
}
.composer input[type="email"] {
  flex: 1; min-width: 0;
  background: var(--bg-panel); border: 1px solid var(--border-default);
  border-radius: var(--r-lg); padding: 9px 12px;
  color: var(--text-primary); font-family: var(--font-ui); font-size: 14px; outline: none;
}
.composer input[type="email"]:focus { border-color: var(--indigo); }
.composer .hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.composer-note { font-size: 12px; color: var(--text-tertiary); margin-top: 10px; }
.composer-error { font-size: 13px; color: var(--critical); margin-top: 8px; display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  background: var(--bg-card); color: var(--text-body);
  border: 1px solid var(--border-default); border-radius: 999px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  padding: 8px 14px; cursor: pointer;
}
.chip:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }

/* Success reply bubble */
.composer-success { margin-top: 16px; }

/* ---------- Cards & grids ---------- */

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card:hover { border-color: var(--border-default); }
.card h3 { font-size: 15.5px; margin-bottom: 7px; }
.card p { font-size: 13.5px; color: var(--text-secondary); }
.card ul { margin: 10px 0 0 18px; font-size: 13px; color: var(--text-secondary); }
.card ul li { margin-bottom: 4px; }

.team-card { text-align: center; padding: 16px 12px; }
.team-card img {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px;
  border: 2px solid var(--border-default); object-fit: cover;
}
.team-card .name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.team-card .role { font-size: 12px; color: var(--indigo); font-weight: 600; margin-bottom: 6px; }
.team-card .bio { font-size: 12.5px; color: var(--text-secondary); }

.steps3 { counter-reset: step; }
.steps3 .card { position: relative; padding-left: 18px; }
.steps3 .stepnum {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--indigo);
  margin-bottom: 8px; display: block;
}

/* ---------- Comparison ---------- */

.compare-card { padding: 20px; }
.compare-card h3 { font-size: 16px; margin-bottom: 12px; }
.compare-card .block { margin-bottom: 12px; }
.compare-card .block:last-child { margin-bottom: 0; }
.compare-card .label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  margin-bottom: 5px;
}
.label.good { color: var(--success); }
.label.bad { color: var(--critical); }
.label.ap { color: var(--indigo); }
.compare-card p, .compare-card ul { font-size: 13.5px; color: var(--text-body); }
.compare-card ul { margin: 0 0 0 18px; }
.compare-card li { margin-bottom: 4px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--r-lg); margin-top: 22px; }
table.compare { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 720px; }
table.compare th, table.compare td {
  padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--border-subtle);
}
table.compare th {
  background: var(--bg-panel); color: var(--text-secondary);
  font-size: 12px; font-weight: 600;
}
table.compare td:first-child, table.compare th:first-child {
  text-align: left; color: var(--text-body); font-weight: 500;
}
table.compare th.ap-col, table.compare td.ap-col {
  background: rgba(99,102,241,0.08); color: var(--text-primary); font-weight: 700;
}
table.compare .yes { color: var(--success); font-weight: 700; }
table.compare .no { color: var(--text-tertiary); }
table.compare .part { color: var(--warning); }

.keep-tools {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--success);
  border-radius: var(--r-lg);
  padding: 20px 22px; margin-top: 22px;
}
.keep-tools h3 { font-size: 16px; margin-bottom: 8px; }
.keep-tools p { font-size: 14px; color: var(--text-body); margin-bottom: 8px; }
.keep-tools p:last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */

.faq details {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 0; margin-bottom: 10px;
}
.faq summary {
  cursor: pointer; padding: 14px 18px;
  font-size: 14.5px; font-weight: 600; color: var(--text-primary);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--text-tertiary); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 18px 14px; font-size: 14px; color: var(--text-body); }

/* ---------- CTA band & footer ---------- */

.cta-band {
  margin-top: 70px; text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: 40px 24px;
  box-shadow: inset 0 0 60px rgba(99,102,241,0.07);
}
.cta-band h2 { font-size: 26px; margin-bottom: 10px; }
.cta-band p { color: var(--text-secondary); margin-bottom: 0; }

footer.site-footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: 70px; padding: 26px 0 0;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: 12.5px; color: var(--text-tertiary);
}
footer.site-footer a { color: var(--text-secondary); }
footer.site-footer .spacer { flex: 1; }

/* Conversation footer nav (prev/next) */
.conv-nav { display: flex; gap: 12px; margin-top: 40px; }
.conv-nav a {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg); padding: 14px 16px; color: var(--text-body);
}
.conv-nav a:hover { border-color: var(--border-default); text-decoration: none; background: var(--bg-hover); }
.conv-nav .dir { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-tertiary); display: block; margin-bottom: 4px; }
.conv-nav .where { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }

/* ---------- Mobile ---------- */

.convlist-toggle, .sticky-cta { display: none; }

@media (max-width: 1080px) {
  .iconrail { display: none; }
  .convlist { width: 250px; flex-basis: 250px; }
}

@media (max-width: 860px) {
  body { overflow-x: hidden; }
  .topnav { display: none; }

  /* Top bar: only brand + Problems toggle + Log in fit; the primary CTA
     lives in the sticky bottom bar instead. */
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar .pill { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn.primary { display: none; }
  .btn { padding: 8px 12px; font-size: 13px; }
  .brand { font-size: 15px; gap: 8px; }

  .convlist {
    position: fixed; inset: 52px 0 0 0; width: 100%; z-index: 40;
    display: none; flex-basis: auto;
  }
  body.nav-open .convlist { display: block; }
  body.nav-open { overflow: hidden; }
  .convlist-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--border-default);
    color: var(--text-body); border-radius: var(--r-lg);
    font-family: var(--font-ui); font-size: 12.5px; font-weight: 600;
    padding: 7px 11px; cursor: pointer; white-space: nowrap;
  }

  .main-inner { padding: 26px 16px 110px; }
  .hero h1 { font-size: 27px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }

  /* 16px+ inputs prevent iOS focus auto-zoom */
  .composer textarea, .composer input[type="email"] { font-size: 16px; }
  .composer .composer-row { flex-direction: column; align-items: stretch; }

  .msg .bubble { overflow-wrap: break-word; }
  .artifact .artifact-foot { flex-wrap: wrap; }
  .conv-nav { flex-direction: column; }

  .sticky-cta {
    display: block; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    padding: 10px 14px; background: rgba(11,13,20,0.92);
    border-top: 1px solid var(--border-default); backdrop-filter: blur(8px);
  }
  .sticky-cta .btn { width: 100%; }
}
