/* ============================================================================
   Premium black & white theme. System fonts for speed + zero network deps.
   ============================================================================ */
:root {
  /* light theme (default) */
  --bg: #ffffff;
  --bg-2: #f6f6f7;
  --ink: #0a0a0a;
  --ink-2: #565656;
  --ink-3: #9a9a9a;
  --line: #ececec;
  --line-2: #dcdcdc;
  --panel: #fbfbfc;
  --glass: rgba(255,255,255,.72);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.07);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --spot: rgba(0,0,0,.05);
  color-scheme: light;
  --radius: 16px;
  --radius-sm: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.4,0,.2,1);
}
:root[data-theme="dark"] {
  --bg: #0a0a0b; --bg-2: #141416; --ink: #f4f4f5; --ink-2: #a8a8ad; --ink-3: #6b6b70;
  --line: #1e1e21; --line-2: #2c2c30; --panel: #0f0f11; --glass: rgba(16,16,18,.72);
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 40px rgba(0,0,0,.55);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --spot: rgba(255,255,255,.06); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a0a0b; --bg-2: #141416; --ink: #f4f4f5; --ink-2: #a8a8ad; --ink-3: #6b6b70;
    --line: #1e1e21; --line-2: #2c2c30; --panel: #0f0f11; --glass: rgba(16,16,18,.72);
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 40px rgba(0,0,0,.55);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --spot: rgba(255,255,255,.06); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  line-height: 1.5; font-size: 15px; font-feature-settings: "cv05" 1, "ss01" 1, "tnum" 1;
  transition: background .25s var(--ease), color .25s var(--ease);
}
::selection { background: var(--ink); color: var(--bg); }

/* ── Ad rails: fixed to the sides, never affect content flow ── */
.ad-rail { position: fixed; top: 0; height: 100vh; width: 184px; padding: 24px 12px; display: flex; align-items: flex-start; justify-content: center; pointer-events: none; }
.ad-rail--left { left: 0; }
.ad-rail--right { right: 0; }
.ad-slot {
  position: sticky; top: 24px; width: 160px; min-height: 600px;
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
@media (max-width: 2100px) { .ad-rail { display: none; } }

/* Ad units: visible by default, Google's script fills them */
.adsbygoogle { display: inline-block !important; }
.ad-inline { display: block; margin: 0 0 26px; }
.ad-ph { display: none; } /* hide placeholders when ads load */

/* ── App column ── */
.app { max-width: 1180px; margin: 0 auto; padding: 0 28px 80px; min-width: 0; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 14px 0; margin-bottom: 8px;
  background: var(--glass); backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand__mark { display: block; }
.brand__name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.seg-toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; }
.seg-toggle button {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 16px; border: 0;
  border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: .18s var(--ease);
}
.seg-toggle button:hover { color: var(--ink); }
.seg-toggle button.is-active { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); cursor: pointer;
  transition: .18s var(--ease);
}
.icon-btn:hover { background: var(--bg-2); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

/* ── Hero ── */
.hero { position: relative; max-width: 780px; margin: 44px auto 44px; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: -120px -40px auto; height: 320px; z-index: -1;
  background: radial-gradient(60% 70% at 50% 0%, var(--spot), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(32px, 5.2vw, 52px); line-height: 1.05; letter-spacing: -.035em;
  margin: 0 0 18px; font-weight: 800;
}
.hero__sub { font-size: 17.5px; color: var(--ink-2); margin: 0 auto 16px; max-width: 660px; line-height: 1.55; }
.hero__sub strong { color: var(--ink); font-weight: 600; }
.hero__meta {
  display: inline-block; font-size: 12px; color: var(--ink-3); font-family: var(--mono);
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
}

/* ── Simple / Advanced visibility ── */
.adv-only { display: none !important; }
body.mode-advanced .adv-only { display: flex !important; }
.controls { transition: none; }

/* ── Controls ── */
.controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; padding: 20px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 28px;
}
.control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.control label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }
.control select, .control input {
  font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line-2);
  border-radius: 9px; background: var(--bg); color: var(--ink); width: 100%;
  appearance: none; cursor: pointer;
}
.control input { font-family: var(--mono); cursor: text; }
.control select:focus, .control input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.control--prompt { grid-column: 1 / -1; }
.control--prompt textarea {
  font: inherit; font-size: 14px; padding: 10px 11px; border: 1px solid var(--line-2);
  border-radius: 9px; background: var(--bg); color: var(--ink); width: 100%; resize: vertical;
  min-height: 46px; line-height: 1.45;
}
.control--prompt textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.prompt-est { font-family: var(--mono); color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 700; }
.control--output { grid-column: 1 / -1; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  font: inherit; font-size: 13.5px; padding: 8px 14px; border: 1px solid var(--line-2);
  border-radius: 10px; background: var(--bg); color: var(--ink-2); cursor: pointer; transition: .12s;
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; gap: 1px;
}
.seg button .hint { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg button[aria-pressed="true"] .hint { color: var(--bg); opacity: .7; }
.addons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.addon { font-size: 13px; padding: 6px 12px; border: 1px dashed var(--line-2); border-radius: 999px; background: var(--bg); color: var(--ink-2); cursor: pointer; user-select: none; transition: .12s; }
.addon[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-style: solid; border-color: var(--ink); }
.advanced { margin-top: 10px; }
.advanced summary { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); cursor: pointer; font-weight: 600; }
.advanced input { font: inherit; font-family: var(--mono); font-size: 14px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--ink); margin-top: 8px; width: 200px; }
.advanced input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.control--filters { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  font-size: 13px; padding: 6px 13px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--bg); color: var(--ink-2); cursor: pointer; user-select: none; transition: .12s;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── Panels ── */
.panel {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 26px; overflow: hidden;
}
.panel__head { padding: 20px 22px 0; }
.panel__head h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.02em; font-weight: 700; }
.panel__head p { margin: 0; color: var(--ink-3); font-size: 13.5px; }

