/* Self-hosted Inter variable font (weights 100-900 in one file).
   Registered under BOTH names: the UI stack uses "InterVariable", while the PDF/iframe
   markup and any legacy rule reference "Inter" — one file, no silent fallback. */
@font-face {
  font-family: "InterVariable";
  src: url("/static/fonts/InterVariable.woff2?v=2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2?v=2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0d1117; --panel: #161b22; --field: #0d1117; --border: #21262d; --text: #e6edf3;
  --muted: #9aa5b1; --accent: #58a6ff; --up: #3fb950; --down: #f85149;
  --live: #3fb950; --snap: #d29922;
  /* type scale — one ladder used everywhere (secondary text stays small, tables dense) */
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13.5px; --fs-lg: 15px; --fs-xl: 17px;
  --lh-tight: 1.35; --lh-body: 1.5;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/var(--lh-body) "InterVariable", "Inter", -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
html { scroll-behavior: smooth; }
h1, h2, h3 { line-height: var(--lh-tight); }
.num, td.num, .kpi-v, .fsum-v, .qbar-total, .tot-line b, .price-cell, .t, .hbar-v, .score-n, .cg-unit b, .pr-rate, .pc-price { font-variant-numeric: tabular-nums; }

/* ── Light theme (JarvisLabs-platform style) ── */
body.light {
  color-scheme: light;
  --bg: #f6f7fa; --panel: #ffffff; --field: #ffffff; --border: #dfe4ea; --text: #17202a; --muted: #5f6b78;
  --accent: #2160e6; --up: #0a8a3a; --down: #d44747;
  --live: #0a8a3a; --snap: #8a5a00;   /* amber/green chips readable on white (was ~2.9:1) */
}
body.light .cc-panel, body.light .card { box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04); }
body.light .disc-badge { color: #1a7f37; background: rgba(46,160,67,.14); }
body.light .best-badge { background: #1a7f37; color: #fff; }
body.light .plan-card, body.light .term-card, body.light .cart-item, body.light .sel-hero,
body.light .pc-empty, body.light .cart-empty, body.light .tot-rows { background: #fff; }
body.light .plan-card.selected { background: #f0f5ff; }
body.light .term-card.selected { background: #f0f5ff; }
body.light .sel-hero { background: #eef4ff; border-color: #c4d7fb; }
body.light .grand-total { background: #e9f7ef; border-color: #b9e3c8; }
body.light .grand-total span, body.light .grand-total i { color: #4b5a68; }
body.light .toast { background: #fff; }
body.light .chip-btn { background: #fff; }
body.light .chip-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
body.light .ghost-btn { background: #fff; }
body.light .fx, body.light .controls input, body.light .controls select,
body.light .cc-field input, body.light .cc-field select, body.light .digest-actions select,
body.light .stepper input, body.light .stepper button { background: #fff; }
body.light .sec-head, body.light .digest .card { background: #fff; }

header { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--border); gap: 16px; flex-wrap: wrap; row-gap: 8px; }
header > div:first-child { min-width: 210px; }   /* title side keeps room for logo + name */
h1 { margin: 0; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; }
.brand-icon { height: 32px; width: 32px; object-fit: cover; object-position: left center; border-radius: 7px; flex: none; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* header control cluster — one compact segmented pill bar */
.hdr-right { display: flex; align-items: center; gap: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px 4px; }
.hdr-item { flex-shrink: 0; background: transparent; border: none; border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; position: relative; }
.hdr-item:hover { background: var(--bg); }
.hdr-item + .hdr-item::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--border); }
.hdr-item:hover::before { opacity: 0; }
#currBtn.active-currency { color: var(--up); }
#currBtn.active-currency::after { content: "•"; margin-left: 5px; color: var(--up); }
.fx { font-variant-numeric: tabular-nums; }
.upd { color: var(--muted); font-size: 12.5px; cursor: default; }
#refreshBtn:disabled { opacity: .7; cursor: wait; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#qtyWarn { color: #e0a23c; }
#qtyWarn:empty { display: none; }
button { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; cursor: pointer; font-weight: 600; }
button:hover { border-color: var(--accent); }
#currBtn { min-width: 76px; }
#currBtn.active-currency { border-color: var(--up); color: var(--up); }
.alt-price { color: var(--muted); font-size: 12.5px; }
.primary-price { font-weight: 400; }   /* uniform weight — no bold/regular mix inside tables */

#tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 22px 14px; }   /* wrap — 5 tabs overflow a 390px phone and used to force a 472px page width */
.tab { border-radius: 10px; padding: 9px 18px; color: var(--muted); font-size: 13.5px; }   /* complete box — all four corners rounded, fully visible */
.tab.active { color: #fff; background: var(--accent); border-color: var(--accent); }   /* accent fill — consistent with active chips */
.tab.active .badge { background: #fff; color: #1f6feb; }   /* accent-on-white was 2.5:1 */
.badge { background: var(--accent); color: #001328; border-radius: 8px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.pill { white-space: nowrap; }

.controls { display: flex; gap: 12px; align-items: flex-end; padding: 12px 22px; flex-wrap: wrap; }
.filter { display: flex; flex-direction: column; gap: 4px; }
.filter.grow { flex: 1; min-width: 220px; }
.filter label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.controls input, .controls select { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; height: 40px; }
.controls input { min-width: 220px; width: 100%; }
.controls select { min-width: 150px; }
.count { color: var(--muted); font-size: 12.5px; padding-bottom: 7px; }
.reset { padding: 0 16px; color: var(--muted); height: 40px; border-radius: 8px; font-size: 13.5px; }   /* matches the filter boxes beside it */
.reset:hover { color: var(--down); border-color: var(--down); }

section { padding: 0 22px 10px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: transparent; border: 1px solid var(--border); border-radius: 10px; }
#gpuTable, #infTable { table-layout: fixed; }   /* locked column widths — no wobble between renders */
#gpuTable th:nth-child(1), #infTable th:nth-child(1) { width: 10%; }
#gpuTable th:nth-child(2) { width: 11%; }
#gpuTable th:nth-child(3) { width: 7%; }
#gpuTable th:nth-child(4) { width: 12%; }
#gpuTable th:nth-child(5) { width: 15%; }
#gpuTable th:nth-child(6) { width: 11%; }
#gpuTable th:nth-child(7) { width: 9%; }
#gpuTable th:nth-child(8) { width: 10%; }
#gpuTable th:nth-child(9) { width: 15%; }
#infTable th:nth-child(2) { width: 22%; }
#infTable th:nth-child(3) { width: 10%; }
#infTable th:nth-child(4) { width: 10%; }
#infTable th:nth-child(5) { width: 10%; }
#infTable th:nth-child(6) { width: 10%; }
#infTable th:nth-child(7) { width: 8%; }
#infTable th:nth-child(8) { width: 9%; }
#infTable th:nth-child(9) { width: 11%; }
#gpuTable td:nth-child(3), #gpuTable td:nth-child(7),
#infTable td:nth-child(3), #infTable td:nth-child(7), #infTable td:nth-child(8), #infTable td:nth-child(9) { white-space: nowrap; }
#gpuTable td:nth-child(6), #infTable td:nth-child(4), #infTable td:nth-child(5), #infTable td:nth-child(6) { white-space: nowrap; }
#gpuTable td:nth-child(9), #infTable td:nth-child(9) { white-space: nowrap; }
#gpuTable td:nth-child(5) { overflow: hidden; }   /* a too-long pill must never bleed into the price cell */
#gpuTable td:nth-child(4) { word-break: break-word; }   /* long region lists wrap instead of clipping */
#gpuTable .pill, #infTable .pill { font-size: 11px; padding: 1px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* headers may wrap to a second line — keeps their right edge aligned with the data at every width */
thead th { text-align: left; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--border); user-select: none; background: var(--panel); }
thead th[data-sort] { cursor: pointer; }
thead th[data-sort]:hover { color: var(--text); }
thead th.num { text-align: right; }
thead th .th-sub { display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--muted); }
th.sorted .th-sub { color: var(--accent); }
#gpuTable thead th, #infTable thead th { white-space: normal; position: sticky; top: 0; z-index: 5; }   /* headers stay visible while scrolling long tables */
#gpuTable thead th:first-child, #infTable thead th:first-child { border-top-left-radius: 10px; }
#gpuTable thead th:last-child, #infTable thead th:last-child { border-top-right-radius: 10px; }
#gpuTable tbody tr:last-child td:first-child, #infTable tbody tr:last-child td:first-child { border-bottom-left-radius: 10px; }
#gpuTable tbody tr:last-child td:last-child, #infTable tbody tr:last-child td:last-child { border-bottom-right-radius: 10px; }
tbody td { padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: var(--fs-md); background: var(--panel); vertical-align: top; }
#gpuTable tbody tr:hover td, #infTable tbody tr:hover td { background: rgba(88, 166, 255, .06); }   /* row tracking, theme-safe */
th.sorted { color: var(--accent); }
th.sorted::after { content: " ↑"; }
th.sorted.desc::after { content: " ↓"; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* price-change flash: a ::before overlay whose BASE state is opacity 0 — the animation only
   lifts it briefly. If the animation is canceled/interrupted (tab throttle, re-render), the
   overlay falls back to invisible by construction: it can never stick, lag, or fight the row
   hover highlight (the glitch on the price column the user kept hitting). */
.price-cell { position: relative; }
.price-cell.flash-up::before, .price-cell.flash-down::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  animation: flashFade .7s ease-out;
}
.price-cell.flash-up::before { background: rgba(63,185,80,.30); }
.price-cell.flash-down::before { background: rgba(248,81,73,.30); }
@keyframes flashFade { 0% { opacity: 1; } 100% { opacity: 0; } }
.price-sub { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; white-space: nowrap; }
.row-sub { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.na { color: var(--muted); font-size: var(--fs-sm); border-bottom: 1px dotted var(--border); cursor: help; }
.empty-cell { text-align: center; padding: 34px 16px !important; color: var(--muted); font-size: var(--fs-md); }
.empty-cell .btn-ghost { margin-top: 10px; }
/* skeleton rows — first paint, before /api/data lands */
tr.skel td { height: 37px; background: linear-gradient(90deg, transparent 20%, rgba(138,148,158,.09) 50%, transparent 80%) var(--panel); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; border-bottom: 1px solid var(--border); }
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -70% 0; } }

.chip { display: inline-block; border-radius: 10px; padding: 1px 7px; font-size: 12.5px; font-weight: 600; }
.chip.up { color: var(--up); background: rgba(63,185,80,.12); }
.chip.down { color: var(--down); background: rgba(248,81,73,.12); }
.chip.flat { color: var(--muted); background: rgba(139,148,158,.12); }
.chip.live { color: var(--live); background: rgba(63,185,80,.12); }
.chip.snap { color: var(--snap); background: rgba(210,153,34,.12); }
.pill { display: inline-block; background: var(--border); color: var(--muted); border-radius: 6px; padding: 1px 7px; font-size: 11px; }
a { color: var(--accent); text-decoration: none; }

#feedSection ul { list-style: none; margin: 0; padding: 0 22px 20px; max-width: 900px; }
#feedList li { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; }
#feedList .t { color: var(--muted); font-size: 12.5px; white-space: nowrap; margin-left: auto; }
#feedList .feed-body { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; }
#feedList s { opacity: .65; }
#feedList .up-t { color: var(--up); }
#feedList .down-t { color: var(--down); }
#feedList .chip { flex: none; min-width: 74px; text-align: center; }

/* ── butter-smooth pass: compositing-friendly polish (no scroll jank) ── */
#gpuTable tbody tr, #infTable tbody tr { content-visibility: auto; contain-intrinsic-size: auto 46px; }
#digestText { overscroll-behavior: contain; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
/* tab switches are instant — no entrance animation (perceived latency) */
.hint { color: var(--muted); padding: 0 22px; }

/* digest */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 0 22px 16px; }
.card h3 { margin: 0 0 10px; font-size: 13.5px; }
.digest { margin-top: 4px; }
.digest-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.digest-actions { display: flex; gap: 8px; align-items: center; }
.digest-actions select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
#digestText { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; max-height: 420px; overflow: auto; font-family: ui-monospace, Menlo, monospace; }

/* quote calculator */
.quote-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; padding: 0 22px; align-items: start; }
@media (max-width: 900px) { .quote-grid { grid-template-columns: 1fr; } }
#quoteSection .card { margin: 0; }
#quoteSection .filter { margin-bottom: 10px; }
.seg { display: flex; gap: 0; }
.segbtn { flex: 1; border-radius: 0; font-size: 12.5px; padding: 6px 8px; }
.segbtn:first-child { border-radius: 6px 0 0 6px; }
.segbtn:last-child { border-radius: 0 6px 6px 0; }
.segbtn.active { background: var(--accent); color: #001; border-color: var(--accent); }
.quote-summary { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.6; }
.quote-summary b { color: var(--accent); }
.primary-btn { background: var(--accent); color: #001; font-weight: 700; border: none; margin-bottom: 14px; }
.primary-btn:hover { filter: brightness(1.1); }
#quoteTable { font-size: 12.5px; }
#quoteTable tbody tr.you-cheapest { background: rgba(63,185,80,.10); }
#quoteTable tbody tr.you-dearer { background: rgba(248,81,73,.07); }
.muted { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.demo-banner { margin: 0 22px 12px; background: rgba(88,166,255,.10); border: 1px solid rgba(88,166,255,.35); border-radius: 8px; padding: 8px 14px; font-size: 13.5px; }
.math-line { background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 13.5px; }
.math-line .big { font-size: 18px; color: var(--accent); }
.mini-hint { color: var(--muted); font-size: 11px; margin-top: 3px; display: block; }
.pos { font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.pos.win { color: var(--up); }
.pos.lose { color: var(--down); }
.our-table { width: 100%; font-size: 12.5px; margin-top: 4px; }
.our-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.our-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.our-table td.num, .our-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

footer { color: var(--muted); font-size: 12.5px; line-height: 1.6; padding: 16px 22px 26px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); }
footer span b { color: var(--text); font-weight: 600; }
.hidden { display: none; }
.provider-name { font-weight: 600; }
#netbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), #8ec2ff); z-index: 1000; opacity: 0; transition: width .35s ease, opacity .3s ease; pointer-events: none; }
#netbar.on { opacity: 1; width: 70%; }
#netbar.done { width: 100%; opacity: 0; }

/* cost calculator flow */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-btn { background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 18px; padding: 5px 14px; font-size: 12.5px; font-weight: 600; }
.chip-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.plan-cards { display: flex; flex-direction: column; gap: 8px; }
.plan-card { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: border-color .15s; }
.plan-card:hover { border-color: var(--accent); }
.plan-card.selected { border-color: var(--accent); background: rgba(88,166,255,.08); }
.plan-card.disabled { opacity: .55; cursor: not-allowed; }
.pc-name { font-weight: 700; font-size: 13.5px; }
.pc-specs { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pc-right { text-align: right; }
.pc-price { font-weight: 700; color: var(--accent); }
.select-btn { margin-top: 4px; font-size: 12.5px; padding: 4px 12px; }
.select-btn.on { background: var(--up); color: #001; border-color: var(--up); font-weight: 700; }
.inv { display: inline-block; border-radius: 5px; padding: 1px 7px; font-size: 11px; font-weight: 700; letter-spacing: .03em; margin-left: 6px; }
.inv.low { color: var(--down); border: 1px solid var(--down); background: rgba(248,81,73,.08); }
.inv.out { color: var(--muted); border: 1px solid var(--muted); background: rgba(139,148,158,.08); }
.inv.ok { color: var(--up); }
.selplan { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; margin-bottom: 10px; }
.term-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.term-card { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px; text-align: center; cursor: pointer; }
.term-card:hover { border-color: var(--accent); }
.term-card.selected { border-color: var(--up); background: rgba(63,185,80,.10); }
.term-card.hourly { border-color: var(--up); }
.tc-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.tc-price { font-size: 15px; font-weight: 700; margin: 4px 0 2px; }
.tc-sub { font-size: 11px; color: var(--muted); }
.save-badge { position: absolute; top: -9px; right: 8px; background: var(--up); color: #001; font-size: 11px; font-weight: 700; border-radius: 8px; padding: 1px 7px; }
.stepper { display: flex; gap: 6px; align-items: center; }
.stepper button { width: 32px; font-size: 15px; padding: 2px 0; }
.stepper input { width: 60px; text-align: center; }
#cartTable { font-size: 12.5px; }
.del { background: none; border: none; cursor: pointer; font-size: 13.5px; }
table.totals { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0 12px; }
table.totals td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
table.totals tr.sep td { border-top: 2px solid var(--border); font-weight: 600; }
table.totals tr.grand td { font-weight: 800; font-size: 15px; color: var(--up); border-bottom: none; }
table.totals tr.mutedrow td { color: var(--muted); font-size: 12.5px; border-bottom: none; }
.export-row { display: flex; gap: 10px; margin-bottom: 8px; }

/* ── Cost Calculator premium redesign ── */
.cc-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; padding: 0 22px; }
@media (max-width: 1000px) { .cc-grid { grid-template-columns: 1fr; } }
.cc-panel { background: var(--panel); border: 1px solid #232b36; border-radius: 16px; padding: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.cc-side .cc-panel { position: sticky; top: 14px; }
.cc-panel-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13.5px; flex: none; }
.ph-title { font-weight: 700; font-size: 15px; }
.ph-sub { color: var(--muted); font-size: 12.5px; }
.cc-main .cc-panel { margin-bottom: 16px; }
.cc-row { display: flex; gap: 12px; }
.cc-field { flex: 1; margin-bottom: 12px; }
.cc-field.grow { flex: 2; }
.cc-field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.cc-field input, .cc-field select { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 10px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-card { position: relative; display: flex; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; transition: background-color .15s, border-color .15s; }
.plan-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(88,166,255,.12); }
.plan-card.selected { border-color: var(--accent); background: rgba(37,99,235,.07); box-shadow: 0 0 0 2px rgba(88,166,255,.25); }
.plan-card.disabled { opacity: .5; cursor: not-allowed; }
.pc-body { flex: 1; min-width: 0; }
.pc-name { font-weight: 700; font-size: 13.5px; }
.pc-specs { color: var(--muted); font-size: 11px; margin-top: 2px; }
.pc-price { font-weight: 800; color: var(--accent); font-size: 13.5px; text-align: right; white-space: nowrap; }
.pc-price span { font-size: 11px; color: var(--muted); font-weight: 400; }
.select-btn { font-size: 12.5px; padding: 9px 16px; margin-top: 4px; min-height: 34px; }
.select-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
.inv { display: inline-block; border-radius: 5px; padding: 1px 7px; font-size: 11px; font-weight: 800; letter-spacing: .04em; margin-left: 6px; }
.inv.low { color: var(--down); border: 1px solid var(--down); background: rgba(248,81,73,.10); animation: pulse 2s infinite; }
.inv.out { color: var(--muted); border: 1px solid var(--muted); }
.inv.ok { color: var(--up); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.pc-empty, .cart-empty { color: var(--muted); background: var(--bg); border: 1px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; font-size: 13.5px; }
.sel-hero { display: flex; gap: 12px; align-items: center; background: rgba(37,99,235,.06); border: 1px solid rgba(37,99,235,.30); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.sh-name { font-weight: 800; font-size: 13.5px; }
.sh-specs { color: var(--muted); font-size: 12.5px; }
.sh-price { margin-left: auto; font-weight: 800; font-size: 18px; color: var(--accent); }
.sh-price span { font-size: 11px; color: var(--muted); font-weight: 400; }
.term-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 10px; margin-bottom: 14px; }
.term-card { position: relative; background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 8px; text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.term-card:hover { border-color: var(--accent); }
.term-card.selected { border-color: var(--accent); background: rgba(37,99,235,.07); box-shadow: 0 4px 14px rgba(37,99,235,.10); }
.tc-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tc-price { font-size: 15px; font-weight: 800; margin: 5px 0 3px; }
.tc-price span { font-size: 11px; color: var(--muted); font-weight: 400; }
.tc-sub { font-size: 11px; color: var(--muted); }
.save-badge { position: absolute; top: -10px; right: 8px; background: var(--up); color: #fff; font-size: 11px; font-weight: 800; border-radius: 10px; padding: 2px 8px; }
.cta { width: 100%; background: var(--accent); color: #fff; font-weight: 800; border: none; border-radius: 10px; padding: 11px; font-size: 13.5px; cursor: pointer; }
.cta:hover { filter: brightness(1.12); }
.ghost-btn { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px; font-size: 13.5px; }
.cc-subhead { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 14px 0 8px; }
.cart-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.cart-item { display: flex; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.ci-body { flex: 1; min-width: 0; }
.ci-name { font-weight: 700; font-size: 12.5px; }
.ci-specs { color: var(--muted); font-size: 11px; margin-top: 2px; }
.ci-mo { font-weight: 800; white-space: nowrap; }
.ci-mo span { font-size: 11px; color: var(--muted); font-weight: 400; }
.del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.del:hover { color: var(--down); }
.tot-rows { margin: 4px 0; }
.tot-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13.5px; border-bottom: 1px dashed var(--border); }
.tot-row i { color: var(--muted); font-style: normal; font-size: 11px; }
.tot-row.sub { border-top: 2px solid var(--border); font-weight: 700; margin-top: 4px; padding-top: 8px; }
.grand-total { display: flex; justify-content: space-between; align-items: center; background: rgba(63,185,80,.10); border: 1px solid rgba(63,185,80,.45); border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.grand-total span { font-size: 11px; font-weight: 800; letter-spacing: .05em; color: var(--muted); display: block; }
.grand-total i { font-style: normal; font-size: 11px; color: var(--muted); display: block; margin-top: 3px; }
.gt-num { font-size: 24px; font-weight: 900; color: var(--up); letter-spacing: -.01em; }
.comp-details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; margin: 10px 0 6px; }
.comp-details table { font-size: 12.5px; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 400; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel); color: var(--text); border: 1px solid var(--up); border-radius: 10px; padding: 10px 18px; font-size: 13.5px; font-weight: 600; opacity: 0; transition: opacity .25s, transform .25s; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── simple 3-step cost calculator ── */
.qsec { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin: 0 22px 16px; }
.qsec-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.qbadge { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.qtitle { font-weight: 800; font-size: 15px; }
.qsub { color: var(--muted); font-size: 12.5px; }
.qrow { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.qfield { flex: 1; min-width: 150px; }
.qfield label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.qfield input, .qfield select, .filter input, .filter select, .sum-card input, .sum-card select {
  width: 100%; background: var(--field); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 9px 11px; font-size: 13.5px; font-family: inherit;
}
.qfield input:focus, .qfield select:focus, .filter input:focus, .filter select:focus,
.sum-card input:focus, .sum-card select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.qfield label, .filter label, .sum-card label {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; margin-bottom: 5px;
}
.qfield input[type="date"] { font-family: inherit; min-height: 38px; }
.qfield input::placeholder { color: var(--muted); opacity: .8; }
.btn-blue { background: var(--accent); color: #fff; font-weight: 800; border: none; border-radius: 8px; padding: 10px 18px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.btn-blue:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font-size: 13.5px; }
.tcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tcard { position: relative; background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 10px; text-align: center; cursor: pointer; transition: border-color .12s, background-color .12s; }
.tcard:hover { border-color: var(--accent); }
.tcard.selected { border-color: var(--accent); background: rgba(37,99,235,.06); }
.tname { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tmo { font-size: 18px; font-weight: 800; margin: 6px 0 3px; }
.tmo span { font-size: 11px; color: var(--muted); font-weight: 500; }
.tsub { font-size: 11px; color: var(--muted); }
.est-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.est-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 7px 8px; border-bottom: 2px solid var(--border); }
.est-table th.num, .est-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.est-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.est-totals { margin-top: 10px; border-top: 2px solid var(--border); padding-top: 8px; }
.tot-line { display: flex; justify-content: space-between; padding: 5px 4px; font-size: 13.5px; }
.tot-line i { color: var(--muted); font-style: normal; font-size: 11px; }
.tot-line.sub { border-top: 1px dashed var(--border); margin-top: 4px; }
.tot-line.config-line { color: var(--muted); font-size: 12.5px; border-top: 1px dashed var(--border); margin-top: 6px; }
.tot-line.config-line b { color: var(--text); }
/* grand total: SAME font + size as the lines above (uniform strip), emphasised by weight and the
   accent-blue rule — user: green 16px/800 broke the visual consistency of the totals block */
.tot-line.grand { font-size: 13.5px; font-weight: 700; color: var(--accent); border-top: 2px solid var(--accent); margin-top: 4px; padding-top: 8px; }

/* ── Cost Calculator v2 (JarvisLabs-style) ── */
.cc2 { display: flex; flex-direction: column; gap: 16px; padding: 0 22px; }
.cc2-main { display: flex; flex-direction: column; gap: 14px; }
.cc2-sec { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.quote-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; align-items: start; }
.cc2-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cc2-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.qn { width: 26px; height: 26px; border-radius: 50%; background: #1f6feb; color: #fff; font-weight: 800; font-size: 12.5px; display: flex; align-items: center; justify-content: center; flex: none; }   /* #1f6feb: white text passes contrast on the fill */
.plan-list { display: flex; flex-direction: column; gap: 8px; }
.plan-list .plan-card { background: var(--bg); }
.plan-list .plan-card.selected { background: rgba(37,99,235,.06); }
.qty-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.qty-pills { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.pill-btn { background: transparent; border: none; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.pill-btn.active { background: var(--accent); color: #fff; }
.qty-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.qty-meta b { color: var(--text); font-size: 13.5px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.price-card { background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; transition: border-color .12s, background-color .12s; position: relative; }
.price-card:hover { border-color: var(--accent); }
.price-card.selected { border-color: var(--accent); background: rgba(37,99,235,.06); }
.pr-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; }
.disc-badge { background: rgba(63,185,80,.18); color: #3ddc70; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 2px 7px; }
.best-badge { background: #1f883d; color: #fff; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 2px 7px; margin-left: 4px; }
.pr-rate { font-size: 18px; font-weight: 800; margin: 8px 0 4px; }
.pr-rate span { font-size: 11px; color: var(--muted); font-weight: 500; }
.pr-sub { font-size: 11px; color: var(--up); min-height: 15px; }
.store-pills { display: flex; gap: 8px; flex-wrap: wrap; }
#storeCustom {
  width: 180px; margin-top: 8px; background: var(--field); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 8px 11px; font-size: 13.5px; font-family: inherit;
}
#storeCustom:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.store-pill { background: var(--bg); border: 1.5px solid var(--border); color: var(--text); border-radius: 10px; padding: 7px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.store-pill.active { border-color: var(--accent); background: rgba(37,99,235,.07); color: var(--accent); }
.store-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 18px; flex-wrap: wrap; margin-bottom: 8px; }
.store-grid.store-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.store-grid.store-grid-3 .qfield { margin: 0; }
.net-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.net-row b { font-size: 13.5px; }
.hint-sm { color: var(--muted); font-size: 11px; margin-top: 4px; }
.hidden { display: none; }
.custom-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.custom-row input { width: 130px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 7px 10px; }
.custom-row select { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 7px 8px; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.sum-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
/* spec pairs stay tight on ANY screen width: 3 columns, whole grid capped —
   no stretched cells on ultra-wide monitors, no orphan items */
#sumRows, #sumRates { display: flex; flex-wrap: wrap; gap: 6px 44px; max-width: 1240px; }
#sumRows .sum-row, #sumRates .sum-row { width: min(280px, 100%); }
#sumRates .sum-row.total { width: 100%; justify-content: space-between; }
.sum-v { white-space: normal; }
.sum-title { font-weight: 800; font-size: 13.5px; margin-bottom: 10px; }
.sum-row { display: flex; gap: 8px; padding: 4px 0; font-size: 12.5px; align-items: center; }
.sum-ic { font-size: 12.5px; width: 18px; }
.sum-k { color: var(--muted); flex: none; }
.sum-v { font-weight: 600; text-align: left; white-space: nowrap; }
.sum-v .sum-per { color: var(--muted); font-weight: 400; font-size: 11px; }
.sum-hint { color: var(--muted); font-size: 12.5px; padding: 6px 0 2px; }
.sum-row.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; justify-content: space-between; }
.sum-row.total .sum-k { flex: 1; }
.sum-row.total .sum-v { text-align: right; }
.sum-row.total .sum-v { font-size: 13.5px; font-weight: 700; color: var(--accent); }
.sum-div { border-top: 1px dashed var(--border); margin: 6px 0; }
.cc2-wide { padding: 0 22px; }
.cc2-wide .est-table { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.est-table .del { min-width: 30px; min-height: 30px; border-radius: 8px; }
.est-table .del:hover { background: rgba(248,81,73,.12); }
/* NOTE: no hover tooltips on the cart action buttons — every anchoring (native title, above,
   below) clipped or covered something in some scroll/viewport position. The icons are
   self-explanatory and aria-labels carry accessibility. */

/* sticky quote action bar — the single Add control + running total, product-grade */
.quote-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 0 22px calc(0px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgba(0,0,0,.28);
}
.qbar-inner {
  max-width: 1400px; margin: 0 auto; min-height: 64px;
  display: flex; align-items: center; gap: 22px;
}
.qbar-recap { color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.qbar-total-block { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.qbar-total-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.qbar-total { font-size: 18px; font-weight: 800; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qbar-total:empty::before { content: "—"; opacity: .4; }
.quote-bar .btn-blue { flex: none; padding: 11px 22px; font-size: 13.5px; }
.quote-bar .btn-blue:focus, .quote-bar .btn-blue:focus-visible { outline: none; }
@media (max-width: 640px) { .qbar-recap { display: none; } .qbar-total-block { margin-left: auto; align-items: flex-end; } .qbar-total { font-size: 15px; } }
/* the fixed bar must never cover the last row of the quote flow or the site footer */
#quoteSection { padding-bottom: 92px; }
body.qbar-on footer { padding-bottom: 96px; }
.est-table td { font-variant-numeric: tabular-nums; }
/* toasts sit above the sticky quote bar, not on top of it */
.toast { bottom: 96px; }
/* reserved-IP checkbox: same accent language as the rest of the form, comfortable target */
.ip-line input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); flex: none; cursor: pointer; }

/* light-mode table & badge polish */
body.light th { background: #f4f6f8; color: #43506b; border-bottom: 1px solid #d9dee5; }
body.light tbody tr:hover td { background: #f6f9fc; }
body.light .pill { border: 1px solid #dfe4ea; color: #43506b; }
body.light .badge { background: #2160e6; color: #fff; font-weight: 700; }
body.light .demo-banner { background: #eef4ff; border-color: #c4d7fb; }

.crow { display: flex; gap: 8px; margin-top: 8px; }
.crow.hidden { display: none; }
.crow input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 10px; }
.crow select { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 8px; }

/* large-cluster box: aligned 2-column form grid (labels | controls) */
.cluster-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 14px; margin-top: 12px; align-items: center; }
.cg-lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cg-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.cluster-grid .chips { margin-bottom: 0; }
#nodeCount { flex: 0 0 90px; width: 90px; min-width: 0; text-align: center; font-weight: 700; height: 31px; padding: 0 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; color: var(--text); font-family: inherit; font-size: 12.5px; }
#nodeCount:focus { outline: none; border-color: var(--accent); }
.cc2 input[type="number"]::-webkit-inner-spin-button, .cc2 input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cc2 input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.cg-unit { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cg-unit b { color: var(--text); }
.cluster-grid .chip-btn { padding: 6px 13px; }

/* segmented control (Interconnect) — visible track so both options read as one component */
.seg { display: inline-flex; align-items: stretch; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; width: max-content; max-width: 100%; }
.seg .pill-btn { padding: 5px 14px; border-radius: 7px; white-space: nowrap; }
.seg .pill-btn:hover:not(.active) { color: var(--text); background: rgba(128,128,128,.14); }

/* custom rate box + switch */
.custom-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 4px; }
.checkline { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 13.5px; }
.ip-line { flex-wrap: wrap; }
.ip-line label[for="ipReserved"] { flex: 1; min-width: 220px; cursor: pointer; }
.ip-qty-wrap { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.ip-qty-wrap.hidden { display: none; }
.ip-qty-wrap input { width: 64px; height: 30px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-align: center; font-weight: 700; font-family: inherit; }
.ip-qty-wrap input:focus { outline: none; border-color: var(--accent); }
.checkline > input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); cursor: pointer; }
.checkline b { font-size: 13.5px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 22px; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }

.store-lbl { font-size: 12.5px; font-weight: 700; color: var(--text); margin: 8px 0 8px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; align-items: end; }
.store-grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.root-add-field { max-width: 480px; margin-top: 12px; }
.root-add-field label { text-transform: none; letter-spacing: 0; font-size: 11px; }
.root-total { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.root-total b { color: var(--text); }
.store-lbl-sub { margin-top: 14px; color: var(--muted); font-weight: 600; font-size: 11px; }
.store-grid .qfield label { text-transform: none; letter-spacing: 0; font-size: 11px; }
.st-rate { color: var(--up); font-weight: 700; }

/* ── UI/UX polish: micro-interactions & consistency ──
   NOTE: no `transform` in transitions and no hover lifts on cards — when scrolling,
   content passes under a stationary cursor and hover-lifts made cards visibly shift
   mid-scroll (read as "the two columns scroll differently") plus constant style
   recalcs caused real scroll lag. Color/border transitions only. */
.chip-btn, .pill-btn, .store-pill, .price-card, .plan-card, .term-card, .tab,
.select-btn, .btn-blue, .btn-ghost, .del, .reset, button {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tab:focus:not(:focus-visible) { outline: none; }   /* mouse clicks: no ring (active fill is the indicator) */
.tab:focus-visible, .tab.active:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }   /* keyboard: clear ring */
table { border-radius: 10px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* competitor check — family banner rows */
#quoteTable .fam-sep td { background: var(--panel); font-weight: 700; font-size: 11px; letter-spacing: .03em; color: var(--text); }

/* ── Prospect Radar ─────────────────────────────────────────────── */
.pros-intro { padding: 0 22px 10px; margin: 0; }
/* tables get a scroll wrapper only when they genuinely overflow — on wide screens the
   wrapper stays overflow:visible so position:sticky headers keep working against the page */
.table-scroll { margin: 0 22px 14px; border: 1px solid var(--border); border-radius: 10px; }
.table-scroll table { border: none; border-radius: 0; }
@media (max-width: 860px) {
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll #gpuTable { min-width: 700px; }
  .table-scroll #infTable { min-width: 860px; }
  .table-scroll #prosTable { min-width: 1080px; }
}
.table-scroll { position: relative; }
@media (max-width: 860px) and (pointer: coarse) {
  /* swipe hint rides along at the bottom of the scrollable table (sticky inside the scroller) */
  .table-scroll::after { content: "swipe →"; position: sticky; bottom: 4px; display: block; width: max-content; margin-left: auto; margin-right: 6px; padding: 2px 9px; font-size: 11px; color: var(--muted); background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--border); border-radius: 999px; pointer-events: none; }
}
#prosTable { table-layout: fixed; width: 100%; min-width: 1080px; }
#prosTable th:nth-child(1) { width: 4%; }   /* rank */
#prosTable th:nth-child(2) { width: 16%; }  /* company */
#prosTable th:nth-child(3) { width: 5%; }   /* tier */
#prosTable th:nth-child(4) { width: 8%; }   /* score */
#prosTable th:nth-child(5) { width: 9%; }   /* signals */
#prosTable th:nth-child(6) { width: 12%; }  /* funding */
#prosTable th:nth-child(7) { width: 12%; }  /* buyer */
#prosTable th:nth-child(8) { width: 14%; }  /* next action */
#prosTable th:nth-child(9) { width: 7%; }   /* researched */
#prosTable th:nth-child(10) { width: 13%; } /* outreach — must fit 3 mini buttons */
#prosTable td { padding: 9px 10px; font-size: 13.5px; }
#prosTable .muted { font-size: 11px; }
#prosTable td:nth-child(8), #prosTable td:nth-child(9) { word-wrap: break-word; }
#prosTable .sig-cell { white-space: normal; line-height: 1.5; font-size: 12.5px; letter-spacing: .5px; }  /* emoji wrap inside the fixed cell instead of painting outside it */
#prosTable td:last-child, #prosTable th:last-child { white-space: nowrap; }
#prosTable .mini-btn { min-width: 28px; min-height: 24px;  padding: 3px 7px; }
.pros-dash-wrap { padding: 0 22px 14px; }
.pros-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 10px; font-weight: 400; appearance: none; -webkit-appearance: none; }
.kpi-on { border-color: var(--accent); color: var(--text); }
.kpi-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.pros-charts { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; margin-bottom: 14px; }
.chart-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.chart-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut-wrap svg { width: 104px; height: 104px; flex: none; }
.donut-big { fill: var(--text); font-size: 24px; font-weight: 700; }
.donut-sub { fill: var(--muted); font-size: 11px; }
.d-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.d-leg { display: flex; align-items: center; gap: 6px; }
.d-leg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hbar { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 12.5px; }
.hbar-l { width: 92px; flex: none; color: var(--muted); }
.hbar-t { flex: 1; height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.hbar-t i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.hbar-v { width: 22px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hist { display: flex; align-items: flex-end; gap: 10px; height: 108px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.vbar i { display: block; width: 100%; max-width: 34px; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; }
.vbar-v { font-size: 11px; font-weight: 700; color: var(--muted); }
.vbar-l { font-size: 11px; color: var(--muted); }
.tier-a { color: var(--up); background: rgba(63,185,80,.14); }
.tier-b { color: var(--snap); background: rgba(210,153,34,.14); }
.tier-c { color: var(--muted); background: rgba(139,148,158,.14); }
.chip.warn { color: var(--snap); background: rgba(210,153,34,.14); font-size: 11px; }
#prosTable td { vertical-align: top; }
#prosTable .rank { color: var(--muted); font-weight: 700; }
#prosTable .row-link { font-size: 12.5px; }
.score-n { font-weight: 700; font-size: 15px; }
.score-bar { width: 64px; height: 4px; background: var(--border); border-radius: 2px; margin: 3px 0 2px; overflow: hidden; }
.score-bar.wide { width: 100px; }
.score-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.prio { display: block; font-size: 11px; }
.sig-cell { white-space: nowrap; font-size: 13.5px; letter-spacing: 2px; }
.sig { cursor: default; }
.na-cell { font-size: 12.5px; max-width: 220px; }
.act-cell { white-space: nowrap; }
.mini-btn { min-width: 28px; min-height: 24px;  padding: 3px 8px; font-size: 12.5px; border-radius: 7px; appearance: none; -webkit-appearance: none; }
.up-t { color: var(--up); }
/* drawer */
.pros-backdrop { position: fixed; inset: 0; background: rgba(1,4,9,.55); z-index: 40; }
.pros-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); background: var(--panel); border-left: 1px solid var(--border); z-index: 41; overflow-y: auto; }
.pd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.pd-head h3 { margin: 0 0 2px; font-size: 18px; }
.pd-domain { font-size: 12.5px; }
.pd-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; font-size: 12.5px; }
.pd-close { border: none; background: transparent; color: var(--muted); font-size: 15px; padding: 4px 8px; }
.pd-close:hover { color: var(--down); }
.pd-body { padding: 14px 18px 30px; }
.pd-sec { margin-bottom: 16px; }
.pd-sec-t { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 7px; }
.sig-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sig-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 3px 10px; font-size: 12.5px; }
.pd-angle { margin: 0; border-left: 3px solid var(--accent); padding: 6px 12px; background: var(--bg); border-radius: 0 8px 8px 0; font-size: 13.5px; }
.pd-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 13.5px; }
.pd-facts > div { display: flex; flex-direction: column; gap: 2px; }
.pd-fact { font-size: 12.5px; margin-bottom: 8px; line-height: 1.5; word-break: break-word; }
.pd-fact b { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.pd-src { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.pd-src a { word-break: break-all; }
.pd-src summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
/* draft modal */
.draft-overlay { position: fixed; inset: 0; background: rgba(1,4,9,.55); z-index: 50; display: flex; align-items: center; justify-content: center; }
.draft-overlay.hidden { display: none; }
.draft-card { width: min(660px, 94vw); max-height: 90vh; display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.draft-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.draft-head h3 { margin: 0; font-size: 15px; }
.draft-tabs { display: flex; gap: 8px; align-items: center; }
.draft-subject { background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
#draftText { flex: 1; min-height: 260px; background: var(--field); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.draft-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* UI audit — tap-target hit areas: padding-only enlargement for small table links
   (no layout shift: negative margins cancel the added padding) */
#gpuTable tbody td a, #infTable tbody td a, #prosTable .row-link {
  display: inline-block; padding: 5px 8px; margin: -5px -8px;
}

body.light .pros-backdrop, body.light .draft-overlay { background: rgba(22,27,34,.4); }
@media (max-width: 1100px) { .pros-kpis { grid-template-columns: repeat(3, 1fr); } .pros-charts { grid-template-columns: 1fr; } }

/* accessibility: honour the OS reduced-motion setting */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* stale-build reload prompt (appears only when a deploy lands mid-session) */
.upd-banner {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 10px 20px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); font-family: inherit;
}
.upd-banner:hover { filter: brightness(1.08); }

/* ═══ 27 Oct 2026 polish pass ═══ */

/* source failures — partial data is never silent */
.src-errors { margin: 10px 22px 0; border: 1px solid color-mix(in srgb, var(--snap) 45%, transparent); background: color-mix(in srgb, var(--snap) 10%, transparent); border-radius: 10px; padding: 9px 14px; font-size: var(--fs-md); }
.src-errors .src-err-line { font-weight: 600; color: var(--text); }
.src-errors details { margin-top: 4px; }
.src-errors summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); }
.src-err-list { margin: 6px 0; padding-left: 18px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; }
.upd.stale { color: var(--snap); font-weight: 600; }

/* ── Price Alerts: summary cards + filters; raw digest demoted to a collapsible ── */
.feed-intro { margin: 0 22px 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 980px; }
.feed-summary { padding: 4px 22px 12px; }
.fsum-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.fsum-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.fsum-v { font-size: 24px; font-weight: 700; line-height: 1.2; }
.fsum-l { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.fsum-card.up .fsum-v { color: var(--up); }
.fsum-card.down .fsum-v { color: var(--down); }
.fsum-card.major .fsum-v { color: var(--snap); }
.fsum-provs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fsum-empty { color: var(--muted); background: var(--panel); border: 1px dashed var(--border); border-radius: 10px; padding: 14px; font-size: var(--fs-md); }
.digest.card { margin-top: 10px; }
.digest.card > summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-weight: 700; font-size: var(--fs-md); list-style: none; }
.digest.card > summary::-webkit-details-marker { display: none; }
.digest.card > summary::before { content: "▸"; color: var(--muted); transition: transform .15s ease; display: inline-block; }
.digest.card[open] > summary::before { transform: rotate(90deg); }
.digest-range { font-weight: 400; font-size: var(--fs-sm); }
.digest-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 10px 0 8px; }
.major-chip { font-size: 11px; font-weight: 700; color: var(--snap); border: 1px solid color-mix(in srgb, var(--snap) 55%, transparent); border-radius: 6px; padding: 0 5px; margin-left: 4px; }
li.feed-empty { color: var(--muted); display: block; text-align: center; padding: 18px; }
li.feed-empty .btn-ghost { margin-top: 8px; }
@media (max-width: 700px) {
  #feedList li { flex-wrap: wrap; }
  #feedList .t { margin-left: 0; width: 100%; padding-left: 2px; }
}

/* ── Prospect Radar additions ── */
.dash-note { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.dash-note b { color: var(--text); }
#prosTable .mini-btn { min-width: 30px; min-height: 28px; }
.warn-text { color: var(--down) !important; font-weight: 600; }

/* quote cart: edit + delete actions */
.est-table .row-actions { white-space: nowrap; text-align: right; vertical-align: middle; }
/* buttons are 30px inline-blocks — without vertical-align they ride the text baseline and
   float at different heights between rows with 1-line vs 2-line descriptions (user report) */
.est-table .row-actions .del { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }

/* chips inside dark summary pill bar keep dark theme colors */
.hdr-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 999px; }

/* ════════════ AI assistant (GLM 5.3 Flash) ════════════ */
/* Launcher — fixed bottom-right; panel never blocks site controls (non-modal companion) */
#aiLauncherWrap { position: fixed; right: 22px; bottom: 22px; z-index: 48; }
/* 48: ABOVE the panel (47) — with the panel open the launcher must stay clickable so
   "Ask AI" toggles it closed; it sits over the panel's foot corner (was z 46 = covered,
   clicks hit the panel and the visitor could not minimise the assistant — 28 Oct report) */
/* 28 Oct: while the panel is open the launcher pill HIDES — it used to float over the
   panel's footer note (z-fight confusion) and, before that, sat dead underneath it.
   Close affordances while open: header ✕, header –, click on the title bar, Escape. */
body.ai-open #aiLauncherWrap { display: none !important; }
.ai-launcher.is-open { border-style: dashed; }
.ai-head { cursor: pointer; }
.ai-min { font-size: 15px; line-height: 1; }
/* hard kill switch (?noai=1): removes every AI affordance from the page */
html.ai-killed #aiLauncherWrap, html.ai-killed .ai-panel, html.ai-killed .ai-entry,
html.ai-killed .ai-explain, html.ai-killed #aiQuoteStrip { display: none !important; }
.ai-launcher {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); color: var(--text); border: 1px solid var(--accent);
  border-radius: 22px; padding: 10px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.ai-launcher:hover { border-color: var(--text); }
.ai-launcher [aria-hidden] { color: var(--accent); font-size: 15px; }
.ai-launcher:focus-visible, .ai-icon-btn:focus-visible, .ai-send:focus-visible,
.ai-copy:focus-visible, .ai-sug:focus-visible, .ai-explain:focus-visible,
.ai-apply:focus-visible, .ai-entry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ai-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 47;
  width: min(420px, calc(100vw - 24px)); height: min(600px, calc(100vh - 48px));
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  overflow: hidden;
}
/* 28 Oct ROOT CAUSE of "cannot minimize": .ai-panel (display:flex, line above) and
   .hidden (display:none, top of file) have EQUAL specificity — the later .ai-panel
   rule won, so the hidden class never visually hid the panel. Every close path
   (–, ✕, Esc, click-outside, title-bar) added .hidden correctly, CSS ignored it,
   and the 500ms reconciler then saw a visible panel and re-flagged AI.open=true.
   Paired selector + !important = cannot lose. */
.ai-panel.hidden { display: none !important; }
body.qbar-on .ai-panel, body.qbar-on #aiLauncherWrap { bottom: 84px; }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.ai-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: 0 0 auto; }
.ai-title b { font-size: 13.5px; display: block; }
.ai-model { font-size: 11px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-head-actions { display: flex; gap: 6px; }
.ai-icon-btn { background: var(--bg); color: var(--muted); border: 1px solid var(--border);
  border-radius: 7px; width: 28px; height: 28px; font-size: 13px; cursor: pointer; }
.ai-icon-btn:hover { color: var(--text); border-color: var(--accent); }
/* ✕ must be impossible to miss: accent-blue, primary-looking (28 Oct visitor report:
   the muted ✕ was not recognised as the close control) */
#aiClose { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
#aiClose:hover { filter: brightness(1.12); color: #fff; }

.ai-msgs { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  overscroll-behavior: contain; scrollbar-width: thin; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg .ai-bubble { max-width: 92%; border-radius: 12px; padding: 9px 12px; font-size: 13px; line-height: 1.5; min-width: 0; }
.ai-msg.user .ai-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.user .ai-bubble code { background: rgba(255,255,255,.18); }
.ai-msg.assistant { justify-content: flex-start; }
.ai-msg.assistant .ai-bubble { background: var(--bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-msg.assistant .ai-bubble.err { border-color: var(--down); }
.ai-p { margin: 0 0 4px; overflow-wrap: break-word; }
.ai-p:last-child { margin-bottom: 0; }
.ai-gap { height: 6px; }
.ai-msg ul { margin: 2px 0 6px; padding-left: 18px; }
.ai-msg li { margin: 2px 0; overflow-wrap: break-word; }
.ai-msg code { background: var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.ai-chip { display: inline-block; font-size: 11px; border-radius: 6px; padding: 1px 8px; margin-bottom: 6px; font-weight: 600; }
.ai-chip.live { background: rgba(63,185,80,.14); color: var(--live); }
.ai-chip.warn { background: rgba(210,153,34,.16); color: var(--snap); }
.ai-chip.err { background: rgba(248,81,73,.14); color: var(--down); }
.ai-thinking { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .4; animation: aiPulse 1.2s infinite; }
.ai-thinking span:nth-child(2) { animation-delay: .2s; }
.ai-thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes aiPulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.ai-activity { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .ai-thinking span { animation: none; opacity: .6; } }

/* structured cards — authoritative numbers rendered from validated tool data */
.ai-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-top: 10px; overflow-x: auto; }
.ai-card-quote { border-color: var(--accent); }
/* 28 Oct: fixed table layout — auto layout let wide 5-col cards overflow the 420px panel
   (screenshot: table clipped at panel edge + stray horizontal scrollbar). First-row widths
   below pin the columns; cells break long words instead of pushing the panel open. */
.ai-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.ai-table td, .ai-table th { padding: 3px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: break-word; word-break: break-word; }
.ai-table thead th { color: var(--muted); font-size: 11px; font-weight: 600; position: static; }
.ai-table td.num, .ai-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-table .row-sub { font-size: 10.5px; color: var(--muted); white-space: normal; }
/* column plans per card type (first row defines the columns in fixed layout) */
.ai-table.t-gpu th:nth-child(1) { width: 27%; }
.ai-table.t-gpu th:nth-child(2) { width: 27%; }
.ai-table.t-gpu th:nth-child(3) { width: 16%; }
.ai-table.t-gpu th:nth-child(4) { width: 18%; }
.ai-table.t-gpu th:nth-child(5) { width: 12%; }
.ai-table.t-llm th:nth-child(1) { width: 36%; }
.ai-table.t-llm th:nth-child(2) { width: 13%; }
.ai-table.t-llm th:nth-child(3) { width: 13%; }
.ai-table.t-llm th:nth-child(4) { width: 13%; }
.ai-table.t-llm th:nth-child(5) { width: 25%; }
.ai-table.t-cost td:nth-child(1) { width: 34%; }
.ai-table.t-cost td:nth-child(2) { width: 40%; }
.ai-table.t-cost td:nth-child(3) { width: 26%; }
.ai-card-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.ai-card-h b { font-size: 12.5px; }
.ai-card-h .muted { font-size: 11px; }
.ai-card-f { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.ai-card-f.warn { color: var(--snap); }
.ai-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ai-table td, .ai-table th { padding: 3px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: break-word; }
.ai-table thead th { color: var(--muted); font-size: 11px; font-weight: 600; position: static; }
.ai-table td.num, .ai-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-table .row-sub { font-size: 10.5px; color: var(--muted); }
.ai-table tr.ai-tot td { border-bottom: none; border-top: 2px solid var(--accent); }
.ai-tots { margin-top: 6px; }
.ai-list { margin: 0; padding-left: 18px; font-size: 12px; }
.ai-list li { margin: 4px 0; }
.ai-sources { font-size: 11px; color: var(--muted); margin-top: 8px; }
.ai-src { color: var(--accent); text-decoration: none; }
.ai-src:hover { text-decoration: underline; }
.ai-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.ai-msg-actions { margin-top: 6px; display: flex; gap: 8px; }
.ai-copy { background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; font-size: 11.5px; padding: 3px 10px; cursor: pointer; }
.ai-copy:hover { color: var(--text); border-color: var(--accent); }
.ai-card-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ai-card-actions .muted { font-size: 11px; }
.ai-apply { font-size: 12.5px; padding: 7px 14px; }
.ai-apply:disabled { opacity: .55; cursor: default; }

.ai-unlock { display: flex; gap: 8px; margin: 8px 0 2px; }
.ai-unlock input { flex: 1; background: var(--field); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 7px 10px; font-size: 13px; }

.ai-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; }
.ai-sug { font-size: 11.5px; padding: 4px 11px; cursor: pointer; }
.ai-composer { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 10px 12px 8px; }
#aiInput { flex: 1; resize: none; background: var(--field); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13px;
  font-family: inherit; line-height: 1.45; max-height: 120px; }
#aiInput:focus { border-color: var(--accent); outline: none; }
#aiInput:disabled { opacity: .6; }
/* OpenCode-look composer bottom bar: "Provider / Model ⌄" left, send right */
.ai-composer-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ai-composer-spacer { flex: 1; }
.ai-model-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px;
  color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.ai-model-btn:hover { border-color: var(--border); color: var(--text); }
.ai-model-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--text); }
.ai-model-provider { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-model-sep { opacity: .55; }
.ai-model-btn-name { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-model-chev { font-size: 10px; transform: translateY(-1px); }
/* the switcher — opens UPWARD from the composer bar, OpenCode style */
.ai-model-menu { position: absolute; left: 10px; right: 10px; bottom: calc(100% - 10px); z-index: 6;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0,0,0,.45); overflow: hidden; }
body.light .ai-model-menu { box-shadow: 0 14px 36px rgba(16,24,40,.22); }
#aiModelSearch { width: 100%; box-sizing: border-box; padding: 9px 12px; background: var(--bg);
  border: none; border-bottom: 1px solid var(--border); color: var(--text); font: inherit; font-size: 12.5px; outline: none; }
.ai-model-list { max-height: 296px; overflow-y: auto; padding: 5px; scrollbar-width: thin; }
.ai-model-fam { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 8px 8px 3px; }
.ai-model-opt { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  background: none; border: none; color: var(--text); padding: 7px 8px; border-radius: 8px;
  cursor: pointer; font: inherit; font-size: 12.5px; }
.ai-model-opt:hover, .ai-model-opt.hl { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ai-model-opt .tick { width: 14px; flex: 0 0 auto; color: var(--accent); font-weight: 700; }
.ai-model-opt .mname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-model-opt .mid { margin-left: auto; color: var(--muted); font-size: 10.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
.ai-model-opt.unavailable { opacity: .45; cursor: not-allowed; }
.ai-model-opt .stchip { flex: 0 0 auto; font-size: 9.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--snap); border: 1px solid currentColor; border-radius: 999px; padding: 1px 6px; }
.ai-model-empty { padding: 12px; color: var(--muted); font-size: 12px; }
.ai-switch-chip { align-self: center; font-size: 11px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 999px; padding: 3px 10px; margin: 2px 0; }
.ai-send { background: var(--accent); color: #fff; border: none; border-radius: 10px;
  width: 38px; height: 38px; font-size: 15px; cursor: pointer; flex: 0 0 auto; }
.ai-send:hover { filter: brightness(1.08); }
.ai-stop { background: var(--down); }
.ai-foot { padding: 0 12px 10px; }
.ai-foot .muted { font-size: 11px; display: block; }

/* entry buttons + quote strip + feed explain */
.ai-entry { font-size: 12px; padding: 5px 12px; }
.ai-entry:hover { color: var(--accent); border-color: var(--accent); }
.ai-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.ai-strip .muted { font-size: 11.5px; }
#feedList .ai-explain { background: transparent; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; padding: 2px 7px; cursor: pointer; color: var(--muted); }
#feedList .ai-explain:hover { color: var(--accent); border-color: var(--accent); }
.feed-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* graceful degradation: assistant unavailable → hide every AI affordance, keep the site whole */
body.ai-off .ai-entry, body.ai-off #aiLauncherWrap, body.ai-off .ai-explain, body.ai-off #aiQuoteStrip { display: none !important; }

/* mobile: near-full-height sheet, clear of the sticky quote bar and toast */
@media (max-width: 640px) {
  #aiLauncherWrap { right: 14px; bottom: 14px; }
  .ai-panel { right: 8px; left: 8px; width: auto; height: calc(100dvh - 76px); bottom: 60px; }
  body.qbar-on .ai-panel { bottom: 128px; height: calc(100dvh - 150px); }
  .ai-msg .ai-bubble { max-width: 96%; }
}

/* light theme refinements */
body.light .ai-panel { box-shadow: 0 12px 40px rgba(16,24,40,.18); }
body.light .ai-msg.assistant .ai-bubble { background: #fff; }
body.light .ai-msg code { background: #eef1f5; }
body.light .ai-card { background: #fff; }
