/* Nextstep styles on top of Bootstrap 5. Colors are tokens so light and dark mode swap in one place. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --line: #e4e7ec; --text: #1a1d23; --text-2: #5b6270; --text-3: #8a91a0;
  --brand: #155eef; --brand-soft: #e8efff;
  --series-1: #257de0; --series-2: #f47230;
  --seq-100: #cce3fd; --seq-200: #9dc8f7; --seq-300: #6aabf1; --seq-400: #338ced; --seq-500: #2370cd; --seq-600: #1757ac; --seq-700: #0e3d7e;
  --empty-cell: #eef1f5;
  --funnel-1: #1b64be; --funnel-2: #2370cd; --funnel-3: #338ced; --funnel-4: #519ced; --funnel-5: #6aabf1;
  --good: #0a7a34; --good-bg: #e6f6ec; --bad: #c4321c; --bad-bg: #fdecea; --warn: #8a5a00; --warn-bg: #fff3d6;
  --bs-primary: #155eef; --bs-primary-rgb: 21, 94, 239; --bs-link-color: #155eef; --bs-link-color-rgb: 21, 94, 239;
  --bs-body-bg: var(--bg); --bs-body-color: var(--text);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318; --surface: #1a1d24; --surface-2: #232731; --line: #2e333e; --text: #eceef2; --text-2: #a3aab8; --text-3: #7d8494;
    --brand: #5b8cff; --brand-soft: #1f2a44;
    --series-1: #338ced; --series-2: #e76624;
    --seq-100: #17325a; --seq-200: #1757ac; --seq-300: #1b64be; --seq-400: #2370cd; --seq-500: #338ced; --seq-600: #6aabf1; --seq-700: #b6d5f8;
    --empty-cell: #232731;
    --funnel-1: #338ced; --funnel-2: #2370cd; --funnel-3: #1b64be; --funnel-4: #1757ac; --funnel-5: #164b94;
    --good: #4cc979; --good-bg: #163222; --bad: #ff7b6b; --bad-bg: #3a1d1a; --warn: #f2b84b; --warn-bg: #3a2e12;
    --bs-primary: #5b8cff; --bs-link-color: #7ea6ff; --bs-link-color-rgb: 126, 166, 255;
    --bs-body-bg: var(--bg); --bs-body-color: var(--text);
    color-scheme: dark;
  }
}
body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: #0b4fd6; --bs-btn-hover-border-color: #0b4fd6; --bs-btn-active-bg: #0a46bf; }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--line); --bs-btn-color: var(--text); }
.card { background: var(--surface); border-color: var(--line); border-radius: 14px; }
.muted, .text-muted { color: var(--text-2) !important; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); }
.logo b { color: var(--text); font-size: 1.1rem; letter-spacing: -.01em; }
code { color: inherit; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .86em; }

/* ---------------------------------------------------------------- auth + setup */
.auth-page { min-height: 100vh; }
.auth-wrap, .setup-wrap { max-width: 440px; margin: 0 auto; padding: 48px 16px; }
.setup-wrap { max-width: 640px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-card { border-radius: 16px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 500; font-size: 1rem; }
.btn-google:hover, .btn-google:focus { background: #f8faff; color: #1f1f1f; border-color: #747775; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-google { background: #131314; color: #e3e3e3; border-color: #8e918f; } :root:not([data-theme="light"]) .btn-google:hover { background: #1f1f20; color: #e3e3e3; } }
:root[data-theme="dark"] .btn-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-3); font-size: .82rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.big-emoji { font-size: 44px; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: s; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-3); }
.steps li span { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); font-weight: 600; flex: none; }
.steps li.current { color: var(--text); font-weight: 600; } .steps li.current span { background: var(--brand); color: #fff; }
.steps li.done span { background: var(--good-bg); color: var(--good); }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: 4px; } .choice b { display: block; font-size: .92rem; } .choice small { color: var(--text-2); font-size: .78rem; }
.snippet-box { position: relative; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 14px 84px 14px 14px; }
.snippet-box code { background: none; color: inherit; padding: 0; font-size: .84rem; white-space: pre-wrap; word-break: break-all; }
.copy-btn { position: absolute; right: 10px; top: 10px; }
.code-sample { background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: .8rem; }
.code-sample code { background: none; padding: 0; }

