/* =========================================================================
   shell.css: app chrome (layer `shell`).
   Precedence comes from the @layer order declared in index.html, not from
   specificity or load order: anything here beats every legacy rule, so no
   !important and no `html body` boosts are needed. Inline styles set by JS
   still win, as they should.

   Breakpoints (only these three):
     phone          max-width: 640px
     mobile shell   max-width: 820px   (matches the JS `innerWidth <= 820` checks)
     compact desk   max-width: 1024px
   ========================================================================= */
@layer shell {

  /* ---- Type: Satoshi everywhere, mono only for code ---------------------- */
  html, body { font-family: var(--font-body); }
  body *:not(code):not(pre):not(kbd):not(samp):not(.material-symbols-outlined):not(.material-icons):not([class*="icon"]) {
    font-family: var(--font-body);
  }
  code, pre, kbd, samp { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

  /* ---- Page surface + the one scroll area ------------------------------- */
  html, body { background: var(--bg-app); color: var(--text-primary); }
  #main { background: var(--bg-app); }
  #main-content {
    background: var(--bg-app);
    color: var(--text-primary);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
  }

  /* ---- Desktop chrome --------------------------------------------------- */
  aside.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: var(--z-nav);
  }
  header.topbar {
    background: var(--bg-app);
    border-bottom: 1px solid var(--border);
    z-index: var(--z-sticky);
  }

  /* Floating "Ask" pill: never on top of the Ask page itself (duplicate
     composer), and the page reserves room for it so it never covers content. */
  #floating-chat { z-index: var(--z-composer); }
  body.route-ask #floating-chat:not(.open):not(.is-open) .floating-chat-toggle { display: none; }
  @media (min-width: 821px) {
    body:not(.route-ask) #main-content { padding-bottom: 88px; }
  }

  /* ---- Composer (one component for Ask, chat and the floating panel) ----- */
  .rich-composer {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
  }
  .rich-composer:focus-within { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--focus-ring); }
  .rich-composer .rc-input { color: var(--text-primary); font-size: var(--t-15); }
  .rich-composer .rc-input:empty::before { color: var(--text-tertiary); }
  .rich-composer .rc-toolbar { gap: var(--sp-2); flex-wrap: nowrap; min-width: 0; }
  .rich-composer .rc-chip,
  .rich-composer .rc-icon-btn,
  .rich-composer .rc-plus-native-wrap {
    color: var(--text-secondary);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    opacity: 1;
  }
  .rich-composer .rc-chip:hover,
  .rich-composer .rc-icon-btn:hover,
  .rich-composer .rc-plus-native-wrap:hover { background: var(--bg-hover); color: var(--text-primary); }
  .rich-composer .rc-chip { width: auto; min-width: 40px; flex: 0 0 auto; }
  .rich-composer .rc-chip-label {
    color: inherit;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }
  .rich-composer .rc-send { background: var(--accent); color: var(--on-accent); border: 0; }
  .rich-composer .rc-send:hover { background: var(--accent-hover); }
  .rich-composer .rc-send:disabled { background: var(--bg-hover); color: var(--text-faint); }

  @media (min-width: 821px) {
    .ai-composer-wrap { width: min(760px, calc(100% - 48px)); margin-inline: auto; }
  }

  /* ---- Mobile shell: slim top bar + bottom tab bar ---------------------- */
  .gl-tabbar { display: none; }

  @media (max-width: 820px) {
    /* One page frame for every scrolling screen: clear the 56px top bar
       once, 16px gutters, and drop the per-view top padding that each
       screen used to add to clear the old bars. The document is the only
       scroller. Ask, Messages, auth and the full-bleed map own their frame. */
    body:not(.route-ask):not(.route-messages):not(.route-hood):not(.is-auth-page) #main-content {
      padding-top: calc(56px + env(safe-area-inset-top, 0px) + var(--page-top));
      padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
      padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
    }
    body:not(.route-ask):not(.route-messages):not(.route-hood):not(.is-auth-page) #main-content > * {
      padding-left: 0;
      padding-right: 0;
      margin-left: 0;
      margin-right: 0;
      max-width: 100%;
    }
    body:not(.route-ask):not(.route-messages):not(.route-hood):not(.is-auth-page) #main-content > :first-child {
      padding-top: 0;
      margin-top: 0;
    }
    /* SuperViz keeps its view pill in the desktop top bar; on phones that
       bar docks directly under the 56px app bar instead of painting over it */
    body.topbar-superviz-chrome .topbar {
      position: fixed;
      top: calc(56px + env(safe-area-inset-top, 0px));
      left: 0;
      right: 0;
      height: 52px;
      z-index: var(--z-sticky);
      background: var(--bg-app);
      border-bottom: 1px solid var(--border);
    }
    /* same specificity as the page-frame rule above, so this one applies */
    body.topbar-superviz-chrome:not(.route-ask):not(.route-messages):not(.route-hood):not(.is-auth-page) #main-content { padding-top: calc(108px + env(safe-area-inset-top, 0px) + var(--page-top)); }
    body.is-auth-page .gl-tabbar,
    body.is-auth-page #floating-chat { display: none; }
    /* top bar: wordmark + overflow menu; view switch and avatar move to the tab bar */
    .mobile-topnav {
      background: var(--bg-app);
      border-bottom: 1px solid var(--border);
      box-shadow: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      z-index: var(--z-sticky);
    }
    .mobile-topnav .mt-switch,
    .mobile-topnav #mt-avatar { display: none; }
    .mobile-topnav::before {
      content: attr(data-title);
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font: 700 var(--fs-18)/1 var(--font-display);
      letter-spacing: -0.01em;
      color: var(--text-primary);
      margin-right: auto;
      padding-left: var(--sp-4);
    }
    .mobile-topnav .mt-kebab-chip { background: transparent; border: 0; box-shadow: none; color: var(--text-secondary); }

    /* bottom tab bar */
    .gl-tabbar {
      display: flex;
      position: fixed;
      left: 0; right: 0; bottom: 0;
      height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
      padding: 0 var(--sp-2) env(safe-area-inset-bottom, 0px);
      align-items: stretch;
      justify-content: space-around;
      background: var(--bg-app);
      border-top: 1px solid var(--border);
      z-index: var(--z-nav);
    }
    .gl-tab {
      flex: 1 1 0;
      display: flex;
      align-items: center;
      justify-content: center;
      height: var(--tabbar-h);
      min-width: 0;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: none;
      box-shadow: none;
      color: var(--text-tertiary);
      text-decoration: none;
      -webkit-tap-highlight-color: transparent;
      cursor: pointer;
    }
    .gl-tab svg { width: 24px; height: 24px; stroke-width: 1.8; }
    .gl-tab[aria-current="page"] { color: var(--text-primary); }
    .gl-tab[aria-current="page"] svg { stroke-width: 2.4; }
    .gl-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -6px; border-radius: var(--r-md); }
    .gl-tab-avatar-ring {
      width: 28px; height: 28px;
      border-radius: 50%;
      overflow: hidden;
      display: grid;
      place-items: center;
      background: var(--bg-elev);
      color: var(--text-secondary);
      font-size: var(--t-10);
      font-weight: 600;
      box-shadow: 0 0 0 1px var(--border-strong);
    }
    .gl-tab-avatar-ring img { width: 100%; height: 100%; object-fit: cover; }
    .gl-tab-avatar-ring img:not([src]), .gl-tab-avatar-ring img[src=""] { display: none; }
    .gl-tab[aria-expanded="true"] .gl-tab-avatar-ring { box-shadow: 0 0 0 2px var(--text-primary); }

    /* page content clears the tab bar */
    #main-content { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--sp-4)); }

    /* Ask composer docks just above the tab bar */
    /* (position/bottom are set inline by app.js; it reads --kb-safe, set below) */
    .ai-composer-wrap { background: var(--bg-app); }
    body.route-ask #main-content { padding-bottom: calc(var(--tabbar-h) + 140px + env(safe-area-inset-bottom, 0px)); }

    /* the solid top bar replaces the old scroll veils and top/bottom fades */
    #mobile-topbar-veil, #perplexity-fade, #perplexity-fade-bottom { display: none; }
    body::before { content: none; }

    /* keyboard open: composer rides the keyboard, tab bar steps aside */
    body:not(.kb-open) .ai-composer-wrap { --kb-safe: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
    body.kb-open .gl-tabbar { display: none; }

    /* the floating Ask pill is redundant with the Ask tab */
    #floating-chat { display: none; }

    /* drawer above the tab bar, on the shared z scale */
    body.mobile-sidebar-open aside.sidebar { z-index: var(--z-drawer); }
  }

  /* ---- Phone primary nav: top-left menu button + popover sheet ---------- */
  /* Replaces the bottom tab bar wherever popover is supported (iOS 17+);
     older browsers keep the bottom bar above. No JS beyond closing the
     sheet after a pick (js/tabbar.js). */
  .mt-nav-btn { display: none; }
  @supports selector(:popover-open) {
    @media (max-width: 820px) {
      :root { --tabbar-h: 0px; }
      .mobile-topnav .mt-nav-btn {
        order: -1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
        width: 44px; height: 44px;
        margin: 0 0 0 calc(var(--sp-1) - var(--sp-3));
        padding: 0;
        border: 0;
        border-radius: var(--r-md);
        background: transparent;
        box-shadow: none;
        color: var(--text-primary);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
      }
      .mobile-topnav .mt-nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
      .mobile-topnav::before { padding-left: var(--sp-1); }
      /* Ask: the session-tabs bar sits under the app bar instead of over it,
         so the menu button is reachable there too */
      body.route-ask.ty-has-agent-tabs #topbar { margin-top: calc(56px + env(safe-area-inset-top, 0px)); }
      /* Messages owns its frame: the list runs to the bottom edge */
      body.route-messages #main-content { padding-bottom: env(safe-area-inset-bottom, 0px); }

      .gl-tabbar:not(:popover-open) { display: none; }
      .gl-tabbar:popover-open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        position: fixed;
        inset: auto;
        top: calc(56px + env(safe-area-inset-top, 0px) + var(--sp-1));
        left: var(--sp-2);
        width: min(260px, calc(100vw - 2 * var(--sp-2)));
        height: auto;
        margin: 0;
        padding: var(--sp-1);
        overflow: visible;
        color: var(--text-primary);
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-top: 1px solid var(--border);
        border-radius: var(--r-lg);
        box-shadow: none;
      }
      .gl-tabbar::backdrop { background: transparent; }
      .gl-tabbar:popover-open .gl-tab {
        flex: 0 0 auto;
        justify-content: flex-start;
        gap: var(--sp-3);
        height: 44px;
        min-height: 44px;
        padding: 0 var(--sp-3);
        border-radius: var(--r-md);
        color: var(--text-secondary);
        font: 500 var(--fs-15, 15px)/1 var(--font-body, inherit);
      }
      .gl-tabbar:popover-open .gl-tab::after { content: attr(aria-label); }
      .gl-tabbar:popover-open .gl-tab svg { width: 20px; height: 20px; flex: 0 0 20px; }
      .gl-tabbar:popover-open .gl-tab-avatar-ring { width: 24px; height: 24px; flex: 0 0 24px; }
      .gl-tabbar:popover-open .gl-tab[aria-current="page"] { color: var(--text-primary); background: var(--bg-elev); }
      .gl-tabbar:popover-open #gl-tab-me { border-top: 1px solid var(--border); border-radius: 0 0 var(--r-md) var(--r-md); margin-top: var(--sp-1); }
    }
  }

  /* ---- Phone menu page (#gl-menu, js/glmenu.js) ------------------------- */
  /* Full-screen popover under the top-left menu button. One scroller (the
     page itself), flat bordered cards, 48px rows, safe-area padding. Hidden
     outright where popover is unsupported; the bottom tab bar covers those. */
  .gl-menu { display: none; }
  @supports selector(:popover-open) {
    .gl-menu:popover-open {
      display: block;
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      max-width: none;
      max-height: none;
      margin: 0;
      padding: 0 0 calc(var(--sp-6, 24px) + env(safe-area-inset-bottom, 0px));
      border: 0;
      border-radius: 0;
      box-shadow: none;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      color: var(--text-primary);
      background: var(--bg-app);
      font-family: var(--font-body);
    }
    .gl-menu::backdrop { background: var(--bg-app); }
    html.glm-open, html.glm-open body { overflow: hidden; }
  }
  .gl-menu .glm-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 calc(var(--sp-4, 16px) + env(safe-area-inset-right, 0px)) 0 calc(var(--sp-4, 16px) + env(safe-area-inset-left, 0px));
  }
  .gl-menu .glm-bar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--sp-2, 8px);
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    margin: 0 calc(-1 * var(--sp-4, 16px));
    padding-left: var(--sp-2, 8px);
    padding-right: var(--sp-4, 16px);
    background: var(--bg-app);
    border-bottom: 1px solid var(--border);
  }
  .gl-menu .glm-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .gl-menu .glm-bar-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
  .gl-menu .glm-me {
    display: flex;
    align-items: center;
    gap: var(--sp-3, 12px);
    padding: var(--sp-5, 20px) 0 var(--sp-4, 16px);
  }
  .gl-menu .glm-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
  }
  .gl-menu .glm-avatar-img { width: 100%; height: 100%; object-fit: cover; }
  .gl-menu .glm-avatar-img[hidden] { display: none; }
  .gl-menu .glm-me-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
  .gl-menu .glm-name { font-size: 17px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gl-menu .glm-org { font-size: 14px; color: var(--text-tertiary); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gl-menu .glm-org[hidden] { display: none; }
  .gl-menu .glm-search {
    display: flex;
    align-items: center;
    gap: var(--sp-2, 8px);
    height: 44px;
    padding: 0 var(--sp-3, 12px);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-elev);
    color: var(--text-tertiary);
  }
  .gl-menu .glm-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
  .gl-menu .glm-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
    box-shadow: none;
  }
  .gl-menu .glm-search input::placeholder { color: var(--text-tertiary); }
  .gl-menu .glm-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
  .gl-menu .glm-sec { margin-top: var(--sp-5, 20px); }
  .gl-menu .glm-sec--empty { display: none; }
  .gl-menu .glm-h {
    margin: 0 0 var(--sp-2, 8px) var(--sp-1, 4px);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
  }
  .gl-menu .glm-card {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
  }
  .gl-menu .glm-card > li { margin: 0; padding: 0; }
  .gl-menu .glm-card > li[hidden] { display: none; }
  .gl-menu .glm-card > li:not([hidden]) ~ li:not([hidden]) { border-top: 1px solid var(--border); }
  .gl-menu .glm-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3, 12px);
    width: 100%;
    min-height: 48px;
    padding: 0 var(--sp-4, 16px);
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .gl-menu .glm-row > .ti:first-child { flex: 0 0 20px; color: var(--text-secondary); }
  @media (hover: hover) {
    .gl-menu .glm-close:hover { background: var(--bg-hover); }
    .gl-menu a.glm-row:hover, .gl-menu button.glm-row:hover { background: var(--bg-hover); }
  }
  .gl-menu a.glm-row:active, .gl-menu button.glm-row:active, .gl-menu .glm-close:active { background: var(--bg-hover); }
  .gl-menu .glm-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .gl-menu .glm-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gl-menu .glm-chev { flex: 0 0 16px; color: var(--text-faint); }
  .gl-menu .glm-row[aria-current="page"] { background: var(--bg-elev); font-weight: 600; }
  .gl-menu .glm-row[aria-current="page"] > .ti:first-child { color: var(--accent); }
  .gl-menu .glm-row--danger, .gl-menu .glm-row--danger > .ti:first-child { color: var(--st-danger); }
  .gl-menu .glm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }
  .gl-menu .glm-badge[hidden] { display: none; }
  .gl-menu .glm-card > li.glm-row--theme { padding: 0 var(--sp-3, 12px) 0 var(--sp-4, 16px); cursor: default; }
  .gl-menu .glm-seg {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 2px;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-elev);
  }
  .gl-menu .glm-seg button {
    height: 30px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: calc(var(--r-md) - 2px);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
  }
  .gl-menu .glm-seg button[aria-checked="true"] {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
    font-weight: 600;
  }
  .gl-menu .glm-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .gl-menu .glm-empty {
    margin: var(--sp-6, 24px) 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-tertiary);
  }
  .gl-menu .glm-empty[hidden] { display: none; }

  /* ---- Confirm / Contact support dialog (.gl-confirm) -------------------- */
  /* The card had resolved to transparent over a 72% dark scrim, so in light
     theme its dark text sat on near-black. Flat card on the shared scrim. */
  .gl-confirm-backdrop {
    background: var(--bg-scrim);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: env(safe-area-inset-top, 0px) var(--sp-4) env(safe-area-inset-bottom, 0px);
  }
  .gl-confirm, .gl-confirm--glass {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
  }
  .gl-confirm h3, .gl-confirm--glass h3 { color: var(--text-primary); }
  .gl-confirm p, .gl-confirm--glass p { color: var(--text-secondary); }
  .gl-confirm textarea, .gl-confirm .gl-textarea, .gl-confirm .gl-pw-input, .gl-confirm input[type="password"] {
    background: var(--bg-app);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    font-size: 16px;
  }
  .gl-confirm textarea::placeholder, .gl-confirm input::placeholder { color: var(--text-tertiary); }
  .gl-confirm .gl-upload-btn { background: transparent; }
  .gl-confirm-btn--cancel { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
  .gl-confirm-btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: none; }
  .gl-confirm-btn--primary:hover { background: var(--accent-hover); filter: none; }

  @media (max-width: 640px) {
    .rich-composer .rc-toolbar { gap: 6px; }
  }

  /* ── Dashboard (Operations overview), task C ───────────────────────────
     The ≥1024px rule switched the prompt grid to 3 columns while the tiles
     still span 2 (--3) and 3 (--2) of the original 6, so every tile sat on
     its own row. Restore the 6-track grid: three small tiles per row, then
     two wide ones. Dark theme also capped the hero card and the right-hand
     stack at fixed heights with overflow hidden, which cut tiles off, and
     stacked each status value under its label; both now match light. */
  @media (min-width: 1024px) {
    .dashboard-view .coo-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .dashboard-view .coo-kpi-grid > .coo-kpi-btn--3 { grid-column: span 2; }
    .dashboard-view .coo-kpi-grid > .coo-kpi-btn--2 { grid-column: span 3; }
  }
  .dashboard-view .page-hero .hero-card,
  .dashboard-view .page-hero .summary-stack,
  .dashboard-view .page-hero .summary-stack > .card.panel { max-height: none; overflow: visible; }
  .dashboard-view .page-hero .summary-stack .summary-item,
  .dashboard-view .page-hero .summary-stack .summary-item--stack {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: var(--sp-3); height: auto; min-height: 28px;
  }
  .dashboard-view .page-hero .summary-stack .summary-item > strong,
  .dashboard-view .page-hero .summary-stack .summary-item--stack > strong {
    margin-left: auto; max-width: 60%; text-align: right;
  }

  /* the dashboard's Ask card was a navy radial + linear gradient even in
     light theme (dark text on navy); flat card like every other surface */
  .dashboard-view #chat-panel,
  .dashboard-lower > .card.chat-panel {
    background: var(--bg-card); background-image: none;
    border: 1px solid var(--border); box-shadow: none;
  }

  /* empty states read as quiet copy, not as blue uppercase links */
  .dashboard-view .empty-state,
  .right-panel .empty-state {
    color: var(--text-secondary); opacity: 1; font-size: 13px; font-weight: 400;
    letter-spacing: 0; text-transform: none; padding: var(--sp-2) 0;
  }
  /* Automations + Recent activity side by side on wide screens (both themes) */
  @media (min-width: 1024px) {
    .dashboard-view .dashboard-lower > .right-panel {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: var(--sp-3); align-items: start;
    }
    .dashboard-view .dashboard-lower > .right-panel > .card { margin: 0; }
  }

  /* ── Reports, task C ─────────────────────────────────────────────────
     Freshness notes were loose red 11px text; they are status pills now
     (neutral when fresh, amber when stale). The empty-window card filled one
     260px grid cell and left the row blank; it spans the row instead. */
  .report-section-head { align-items: center; }
  .report-refreshed-pill {
    display: inline-block; height: 22px; padding: 0 var(--sp-2);
    margin-left: 0; border: 1px solid var(--border); border-radius: 999px;
    font-size: 12px; font-weight: 500; line-height: 20px; color: var(--text-secondary);
    background: transparent; white-space: nowrap;
  }
  .report-refreshed-pill::first-letter { text-transform: uppercase; }
  .report-refreshed-pill.stale,
  .report-refreshed-pill.synthetic {
    color: var(--st-warning);
    border-color: color-mix(in srgb, var(--st-warning) 45%, transparent);
  }
  .report-source-pill::before { content: none; }
  .report-tools-row .pred-badge-flat {
    display: inline-flex; align-items: center; height: 24px; padding: 0 var(--sp-3);
    border: 1px solid color-mix(in srgb, var(--st-warning) 45%, transparent); border-radius: 999px;
    color: var(--st-warning); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none;
  }
  .report-kpi-grid > .report-empty-card {
    grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); min-height: 0;
  }
  .report-kpi-grid > .report-empty-card .pred-empty { padding: 0; text-align: left; min-height: 0; color: var(--text-secondary); }
  .report-kpi-grid > .report-empty-card .report-refresh { margin-top: 0; }

  /* Divisions tiles: the icon used a dark-theme grey (#e5e5e5) in light
     theme and nearly vanished. Secondary text colour in both themes. */
  .gl-division-card .gdc-icon { color: var(--text-secondary); }

  /* Plan badge ("Max") sits on the blue accent: white text, full opacity.
     Light theme had near-black on blue at 75% opacity (3.1:1). */
  #footer-org-tier.footer-org-tier-badge,
  #account-menu-tier.account-menu-tier-badge { color: var(--on-accent); opacity: 1; }

  /* Contrast pass (Task C audit). Hard-coded greys and the raw brand blue
     fell under 4.5:1 in one theme or the other; use the theme tokens. */
  .predictions-view .pred-section-blurb,
  .predictions-view .pred-card-sub,
  .predictions-view .pred-empty--muted,
  .sv-section-blurb,
  .sv-empty,
  .sv-empty > span { color: var(--text-secondary); }
  .route-viewswitch .route-viewbtn.is-active { color: var(--on-accent); }
  .route-viewswitch .route-ai-btn:not(.is-active),
  .chats-empty a,
  .superset-empty-card a,
  .msg-tabs-bar .msg-tab-dashboard { color: var(--accent-text); }

  /* Notifications panel (desktop): it lives inside the sidebar, whose
     backdrop-filter + z-index 200 make it a stacking context under the
     z-1199 page backdrop, so the bell opened a blurred page with no panel.
     The sidebar also clips overflow. Lift it above the backdrop and let the
     panel out while it is open. */
  body.notif-panel-open aside.sidebar#sidebar { z-index: 1200; overflow: visible; }
  /* Notifications panel and history modal: flat card in both themes. Both
     had a light frosted gradient even in dark theme (near-white text on it,
     1.1:1). The panel also kept a 360px min-height when empty. */
  body .notif-panel,
  .notif-history-overlay .notif-history-modal {
    background: var(--bg-card);
    background-image: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body .notif-panel, body .notif-panel .notif-panel-body { min-height: 0; }
  .notif-history-modal .notif-history-title { color: var(--text-primary); }
  .notif-history-modal .notif-history-close { color: var(--text-secondary); }
  .notif-history-body > .notif-empty,
  .notif-panel-body > .notif-empty { text-align: center; padding: 12px 8px 16px; color: var(--text-secondary); font-size: 13px; }

  /* the top bar is a solid surface; the old fade veil under it is gone */
  .topbar::after { content: none; }
}
