:root {
  --navy: #16324f;
  --navy-2: #214a70;
  --ink: #17222d;
  --muted: #566574;
  --faint: #7d8a97;
  --line: #dbe2e9;
  --line-soft: #e9eef3;
  --bg: #f3f6f9;
  --card: #ffffff;
  --accent: #0b7a68;
  --accent-ink: #ffffff;
  --accent-bg: #e7f4f0;
  --accent-line: #b9dfd6;
  --stop: #b4311f;
  --stop-bg: #fdf1ef;
  --stop-line: #f0c6bf;
  --warn: #7a5200;
  --warn-bg: #fff7e2;
  --warn-line: #efd994;
  --formula: #2f6fdb;
  font: 15px/1.55 Inter, 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }
a { color: var(--navy-2); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--formula); outline-offset: 2px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-secondary { background: #fff; color: var(--navy); border-color: #b9c6d3; }
.btn-secondary:hover:not(:disabled) { background: #f4f7fa; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* ---------- Site chrome ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; font-size: 16px; text-decoration: none; letter-spacing: -0.01em; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.topbar nav a:not(.btn):hover { color: var(--navy); }

.hero { background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--line-soft); }
.hero-inner { padding-top: 22px; padding-bottom: 18px; }
.hero-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 6px; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.025em; color: var(--navy); margin-bottom: 10px; }
.lede { font-size: 16px; color: var(--muted); margin: 0; max-width: 64ch; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hero-points li { font-size: 14px; color: var(--muted); padding-left: 16px; border-left: 3px solid var(--accent-line); }
.hero-points strong { color: var(--ink); }

.app-section { padding: 18px 0 44px; }
.app-section .wrap { max-width: 1392px; }
.band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 52px 0; margin: 0; }
main > .wrap { padding-top: 52px; padding-bottom: 52px; }
.section-title { font-size: 26px; letter-spacing: -0.02em; color: var(--navy); margin-bottom: 14px; }
.section-lede { color: var(--muted); max-width: 80ch; }
.fine { font-size: 13px; color: var(--muted); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.plain { padding-left: 18px; margin: 0 0 10px; }
.plain li { margin: 6px 0; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards li, .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.cards h3, .card h3 { font-size: 17px; margin-bottom: 6px; color: var(--navy); }
.cards p { color: var(--muted); margin: 0; font-size: 14px; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.card-accent { background: var(--accent-bg); border-color: var(--accent-line); }
.ticks { list-style: none; padding: 0; margin: 10px 0 0; }
.ticks li { padding: 7px 0 7px 22px; position: relative; font-size: 14px; border-top: 1px solid rgba(23,34,45,0.08); }
.ticks li:first-child { border-top: 0; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.card-accent .ticks li::before { background: var(--accent); }
.install { padding-left: 20px; margin: 8px 0 12px; }
.install li { margin: 6px 0; font-size: 14px; }
.files li { font-size: 14px; }
.video { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #0d1a28; aspect-ratio: 16 / 9; }
.footer { padding: 26px 0 40px; color: var(--muted); font-size: 13px; }

/* ---------- Demo app ---------- */
.app { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(22,50,79,0.08), 0 1px 3px rgba(22,50,79,0.06); overflow: hidden; }
.app-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fbfcfd; flex-wrap: wrap; }
.app-head h2 { font-size: 17px; color: var(--navy); }
.app-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--faint); border: 1px solid var(--line); background: #fff; }
.steps li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line-soft); font-size: 11px; font-weight: 700; color: var(--muted); }
.steps li.is-current { color: #fff; background: var(--navy); border-color: var(--navy); }
.steps li.is-current span { background: rgba(255,255,255,0.2); color: #fff; }
.steps li.is-done { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); }
.steps li.is-done span { background: var(--accent); color: #fff; }

.app-body { display: grid; grid-template-columns: 284px minmax(0, 1fr) 300px; height: clamp(600px, calc(100vh - 190px), 780px); }
.app-body > * { min-width: 0; min-height: 0; }
.pane-left { padding: 16px; border-right: 1px solid var(--line); background: #fbfcfd; display: flex; flex-direction: column; overflow: auto; }
.pane-right { padding: 16px; border-left: 1px solid var(--line); background: #fbfcfd; overflow: auto; }
.pane-center { display: flex; flex-direction: column; background: #fff; }

.file-name { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.file-name strong { display: block; font-size: 14px; line-height: 1.25; color: var(--navy); }
.file-name small { color: var(--muted); font-size: 12px; }
.file-badge { background: #1d6f42; color: #fff; font-weight: 800; font-size: 10px; letter-spacing: 0.04em; padding: 7px 6px; border-radius: 6px; }
.sheet-list { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.sheet-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row:hover:not(.is-locked) { background: #f6f9fc; }
.sheet-row.is-selected { background: #eef4fa; }
.sheet-row input { width: 17px; height: 17px; accent-color: var(--navy); flex: none; }
.sheet-text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sheet-name { font-weight: 600; font-size: 14px; white-space: nowrap; }
.sheet-text small { font-size: 12px; color: var(--muted); }
.sheet-row.is-locked { cursor: not-allowed; background: #f8f9fb; }
.sheet-row.is-locked .sheet-name { color: var(--faint); font-weight: 500; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.tag-lock { background: var(--stop-bg); color: var(--stop); }
.actions { display: grid; gap: 8px; margin-top: 14px; }
.actions .btn { width: 100%; }
.status { font-size: 13px; color: var(--muted); min-height: 20px; margin: 10px 0 0; }
.status.error { color: var(--stop); }

.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--line-soft); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-selected='true'] { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(22,50,79,0.18); }
.legend { margin: 0; font-size: 12px; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key::before { content: ''; width: 12px; height: 12px; border-radius: 3px; border: 1px solid #ddd; }
.key-hidden::before { background: repeating-linear-gradient(-45deg, #fde7e3, #fde7e3 3px, #f8cbc3 3px, #f8cbc3 6px); border-color: #efb5ab; }
.key-formula::before { border: 0; width: 0; height: 0; border-style: solid; border-width: 0 0 10px 10px; border-color: transparent transparent var(--formula) transparent; border-radius: 0; }
.key-note::before { border: 0; width: 0; height: 0; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent #d12a1c transparent transparent; border-radius: 0; }
.formula-bar { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--line); font-size: 13px; min-height: 32px; }
.fb-address { width: 64px; text-align: center; border-right: 1px solid var(--line); padding: 5px 0; color: var(--muted); font-weight: 600; }
.fb-entry { padding: 5px 12px; color: var(--ink); font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-host { flex: 1; min-height: 0; overflow: auto; background: #fff; position: relative; }
.banner { position: sticky; left: 0; background: var(--stop-bg); color: var(--stop); border-bottom: 1px solid var(--stop-line); padding: 8px 14px; font-size: 13px; font-weight: 600; }
.grid-scroll { min-width: min-content; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.sheet-tabs { display: flex; gap: 2px; padding: 6px 10px 0; border-top: 1px solid var(--line); background: #f0f3f6; overflow-x: auto; }
.sheet-tab { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 6px 12px; font-size: 12.5px; color: var(--muted); border-radius: 6px 6px 0 0; cursor: pointer; white-space: nowrap; }
.sheet-tab:hover { background: #e6ebf0; }
.sheet-tab.is-active { background: #fff; color: var(--navy); font-weight: 700; border-color: var(--line); box-shadow: inset 0 -2px 0 var(--accent); }
.sheet-tab.is-hidden-sheet { color: var(--stop); font-style: italic; }
.sheet-tab em { font-size: 11px; opacity: 0.85; }

/* Spreadsheet grid */
.xl-grid { border-collapse: collapse; table-layout: fixed; font: 13px/20px Calibri, Carlito, 'Segoe UI', Arial, sans-serif; color: #000; background: #fff; }
.xl-grid td { border: 1px solid #e3e7eb; padding: 0 6px; overflow: hidden; text-overflow: clip; white-space: nowrap; height: 20px; position: relative; }
.xl-grid.is-client td { border-color: #eef1f4; }
.xl-grid th { background: #f3f5f7; color: var(--muted); font-weight: 500; font-size: 11px; border: 1px solid #dde2e7; position: sticky; top: 0; z-index: 2; padding: 0 4px; height: 20px; }
.xl-grid th.row-head { position: sticky; left: 0; top: auto; z-index: 1; text-align: center; }
.xl-grid th.corner { left: 0; z-index: 3; }
.xl-grid td.is-picked { outline: 2px solid var(--formula); outline-offset: -2px; z-index: 1; }
.xl-grid th.is-hidden, .is-hidden-row th.row-head { background: #f8d9d3; color: var(--stop); }
.xl-grid th em { font-style: normal; font-size: 10px; }
.is-hidden-row td, td.is-hidden-col { background: repeating-linear-gradient(-45deg, #fde9e5, #fde9e5 6px, #fbd9d2 6px, #fbd9d2 12px) !important; color: #8d2b1d !important; }
td.has-formula::after { content: ''; position: absolute; right: 0; bottom: 0; border-style: solid; border-width: 0 0 7px 7px; border-color: transparent transparent var(--formula) transparent; }
td.has-note::before { content: ''; position: absolute; right: 0; top: 0; border-style: solid; border-width: 0 8px 8px 0; border-color: transparent #d12a1c transparent transparent; }
td.has-link { text-decoration: underline; text-decoration-color: #9db4d6; }

/* Right pane */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.results-head h3 { font-size: 15px; color: var(--navy); }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.pill-ok { background: var(--accent-bg); color: var(--accent); }
.group { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; border-left: 4px solid var(--line); }
.group h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 4px; }
.group-keep { border-left-color: var(--accent); }
.group-out { border-left-color: #d9604f; }
.group-warn { border-left-color: #d9a21b; }
.stat { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; font-size: 12.5px; line-height: 1.35; }
.stat b { flex: none; min-width: 48px; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--navy); }
.stat span { color: var(--muted); }
.stat.is-zero b { color: var(--faint); font-weight: 600; }
.unsupported { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; margin: 4px 0 0; }
.blockers { background: var(--stop-bg); border: 1px solid var(--stop-line); color: var(--stop); border-radius: 10px; padding: 12px 14px; }
.blockers h3 { font-size: 14px; margin-bottom: 4px; }
.blockers ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }

.success { text-align: center; padding: 8px 4px; }
.success-mark { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 700; margin: 4px auto 12px; box-shadow: 0 0 0 7px var(--accent-bg); }
.success h3 { font-size: 20px; color: var(--navy); margin-bottom: 6px; }
.file-line { font-weight: 600; font-size: 13px; word-break: break-word; margin: 0 0 2px; }
.verified { text-align: left; background: #fff; border: 1px solid var(--accent-line); border-radius: 10px; padding: 10px 12px; margin: 14px 0; }
.verified h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); margin-bottom: 4px; }
.verified ul { list-style: none; margin: 0; padding: 0; }
.verified li { font-size: 13px; padding: 4px 0 4px 22px; position: relative; }
.verified li.ok::before { content: '✓'; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.verified li.bad::before { content: '!'; position: absolute; left: 4px; color: var(--stop); font-weight: 700; }
.success-actions { display: grid; }

.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 700px; gap: 48px; align-items: center; }
.result-shot { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(22,50,79,0.12); background: #fff; line-height: 0; }
.result-shot img { width: 100%; height: auto; }

/* ---------- Excel task pane (narrow) ---------- */
.pane { background: #fff; }
.pane header { padding: 14px 14px 12px; background: var(--navy); color: #fff; }
.pane header .brand { color: #fff; font-size: 15px; margin-bottom: 4px; }
.pane header h1 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.pane header p { color: #c8d6e4; font-size: 12.5px; margin: 0; }
.pane main { padding: 14px 14px 28px; }
.pane h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pane .sheets { border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow: auto; }
.sheet { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 14px; }
.sheet:last-child { border-bottom: 0; }
.sheet input { width: 16px; height: 16px; accent-color: var(--navy); }
.sheet-name { flex: 1; }
.hidden-sheet { color: var(--faint); cursor: not-allowed; background: #f8f9fb; }
.pane .actions { display: flex; gap: 8px; margin: 14px 0 8px; flex-wrap: wrap; }
.pane .actions button { width: auto; flex: 1 1 auto; padding: 8px 12px; border-radius: 8px; border: 1px solid #b9c6d3; background: #fff; color: var(--navy); font-weight: 600; cursor: pointer; }
.pane .actions button.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.pane .actions button:disabled { opacity: 0.45; cursor: not-allowed; }
button.link { border: 0; padding: 0; background: none; color: var(--navy-2); text-decoration: underline; font-size: 13px; cursor: pointer; }
.pane .report { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; background: #fff; }
.report h3 { font-size: 15px; color: var(--navy); margin-bottom: 2px; }
.report .summary { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.left-out { font-size: 13px; background: var(--stop-bg); border: 1px solid var(--stop-line); border-radius: 8px; padding: 7px 10px; margin-bottom: 10px; }
.left-out.none { background: var(--accent-bg); border-color: var(--accent-line); }
.left-out span { font-weight: 700; }
.grid-wrap { overflow: auto; max-height: 280px; border: 1px solid var(--line); border-radius: 6px; }
.grid { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.grid td { border: 1px solid var(--line-soft); padding: 2px 8px; }
.excluded, .always { font-size: 13px; color: var(--muted); }
.always ul { margin: 4px 0; padding-left: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .app-body { grid-template-columns: 260px minmax(0, 1fr); height: auto; }
  .pane-center { height: 600px; grid-column: 2; grid-row: 1; }
  .pane-left { grid-row: 1; }
  .pane-right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .result-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-row, .two, .compare, .cards.three { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero h1 { font-size: 32px; }
  .topbar nav a:not(.btn) { display: none; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .app-body { grid-template-columns: minmax(0, 1fr); }
  .pane-center { grid-column: 1; grid-row: auto; height: 460px; }
  .pane-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero h1 { font-size: 28px; }
  .brand span { font-size: 14px; }
  .steps li { font-size: 12px; padding: 5px 9px; }
  .view-bar { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
