/* ============================================================================
   css/v2-shell.css  —  Phase 69 Dashboard v2 light SHELL (topbar + sidebar)
   ----------------------------------------------------------------------------
   Flips the shared chrome (header + sidebar) to the v2 light palette, gated on
   <body class="v2-shell">. Works by overriding the dark design tokens
   (css/variables.css) ONLY on the .header and .sidebar subtrees — the main
   content area keeps --bg-body dark, so not-yet-migrated (dark) tabs still
   render their dark content correctly inside the light frame. The migrated
   Results tab (#tab-results.v2-theme) supplies its own light surface, so with a
   light shell it now reads as one cohesive light dashboard.

   Hand-written (NOT generated by scripts/build-v2-theme.js). Remove the
   `v2-shell` body class to revert the shell to dark.
   ============================================================================ */

/* ── Shell accent tokens (2026-07 P1): every accent literal in this file now
   reads these vars. Defaults are the EXACT pre-token hexes, so an instance
   without colorTokens.shellAccent renders byte-identically. A branded
   instance sets ONE config key — the index.html injector writes
   --shell-accent and derives dark/tints from it. ── */
body.v2-shell {
  --shell-accent:             #1A73E8;
  --shell-accent-dark:        #1561C2;
  --shell-accent-tint:        #E8F0FE;
  --shell-accent-tint-soft:   #F0F6FF;
  --shell-accent-tint-strong: #D6E6FF;
}

/* ── Token override: light shell surfaces + text + borders ── */
body.v2-shell .header,
body.v2-shell .sidebar {
  --bg-header:           #FFFFFF;
  --bg-sidebar:          #FFFFFF;
  --bg-card:             #FFFFFF;
  --bg-card-hover:       #F0F4F8;
  --text-primary:        #1A2940;
  --text-secondary:      #455570;
  --text-muted:          #5E6C82;
  --border-color:        #E6EBF2;
  --border-color-hover:  #D4DBE6;
  /* active nav-item → mockup Google-blue accent + light-blue tint bg */
  --tc-primary:          var(--shell-accent);
  --tc-primary-light:    var(--shell-accent);
  --tc-primary-glow:     var(--shell-accent-tint);
}

/* ── A16: legacy border-token alias for the LIGHT CONTENT SURFACE ──
   css/variables.css defines --border-color / --border-color-hover as DARK-theme
   values (rgba(255,255,255,.08) — a translucent white hairline). The light
   content tabs (.v2-theme) define the renamed --border / --border-strong but
   never the legacy pair, so every shared component inside them that still reads
   the old name drew white-on-white, i.e. nothing: ~29 Results-tab table rows'
   separators, .card borders, .login-field inputs, the score ring track
   (.as-track), the scan bar (.scan-bar) and the stage icons (.st-ic).

   A15 shipped this alias scoped to #fd-dashboard-panel only, because widening it
   changes 03-dashboard-results by more than its 250px budget and the honest fix
   is a coordinated re-baseline. This is that re-baseline (Q7), so the alias is
   promoted to the whole light surface and the panel-scoped copy in index.html is
   dropped.

   Lives here, NOT in css/v2-theme.css, which is AUTO-GENERATED from
   proposal/dashboard-preview-2026-06-v2.html and would lose a hand-edit on the
   next `node scripts/build-v2-theme.js`. And NOT by retargeting the ~15 shared
   selectors in components.css, which also serve the DARK /login page where the
   dark value is correct. Values are exactly --border / --border-strong. ── */
.v2-theme {
  --border-color:        #E6EBF2;
  --border-color-hover:  #D4DBE6;
}

/* ── Header border + subtle elevation on light ── */
body.v2-shell .header {
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.06);
}
body.v2-shell .sidebar {
  border-right: 1px solid var(--border-color);
}

/* ── Logo: the header uses the all-white logo (invisible on white). Swap to the
   full-color brand logo via the v2-shell-only <img> the markup now carries. ── */
