/* SAVRN shell core — extracted from _shell.html.j2 (2026-06-10).
   Loads BEFORE per-page CSS so pages can override. */
  /* ===========================================
     SAVRN app shell — Linear / Notion mood
     =========================================== */
  :root {
    /* ---- savrn.com verified palette (Elementor kit 624) ---- */
    --shell-bg:        #FFFFFF;          /* pure white (savrn.com body) */
    --shell-bg-warm:   #F4F4F0;          /* secondary warm off-white (savrn.com --secondary) */
    --surface:         #FFFFFF;          /* card */
    --surface-warm:    #F4F4F0;
    --surface-hover:   #F4F4F0;
    --sidebar-bg:      #ffffff;          /* crisp white sidebar (no beige) — separated by border-right + inset shadow */
    --sidebar-w:       248px;
    --sidebar-w-mini:  64px;
    --topbar-h:        56px;

    /* ---- Ink (cold blue-black, matches savrn.com --text) ---- */
    --ink:             #0D1621;
    --ink-soft:        #2A3340;
    --ink-faint:       #5A6470;
    --muted:           #7E8794;

    /* ---- Primary blue (savrn.com --primary) ---- */
    --primary:         #5385B3;
    --primary-deep:    #3D6E99;
    --primary-soft:    rgba(83,133,179,0.12);   /* matches savrn.com --e9deab6 */
    --primary-strong:  rgba(83,133,179,0.43);   /* matches savrn.com --8231b57 */

    /* ---- Accent: orange (savrn.com --accent #E85D04) ---- */
    --accent:          #E85D04;
    --accent-deep:     #B7470A;
    --accent-soft:     rgba(232,93,4,0.10);
    --accent-peach:    #FFBC7D;                 /* savrn.com page-transition color */

    /* ---- Financial semantic colors ---- */
    --mint:            #4D9974;
    --mint-soft:       rgba(77,153,116,0.12);
    --green:           #2E7D32;
    --amber:           #B26A00;
    --red:             #B23A30;
    --red-soft:        rgba(178,58,48,0.10);

    /* ---- Compatibility aliases — older Phase 24/26 references survive ---- */
    --bone:            var(--shell-bg);
    --bone-2:          var(--shell-bg-warm);
    --gold:            var(--accent);
    --gold-deep:       var(--accent-deep);
    --gold-soft:       var(--accent-soft);

    /* ---- Hairlines / shadows ---- */
    --rule:            #D9DCE0;
    --rule-soft:       #ECEEF1;
    --shadow-1:        0 1px 0 rgba(13,22,33,0.04), 0 1px 2px rgba(13,22,33,0.04);
    --shadow-2:        0 4px 14px rgba(13,22,33,0.07), 0 1px 0 rgba(13,22,33,0.04);
    --shadow-lift:     0 24px 60px -16px rgba(13,22,33,0.22), 0 4px 14px rgba(13,22,33,0.08);

    --radius-sm:       6px;
    --radius:          10px;
    --radius-lg:       14px;
    --radius-pill:     999px;
    --kbd-bg:          #E5E7EA;

    /* ---- Motion tokens (design-polish 2026-06-09) ----
       Built-in CSS easings are too weak; these give transitions
       an immediate start (ease-out) and a confident arc (in-out). */
    --ease-out:        cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out:     cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer:     cubic-bezier(0.32, 0.72, 0, 1);
  }
  html, body { background: var(--shell-bg); color: var(--ink); }
  /* ---- Universal press feedback: every real button confirms the press ---- */
  button, input[type="submit"], .btn, .btn-primary, .btn-secondary {
    transition: transform 140ms var(--ease-out);
  }
  button:not([disabled]):active, input[type="submit"]:not([disabled]):active,
  .btn:active, .btn-primary:active, .btn-secondary:active {
    transform: scale(0.97);
  }
  /* ---- Keyboard focus ring (only on keyboard navigation) ---- */
  :focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
  }
  /* ---- Reduced motion: keep fades, kill movement ---- */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
  /* ---- Touch devices: hover-lift effects are desktop-only ----
     (tap-triggered :hover sticks on touch; suppress the movement,
      keep the color changes) ---- */
  @media (hover: none), (pointer: coarse) {
    .help-fab:hover, .return-bar .pill:hover, #fixit-fab:hover { transform: none; }
  }
  /* Tabular numerals globally — every $ figure, every %, lines up. */
  body {
    font-feature-settings: "cv11", "ss01", "ss02", "tnum";
    font-variant-numeric: tabular-nums;
  }
  /* Faint atmosphere — orange tint top-left, blue tint bottom-right (savrn.com cue) */
  body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background:
      radial-gradient(ellipse at 0% 0%, rgba(232,93,4,0.025) 0%, transparent 50%),
      radial-gradient(ellipse at 100% 100%, rgba(83,133,179,0.04) 0%, transparent 50%);
  }

  .shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows:    var(--topbar-h) 1fr;
    min-height: 100vh;
  }
  .shell.collapsed { grid-template-columns: var(--sidebar-w-mini) 1fr; }

  /* ------- Top bar ------- */
  .topbar {
    grid-column: 1 / -1;
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.86);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--rule);
    display: flex; align-items: center; gap: 14px;
    padding: 0 18px;
    height: var(--topbar-h);
  }
  .brand-mark {
    display: flex; align-items: center; gap: 9px;
    font-weight: 900; font-size: 15px; letter-spacing: -0.01em; color: var(--ink);
    text-decoration: none;
  }
  .brand-mark .dot {
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--accent);   /* brand spec: the SAVRN dot is copper */
    box-shadow: 0 0 0 4px rgba(232,93,4,0.16), 0 1px 2px rgba(15,30,45,0.16);
  }
  .topbar-divider {
    width: 1px; height: 18px; background: var(--rule); margin: 0 4px;
  }
  .project-switcher {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13px; font-weight: 600; color: var(--ink);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
  }
  .project-switcher:hover { background: var(--surface-hover); border-color: var(--rule); text-decoration: none; }
  .project-switcher .chev {
    font-size: 10px; color: var(--muted);
  }

  .topbar-spacer { flex: 1; }

  .search-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px 7px 14px;
    background: rgba(252,250,244,0.85);
    border: 1px solid var(--rule); border-radius: 8px;
    font-size: 13px; color: var(--ink-faint);
    cursor: pointer; user-select: none;
    transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
    min-width: 280px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), var(--shadow-1);
  }
  .search-pill:hover { background: var(--surface-hover); border-color: var(--primary); }
  .search-pill .ic { color: var(--muted); font-size: 13px; line-height: 1; }
  .search-pill .placeholder { flex: 1; }
  .kbd { display: inline-flex; gap: 2px; }
  .kbd kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 20px; padding: 0 5px;
    background: var(--kbd-bg); border-radius: 4px;
    font-family: ui-monospace, SF Mono, monospace; font-size: 10px; font-weight: 600;
    color: var(--ink-soft); line-height: 1;
  }

  .user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 4px 4px 10px; border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px; color: var(--ink-soft); cursor: pointer; text-decoration: none;
    transition: background 0.12s;
  }
  .user-chip:hover { background: var(--surface-hover); text-decoration: none; }
  .user-chip .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  }
  .user-chip .who { display: none; }
  @media (min-width: 900px) { .user-chip .who { display: inline; } }

  /* ── Project-switcher dropdown (P76 — replaces decorative link) ── */
  .project-switcher-menu { position: relative; }
  .project-switcher-menu > summary { list-style: none; cursor: pointer; }
  .project-switcher-menu > summary::-webkit-details-marker { display: none; }
  .project-switcher-menu > summary.project-switcher .chev {
    transition: transform 0.15s;
  }
  .project-switcher-menu[open] > summary.project-switcher .chev { transform: rotate(180deg); }
  .project-switcher-menu[open] > summary.project-switcher {
    background: var(--surface-hover); border-color: var(--rule);
  }
  .project-switcher-pop {
    position: absolute; left: 0; top: calc(100% + 6px);
    min-width: 280px; max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 6px; z-index: 60;
    /* scale in from the trigger, not from nowhere */
    transform-origin: top left;
    transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
    @starting-style {
      opacity: 0;
      transform: scale(0.97) translateY(-2px);
    }
  }
  .project-switcher-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px 10px; border-bottom: 1px solid var(--rule-soft);
    margin-bottom: 4px;
  }
  .project-switcher-head .lab {
    font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--muted);
  }
  .project-switcher-head .new {
    font-size: 11px; font-weight: 700; color: var(--accent-deep);
    text-decoration: none; padding: 2px 8px; border-radius: 4px;
    background: var(--accent-soft);
  }
  .project-switcher-head .new:hover { background: rgba(232,93,4,0.20); text-decoration: none; }
  .project-switcher-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 12px; border-radius: 7px;
    font-size: 13px; color: var(--ink-soft); text-decoration: none;
  }
  .project-switcher-item:hover {
    background: var(--surface-hover); color: var(--ink); text-decoration: none;
  }
  .project-switcher-item .ic {
    width: 16px; text-align: center; color: var(--muted); font-size: 11px;
  }
  .project-switcher-item.is-current { background: var(--primary-soft); color: var(--primary-deep); font-weight: 700; }
  .project-switcher-item.is-current .ic { color: var(--primary); }
  .project-switcher-item .nm { flex: 1; }
  .project-switcher-item .meta {
    font-size: 10.5px; color: var(--muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
  }
  .project-switcher-empty {
    padding: 12px; text-align: center; font-size: 12px; color: var(--ink-faint);
  }
  .project-switcher-sep {
    height: 1px; background: var(--rule-soft); margin: 4px 6px;
  }

  /* ── User-menu dropdown (P75 — replaces single-link user-chip) ───── */
  .user-menu { position: relative; }
  .user-menu > summary { list-style: none; }
  .user-menu > summary::-webkit-details-marker { display: none; }
  .user-menu > summary.user-chip { padding-right: 8px; }
  .user-menu > summary.user-chip .chev {
    font-size: 10px; color: var(--muted); margin-left: 2px;
    transition: transform 0.15s;
  }
  .user-menu[open] > summary.user-chip .chev { transform: rotate(180deg); }
  .user-menu[open] > summary.user-chip {
    background: var(--surface-hover); border-color: var(--rule);
  }
  .user-menu-pop {
    position: absolute; right: 0; top: calc(100% + 6px);
    width: 240px; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 6px; z-index: 60;
    transform-origin: top right;
    transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
    @starting-style {
      opacity: 0;
      transform: scale(0.97) translateY(-2px);
    }
  }
  .user-menu-head {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--rule-soft); margin-bottom: 4px;
    display: flex; flex-direction: column; gap: 2px;
  }
  .user-menu-name {
    font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em;
  }
  .user-menu-mail {
    font-size: 11.5px; color: var(--ink-faint);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .user-menu-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 12px; border-radius: 7px;
    font-size: 13px; color: var(--ink-soft); text-decoration: none;
    transition: background 0.1s;
  }
  .user-menu-item:hover {
    background: var(--surface-hover); color: var(--ink); text-decoration: none;
  }
  .user-menu-item .ic {
    width: 18px; height: 18px; display: grid; place-items: center;
    background: var(--surface-warm); border: 1px solid var(--rule);
    border-radius: 4px;
    font-size: 10px; font-weight: 800; color: var(--ink-soft);
  }
  .user-menu-item.user-menu-out { color: var(--red); }
  .user-menu-item.user-menu-out:hover { background: var(--red-soft); color: var(--red); }
  .user-menu-item.user-menu-out .ic { color: var(--red); border-color: rgba(178,58,48,0.30); background: var(--red-soft); }
  .user-menu-sep {
    height: 1px; background: var(--rule-soft); margin: 4px 6px;
  }

  /* ------- Section divider (used across long-scroll pages) -------
     A 28px solid brand-blue bar + uppercase section label + thin rule
     extending across the row. Helps users orient on mobile where
     sections otherwise blend with the clean background. Use:
       <div class="section-divider"><span class="lab">MODULES</span></div>
     Variants: .accent (orange), .mint, .navy. */
  .section-divider {
    position: relative;
    margin: 36px 0 14px;
    display: flex; align-items: center; gap: 0;
    font-size: 10.5px; font-weight: 800;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--primary-deep);
  }
  .section-divider::before {
    content: ""; flex: 0 0 28px;
    height: 3px; background: var(--primary);
    border-radius: 2px; margin-right: 14px;
  }
  .section-divider .lab { white-space: nowrap; }
  .section-divider::after {
    content: ""; flex: 1;
    height: 1px; background: var(--rule);
    margin-left: 14px;
  }
  .section-divider.accent { color: var(--accent-deep); }
  .section-divider.accent::before { background: var(--accent); }
  .section-divider.mint   { color: #2D6B53; }
  .section-divider.mint::before   { background: #4D9974; }
  .section-divider.navy   { color: #0C1A26; }
  .section-divider.navy::before   { background: #0C1A26; flex-basis: 36px; height: 4px; }
  @media (max-width: 760px) {
    .section-divider { margin: 28px 0 12px; font-size: 10px; }
    .section-divider::before { flex-basis: 22px; margin-right: 10px; }
    .section-divider::after  { margin-left: 10px; }
  }

  /* ------- "Return to project" bar (universal pages only) ------- */
  .return-bar {
    background: linear-gradient(90deg,
      rgba(232,93,4,0.10) 0%,
      rgba(232,93,4,0.05) 60%,
      transparent 100%);
    border-bottom: 1px solid rgba(232,93,4,0.18);
    padding: 10px 24px;
    display: flex; align-items: center; gap: 16px;
  }
  .return-bar .label {
    font-size: 10.5px; font-weight: 700; color: var(--accent-deep);
    text-transform: uppercase; letter-spacing: 0.10em;
  }
  .return-bar .pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px 7px 12px; border-radius: var(--radius-pill);
    background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
    text-decoration: none; letter-spacing: 0.01em;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    transition: background 0.12s, transform 0.12s;
  }
  .return-bar .pill:hover { background: var(--accent-deep); transform: translateX(-1px); text-decoration: none; color: #fff; }
  .return-bar .pill .arr { font-weight: 800; font-size: 14px; line-height: 1; }
  .return-bar .pill .nm { letter-spacing: -0.01em; }
  .return-bar .here {
    font-size: 11.5px; color: var(--ink-faint); margin-left: auto;
    text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  }
  @media (max-width: 760px) {
    .return-bar { padding: 8px 14px; flex-wrap: wrap; gap: 10px; }
    .return-bar .here { display: none; }
    .return-bar .label { display: none; }
  }

  /* ------- Sidebar ------- */
  .sidebar {
    grid-column: 1; grid-row: 2;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--rule);
    padding: 18px 12px 24px;
    display: flex; flex-direction: column; gap: 4px;
    overflow-y: auto; height: calc(100vh - var(--topbar-h));
    position: sticky; top: var(--topbar-h);
    box-shadow: inset -1px 0 0 rgba(26,22,17,0.03);
  }
  .sidebar .sb-group {
    margin-top: 18px;
  }
  .sidebar .sb-group:first-child { margin-top: 0; }
  .sidebar .sb-heading-link {
    display: block; text-decoration: none;
    color: var(--ink); font-weight: 700; font-size: 12px;
    text-transform: none; letter-spacing: -0.005em;
    padding: 6px 10px 10px;
    border-bottom: 1px solid var(--rule-soft);
    margin-bottom: 8px;
    transition: color 0.12s;
  }
  .sidebar .sb-heading-link:hover { color: var(--primary-deep); text-decoration: none; }
  .sidebar .sb-heading-link.is-active-home {
    color: var(--primary-deep); background: rgba(83,133,179,0.06);
    border-radius: 6px 6px 0 0; padding-top: 8px;
  }
  .sidebar .sb-home-ic {
    display: inline-block; margin-right: 6px;
    color: var(--primary); font-weight: 800;
  }
  .sidebar .sb-heading {
    font-size: 10px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.10em;
    padding: 4px 10px 8px;
  }
  .sb-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13px; font-weight: 500; color: var(--ink-soft);
    text-decoration: none; user-select: none;
    transition: background 0.12s, color 0.12s;
  }
  .sb-item .ic {
    width: 16px; height: 16px; display: inline-grid; place-items: center;
    color: var(--muted); flex-shrink: 0;
  }
  .sb-item:hover { background: rgba(12,23,19,0.05); color: var(--ink); text-decoration: none; }
  .sb-item.active {
    background: var(--surface); color: var(--ink); font-weight: 700;
    box-shadow: var(--shadow-1);
  }
  .sb-item.active .ic { color: var(--primary); }
  /* P233k Help group lead item subtle accent */
  .sb-help-group { border-bottom: 1px solid var(--rule-soft); padding-bottom: 6px; margin-bottom: 8px; }
  .sb-help-lead { border-left: 3px solid var(--accent, #E85D04); padding-left: 9px; font-weight: 700; }
  .sb-help-lead .ic { color: var(--accent, #E85D04); }
  .sb-help-lead.active { background: rgba(232, 93, 4, 0.08); }
  /* P240 — quote builder sidebar item */
  .sb-quote-builder { border-left: 3px solid var(--accent, #E85D04); padding-left: 9px; font-weight: 700; }
  .sb-quote-builder .ic { color: var(--accent, #E85D04); }
  .sb-quote-builder.active { background: rgba(232, 93, 4, 0.08); }


  .sb-item .count {
    margin-left: auto; font-size: 11px; color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .sb-item.active .count { color: var(--ink-faint); }

  /* ----- Project switcher rows ----- */
  .sb-item.sb-proj { padding-left: 12px; }
  .sb-item.sb-proj .proj-name {
    display: inline-block; max-width: 165px; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis; vertical-align: middle;
  }
  .arch-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    vertical-align: middle; margin-right: 9px; flex-shrink: 0;
  }
  .arch-dot-blue   { background: var(--primary); box-shadow: 0 0 0 2px rgba(83,133,179,0.18); }
  .arch-dot-teal   { background: var(--mint, #4D9974); box-shadow: 0 0 0 2px rgba(77,153,116,0.22); }
  .arch-dot-orange { background: var(--accent, #E85D04); box-shadow: 0 0 0 2px rgba(232,93,4,0.22); }
  .arch-dot-muted  { background: var(--muted); box-shadow: 0 0 0 2px rgba(122,118,112,0.18); }
  .arch-dot-empty  {
    background: transparent; border: 1px dashed var(--rule);
    width: 11px; height: 11px; line-height: 9px;
    text-align: center; font-size: 10px; color: var(--muted); font-weight: 800;
    box-shadow: none;
  }
  .sb-item.sb-proj-add { color: var(--muted); font-style: italic; }
  .sb-item.sb-proj-add:hover { color: var(--ink); font-style: normal; }

  /* ──── Phase 109 — new IA elements ──── */

  /* Compact subsection heading (within per-project nav) */
  .sb-subhead {
    font-size: 9.5px; font-weight: 800; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.10em;
    padding: 14px 10px 6px;
    border-top: 1px solid var(--rule-soft); margin-top: 6px;
  }
  .sb-subhead:first-child { border-top: none; margin-top: 0; padding-top: 4px; }

  /* Agent health dot in AI INSIGHTS subsection */
  .sb-health-dot {
    margin-left: auto; display: inline-block; min-width: 28px;
    padding: 1px 7px; border-radius: 999px;
    font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums; text-align: center;
  }
  .sb-health-dot.good { background: var(--mint-soft); color: #2D6B53; }
  .sb-health-dot.ok   { background: rgba(232,184,4,0.20); color: #B7470A; }
  .sb-health-dot.bad  { background: rgba(232,93,4,0.18); color: var(--accent-deep); }
  .sb-health-dot.crit { background: rgba(178,58,48,0.20); color: #B23A30; }
  .sb-health-dot.none { background: var(--surface-warm); color: var(--muted); border: 1px solid var(--rule); }

  /* Phase-grouped project switcher */
  .sb-phase {
    font-size: 9.5px; font-weight: 800; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 12px 10px 4px;
    display: flex; align-items: center; gap: 6px;
  }
  .sb-phase:first-of-type { padding-top: 6px; }
  .sb-phase .ph-pill {
    width: 7px; height: 7px; border-radius: 50%;
    display: inline-block;
  }
  .sb-phase.pre-ops  .ph-pill { background: #E8B504; box-shadow: 0 0 0 2px rgba(232,184,4,0.18); }
  .sb-phase.live     .ph-pill { background: var(--mint); box-shadow: 0 0 0 2px rgba(77,153,116,0.20); }
  .sb-phase.stalled  .ph-pill { background: #B23A30; box-shadow: 0 0 0 2px rgba(178,58,48,0.18); }

  /* Project row health indicator (replaces the static color dots) */
  .sb-proj .health-dot {
    margin-right: 9px; display: inline-block;
    width: 9px; height: 9px; border-radius: 50%;
    flex-shrink: 0;
  }
  .sb-proj .health-dot.good { background: #4D9974; box-shadow: 0 0 0 2px rgba(77,153,116,0.22); }
  .sb-proj .health-dot.ok   { background: #E8B504; box-shadow: 0 0 0 2px rgba(232,184,4,0.22); }
  .sb-proj .health-dot.bad  { background: #E85D04; box-shadow: 0 0 0 2px rgba(232,93,4,0.22); }
  .sb-proj .health-dot.crit { background: #B23A30; box-shadow: 0 0 0 2px rgba(178,58,48,0.22); }
  .sb-proj .health-dot.none { background: transparent; border: 1px dashed var(--rule); }

  .sb-proj .h-num {
    margin-left: auto; font-size: 10px; font-weight: 700;
    color: var(--muted); font-variant-numeric: tabular-nums;
    padding-left: 6px;
  }
  .sb-item.sb-proj.active .h-num { color: var(--ink-faint); font-weight: 800; }

  /* TODAY section — distinctive dark accent */
  .sb-today {
    background: linear-gradient(135deg, rgba(13,22,33,0.05), rgba(13,22,33,0.02));
    border-radius: 8px; padding: 6px 0 8px; margin-bottom: 4px;
  }
  .sb-today .sb-heading { padding-top: 8px; color: var(--accent-deep); }
  .sb-today .sb-item { padding: 6px 12px; }
  .sb-today .sb-item .ic { color: var(--accent); }

  .sb-footer {
    margin-top: auto; padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-size: 11px; color: var(--muted);
    line-height: 1.6;
  }
  .sb-footer a { color: var(--muted); }
  .sb-footer .pill {
    display: inline-block; padding: 2px 7px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--rule); font-weight: 600;
  }

  /* ------- Main content area ------- */
  .main {
    grid-column: 2; grid-row: 2;
    padding: 28px 32px 40px;
    max-width: 1280px; width: 100%; margin: 0 auto;
    overflow-x: clip;   /* contain stray horizontal overflow without breaking sticky (clip keeps overflow-y visible) */
  }
  /* ------- Footer (universal) ------- */
  .app-footer {
    margin-top: 50px; padding: 22px 0 0;
    border-top: 1px solid var(--rule);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    font-size: 11px; color: var(--muted);
  }
  /* ------- Hamburger button (mobile only) ------- */
  .hamburger {
    display: none;
    width: 36px; height: 36px; border-radius: 8px;
    border: 1px solid var(--rule); background: var(--surface);
    padding: 0; margin-right: 2px;
    cursor: pointer; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px;
    transition: background 0.12s;
  }
  .hamburger:hover { background: var(--surface-hover); }
  .hamburger span {
    display: block; width: 18px; height: 2px;
    background: var(--ink); border-radius: 2px;
    transition: transform 0.18s, opacity 0.18s;
  }
  body.nav-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
  body.nav-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* ------- Mobile drawer backdrop ------- */
  .nav-backdrop {
    position: fixed; inset: 0; z-index: 45;
    background: rgba(13,22,33,0.40); backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    /* fade with the drawer instead of popping on */
    opacity: 0; visibility: hidden;
    transition: opacity 0.22s var(--ease-drawer), visibility 0.22s;
  }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }

  /* ------- Mobile breakpoint ------- */
  @media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .shell > * { min-width: 0; }
    .topbar { min-width: 0; max-width: 100%; }
    .main { grid-column: 1; padding: 20px 16px 80px; max-width: 100%; }

    /* Show the hamburger */
    .hamburger { display: inline-flex; }

    /* Hide secondary topbar elements that need real estate */
    .project-switcher { display: none; }
    .topbar-divider { display: none; }

    /* Search collapses to icon-only — still triggers Cmd+K palette */
    .search-pill {
      min-width: 0; padding: 7px 9px;
      gap: 0;
    }
    .search-pill .placeholder { display: none; }
    .search-pill .kbd { display: none; }
    .search-pill .ic { font-size: 16px; }

    /* User chip: avatar only */
    .user-chip .who { display: none !important; }

    /* Sidebar becomes a slide-in drawer */
    .sidebar {
      position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
      width: 96px; z-index: 50;
      transform: translateX(-100%);
      transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
      box-shadow: 8px 0 24px rgba(13,22,33,0.10);
    }
    body.nav-open .sidebar { transform: translateX(0); }

    /* Tighter topbar */
    .topbar { padding: 0 14px; gap: 10px; }
    .brand-mark { font-size: 14px; }

    /* Cmd+K palette wider on small screens */
    .cmdk-backdrop.open { padding-top: 8vh; }
  }
  @media (max-width: 500px) {
    /* Phone-tight */
    .main { padding: 16px 14px 80px; }
    .brand-mark { gap: 7px; }
  }

  /* ------- Cmd+K palette ------- */

  /* ─── P230 — floating help button (universal) ─── */
  .help-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--accent);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Fraunces", "Noto Serif", Georgia, serif;
    font-size: 30px;
    font-weight: 700;
    font-style: italic;
    cursor: pointer;
    text-decoration: none;
    z-index: 9000;
    box-shadow: 0 4px 14px rgba(13, 22, 33, 0.25);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out),
                background 0.2s ease, color 0.2s ease;
  }
  .help-fab:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(232, 93, 4, 0.35);
    text-decoration: none;
  }
  .help-fab::after {
    content: "Site map";
    position: absolute;
    right: 64px;
    background: var(--ink);
    color: #fff;
    padding: 7px 12px;
    border-radius: 6px;
    font-family: -apple-system, "Helvetica Neue", sans-serif;
    font-size: 12px;
    font-weight: 600;
    font-style: normal;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 14px rgba(13, 22, 33, 0.25);
  }
  .help-fab:hover::after { opacity: 1; }
  /* hide on /help/site-map itself (no need to point at the page you're on) */
  body[data-page="help-site-map"] .help-fab { display: none; }
  /* hide on the print view */
  @media print { .help-fab { display: none; } }
  /* slightly smaller on mobile */
  @media (max-width: 720px) {
    .help-fab { width: 46px; height: 46px; font-size: 24px; bottom: 14px; right: 14px; }
    .help-fab::after { display: none; }
  }

    .cmdk-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(12,23,19,0.36);
    backdrop-filter: blur(6px);
    display: none;
    /* no open animation: Cmd+K is keyboard-initiated and used constantly —
       the palette should feel attached to the keystroke (Raycast rule) */
  }
  .cmdk-backdrop.open { display: grid; place-items: start center; padding-top: 12vh; }
  .cmdk-panel {
    width: min(640px, 92vw);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 12px;
    box-shadow: var(--shadow-lift);
    overflow: hidden;
  }
  .cmdk-panel input {
    width: 100%; box-sizing: border-box;
    padding: 18px 22px;
    border: none; border-bottom: 1px solid var(--rule);
    font: inherit; font-size: 15px; color: var(--ink);
    background: transparent; outline: none;
  }
  .cmdk-results {
    max-height: 60vh; overflow-y: auto;
    padding: 8px;
  }
  .cmdk-group-label {
    font-size: 10px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.10em;
    padding: 10px 12px 4px;
  }
  .cmdk-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 7px;
    color: var(--ink-soft); text-decoration: none;
    cursor: pointer;
  }
  .cmdk-row:hover, .cmdk-row.active {
    background: var(--primary-soft); color: var(--ink); text-decoration: none;
  }
  .cmdk-row .ic { color: var(--muted); width: 16px; }
  .cmdk-row .label { font-size: 13px; font-weight: 600; }
  .cmdk-row .ctx { font-size: 11px; color: var(--muted); margin-left: auto; }
  .cmdk-empty {
    padding: 28px; text-align: center; color: var(--muted); font-size: 13px;
  }

/* ══ Six-pillar switcher (2026-06-10) ══ */
.pillar-switcher { position: relative; margin: 6px 0 2px; }
.pillar-switcher > summary { list-style: none; cursor: pointer; }
.pillar-switcher > summary::-webkit-details-marker { display: none; }
.pillar-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--rule);
  box-shadow: var(--shadow-1);
  font-size: 13.5px; font-weight: 800; color: var(--ink);
  user-select: none;
  transition: background 0.12s, border-color 0.12s;
}
.pillar-pill:hover { border-color: var(--primary); }
.pillar-switcher[open] .pillar-pill {
  border-color: var(--primary); background: var(--primary-soft);
}
.pillar-pill .pp-ic {
  width: 22px; height: 22px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 6px; font-size: 11px; flex-shrink: 0;
}
.pillar-pill .pp-name { flex: 1; letter-spacing: -0.01em; }
.pillar-pill .chev {
  font-size: 10px; color: var(--muted);
  transition: transform 0.15s var(--ease-out);
}
.pillar-switcher[open] .pillar-pill .chev { transform: rotate(180deg); }
.pillar-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 70;
  background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  transform-origin: top left;
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
  @starting-style {
    opacity: 0;
    transform: scale(0.97) translateY(-2px);
  }
}
.pillar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  text-decoration: none;
}
.pillar-item:hover { background: var(--surface-hover); text-decoration: none; }
.pillar-item.is-current { background: var(--primary-soft); }
.pillar-item .ic {
  width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--surface-warm); border: 1px solid var(--rule);
  border-radius: 6px; font-size: 11px; color: var(--ink-soft); flex-shrink: 0;
}
.pillar-item.is-current .ic {
  background: var(--primary-soft); color: var(--primary-deep);
  border-color: rgba(83,133,179,0.35);
}
.pillar-item .pi-text {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.pillar-item .nm { font-size: 13px; font-weight: 700; color: var(--ink); }
.pillar-item .desc { font-size: 11px; color: var(--muted); }
/* Pinned active-projects group */
.sb-pinned { padding-top: 10px; border-top: 1px solid var(--rule-soft); margin-top: 14px; }

/* ══ De-emoji + alignment fixes (2026-06-10) ══ */
html { font-variant-emoji: text; }
/* Project rows: align names with the 16px icon column of regular items
   (9px dot + 4px + 13px = 16px ic + 10px gap) */
.sb-item.sb-proj .health-dot { margin-left: 4px; margin-right: 13px; }

/* ============ Icon-rail sidebar (2026-06-20) — whole platform nav as a slim rail ============ */
:root{ --sidebar-w: 96px; }
.sidebar{ padding:14px 7px 22px; gap:2px; align-items:stretch; }
.sidebar .sb-group{ margin-top:0; display:flex; flex-direction:column; gap:2px; }
.sidebar .sb-group + .sb-group{ border-top:1px solid var(--rule-soft); padding-top:9px; margin-top:9px; }
.sidebar .sb-group.sb-pinned{ display:none; }
.sidebar .sb-heading{ font-size:8.5px; font-weight:800; text-align:center; letter-spacing:.13em; padding:2px 0 7px; color:var(--muted); }
.sb-item{ flex-direction:column; align-items:center; gap:6px; padding:9px 3px; border-radius:13px; font-size:10px; font-weight:600; text-align:center; line-height:1.12; color:var(--ink-soft); position:relative; }
.sb-item .ic{ width:24px; height:24px; font-size:21px; color:var(--muted); display:grid; place-items:center; }
.sb-item .ic svg{ width:23px; height:23px; display:block; }
.sb-item:hover{ background:rgba(28,38,58,.05); color:var(--ink); }
.sb-item.active{ background:rgba(232,93,4,.10); color:var(--accent-deep); box-shadow:none; font-weight:700; }
.sb-item.active .ic{ color:var(--accent); }
.sb-item .count{ position:absolute; top:5px; right:12px; margin:0; font-size:9px; font-weight:800; }
.sidebar .sb-heading-link{ font-size:15px; font-weight:800; letter-spacing:.02em; color:var(--ink); text-align:center; padding:8px 2px 10px; border:none; line-height:1.1; margin-bottom:2px; }
.sb-item.sb-proj .proj-name{ max-width:84px; font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; }
.sb-item.sb-proj .health-dot{ margin:0 0 2px !important; }
.sb-item.sb-proj .h-num{ display:none; }
.sb-subhead{ font-size:8px; text-align:center; padding:9px 2px 4px; }
.sb-phase{ font-size:8px; text-align:center; }
.sb-help-lead, .sb-quote-builder{ border-left:none !important; padding-left:3px; }