/* ---------------------------------------------------------------- top bar + tabs (one row you swipe on phones) */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 0; position: relative; z-index: 1030; } /* above the sticky tab bar, so its menus aren't hidden */
.site-switch .btn { max-width: 46vw; font-weight: 600; }
.avatar { width: 34px; height: 34px; padding: 0; font-weight: 700; }
.tabbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.tabs-scroll { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; margin: 0 -4px; padding: 0 4px; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 12px 12px 10px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: .92rem; border-bottom: 2.5px solid transparent; white-space: nowrap; scroll-snap-align: start; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab.soon { color: var(--text-3); opacity: .55; cursor: default; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pulse 2s infinite; vertical-align: middle; }
.live-dot.big { width: 12px; height: 12px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.sample-banner { background: #fff7e6; color: #6b4a00; font-size: .85rem; padding: 8px 0; border-bottom: 1px solid #f5e0b3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sample-banner { background: #2d2412; color: #f3d48a; border-color: #4a3b18; } }

/* ---------------------------------------------------------------- page */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 34px; }
.date-menu { min-width: 250px; }
.date-menu .btn.active { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--text); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .84rem; }
.chip button { border: 0; background: rgba(0, 0, 0, .08); border-radius: 50%; width: 22px; height: 22px; line-height: 1; color: inherit; }
.quick-filters { gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.qf { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--text-2); }
.qf select { min-width: 150px; }
.sheet .qf { flex-direction: column; align-items: stretch; }
.sheet.offcanvas-bottom { height: auto; max-height: 80vh; border-radius: 18px 18px 0 0; }
.loading, .empty { color: var(--text-2); padding: 28px 8px; text-align: center; font-size: .92rem; }
#view.is-loading { opacity: .55; transition: opacity .2s; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1200px) { .tiles-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.tile-label { font-size: .8rem; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: .78rem; color: var(--text-2); min-height: 1.2em; }
.help { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--surface-2); font-size: .66rem; color: var(--text-2); cursor: help; }
.chg { font-weight: 600; font-size: .78rem; border-radius: 6px; padding: 1px 5px; white-space: nowrap; }
.chg.up { color: var(--good); background: var(--good-bg); } .chg.down { color: var(--bad); background: var(--bad-bg); } .chg.flat { color: var(--text-2); background: var(--surface-2); }
td .chg { font-size: .7rem; margin-left: 4px; }