body.v2-shell .header-logo--white { display: none; }
body:not(.v2-shell) .header-logo--color { display: none; }
body.v2-shell .header-logo--color { display: block; height: 32px; width: auto; }

/* ── nav-item hover: the dark theme uses a white-alpha wash that vanishes on
   white. Use a light tint instead. ── */
body.v2-shell .nav-item:hover {
  background: #F0F4F8;
}
body.v2-shell .nav-item.active {
  background: var(--tc-primary-glow);
  color: var(--tc-primary);
  border-left-color: var(--tc-primary);
}

/* ── Section dividers / labels read fine via the token override; nudge the
   divider line so it's visible on white. ── */
body.v2-shell .nav-section-divider {
  background: var(--border-color);
}

/* ── Client switcher <select> + logout button: token-driven, but pin the select
   surface so it doesn't inherit a dark input bg. ── */
body.v2-shell .client-switcher-select {
  background: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
body.v2-shell .header-logout {
  color: var(--text-secondary);
}
body.v2-shell .header-logout:hover {
  background: #F0F4F8;
  color: var(--text-primary);
}

/* ── Score pills in the sidebar (audit/AI) use a white-alpha bg in dark mode;
   give them a light chip on white. ── */
body.v2-shell .nav-item-score {
  background: #EEF2F7;
  color: var(--text-secondary);
}

/* Phase 69 v2 IA: section heads, NEW badges, scroll for the longer 15-tab nav */
body.v2-shell .nav-section-label { color: var(--text-muted); }
body.v2-shell .nav-badge {
  margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .04em;
  background: var(--tc-primary-glow); color: var(--tc-primary);
  padding: 1px 6px; border-radius: 999px; text-transform: none;
}
body.v2-shell .sidebar-nav { overflow-y: auto; }

/* ── Subtle scrollbars — page + sidebar + any scroll area ──
   The default OS scrollbar reads chunky on the light shell. Replace it with a thin
   slate thumb on a transparent track, rounded, padded (border + background-clip) so it
   renders ~5px and stays present but quiet; it darkens on hover. Covers the document
   viewport (html:has) and every scroll container under the shell (sidebar, tables,
   maps). Full-page captures never paint a scrollbar, so this is baseline-neutral. */
html:has(body.v2-shell),
body.v2-shell,
body.v2-shell * {                                          /* * → Firefox: scrollbar-width isn't inherited */
  scrollbar-width: thin;                                   /* Firefox */
  scrollbar-color: rgba(96, 108, 130, 0.42) transparent;   /* thumb / track */
}
html:has(body.v2-shell)::-webkit-scrollbar,
body.v2-shell ::-webkit-scrollbar { width: 11px; height: 11px; }
html:has(body.v2-shell)::-webkit-scrollbar-track,
body.v2-shell ::-webkit-scrollbar-track { background: transparent; }
html:has(body.v2-shell)::-webkit-scrollbar-thumb,
body.v2-shell ::-webkit-scrollbar-thumb {
  background: rgba(96, 108, 130, 0.30);
  border-radius: 8px;
  border: 3px solid transparent;        /* padding so the thumb reads thin */
  background-clip: padding-box;
}
html:has(body.v2-shell)::-webkit-scrollbar-thumb:hover,
body.v2-shell ::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 108, 130, 0.55);
  background-clip: padding-box;
}
html:has(body.v2-shell)::-webkit-scrollbar-corner,
body.v2-shell ::-webkit-scrollbar-corner { background: transparent; }

