/* ============================================================
   UK PCP Calculator Pro — design tokens & base
   Modern fintech · cool blue-teal · light + dark
   ============================================================ */

:root {
  /* type */
  --font-display: "Schibsted Grotesk", system-ui, sans-serif;
  --font-body: "Schibsted Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* radius + density (overridable by Tweaks) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --pad: 1;            /* density multiplier */

  /* accent (overridable by Tweaks) */
  --accent: oklch(0.60 0.114 224);
  --accent-strong: oklch(0.50 0.125 244);
  --accent-ink: oklch(0.99 0.01 224);

  /* light theme (default) */
  --bg: oklch(0.984 0.004 232);
  --bg-grad: oklch(0.965 0.012 224);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.975 0.006 232);
  --surface-3: oklch(0.96 0.008 232);
  --border: oklch(0.912 0.009 232);
  --border-strong: oklch(0.85 0.012 232);
  --ink: oklch(0.28 0.022 252);
  --ink-2: oklch(0.49 0.02 250);
  --ink-3: oklch(0.63 0.015 248);
  --accent-soft: oklch(0.955 0.028 220);
  --accent-line: oklch(0.86 0.05 220);

  --pos: oklch(0.58 0.12 158);
  --pos-soft: oklch(0.95 0.04 158);
  --neg: oklch(0.585 0.17 25);
  --neg-soft: oklch(0.955 0.035 25);
  --warn: oklch(0.74 0.13 72);
  --warn-soft: oklch(0.96 0.05 80);

  --shadow-sm: 0 1px 2px oklch(0.4 0.03 252 / 0.06), 0 1px 3px oklch(0.4 0.03 252 / 0.05);
  --shadow-md: 0 2px 6px oklch(0.4 0.03 252 / 0.06), 0 8px 24px oklch(0.4 0.03 252 / 0.07);
  --shadow-lg: 0 8px 20px oklch(0.4 0.03 252 / 0.09), 0 24px 60px oklch(0.4 0.03 252 / 0.10);
  --ring: 0 0 0 3px oklch(0.60 0.114 224 / 0.18);
}

[data-theme="dark"] {
  --bg: oklch(0.205 0.018 252);
  --bg-grad: oklch(0.235 0.026 248);
  --surface: oklch(0.245 0.021 252);
  --surface-2: oklch(0.275 0.024 252);
  --surface-3: oklch(0.305 0.026 252);
  --border: oklch(0.345 0.02 252);
  --border-strong: oklch(0.42 0.022 252);
  --ink: oklch(0.965 0.006 232);
  --ink-2: oklch(0.78 0.016 240);
  --ink-3: oklch(0.62 0.018 244);
  --accent: oklch(0.72 0.105 215);
  --accent-strong: oklch(0.66 0.12 230);
  --accent-soft: oklch(0.33 0.045 224);
  --accent-line: oklch(0.45 0.06 224);

  --pos: oklch(0.74 0.13 158);
  --pos-soft: oklch(0.33 0.05 158);
  --neg: oklch(0.7 0.16 28);
  --neg-soft: oklch(0.34 0.06 28);
  --warn: oklch(0.82 0.12 78);
  --warn-soft: oklch(0.36 0.05 78);

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 2px 8px oklch(0 0 0 / 0.32), 0 12px 30px oklch(0 0 0 / 0.34);
  --shadow-lg: 0 10px 24px oklch(0 0 0 / 0.4), 0 30px 70px oklch(0 0 0 / 0.45);
  --ring: 0 0 0 3px oklch(0.72 0.105 215 / 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}
#root { min-height: 100vh; }
:root { --global-nav-h: 54px; }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; line-height: 1.1; font-weight: 600; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---- App frame ---- */
svg { max-width: 100%; }
.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 100% 0%, var(--bg-grad), transparent 60%),
    var(--bg);
}
.app.mobile-mode { grid-template-columns: 1fr; }