/* ── Scatter ── */
.scatter {
  position: relative;
  aspect-ratio: 1000 / 420;
  height: auto;
  min-height: 350px;
  max-height: 500px;
  margin: 16px 22px 26px;
}
.scatter svg { width: 100%; height: 100%; overflow: visible; }
.scatter .axis-line { stroke: var(--line-2); stroke-width: 1; }
.scatter .grid-line { stroke: var(--line); stroke-width: 1; }
.scatter .axis-label { fill: var(--ink-3); font-size: 11px; font-family: var(--mono); }
.dot { cursor: pointer; transition: .15s; }
.dot circle { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; transition: fill .15s, stroke-width .15s; }
.dot:hover circle { fill: var(--ink); }
.dot text {
  fill: var(--ink);
  font-size: 11.5px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s, font-weight .15s;
}
.dot.dot--landmark text {
  opacity: 0.45;
}
.dot.dot--best-value text {
  opacity: 1;
  font-weight: 700;
}
.dot.dot--best-value circle {
  stroke-width: 2.5;
  stroke: var(--ink);
}
.dot:hover text {
  opacity: 1 !important;
  font-weight: 700;
}

/* ── Table ── */
.table-wrap { overflow-x: auto; padding: 14px 8px 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); cursor: pointer; border-bottom: 1px solid var(--line-2); }
th:hover { color: var(--ink); }
th.num, td.num { text-align: right; font-family: var(--mono); }
tbody tr { border-bottom: 1px solid var(--line); cursor: pointer; }
tbody tr:hover { background: var(--panel); }
tbody tr.best td { font-weight: 600; }
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-2); margin-left: 6px; vertical-align: middle; letter-spacing: .03em; }
.badge--think { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.badge--best { background: var(--bg); color: var(--ink); }
.detail-row td { background: var(--panel); white-space: normal; font-size: 13px; color: var(--ink-2); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px 20px; }
.detail-grid b { color: var(--ink); font-family: var(--mono); }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar > span { display: block; height: 100%; background: var(--ink); }

/* ── Thinking compare ── */
.think-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 16px; padding: 18px 22px 26px; }
.think-card { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; }
.think-card h3 { margin: 0 0 12px; font-size: 15px; }
.think-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.think-row:first-of-type { border-top: 0; }
.think-row .k { color: var(--ink-3); }
.think-row .v { font-family: var(--mono); font-weight: 600; }
.delta-up { color: var(--ink); }
.delta-line { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); }
.delta-line b { color: var(--ink); }