.dash-card { margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-sub { color: var(--text-2); font-size: .82rem; margin: -4px 0 10px; }
.chart-label { font-size: .78rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.chart { display: block; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--text-3); font-size: 11px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .cell { stroke: none; }
.chart-tip { position: absolute; z-index: 2000; display: none; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, .14); border-radius: 10px; padding: 8px 10px; font-size: .8rem; min-width: 120px; }
.tip-h { font-weight: 600; margin-bottom: 2px; }

.funnel-step { margin: 6px 0; }
.funnel-label { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 4px; }
.funnel-track { background: var(--surface-2); border-radius: 6px; height: 28px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 0 6px 6px 0; }
.funnel-drop { font-size: .78rem; color: var(--bad); padding: 4px 0 2px 2px; }

/* ---------------------------------------------------------------- tables -> cards on phones */
.table-search { max-width: 260px; margin-bottom: 8px; }
.table-wrap { overflow-x: auto; }
.data-table { margin: 0; --bs-table-bg: transparent; color: var(--text); font-size: .88rem; }
.data-table th { border-bottom-color: var(--line); white-space: nowrap; font-weight: 600; }
.data-table td { border-bottom-color: var(--line); vertical-align: middle; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td.first { position: relative; max-width: 360px; }
.sort { border: 0; background: none; padding: 0; color: var(--text-2); font-weight: 600; font-size: .8rem; }
.share { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--series-1); opacity: .35; border-radius: 0 2px 2px 0; }
.link-filter { border: 0; background: none; padding: 0; color: inherit; text-align: left; font: inherit; }
.link-filter:hover { color: var(--brand); text-decoration: underline; }
.cell-sub { display: block; color: var(--text-3); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; word-break: break-all; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--surface-2); }
.yes { color: var(--good); font-weight: 600; }
.sub-tabs { gap: 4px; margin-bottom: 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.sub-tabs .nav-link { padding: 4px 12px; font-size: .84rem; border-radius: 999px; color: var(--text-2); white-space: nowrap; }
.sub-tabs .nav-link.active { background: var(--brand); color: #fff; }
.bot-line { font-size: .82rem; color: var(--text-2); margin: 4px 2px 24px; }
.bot-line summary { cursor: pointer; } .bot-line ul { margin: 6px 0 0; }
.install-banner { display: flex; align-items: center; gap: 12px; justify-content: space-between; background: var(--brand-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; }

/* ---------------------------------------------------------------- live */
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.live-count { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; } .live-count b { font-size: 2rem; }
.live-list { display: grid; gap: 8px; }
.live-card { display: grid; grid-template-columns: 170px 1fr 220px 110px; gap: 12px; align-items: center; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); }
.live-card:hover:not(:disabled) { border-color: var(--brand); }
.live-card > span { min-width: 0; }
.lc-where { display: flex; gap: 8px; align-items: center; font-weight: 600; } .lc-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-meta { display: flex; flex-direction: column; font-size: .82rem; color: var(--text-2); }
.lc-time { text-align: right; } .lc-time b { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- visit path panel */
.path-panel { --bs-offcanvas-width: 460px; }
.visit-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.visit-sum > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: .85rem; }
.visit-sum .muted { display: block; font-size: .72rem; } .visit-sum b { display: block; }
.converted-note { background: var(--good-bg); color: var(--good); border-radius: 10px; padding: 8px 10px; font-weight: 600; font-size: .88rem; margin-bottom: 12px; }
.path-steps { list-style: none; padding: 0; margin: 0; counter-reset: st; }
.path-steps > li { position: relative; padding: 0 0 16px 34px; counter-increment: st; }
.path-steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.path-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.ps-path { font-family: ui-monospace, Menlo, monospace; font-size: .86rem; font-weight: 600; word-break: break-all; }
.ps-meta { font-size: .78rem; color: var(--text-2); }
.ps-events { margin: 4px 0 0; padding-left: 16px; font-size: .8rem; }
.other-visits { padding-left: 18px; font-size: .85rem; }

/* ---------------------------------------------------------------- settings */
.settings-nav { top: 64px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { color: var(--text-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.settings-nav a:hover { background: var(--surface); color: var(--text); }
.settings section { scroll-margin-top: 64px; }

/* ---------------------------------------------------------------- paths + funnels (phase 2) */
.chain { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.chain-step { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; background: var(--surface-2); border-radius: 6px; padding: 2px 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-arrow, .chain-more { color: var(--text-3); font-size: .8rem; }
.minibar { display: block; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.minibar > span { display: block; height: 100%; border-radius: 0 3px 3px 0; }
.path-list { list-style: none; padding: 0; margin: 0; }
.path-list > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.path-list > li:last-child { border-bottom: 0; }
.pl-top { margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.next-list { list-style: none; padding: 0; margin: 0; }
.next-list > li { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 2px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.next-list > li:last-child { border-bottom: 0; }
.next-list .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-list .minibar { margin: 0; }
.nl-n { text-align: right; font-variant-numeric: tabular-nums; font-size: .88rem; white-space: nowrap; }
.nl-c { grid-column: 1 / -1; }
.visit-list { display: flex; flex-direction: column; }
.visit-row { display: grid; grid-template-columns: 110px 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px; color: inherit; width: 100%; font-size: .88rem; }
.visit-row:hover, .visit-row:focus-visible { background: var(--surface-2); }
.vr-when, .vr-src { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-meta { white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
.yes { color: var(--good); font-weight: 700; }
.funnel.big .funnel-track { height: 36px; border-radius: 8px; }
.funnel.big .funnel-step { margin: 8px 0; }
.funnel.big .funnel-label { gap: 12px; align-items: baseline; }
.funnel.big .funnel-label > span { min-width: 0; }
.funnel.big .funnel-label > b { flex: none; white-space: nowrap; text-align: right; }
.funnel-drop.as-btn { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 6px 8px; margin: 2px 0; }
.funnel-drop.as-btn:hover, .funnel-drop.as-btn.active { background: var(--bad-bg); }
.funnel-drop .see { color: var(--brand); font-weight: 600; margin-left: 4px; white-space: nowrap; }
.step-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .72rem; font-weight: 700; margin-right: 8px; }
.split-table td .cell-sub { display: block; }
.star { color: #e3a008; }
.goal-actions { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.choice-grid.four { grid-template-columns: repeat(4, 1fr); }
.choice-grid.five { grid-template-columns: repeat(5, 1fr); }
.link-kind { display: inline-block; width: 1.5em; }
.badge-n { font-size: .75em; opacity: .7; margin-left: 2px; }
.element-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.element-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; color: inherit; font-size: .88rem; }
.element-row:last-child { border-bottom: 0; }
.element-row:hover { background: var(--surface-2); }
.element-row.active { background: var(--brand-soft); }
.fsteps { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.fsteps > li > * { display: inline-block; vertical-align: middle; }
.fsteps select { width: calc(100% - 44px); margin-right: 4px; }
.weekly-pre { background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: .8rem; white-space: pre-wrap; max-height: 420px; overflow: auto; }
.goal-note { background: var(--brand-soft); border-radius: 10px; padding: 8px 10px; font-size: .85rem; }
.ev-click { color: var(--text-2); }
.ev-frust { color: var(--bad); font-weight: 600; }

/* ---------------------------------------------------------------- heat maps (phase 3) */
.heat-controls .card-body { padding: 12px 16px; }
.hc-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.hc-row label { display: flex; flex-direction: column; gap: 2px; min-width: 150px; flex: 0 1 auto; }
.hc-row .hc-page { flex: 1 1 260px; }
.hc-l { font-size: .72rem; color: var(--text-2); font-weight: 500; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { border: 0; background: none; color: var(--text-2); font-size: .85rem; font-weight: 500; padding: 5px 12px; border-radius: 8px; white-space: nowrap; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.heat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.heat-legend { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--text-2); }
.heat-legend i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(253,208,162,.5), #fd8d3c, #d94801, #7f2704); }
.heat-stage { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin: 0 auto; max-width: 100%; }
.heat-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; }
.heat-blank { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, #f6f7f9 0 1px, transparent 1px 80px), #fff; }
.heat-frame iframe { position: absolute; left: 0; top: 0; border: 0; pointer-events: none; background: #fff; }
.heat-frame.picking iframe { pointer-events: auto; cursor: crosshair; }
.heat-frame canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.heat-frame.dim::after { content: ""; position: absolute; inset: 0; background: rgba(17,24,39,.18); pointer-events: none; z-index: 1; }
.heat-frame canvas, .heat-marks { z-index: 2; }
.heat-frame.picking::after { display: none; }
.heat-frame.picking canvas { opacity: .25; }
.heat-marks { position: absolute; inset: 0; pointer-events: none; }
.reach-line, .fold-line { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(255,255,255,.9); }
.reach-line span, .fold-line span, .bottom-note { position: absolute; left: 12px; top: 4px; background: rgba(17,24,39,.85); color: #fff; font: 600 15px/1.3 system-ui, sans-serif; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.fold-line { border-top: 3px solid #f47230; }
.fold-line span { background: #f47230; left: auto; right: 12px; }
.bottom-note { left: 50%; transform: translateX(-50%); }
.flash { position: absolute; border: 4px solid #155eef; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(17,24,39,.25); animation: flash 2.6s ease-out forwards; }
@keyframes flash { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.top-clicks { display: flex; flex-direction: column; max-height: 720px; overflow-y: auto; margin: 0 -4px; }
.tc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 4px; color: inherit; font-size: .86rem; width: 100%; }
.tc-row:hover, .tc-row:focus-visible { background: var(--surface-2); }
.tc-name { min-width: 0; } .tc-name b, .tc-name .cell-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tc-row .minibar { grid-column: 1 / -1; margin-top: 2px; }
.tc-goal { grid-column: 1 / -1; color: var(--brand); font-size: .78rem; font-weight: 600; justify-self: start; }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; }
.day-chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.day-chip span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.day-chip i { font-style: normal; font-size: .75rem; }
.day-chip.active { background: var(--brand-soft); border-color: var(--brand); }

/* ---------------------------------------------------------------- phones */
@media (max-width: 1199.98px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .container-xl { padding-left: 16px; padding-right: 16px; }
  .tiles, .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tiles .tile:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .tile { padding: 12px; } .tile-label { white-space: normal; } .tile-value { font-size: 1.5rem; }
  .card-body { padding: 14px; }
  .choice-grid { grid-template-columns: 1fr; }
  .steps li { font-size: 0; } .steps li.current { font-size: .85rem; }
  .table-search { max-width: none; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; }
  .data-table td { border: 0; padding: 0 !important; text-align: left !important; }
  .data-table td.first { grid-column: 1 / -1; max-width: none; font-weight: 600; padding-bottom: 6px !important; }
  .data-table td.num::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--text-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .share { bottom: 0; }
  .live-card { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .lc-page { grid-column: 1 / -1; order: 3; } .lc-meta { order: 4; grid-column: 1 / -1; flex-direction: row; gap: 10px; flex-wrap: wrap; }
  .path-panel { --bs-offcanvas-width: 100vw; }
  .choice-grid.four { grid-template-columns: 1fr 1fr; }
  .choice-grid.five { grid-template-columns: 1fr 1fr; }
  .choice-grid.five .choice:last-child { grid-column: span 2; }
  .visit-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .vr-path { grid-column: 1 / -1; order: 3; } .vr-src { display: none; }
  .next-list > li { grid-template-columns: minmax(0, 1fr) auto; } .next-list .minibar { grid-column: 1 / -1; order: 3; }
  .chain-step { max-width: 150px; }
  .hc-row label { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .hc-row .hc-page { flex-basis: 100%; }
  .heat-controls:not(.open) .hc-row label:not(.hc-page) { display: none; }
  .seg { width: 100%; } .seg-btn { flex: 1; padding: 6px 4px; }
  .top-clicks { max-height: none; }
  .funnel.big .funnel-label .cell-sub { display: block !important; white-space: normal; overflow-wrap: anywhere; }
  .install-banner { flex-direction: column; align-items: flex-start; }
  .snippet-box { padding-right: 14px; padding-bottom: 52px; } .copy-btn { top: auto; bottom: 10px; }
}

/* ---------------------------------------------------------------- Product usage (Phase 4) */
.pbar { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--empty-cell); vertical-align: middle; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.quiet-list, .now-list, .past-reviews, .ask-list { list-style: none; padding: 0; margin: 0; }
.quiet-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.quiet-list li span { color: var(--text-2); font-size: .875rem; white-space: nowrap; }
.now-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.now-list .cell-sub { width: 100%; padding-left: 16px; }
.flag-pill { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); margin: 1px 0; }
.flag-pill.flag-rage { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.ret-table th, .ret-table td { vertical-align: middle; }
.ret-table th[scope=row] { font-weight: 500; white-space: nowrap; }
.ret { text-align: center; padding: 2px !important; }
.ret span { display: block; border-radius: 6px; padding: 5px 4px; font-variant-numeric: tabular-nums; font-size: .82rem;
  background: color-mix(in srgb, var(--seq-500) calc(var(--a) * 100%), var(--empty-cell)); color: var(--text); }
.ret.na { color: var(--text-3); }
.ret-avg th, .ret-avg td { border-bottom: 2px solid var(--line); font-weight: 600; }
.pt-kind { min-width: 120px; } .pt-feature { min-width: 120px; }

/* ---------------------------------------------------------------- AI review (Phase 4) */
.ai-headline { font-size: 1.08rem; font-weight: 600; line-height: 1.4; }
.ai-block { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.ai-block > p { margin-bottom: .5rem; }
.ai-next { background: var(--brand-soft); }
.ai-points { list-style: none; padding: 0; margin: 0; }
.ai-point { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ai-point:first-child { border-top: 0; padding-top: 2px; }
.ai-point p { margin: 2px 0 4px; color: var(--text); }
.ai-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600; font-size: .85rem; display: grid; place-items: center; }
.ai-numbers { font-size: .82rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ai-link { font-size: .85rem; }
.ai-good h3 { color: var(--good); } .ai-wrong h3 { color: var(--bad); }
.ai-empty { padding: 8px 0; }
.ai-mini { padding-left: 1.2rem; margin-bottom: .5rem; } .ai-mini li { margin-bottom: 4px; }
.ask-form { display: flex; gap: 8px; } .ask-form input { min-width: 0; }
.ask-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ask-new li { border-bottom: 0; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.ask-q { font-weight: 600; margin-bottom: 2px; }
.past-reviews li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- platform admin */
.admin-wrap { max-width: 980px; }

/* AI panel: four AIs compared */
.ai-panel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 14px; }
.ai-chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.ai-chip.off { opacity: .6; text-decoration: none; font-weight: 400; }
.ai-by { font-size: .75rem; color: var(--text-2); margin-top: 4px; }
.ai-by-one { color: #b45309; font-weight: 600; }
.ai-by-all { color: #15803d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ai-by-one { color: #fbbf24; } :root:not([data-theme="light"]) .ai-by-all { color: #4ade80; } }
:root[data-theme="dark"] .ai-by-one { color: #fbbf24; } :root[data-theme="dark"] .ai-by-all { color: #4ade80; }
.ai-own { border-top: 1px solid var(--line); padding: 8px 0; }
.ai-own summary { cursor: pointer; }
.panel-row + .panel-row { border-top: 1px solid var(--line); padding-top: 12px; }

/* team page */
.team-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.team-list li:last-child { border-bottom: 0; }
.team-list select { min-width: 120px; }
/* setup step 3: guidance for each kind of conversion, and the form picker slide-over */
.goal-help { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 4px; background: var(--brand-soft); font-size: .9rem; }
.goal-help .snippet-box { padding-top: 10px; padding-bottom: 10px; }
.goal-help code { word-break: break-word; }
.goal-added { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.goal-added li { padding: 3px 0; }
.pick-panel.offcanvas-end { width: min(1100px, 92vw); }
.pick-frame { width: 100%; border: 0; background: #fff; min-height: 60vh; }
@media (max-width: 575px) { .pick-panel.offcanvas-end { width: 100vw; } }

/* each site's own icon in the site menu */
.site-icon { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; vertical-align: -3px; margin-right: 8px; flex: none; }

/* site search */
.search-term { font-weight: 600; overflow-wrap: anywhere; }
.bad-text { color: var(--bad); font-weight: 600; }
.privacy-note { margin: 4px 2px 24px; }
/* Errors page: JavaScript errors visitors hit */
.err-callout { display: flex; gap: 12px; align-items: flex-start; background: var(--bad-bg); color: var(--text); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.err-callout-icon { font-size: 1.3rem; line-height: 1.2; color: var(--bad); }
.err-callout > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.err-callout-sub { font-size: .9rem; color: var(--text-2); margin-top: 2px; }
.err-pill { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 999px; margin: 3px 4px 0 0; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.err-pill.err-money { background: var(--bad-bg); color: var(--bad); border-color: transparent; font-weight: 600; }
.err-pill.err-back { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.err-pill.err-fixed { background: var(--good-bg); color: var(--good); border-color: transparent; }
.err-msg { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; word-break: break-word; }
.err-src { font-family: ui-monospace, Menlo, monospace; font-size: .74rem; word-break: break-all; }
.err-worse { color: var(--bad); font-weight: 600; }
.err-head { margin-bottom: 10px; }
.err-kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.err-big { font-family: ui-monospace, Menlo, monospace; font-size: .95rem; font-weight: 600; word-break: break-word; }
.err-tip { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .88rem; }
.err-dims { list-style: none; padding: 0; margin: 0; font-size: .85rem; }
.err-dims li { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 4px 0 6px; border-bottom: 1px solid var(--line); }
.err-dims li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-dims li i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--bad); opacity: .45; border-radius: 2px; }
.err-stack { background: var(--surface-2); border-radius: 10px; padding: 10px; font-size: .74rem; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; }
.err-visits { display: grid; gap: 6px; }
.err-visit { display: grid; grid-template-columns: 130px 1fr auto auto; gap: 10px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: .84rem; color: var(--text); }
.err-visit:hover, .err-visit:focus-visible { background: var(--surface-2); }
@media (max-width: 767.98px) { .err-visit { grid-template-columns: 1fr auto; } .err-visit .path { grid-column: 1 / -1; order: -1; } }
.ps-events .ev-js_error { color: var(--bad); }
/* Forms: where people stop, box by box */
.ff-notes { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.ff-notes li { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; font-size: .88rem; }
.ff-notes li.ff-note-quit { background: var(--bad-bg); }
.ff-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.ff-list { list-style: none; padding: 0; margin: 0; counter-reset: ff; }
.ff-row { display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(120px, 2fr) minmax(0, 2.2fr); gap: 4px 14px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line); counter-increment: ff; border-radius: 6px; }
.ff-row.active { background: var(--bad-bg); }
.ff-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-name::before { content: counter(ff); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: .72rem; font-weight: 600; margin-right: 8px; }
.ff-track { position: relative; height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.ff-reach { position: absolute; left: 0; top: 0; bottom: 0; background: var(--seq-200); border-radius: 0 4px 4px 0; }
.ff-quit { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bad); border-radius: 0 4px 4px 0; }
.ff-nums { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .84rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ff-row.worst .ff-see b { color: var(--bad); }
.ff-see { background: none; border: 0; padding: 0; color: inherit; text-align: left; }
.ff-see .see { color: var(--brand); font-weight: 600; white-space: nowrap; }
.ff-see:hover .see { text-decoration: underline; }
.ff-err { color: var(--bad); }
@media (max-width: 767.98px) {
  .ff-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 2px; }
  .ff-head span:last-child { display: none; }
}

/* ---------------------------------------------------------------- session replay player */
.replay-modal .modal-content { background: var(--surface); border-color: var(--line); }
.rp-head { min-width: 0; }
.rp-head .path { font-family: ui-monospace, Menlo, monospace; font-size: .88rem; word-break: break-all; }
.rp-pageno { color: var(--text-2); font-weight: 500; }
.rp-stage { position: relative; display: flex; justify-content: center; align-items: flex-start; padding: 8px; background: var(--surface-2); min-height: 260px; overflow: hidden; }
.rp-screen { position: relative; transform-origin: 0 0; flex: none; box-shadow: 0 2px 12px rgba(0,0,0,.18); border-radius: 6px; overflow: hidden; background: #fff; }
.rp-screen iframe { position: absolute; left: 0; top: 0; border: 0; background: #fff; pointer-events: none; }
.rp-overlay { position: absolute; left: 0; top: 0; overflow: hidden; }
.rp-cursor { position: absolute; left: 0; top: 0; transition: transform .06s linear; will-change: transform; z-index: 3; }
.rp-cursor svg { display: block; transform: translate(-3px, -2px); }
.rp-cursor.touch svg { display: none; }
.rp-cursor.touch::after { content: ""; display: block; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(21,94,239,.28); border: 2px solid rgba(21,94,239,.75); }
.rp-click { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid #f47230; animation: rp-ring .9s ease-out forwards; z-index: 2; pointer-events: none; }
@keyframes rp-ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.rp-typed { position: absolute; border: 2px dashed #8b5cf6; border-radius: 6px; background: rgba(139,92,246,.10); z-index: 2; pointer-events: none; }
.rp-typed span { position: absolute; left: 0; top: -24px; white-space: nowrap; background: #8b5cf6; color: #fff; font: 600 12px/1 system-ui, sans-serif; padding: 5px 7px; border-radius: 5px; }
.rp-msg { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); background: rgba(17,24,39,.86); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: .9rem; z-index: 5; max-width: 90%; text-align: center; }
.rp-controls { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rp-play { width: 42px; font-size: .9rem; }
.rp-time { font-variant-numeric: tabular-nums; font-size: .86rem; color: var(--text-2); min-width: 86px; }
.rp-track { position: relative; flex: 1 1 200px; min-width: 160px; }
.rp-track .form-range { position: relative; z-index: 1; display: block; }
.rp-marks { position: absolute; left: 8px; right: 8px; top: 50%; height: 0; pointer-events: none; z-index: 2; }
.rp-mark { position: absolute; width: 3px; height: 12px; margin: -6px 0 0 -1px; border-radius: 2px; }
.rp-mark.click { background: #f47230; }
.rp-mark.typed { background: #8b5cf6; }
.rp-skip { white-space: nowrap; }
.rp-watch { font-family: system-ui, sans-serif; font-size: .8rem; font-weight: 600; text-decoration: none; }
.replay-promise { padding-left: 1.1rem; color: var(--text-2); }
@media (max-width: 575.98px) { .rp-controls { gap: 8px; padding: 8px 10px; } .rp-track { order: 9; flex-basis: 100%; } .rp-note { font-size: .78rem; } }
/* page speed */
.speed-pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.speed-pill.sp-good { color: var(--good); background: var(--good-bg); } .speed-pill.sp-ok { color: var(--warn); background: var(--warn-bg); } .speed-pill.sp-poor { color: var(--bad); background: var(--bad-bg); }
.sp-val { font-weight: 600; } .sp-val.sp-good { color: var(--text); } .sp-val.sp-ok { color: var(--warn); } .sp-val.sp-poor { color: var(--bad); }
.speed-lead { font-size: 1rem; margin-bottom: 14px; max-width: 62rem; }
.chart .good-zone { fill: var(--good-bg); opacity: .7; }
.chart .tick.strong { fill: var(--text-2); font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--text-2); margin-bottom: 4px; }
.speed-help summary { cursor: pointer; list-style: revert; }
.speed-help dt { font-weight: 600; margin-top: 8px; } .speed-help dd { color: var(--text-2); margin-bottom: 0; }
.speed-problem { font-size: .8rem; color: var(--text-2); white-space: normal; margin-top: 2px; line-height: 1.5; }
.speed-dev td, .speed-dev th { background: transparent; color: var(--text); } .speed-dev .num { text-align: right; } .speed-dev thead th { font-weight: 600; font-size: .8rem; color: var(--text-2); }
/* AI funnel ideas */
.idea-progress { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-progress span { background: var(--brand-soft); border-radius: 999px; padding: 3px 10px; }
.idea-list { list-style: none; padding: 0; margin: 0 0 8px; }
.idea { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.idea-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.idea-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: st; }
.idea-steps li { counter-increment: st; background: var(--brand-soft); border-radius: 8px; padding: 3px 10px; font-size: .85rem; }
.idea-steps li::before { content: counter(st) ". "; font-weight: 700; }
.idea-steps li + li { position: relative; }
/* ---------------------------------------------------------------- Leaving and coming back (Visitor paths) */
.bucket-list > li { grid-template-columns: 104px minmax(0, 1fr) auto; padding: 6px 0; font-size: .9rem; }
.takeaways { margin: 0 0 12px; padding: 10px 14px 10px 30px; background: var(--surface-2); border-radius: 12px; font-size: .92rem; }
.takeaways li + li { margin-top: 4px; }
@media (max-width: 767.98px) {
  .bucket-list > li { grid-template-columns: 104px minmax(0, 1fr) auto; } .bucket-list .minibar { grid-column: auto; order: 0; }
}
/* ---------------------------------------------------------------- Sales by source */
.sales-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sales-bar select { max-width: 260px; }
.sales-note { background: var(--bs-tertiary-bg); border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin: 0 0 16px; }
.sales-how { padding-left: 1.1rem; }
.sales-how li { margin-bottom: 6px; }
@media (max-width: 767.98px) { .sales-chg { display: block; margin-top: 2px; } .sales-chg .chg { font-size: .75rem; } }
@media (max-width: 575.98px) {
  .credit-pick { width: 100%; }
  .credit-pick .btn { flex: 1; font-size: .8rem; }
}
.link-tabs { flex-wrap: wrap; row-gap: 4px; }

/* Frustration signals */
.flag-pill.fr-rage { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.flag-pill.fr-dead { background: var(--surface-2); color: var(--text); }
:root { --fr-back: #9a5b00; --fr-back-bg: #fff2dc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fr-back: #f5b041; --fr-back-bg: #3a2c14; } }
.flag-pill.fr-back { background: var(--fr-back-bg); color: var(--fr-back); border-color: transparent; }
.fr-what { margin-top: 2px; }
.fr-visits { display: grid; gap: 6px; }
.fr-visit { display: flex; justify-content: space-between; gap: 10px; text-align: left; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); }
.fr-visit:hover { border-color: var(--bad); }
.fr-bits { font-size: .8rem; color: var(--bad); white-space: nowrap; align-self: center; }
@media (max-width: 575px) { .fr-visit { flex-direction: column; gap: 2px; } .fr-bits { white-space: normal; } }
.fr-mark { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; border-radius: 999px; font: 700 15px/1 system-ui, sans-serif; color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 2px 8px rgba(0,0,0,.35); pointer-events: auto; cursor: default; }
.fr-mark.rage { background: #c4321c; }
.fr-mark.dead { background: #4b5563; border: 3px dashed #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }

/* ---------------------------------------------------------------- phone app (Add to Home Screen) */
code { overflow-wrap: anywhere; }
.fr-visit > span:first-child { min-width: 0; } .fr-visit .path { overflow-wrap: anywhere; } .fr-visit .cell-sub { white-space: normal; }
a, button, .btn, .tab, label, summary { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
.topbar, .tabbar, .dock, .more-sheet { -webkit-user-select: none; user-select: none; }

/* the bottom bar: phones only */
.dock { display: none; }
.nav-ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 767.98px) {
  .tabbar { display: none; }                       /* sections live in the bottom bar and the "More" sheet */
  .topbar { position: sticky; top: 0; padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
  .topbar .container-xl { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  body:has(.dock) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .dock { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
    background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--line); padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
  .dock-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; min-width: 0; padding: 4px 2px; border: 0; background: none;
    color: var(--text-3); text-decoration: none; font-size: .68rem; font-weight: 600; border-radius: 12px; }
  .dock-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dock-item.active { color: var(--brand); }
  .dock-item.active .nav-ico { stroke-width: 2.2; }
  .dock-item:active { background: var(--surface-2); }
  .container-xl { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  /* iPhone zooms into any box with text under 16px when you tap it; keep them at 16px */
  input.form-control, select.form-select, textarea.form-control, .form-control-sm, .form-select-sm { font-size: 16px; }
  .card-head { min-width: 0; } .card-head > * { min-width: 0; } .card-head .form-select.w-auto, .mw-50 { max-width: 55%; }
  /* finger-sized controls */
  .btn-sm { min-height: 38px; padding-left: 12px; padding-right: 12px; }
  .chip button { width: 28px; height: 28px; }
  .dropdown-item { padding-top: 10px; padding-bottom: 10px; }
  .help { width: 20px; height: 20px; font-size: .72rem; }
  .sub-tabs .nav-link { padding: 7px 14px; }
  .offcanvas-end.path-panel, .offcanvas-end { --bs-offcanvas-width: 100vw; }
}
/* sheets that slide up from the bottom, like on a phone */
.sheet.offcanvas-bottom { padding-bottom: env(safe-area-inset-bottom); }
.offcanvas-end, .offcanvas-start { padding-top: env(safe-area-inset-top); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.more-sheet.offcanvas-bottom { max-height: 88vh; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 12px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none; font-size: .8rem; font-weight: 500; text-align: center; line-height: 1.2; min-height: 84px; }
.more-item .nav-ico { color: var(--brand); }
.more-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.more-item:active { transform: scale(.97); }
.more-links { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .9rem; }
.more-links a { padding: 6px 0; text-decoration: none; }
.install-steps { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 14px; }
.install-steps li { display: flex; gap: 12px; align-items: center; font-size: .95rem; }
.step-ico { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--brand); }
.step-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.step-ico img { border-radius: 6px; }
.install-banner-app { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 1036; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 10px 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  transform: translateY(20px); opacity: 0; transition: transform .25s, opacity .25s; }
.install-banner-app.show { transform: none; opacity: 1; }
.install-banner-app img { border-radius: 10px; flex: none; }
.install-banner-app div { flex: 1; min-width: 0; font-size: .82rem; line-height: 1.3; }
.install-banner-app b { display: block; font-size: .9rem; } .install-banner-app span { color: var(--text-2); }
.install-banner-app .btn-close { flex: none; padding: 10px; }
@media (prefers-reduced-motion: reduce) { .install-banner-app { transition: none; } }

/* inside the installed app */
html.is-app, html.is-app body { overscroll-behavior-y: none; }
.ptr { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; z-index: 1040; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14); display: grid; place-items: center; transform: translate(-50%, -44px); opacity: 0; pointer-events: none; color: var(--text-3); }
.ptr svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ptr.ready { color: var(--brand); }
.ptr.spin svg { animation: ptr-spin .7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
/* pages with their own top bar (team, app settings, setup, legal) clear the status bar and notch too */
html.is-app .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
html.is-app .auth-wrap, html.is-app .setup-wrap { padding-top: calc(32px + env(safe-area-inset-top)); padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