/* ---- Sidebar: floating frosted-glass rail ---- */
.sidebar {
  width: 240px;
  margin: 14px 0 14px 14px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: calc(var(--global-nav-h, 0px) + 14px);
  height: calc(100vh - var(--global-nav-h, 0px) - 28px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.rail-nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  display: grid; place-items: center; color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; line-height: 1.12; letter-spacing: -0.02em; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: 0.02em; }

.nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3); font-weight: 600; padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent; background: none; width: 100%; text-align: left;
  transition: background .14s, color .14s, box-shadow .14s;
}
.nav-item .ni-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-3); transition: background .15s, box-shadow .15s, transform .15s;
}
.nav-item .ni-label { flex: 1; min-width: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item:hover .ni-dot { background: var(--ink-2); }
.nav-item.active {
  background: var(--surface-3); color: var(--ink); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.nav-item.active .ni-dot {
  background: var(--accent); box-shadow: 0 0 9px var(--accent); transform: scale(1.1);
}
.nav-item.nav-link { color: var(--ink-2); text-decoration: none; }
.nav-item .ni-tag {
  margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 999px; background: var(--surface-3); color: var(--ink-3);
  text-transform: uppercase;
}

/* ---- Pinned context-summary footer ---- */
.rail-foot {
  margin-top: auto;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.rail-foot-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-3); font-weight: 600; margin-bottom: 9px;
}
.rail-foot-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 12px; }
.rail-foot-row span { color: var(--ink-2); }
.rail-foot-row b { font-weight: 600; }
.rail-foot-row.hero { margin-top: 5px; padding-top: 8px; border-top: 1px solid var(--border); }
.rail-foot-row.hero b { font-size: 16px; color: var(--accent-strong); }
.rail-foot-note { font-size: 9.5px; color: var(--ink-3); margin-top: 9px; letter-spacing: .01em; }

/* ---- Topbar ---- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 30px; border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--surface) 78%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: var(--global-nav-h, 0px); z-index: 20;
}
.topbar .crumb { font-size: 13px; color: var(--ink-3); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.topbar-spacer { flex: 1; }

.seg {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px;
}
.seg button {
  border: none; background: none; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px;
  transition: all .14s;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center;
  transition: all .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--border-strong); }

/* ---- Content area ---- */
.content { padding: calc(28px * var(--pad)) 30px 64px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.page-head p { color: var(--ink-2); margin: 9px 0 0; font-size: 14.5px; max-width: 60ch; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: calc(22px * var(--pad)); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 16px; }
.card-head .ch-ico { width: 18px; height: 18px; color: var(--accent); }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* ---- Fields ---- */
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix { position: absolute; left: 13px; color: var(--ink-3); font-size: 14px; pointer-events: none; font-weight: 500; }
.input-suffix { position: absolute; right: 13px; color: var(--ink-3); font-size: 13px; pointer-events: none; }
.text-input {
  width: 100%; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--ink); border-radius: var(--r-sm); padding: 10px 13px 10px 26px;
  font-size: 15px; font-weight: 600; transition: all .14s; font-variant-numeric: tabular-nums;
}
.text-input.no-prefix { padding-left: 13px; }
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.text-input:hover { border-color: var(--border-strong); }

/* ---- Slider ---- */
.slider-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.slider-val { font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: var(--accent-strong); }
input[type=range].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--surface-3); outline: none; }
input[type=range].rng::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface); box-shadow: var(--shadow-sm); cursor: grab;
}
input[type=range].rng::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); cursor: grab;
}