/* ── SEO footer ── */
.seo-foot { max-width: 760px; margin: 50px auto 0; color: var(--ink-2); }
.seo-foot h2 { font-size: 18px; color: var(--ink); }
.seo-foot .disclaimer { font-size: 13px; color: var(--ink-3); }
.seo-foot .credit { font-size: 12px; color: var(--ink-3); font-family: var(--mono); margin-top: 24px; text-align: center; }

/* ── Responsive Dashboard Layout ── */
@media (min-width: 1024px) {
  .app {
    max-width: 1800px;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 32px;
    align-items: start;
  }
  .topbar {
    grid-column: 1 / -1;
  }
  .hero {
    grid-column: 1 / -1;
    text-align: center;
    max-width: 800px;
    margin: 28px auto 16px;
  }
  .hero h1 {
    font-size: clamp(30px, 4vw, 44px);
    margin-bottom: 12px;
  }
  .hero__sub {
    font-size: 16px;
    max-width: 680px;
    margin-bottom: 12px;
  }
  .hero::before {
    inset: -120px -100px auto;
    background: radial-gradient(60% 70% at 50% 0%, var(--spot), transparent 70%);
  }
  .controls {
    grid-column: 1;
    grid-row: 3 / span 3;
    position: sticky;
    top: 90px;
    grid-template-columns: 1fr;
    margin-bottom: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .controls::-webkit-scrollbar {
    width: 6px;
  }
  .controls::-webkit-scrollbar-track {
    background: transparent;
  }
  .controls::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border-radius: 99px;
  }
  .panel {
    grid-column: 2;
    margin-bottom: 32px;
  }
  .ad-inline {
    grid-column: 2;
    margin-bottom: 32px;
  }
  .seo-foot {
    grid-column: 2;
    max-width: none;
    margin-top: 20px;
  }
}

/* ── FAQ Accordion Section ── */
.faq-grid {
  padding: 10px 22px 26px;
}
.faq-item {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.faq-item:first-of-type {
  border-top: 0;
}
.faq-item summary {
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  outline: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-weight: 400;
  font-size: 18px;
  color: var(--ink-3);
  transition: transform 0.15s var(--ease);
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--ink);
}
.faq-answer {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.faq-answer p {
  margin: 0 0 10px;
}
.faq-answer p:last-child {
  margin-bottom: 0;
}
.faq-answer code {
  font-family: var(--mono);
  background: var(--bg-2);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* ── Toggle Switch & Action Buttons ── */
.control--toggle {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px !important;
  color: var(--ink) !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  cursor: pointer;
  user-select: none;
}
.toggle-label input {
  display: none;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  background-color: var(--line-2);
  border-radius: 22px;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--bg);
  top: 3px;
  left: 3px;
  transition: all 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-label input:checked + .toggle-switch {
  background-color: var(--ink);
}
.toggle-label input:checked + .toggle-switch::after {
  left: 19px;
}
.toggle-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-left: 48px;
}

.panel__actions {
  display: flex;
  gap: 8px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.action-btn:hover {
  background: var(--bg-2);
  color: var(--ink);
  border-color: var(--line);
}
.action-btn svg {
  flex-shrink: 0;
}
.action-btn--success {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}
.action-btn--success:hover {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
}

/* ── Wizard Section ── */
.wizard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 18px 22px 26px;
}
.wizard-card {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wizard-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.wizard-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wizard-row label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  font-weight: 600;
}
.wizard-row select, .wizard-row input {
  font: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
}
.budget-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.budget-input-wrap span {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.savings-result {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}
.result-highlight {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.badge-diff {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.badge-diff--pos {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.badge-diff--neg {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ── Agentic Simulator ── */
.control--agent-sim {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 6px;
}
.agent-sim-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-2);
}
.agent-sim-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.agent-sim-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.agent-sim-field label {
  font-size: 10px !important;
  color: var(--ink-3) !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
}
.agent-sim-field input {
  font: inherit;
  font-family: var(--mono);
  font-size: 13px;
  padding: 7px 9px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
}
.agent-sim-field input:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}