/* ── Phase 69 v2: light login gate (matches dashboard + boot splash) ── */
body.v2-shell .login-gate {
  --bg-body: #F5F7FA; --bg-card: #FFFFFF;
  --text-primary: #1A2940; --text-secondary: #455570; --text-muted: #5E6C82;
  --border-color: #E6EBF2; --tc-primary: var(--shell-accent);
  background: var(--bg-body);
}
body.v2-shell .login-gate .login-container {
  background: #FFFFFF; border: 1px solid var(--border-color); border-radius: 16px;
  box-shadow: 0 1px 3px rgba(60,64,67,0.12), 0 10px 28px rgba(60,64,67,0.08);
  padding: 40px 36px;
}
body.v2-shell .login-gate .login-field input {
  background: #FFFFFF; border: 1px solid var(--border-color); color: var(--text-primary);
  min-height: 44px; border-radius: 10px;
}
body.v2-shell .login-gate .login-btn { min-height: 44px; border-radius: 10px; }
body.v2-shell .login-gate .login-field input:focus {
  border-color: var(--shell-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--shell-accent) 15%, transparent);
}
body.v2-shell .login-gate .login-btn {
  background: var(--shell-accent); border: none; color: #FFFFFF; font-weight: 600;
}
body.v2-shell .login-gate .login-btn:hover { background: var(--shell-accent-dark); }

/* ════════════════════════════════════════════════════════════════════════
   Phase 69 Stream 1 — GLOBAL TOPBAR (product strip + honest compare line)
   Shell chrome rendered once below .header, above tab content. Explicit light
   values (not token-driven) so it's independent of per-tab theme state. Rows
   bleed full-width; an inner wrapper centres content to --content-max-width so
   it lines up with the 32px-padded, centred tab content.
   ════════════════════════════════════════════════════════════════════════ */