/* ---- Stats / results ---- */
.hero-result {
  background: linear-gradient(150deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink); border-radius: var(--r-lg); padding: 24px 26px;
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.hero-result::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
  border-radius: 50%; background: radial-gradient(circle, oklch(1 0 0 / 0.14), transparent 70%);
}
.hero-result .hr-label { font-size: 12.5px; opacity: .85; font-weight: 600; letter-spacing: .03em; }
.hero-result .hr-value { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.hero-result .hr-value small { font-size: 17px; opacity: .8; font-weight: 500; }
.hero-result .hr-foot { font-size: 12px; opacity: .8; }

.stat {
  padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2);
  border: 1px solid var(--border);
}
.stat .s-label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.stat .s-value { font-size: 21px; font-weight: 700; font-family: var(--font-display); margin-top: 3px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .s-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.pill.pos { background: var(--pos-soft); color: var(--pos); }
.pill.neg { background: var(--neg-soft); color: var(--neg); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.neutral { background: var(--surface-3); color: var(--ink-2); }

/* ---- Breakdown rows ---- */
.brk-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.brk-row:last-child { border-bottom: none; }
.brk-row .brk-k { color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.brk-row .brk-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.brk-row.total { font-weight: 700; border-top: 2px solid var(--border-strong); margin-top: 4px; padding-top: 13px; }
.brk-row.total .brk-k { color: var(--ink); font-weight: 700; }
.brk-row.total .brk-v { font-size: 16px; }

/* ---- Info tooltip ---- */
.info { position: relative; display: inline-flex; }
.info-ico { width: 14px; height: 14px; color: var(--ink-3); cursor: help; }
.info-pop {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--surface); font-size: 11.5px; font-weight: 500;
  padding: 8px 11px; border-radius: 8px; width: 220px; line-height: 1.45; z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .15s; box-shadow: var(--shadow-md); text-transform: none; letter-spacing: 0;
}
[data-theme="dark"] .info-pop { background: var(--surface-3); color: var(--ink); border: 1px solid var(--border-strong); }
.info:hover .info-pop { opacity: 1; }

/* ---- Disclaimer ---- */
.disclaimer {
  display: flex; gap: 10px; align-items: flex-start; font-size: 11.5px; color: var(--ink-3);
  line-height: 1.5; padding: 13px 15px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px dashed var(--border-strong); margin-top: 20px;
}
.disclaimer svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--ink-3); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; border: 1px solid transparent; transition: all .15s;
}
.btn-primary { background: var(--accent-strong); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: var(--shadow-sm); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { color: var(--ink); border-color: var(--border-strong); }
.btn svg { width: 16px; height: 16px; }

/* ---- Layout helpers ---- */
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
.grid-12 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- Monetisation: partner offers ---- */
.ad-label {
  display: flex; align-items: center; gap: 6px; font-size: 9.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 7px;
}
.ad-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.partner-card {
  display: flex; gap: 13px; align-items: flex-start; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s, transform .15s; text-decoration: none; color: inherit;
}
.partner-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.partner-logo {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  background-image: repeating-linear-gradient(135deg, var(--surface-3) 0 6px, var(--surface) 6px 12px);
  border: 1px solid var(--border); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 8px; color: var(--ink-3); text-align: center; line-height: 1.2; padding: 4px;
}
.partner-body { flex: 1; min-width: 0; }
.partner-cat { font-size: 10.5px; font-weight: 600; color: var(--accent-strong); letter-spacing: 0.02em; text-transform: uppercase; }
.partner-head { font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 2px 0 3px; line-height: 1.25; }
.partner-blurb { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.partner-cta {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  font-size: 12px; font-weight: 600; color: var(--accent-strong);
}
.partner-cta svg { width: 13px; height: 13px; transition: transform .15s; }
.partner-card:hover .partner-cta svg { transform: translateX(2px); }
.partner-disclosure { font-size: 10.5px; color: var(--ink-3); line-height: 1.5; margin-top: 10px; display: flex; gap: 6px; }
.partner-disclosure svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px; }

/* ---- Ad slot ---- */
.ad-slot {
  border: 1px dashed var(--border-strong); border-radius: var(--r-md); overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface) 10px 20px);
}
.ad-slot-inner { display: grid; place-items: center; text-align: center; padding: 18px; gap: 3px; }
.ad-slot-mpu { width: 100%; max-width: 300px; height: 250px; margin: 0 auto; }
.ad-slot-leader { width: 100%; height: 90px; }
.ad-slot .as-dim { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.ad-slot .as-note { font-size: 11px; color: var(--ink-3); max-width: 200px; }

/* ---- Premium upsell + checkout modal ---- */
.premium-card {
  border: 1px solid var(--accent-line); border-radius: var(--r-lg); background: var(--surface);
  padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.premium-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 70% at 100% 0%, var(--accent-soft), transparent 60%);
}
.premium-feats { display: flex; flex-direction: column; gap: 7px; margin: 13px 0 15px; }
.premium-feat { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); }
.premium-feat svg { width: 15px; height: 15px; color: var(--pos); flex-shrink: 0; }
.premium-price { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.premium-price small { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: oklch(0.2 0.02 252 / 0.5);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; overflow: hidden;
  animation: popIn .22s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes popIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 22px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 18px; }
.modal-close { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; font-size: 18px; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 16px 22px 22px; }
.checkout-summary { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 13px 15px; margin-bottom: 16px; }
.card-input-row { display: grid; grid-template-columns: 1fr 90px 80px; gap: 9px; }
.pay-success { text-align: center; padding: 12px 0 4px; }
.pay-tick { width: 56px; height: 56px; border-radius: 50%; background: var(--pos-soft); color: var(--pos); display: grid; place-items: center; margin: 0 auto 14px; }
.pay-tick svg { width: 30px; height: 30px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--ink-3); margin-top: 12px; }
.secure-note svg { width: 13px; height: 13px; }

/* ---- Mobile device frame ---- */
.device-stage { display: grid; place-items: start center; padding: 30px 16px 64px; }
.device {
  width: 390px; max-width: 100%; background: var(--surface); border-radius: 38px;
  border: 10px solid oklch(0.18 0.01 252); box-shadow: var(--shadow-lg);
  overflow: hidden; position: relative;
}
[data-theme="dark"] .device { border-color: oklch(0.12 0.008 252); }
.device-notch { height: 30px; display: grid; place-items: center; position: relative; }
.device-notch::after { content: ""; width: 110px; height: 22px; background: oklch(0.18 0.01 252); border-radius: 0 0 16px 16px; position: absolute; top: 0; }
.device-scroll { height: 720px; overflow-y: auto; }
.device .grid-12, .device .grid-2 { grid-template-columns: 1fr; gap: 14px; }
.device .stack { position: static !important; }
.device .stat-grid { grid-template-columns: 1fr 1fr; }
.device .hero-result .hr-value { font-size: 36px; }

/* responsive */
@media (max-width: 920px) {
  .grid-12, .grid-2 { grid-template-columns: minmax(0,1fr); }
}
/* Tablet & mobile: collapse the sidebar into a horizontal rail (matches the suite) */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    width: auto; margin: 0 0 4px; height: auto;
    position: sticky; top: calc(var(--global-nav-h, 54px) + 6px); z-index: 60;
    flex-direction: column; gap: 10px; padding: 10px 12px;
  }
  .rail-nav {
    flex-direction: row; align-items: center; gap: 4px;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
    margin: 0; padding: 0; min-height: 0;
  }
  .rail-nav::-webkit-scrollbar { display: none; }
  .nav-group { flex-direction: row; align-items: center; gap: 4px; }
  .nav-group-label, .rail-foot { display: none; }
  .nav-item { width: auto; white-space: nowrap; flex: 0 0 auto; min-height: 40px; }
  .content { padding: 20px 16px 60px; }
  /* hover tooltips are unusable on touch and their centred bubble can overflow */
  .info-pop { display: none; }
}

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid var(--surface); }
::-webkit-scrollbar-track { background: transparent; }