body.v2-shell .v2-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E6EBF2;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.05);
}
body.v2-shell .v2-topbar-inner {
  max-width: var(--content-max-width, 1200px);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Row 1: product / service strip ── */
body.v2-shell .v2-topbar-products { border-bottom: 1px solid #EEF2F7; }
body.v2-shell .v2-topbar-products .v2-topbar-inner {
  display: flex; align-items: center; gap: 2px; overflow-x: auto;
}
body.v2-shell .v2-product {
  appearance: none; background: transparent; border: none; font-family: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 15px; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #455570; border-bottom: 3px solid transparent;
  transition: color .12s, background .12s, border-color .12s;
}
body.v2-shell .v2-product:hover { color: #1A2940; background: #F6F9FD; }
body.v2-shell .v2-product.is-active { color: var(--shell-accent); border-bottom-color: var(--shell-accent); }
body.v2-shell .v2-product:focus-visible { outline: 2px solid var(--shell-accent); outline-offset: -2px; }
body.v2-shell .v2-product-status {
  display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  font-size: 10px; font-weight: 700; line-height: 1;
}
body.v2-shell .v2-product-status.on  { background: var(--shell-accent); color: #FFFFFF; }
body.v2-shell .v2-product-status.off { background: #EAEDF1; color: #8A97A8; }
body.v2-shell .v2-product.is-inactive {
  color: #98A2B3; font-weight: 600; text-transform: none; letter-spacing: 0;
}
body.v2-shell .v2-product.is-inactive:hover { color: var(--shell-accent); background: var(--shell-accent-tint-soft); }
body.v2-shell .v2-product.is-inactive:hover .v2-product-status.off { background: var(--shell-accent-tint-strong); color: var(--shell-accent); }
body.v2-shell .v2-product-tag {
  font-size: 9px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  color: #8A97A8; background: #F2F4F7; border-radius: 999px; padding: 2px 7px;
}
/* Activated add-on (e.g. Content Calendar) — positive green tag vs the grey "Not activated". */
body.v2-shell .v2-product-tag.on { color: #1E8E3E; background: #E6F4EA; }
body.v2-shell .v2-product.is-inactive:hover .v2-product-tag { color: var(--shell-accent); background: var(--shell-accent-tint-strong); }
body.v2-shell .v2-product-divider {
  width: 1px; height: 20px; background: #E6EBF2; margin: 0 8px; flex: none;
}

/* ── Row 2: honest compare / window line ── */
body.v2-shell .v2-topbar-compare {
  background: linear-gradient(90deg, var(--shell-accent-tint) 0%, rgba(232, 240, 254, 0) 62%);
}
/* Hidden on tabs without period-over-period deltas (gated in _v2SyncProductStrip). */
body.v2-shell .v2-topbar-compare[hidden] { display: none; }
body.v2-shell .v2-topbar-compare .v2-topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px;
}
body.v2-shell .v2-compare-window {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: #1A2940;
}
body.v2-shell .v2-compare-ico { width: 14px; height: 14px; color: #5E6C82; flex: none; }
body.v2-shell .v2-compare-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5E6C82;
}
body.v2-shell .v2-compare-current { font-weight: 700; color: #1A2940; }
body.v2-shell .v2-compare-divider { width: 4px; height: 4px; border-radius: 50%; background: #C2CBD8; flex: none; }
body.v2-shell .v2-compare-vs { color: #455570; }
body.v2-shell .v2-compare-meta { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
body.v2-shell .v2-compare-legend { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; }
body.v2-shell .v2-leg.up { color: #1E8E3E; }
body.v2-shell .v2-leg.down { color: #D93025; }
body.v2-shell .v2-leg.flat { color: #5E6C82; }
body.v2-shell .v2-compare-toggle {
  appearance: none; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; background: #FFFFFF; border: 1px solid #D4DBE6; color: #455570;
  font-size: 11px; font-weight: 600;
}
body.v2-shell .v2-compare-toggle svg { width: 13px; height: 13px; }
body.v2-shell .v2-compare-toggle:hover { border-color: var(--shell-accent); color: var(--shell-accent); }
body.v2-shell .v2-compare-toggle[aria-pressed="true"] { background: var(--shell-accent); border-color: var(--shell-accent); color: #FFFFFF; }
body.v2-shell .v2-compare-help {
  appearance: none; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: #FFFFFF; border: 1px solid #D4DBE6; color: #5E6C82;
}
body.v2-shell .v2-compare-help svg { width: 13px; height: 13px; }
body.v2-shell .v2-compare-help:hover, body.v2-shell .v2-compare-help[aria-expanded="true"] { border-color: var(--shell-accent); color: var(--shell-accent); }
body.v2-shell .v2-compare-explainer {
  flex-basis: 100%; margin-top: 2px; padding: 10px 14px; background: #FFFFFF;
  border: 1px solid #E6EBF2; border-radius: 8px; font-size: 12px; line-height: 1.55; color: #455570;
}
body.v2-shell .v2-compare-explainer[hidden] { display: none; }
body.v2-shell .v2-compare-explainer strong { color: #1A2940; display: block; margin-bottom: 3px; font-size: 12.5px; }

/* ── "Highlight changes" — pulse every delta pill on the active tab ── */
body.v2-shell.v2-highlight-deltas .tab-content.active .kpi-delta {
  animation: v2DeltaPulse 1.2s ease-in-out 3; border-radius: 6px;
}
@keyframes v2DeltaPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--shell-accent) 0%, transparent); }
  50%      { box-shadow: 0 0 0 4px color-mix(in srgb, var(--shell-accent) 30%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  body.v2-shell.v2-highlight-deltas .tab-content.active .kpi-delta {
    animation: none; outline: 2px solid color-mix(in srgb, var(--shell-accent) 55%, transparent); outline-offset: 1px;
  }
}

/* ── Service upsell modal (built in JS, appended to <body>) ── */
body.v2-shell .v2-upsell-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(26, 41, 64, 0.45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 24px;
}
body.v2-shell .v2-upsell-backdrop[hidden] { display: none; }
body.v2-shell .v2-upsell {
  width: min(440px, 100%); background: #FFFFFF; border-radius: 16px;
  box-shadow: 0 10px 40px rgba(26, 41, 64, 0.25); padding: 28px; font-family: inherit; color: #1A2940;
}
body.v2-shell .v2-upsell-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--shell-accent-tint); color: var(--shell-accent); margin-bottom: 14px;
}
body.v2-shell .v2-upsell-ico svg { width: 22px; height: 22px; }
body.v2-shell .v2-upsell-tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--shell-accent);
}
body.v2-shell .v2-upsell h3 { margin: 4px 0 0; font-size: 18px; font-weight: 700; }
body.v2-shell .v2-upsell p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.6; color: #455570; }
body.v2-shell .v2-upsell-list { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
body.v2-shell .v2-upsell-list li { display: flex; gap: 8px; font-size: 13px; color: #1A2940; align-items: flex-start; }
body.v2-shell .v2-upsell-list svg { width: 16px; height: 16px; color: #1E8E3E; flex: none; margin-top: 1px; }
body.v2-shell .v2-upsell-actions { display: flex; gap: 10px; margin-top: 22px; }
body.v2-shell .v2-upsell-btn {
  appearance: none; font-family: inherit; cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 9px; flex: 1; text-align: center; text-decoration: none; line-height: 1.2;
}
body.v2-shell .v2-upsell-btn.primary { background: var(--shell-accent); border: 1px solid var(--shell-accent); color: #FFFFFF; }
body.v2-shell .v2-upsell-btn.primary:hover { background: var(--shell-accent-dark); }
body.v2-shell .v2-upsell-btn.ghost { background: #FFFFFF; border: 1px solid #D4DBE6; color: #455570; }
body.v2-shell .v2-upsell-btn.ghost:hover { background: #F0F4F8; }

/* ── Responsive: tighten gutters to match tab content on small screens ── */
@media (max-width: 768px) {
  body.v2-shell .v2-topbar-inner { padding: 0 16px; }
  body.v2-shell .v2-product { padding: 11px 11px; font-size: 12px; }
}

/* ════════════ Content Calendar tab (cp-*) — calendar grid · cards · lanes ════════════ */
body.v2-shell .cp-toolbar { display:flex; align-items:center; gap:12px 14px; flex-wrap:wrap; margin:18px 0 14px; }
body.v2-shell .cp-seg { display:inline-flex; background:var(--bg-tint); border:1px solid var(--border); border-radius:var(--radius-pill); padding:3px; gap:2px; }
body.v2-shell .cp-seg button { border:0; cursor:pointer; font:inherit; font-size:13px; font-weight:600; padding:6px 14px; border-radius:var(--radius-pill); background:transparent; color:var(--text-secondary); display:inline-flex; align-items:center; gap:6px; transition:background .12s, color .12s; }
body.v2-shell .cp-seg button[aria-selected="true"] { background:var(--bg-card); color:var(--text-primary); box-shadow:0 1px 3px rgba(0,0,0,.10); }
body.v2-shell .cp-weeknav { display:inline-flex; align-items:center; gap:10px; }
body.v2-shell .cp-weeknav .cp-weeklabel { font-size:13.5px; font-weight:700; color:var(--text-primary); white-space:nowrap; }
body.v2-shell .cp-weeknav .cp-weeklabel small { display:block; font-size:11px; font-weight:500; color:var(--text-muted); }
body.v2-shell .cp-navbtn { width:30px; height:30px; border-radius:8px; border:1px solid var(--border); background:var(--bg-card); cursor:pointer; color:var(--text-secondary); display:grid; place-items:center; font-size:15px; line-height:1; }
body.v2-shell .cp-navbtn:hover:not(:disabled) { background:var(--bg-card-soft); color:var(--text-primary); }
body.v2-shell .cp-navbtn:disabled { opacity:.35; cursor:default; }
body.v2-shell .cp-filterbar { display:inline-flex; gap:6px; flex-wrap:wrap; margin-left:auto; }
body.v2-shell .cp-fchip { font-size:12px; font-weight:600; padding:4px 11px; border-radius:var(--radius-pill); border:1px solid var(--border); background:var(--bg-card); cursor:pointer; color:var(--text-secondary); display:inline-flex; align-items:center; gap:6px; }
body.v2-shell .cp-fchip[aria-pressed="false"] { opacity:.4; }
body.v2-shell .cp-fdot { width:8px; height:8px; border-radius:50%; flex:none; }

/* calendar grid */
body.v2-shell .cp-cal { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
body.v2-shell .cp-day { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:9px; min-height:128px; display:flex; flex-direction:column; gap:7px; }
body.v2-shell .cp-day.cp-empty { background:var(--bg-tint); }
body.v2-shell .cp-dayhead { font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.4px; display:flex; align-items:baseline; justify-content:space-between; }
body.v2-shell .cp-dayhead .cp-daynum { color:var(--text-secondary); font-size:13px; }
body.v2-shell .cp-tile { text-align:left; width:100%; border:1px solid var(--border); border-left-width:3px; border-radius:9px; background:var(--bg-card-soft); padding:8px 9px; cursor:pointer; display:flex; flex-direction:column; gap:4px; transition:transform .08s ease, box-shadow .08s ease; }
body.v2-shell .cp-tile:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,0,0,.09); }
body.v2-shell .cp-tile-ch { font-size:10px; font-weight:700; display:flex; align-items:center; gap:5px; text-transform:uppercase; letter-spacing:.2px; }
body.v2-shell .cp-tile-ch .cp-fdot { width:7px; height:7px; }
body.v2-shell .cp-tile-title { font-size:12px; font-weight:600; color:var(--text-primary); line-height:1.32; }
body.v2-shell .cp-tile-meta { font-size:10px; color:var(--text-muted); display:flex; align-items:center; gap:6px; }
body.v2-shell .cp-tile-thumb { width:100%; height:54px; object-fit:cover; border-radius:6px; }
body.v2-shell .cp-daymute { font-size:11px; color:var(--text-muted); opacity:.7; }

/* cards view */
body.v2-shell .cp-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:14px; align-items:start; }
body.v2-shell .cp-card { background:var(--bg-card); border:1px solid var(--border); border-left-width:3px; border-radius:13px; padding:15px 16px; display:flex; flex-direction:column; }
/* card image picker (Cards view) */
body.v2-shell .cp-cardimg { flex:none; width:96px; display:flex; flex-direction:column; gap:5px; }
body.v2-shell .cp-cardthumb { padding:0; border:1px solid var(--border); border-radius:8px; overflow:hidden; cursor:pointer; background:#0d1722; width:96px; height:96px; display:block; }
body.v2-shell .cp-cardthumb img { width:96px; height:96px; object-fit:cover; display:block; }
body.v2-shell .cp-cardthumb:hover { border-color:var(--text-muted); }
body.v2-shell .cp-cardbrief { display:flex; align-items:center; justify-content:center; border:1px dashed var(--border); background:var(--bg-tint); color:var(--text-muted); font-size:8px; font-weight:700; text-align:center; line-height:1.2; cursor:default; }
body.v2-shell .cp-cardvar { display:inline-flex; background:var(--bg-tint); border:1px solid var(--border); border-radius:var(--radius-pill); padding:2px; }
body.v2-shell .cp-cardvar button { flex:1; border:0; cursor:pointer; font:inherit; font-size:10px; font-weight:700; padding:3px 0; border-radius:var(--radius-pill); background:transparent; color:var(--text-secondary); }
body.v2-shell .cp-cardvar button[aria-selected="true"] { background:var(--bg-card); color:var(--text-primary); box-shadow:0 1px 2px rgba(0,0,0,.12); }
body.v2-shell .cp-carddl { display:inline-flex; align-items:center; justify-content:center; gap:4px; font-size:10.5px; font-weight:700; color:var(--chart-blue); text-decoration:none; padding:2px; }

/* lanes view */
body.v2-shell .cp-lanes { background:var(--bg-card); border:1px solid var(--border); border-radius:14px; overflow:hidden; }
body.v2-shell .cp-lane { display:grid; grid-template-columns:170px repeat(var(--cp-weeks,4),1fr); align-items:center; border-top:1px solid var(--border); }
body.v2-shell .cp-lane:first-child { border-top:0; background:var(--bg-card-soft); }
body.v2-shell .cp-lane-h { padding:10px 14px; font-size:12px; font-weight:700; color:var(--text-secondary); display:flex; align-items:center; gap:8px; }
body.v2-shell .cp-lane-cell { padding:10px 8px; display:flex; gap:5px; flex-wrap:wrap; justify-content:center; border-left:1px solid var(--border); min-height:42px; align-items:center; }
body.v2-shell .cp-lanedot { width:20px; height:20px; border-radius:50%; border:0; cursor:pointer; display:grid; place-items:center; color:#fff; font-size:10px; font-weight:700; }
body.v2-shell .cp-lanedot:hover { transform:scale(1.12); }

/* channel legend + recommended */
body.v2-shell .cp-chips { display:flex; gap:10px; flex-wrap:wrap; }
body.v2-shell .cp-chan { flex:1; min-width:210px; background:var(--bg-card); border:1px solid var(--border); border-left-width:3px; border-radius:11px; padding:12px 14px; }
body.v2-shell .cp-rec { flex:1; min-width:210px; background:var(--bg-tint); border:1px dashed var(--border); border-radius:11px; padding:12px 14px; }
body.v2-shell .cp-sectlabel { font-size:11px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:var(--text-muted); margin:18px 0 8px; }

/* detail modal */
body.v2-shell .cp-bd { position:fixed; inset:0; background:rgba(15,23,42,.48); display:flex; align-items:flex-start; justify-content:center; z-index:1000; padding:40px 20px; overflow:auto; animation:cpFade .14s ease; }
body.v2-shell .cp-modal { background:var(--bg-card); border-radius:16px; max-width:560px; width:100%; box-shadow:0 24px 70px rgba(0,0,0,.32); overflow:hidden; animation:cpPop .16s cubic-bezier(.2,.8,.3,1); }
body.v2-shell .cp-herowrap { position:relative; }
body.v2-shell .cp-modal-hero { width:100%; max-height:300px; object-fit:contain; display:block; background:#0d1722; }
body.v2-shell .cp-imgtoggle { position:absolute; top:12px; left:12px; display:inline-flex; gap:2px; padding:3px; background:rgba(13,23,34,0.78); border-radius:var(--radius-pill); }
body.v2-shell .cp-imgtoggle button { border:0; cursor:pointer; font:inherit; font-size:11.5px; font-weight:700; padding:5px 12px; border-radius:var(--radius-pill); background:transparent; color:rgba(255,255,255,0.8); }
body.v2-shell .cp-imgtoggle button[aria-selected="true"] { background:#fff; color:#182939; }
body.v2-shell .cp-dl { text-decoration:none; }
body.v2-shell .cp-modal-brief { height:120px; display:flex; align-items:center; justify-content:center; background:var(--bg-tint); color:var(--text-muted); font-size:12px; text-align:center; padding:16px; }
body.v2-shell .cp-modal-body { padding:18px 20px 20px; }
body.v2-shell .cp-modal-copy { font-size:14px; line-height:1.6; color:var(--text-secondary); white-space:pre-wrap; background:var(--bg-tint); border-radius:10px; padding:12px 14px; }
body.v2-shell .cp-x { position:absolute; top:14px; right:16px; width:32px; height:32px; border-radius:50%; border:0; background:rgba(255,255,255,.92); cursor:pointer; font-size:17px; line-height:1; color:#334; display:grid; place-items:center; box-shadow:0 2px 8px rgba(0,0,0,.18); }
@keyframes cpFade { from{opacity:0} to{opacity:1} }
@keyframes cpPop { from{opacity:0; transform:translateY(8px) scale(.98)} to{opacity:1; transform:none} }

/* copy button (shared) */
body.v2-shell .cp-copybtn { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; padding:7px 13px; border-radius:9px; border:1px solid var(--border); background:var(--bg-card-soft); color:var(--text-primary); cursor:pointer; }
body.v2-shell .cp-copybtn:hover { background:var(--bg-card); }

/* compact context bar (goal + stats, replaces the goal banner + 4 tiles) */
body.v2-shell .cp-context { display:flex; align-items:center; gap:12px 18px; flex-wrap:wrap; background:var(--bg-card-soft); border:1px solid var(--border); border-radius:12px; padding:11px 16px; margin:14px 0 4px; }
body.v2-shell .cp-goal { display:inline-flex; align-items:center; gap:7px; font-size:13.5px; font-weight:700; color:var(--text-primary); }
body.v2-shell .cp-goal svg { color:#E8773A; }
body.v2-shell .cp-statgroup { display:inline-flex; gap:18px; flex-wrap:wrap; margin-left:auto; }
body.v2-shell .cp-stat { font-size:12.5px; color:var(--text-secondary); white-space:nowrap; }
body.v2-shell .cp-stat b { font-size:15px; font-weight:800; margin-right:4px; }
body.v2-shell .cp-fcad { font-size:10px; font-weight:700; opacity:.65; margin-left:1px; }

/* compact "channels worth adding" (why clamped to 2 lines; full text on hover) */
body.v2-shell .cp-rec-head { display:flex; align-items:center; gap:8px; margin-bottom:5px; }
body.v2-shell .cp-rec-tag { margin-left:auto; font-size:9px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; border-radius:var(--radius-pill); padding:2px 8px; white-space:nowrap; }
body.v2-shell .cp-rec-why { font-size:12px; color:var(--text-secondary); line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* "why this works" — collapsed by default */
body.v2-shell .cp-why { margin-top:20px; border:1px solid var(--border); border-radius:12px; background:var(--bg-card); }
body.v2-shell .cp-why > summary { cursor:pointer; padding:13px 16px; font-size:13.5px; font-weight:700; color:var(--text-primary); list-style:none; display:flex; align-items:center; }
body.v2-shell .cp-why > summary::-webkit-details-marker { display:none; }
body.v2-shell .cp-why > summary::before { content:'\25B8'; margin-right:9px; color:var(--text-muted); font-size:12px; }
body.v2-shell .cp-why[open] > summary::before { content:'\25BE'; }
body.v2-shell .cp-why-body { padding:2px 16px 18px; }

@media (max-width:1024px){
  body.v2-shell .cp-cal { grid-template-columns:1fr; }
  body.v2-shell .cp-day { flex-direction:row; align-items:stretch; min-height:0; }
  body.v2-shell .cp-dayhead { flex-direction:column; min-width:60px; align-items:flex-start; gap:2px; }
  body.v2-shell .cp-day .cp-tilewrap { flex:1; display:flex; flex-direction:column; gap:6px; }
  body.v2-shell .cp-lane { grid-template-columns:120px repeat(var(--cp-weeks,4),1fr); }
  body.v2-shell .cp-filterbar { margin-left:0; }
}

/* ── P1 2026-07: tabular numerals wherever numbers column-align — KPI tiles,
   data/rank tables, growth figures. Lining tabular digits stop the jitter when
   values change width (emil: unseen details compound). ── */
body.v2-shell .kpi-tile,
body.v2-shell .data-table,
body.v2-shell .rank-table,
body.v2-shell .kpi-value,
body.v2-shell .v2-compare-current {
  font-variant-numeric: tabular-nums;
}
