/* index.css  — the v2 shell stylesheet
   Extracted from index.html (was inline head <style>, lines 193-2269).
   Base: Session 23 build, html md5 f290e41865fabf8b3bd6af6104b4a38a.
   Last touched: Session 83 · July 16, 2026 — presentation mode: #tool-overlay.presenting
   (viewport-expanded overlay above the shell chrome, z 500) + the .tool-present-pill /
   .tool-present-btn exit controls rendered inside the overlay. Ships WITH index.html S83.
   Prior (S54): the "Camo" light-canvas appearance
   (:root[data-theme="camo"] --canvas-bg = seamless ses-camo-light.png tile + teal fallback;
   .appearance-sw.camo swatch chip). Ships WITH index.html. (S44/S46 also touched — see FILES.md.)
   Deploy FLAT beside index.html in salesportal/. The two small body style
   blocks (#ses-login-gate-style, #ses-account-style) stay inline in index.html.
   Sanity grep: grep -n ':root' index.css  ·  grep -n 'data-theme="camo"' index.css */

  :root {
    /* ── Secure Energy brand palette (Session 20) ──
       Teal #1c7363 is the workhorse (links, active states, primary buttons).
       Orange-red #e85543 is the single reserved accent/CTA — use sparingly.
       Body text gray #4c4c4c, Raleway. Light theme is the default below;
       the night theme overrides these same tokens via :root[data-theme="night"]. */
    --brand: #1C7363;
    --brand-2: #155A4D;
    --brand-3: #4FA48E;
    --brand-tint: #E4F0EC;
    --brand-tint-2: #F2F8F6;

    --ink: #2B2B2B;
    --ink-2: #4C4C4C;
    --ink-3: #7C7C7C;
    --ink-4: #A6A6A6;

    --bg: #FBFAF8;
    --surface: #FFFFFF;
    --surface-2: #F2F4F3;
    --surface-3: #E8ECEA;

    --line: #E0E2E0;
    --line-2: #CFD3D1;

    /* Reserved CTA accent — orange-red. Sparing use only. */
    --accent: #E85543;
    --accent-2: #D44530;
    --accent-bg: #FCEAE6;

    --accent-amber: #B8651F;
    --accent-amber-bg: #FBF1E2;
    --accent-blue: #1F5A8C;

    /* Artifact state tokens — three clearly distinct treatments */
    --state-draft-bg: #FFFFFF;
    --state-draft-border: #E0E2E0;
    --state-draft-text: #2B2B2B;

    --state-packet-bg: #E4F0EC;
    --state-packet-border: #4FA48E;
    --state-packet-accent: #155A4D;

    --state-locked-bg: #E8ECEA;
    --state-locked-border: #C5CAC8;
    --state-locked-text: #5A625E;
    --accent-blue-bg: #E6EFF7;
    --accent-red: #C0392B;
    --accent-red-bg: #FBE9E7;

    --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --font-body: 'Raleway', 'Inter Tight', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

    --radius: 4px;
    --radius-lg: 8px;

    --shadow-sm: 0 1px 0 rgba(20,30,27,0.04);
    --shadow-md: 0 2px 0 rgba(20,30,27,0.04), 0 0 0 0.5px rgba(20,30,27,0.08);
    /* Soft card lift (S46) — used by the Start-something-new tiles. */
    --shadow-card: 0 2px 8px rgba(20,30,27,0.08);

    /* Canvas background (S46). The default light appearance ("teal") is a faint
       teal wash off the theme-flipped brand-tint tokens; the "white"/"grey"
       appearances below override it with a flat color. .canvas reads --canvas-bg. */
    --canvas-bg: linear-gradient(158deg, var(--brand-tint-2) 0%, var(--brand-tint) 100%);
  }

  /* ── Light-canvas appearance variants (S46). Inherit every light token from
     :root and override ONLY the canvas background. Selected via the topbar
     appearance picker; persisted to ses_theme_v1. ── */
  :root[data-theme="white"] { --canvas-bg: #FBFAF8; }   /* the original near-white --bg */
  :root[data-theme="grey"]  { --canvas-bg: #EDF0EE; }   /* the darker-neutral swatch */
  /* S54 — SES-teal camo canvas. A seamless (edge-wrapping) tile of the brand
     palette (teal field, charcoal + off-white patches, faint orange accent),
     baked from the layered-noise generator; low-contrast so it sits behind UI.
     A light-canvas variant like white/grey (chrome + toolTheme="light" unchanged).
     The pale-teal color is the fallback if the asset is missing/404s. */
  :root[data-theme="camo"]  { --canvas-bg: url('../assets/images/ses-camo-light.png') repeat, #E4F0EC; }

  /* ── Night theme — overrides the same tokens. Shell chrome only in Phase 1;
     iframe tools stay light until Phase 2 themes them over the bridge. ── */
  :root[data-theme="night"] {
    --brand: #43AE94;
    --brand-2: #5CC1A8;
    --brand-3: #2F7D6A;
    --brand-tint: #1B3A33;
    --brand-tint-2: #16302A;

    --ink: #E9EDEB;
    --ink-2: #BAC4BF;
    --ink-3: #8B958F;
    --ink-4: #5F6A64;

    --bg: #10201C;
    --surface: #172925;
    --surface-2: #1E332D;
    --surface-3: #274038;

    --line: #2A3D37;
    --line-2: #36493F;

    --accent: #F06B50;
    --accent-2: #E85543;
    --accent-bg: #3A211C;

    --state-draft-bg: #172925;
    --state-draft-border: #2A3D37;
    --state-draft-text: #E9EDEB;

    --state-packet-bg: #1B3A33;
    --state-packet-border: #2F7D6A;
    --state-packet-accent: #5CC1A8;

    --state-locked-bg: #1E332D;
    --state-locked-border: #36493F;
    --state-locked-text: #9AA49E;
    --accent-blue: #6FA8D6;
    --accent-blue-bg: #1A2C3A;
    --accent-red: #E8796B;
    --accent-red-bg: #3A211C;
    /* S46: night amber tint — light theme's --accent-amber-bg (#FBF1E2) had no
       night override, so it glared on the TQM card. Dark amber, paralleling
       --accent-bg (#3A211C). */
    --accent-amber-bg: #3A2E1C;

    --shadow-sm: 0 1px 0 rgba(0,0,0,0.30);
    --shadow-md: 0 2px 0 rgba(0,0,0,0.30), 0 0 0 0.5px rgba(0,0,0,0.45);
    /* S46 */
    --shadow-card: 0 2px 8px rgba(0,0,0,0.35);
    --canvas-bg: linear-gradient(158deg, var(--brand-tint-2) 0%, var(--brand-tint) 100%);
  }

  @import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Raleway:wght@400;500;600;700&family=Inter+Tight:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html, body {
    height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
  }

  button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
  }

  input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: var(--surface);
    border: 0.5px solid var(--line-2);
    border-radius: var(--radius);
    padding: 6px 10px;
    width: 100%;
  }
  input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-tint);
  }

  /* ─── App layout ─── */
  .app {
    display: grid;
    grid-template-rows: 56px 1fr;
    height: 100vh;
  }

  /* ─── Topbar ─── */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: var(--surface);
    border-bottom: 0.5px solid var(--line);
  }
  .topbar-left {
    display: flex; align-items: center; gap: 12px;
  }
  .topbar-home {
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
    padding: 4px 8px;
    margin: 0 -8px;
    border-radius: var(--radius);
    transition: background 0.1s;
  }
  .topbar-home:hover {
    background: var(--surface-2);
  }
  .topbar-home:hover .product-name::after {
    content: ' · home';
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 400;
    margin-left: 4px;
  }
  .logo {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
  }
  .product-name {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 17px;
    letter-spacing: -0.2px;
  }
  .product-name .v {
    color: var(--ink-3);
    font-size: 12px;
    font-family: var(--font-mono);
    margin-left: 6px;
    letter-spacing: 0;
  }
  /* Mode indicator badge — live (Azure) vs mock (fixtures) */
  .mode-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 9px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 999px;
    line-height: 1.5;
    vertical-align: middle;
    cursor: help;
  }
  .mode-badge.mode-live {
    background: var(--state-packet-bg);
    color: var(--state-packet-accent);
    border: 0.5px solid var(--brand-3);
  }
  .mode-badge.mode-mock {
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
    border: 0.5px solid var(--accent-amber);
  }
  .topbar-right {
    display: flex; align-items: center; gap: 14px;
    font-size: 12px;
    color: var(--ink-2);
  }
  .topbar-search {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    background: var(--surface-2);
    border-radius: var(--radius);
    width: 280px;
    color: var(--ink-3);
  }
  .user-pill {
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background 0.1s;
  }
  .user-pill:hover { background: var(--surface-2); }
  .user-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--brand-2);
    color: white;
    font-size: 10px;
    font-weight: 500;
    display: flex; align-items: center; justify-content: center;
  }
  .user-pill-caret { color: var(--ink-3); font-size: 9px; }

  /* Session 3: top-bar icon buttons (client lookup, feedback) */
  .topbar-icon-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 0.5px solid transparent;
    border-radius: var(--radius);
    color: var(--ink-2);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
  }
  .topbar-icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
  }

  /* Session 20: hoisted tool actions in the topbar (tool mode). Compact so the
     44px bar height is unchanged. Primary = teal fill; secondary = teal outline. */
  .topbar-tool-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .tta-divider {
    width: 1px;
    height: 18px;
    background: var(--line);
    margin: 0 4px;
    display: inline-block;
  }
  .tta-btn {
    height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius);
    border: 0.5px solid var(--brand-3);
    background: var(--brand-tint);
    color: var(--brand);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, border-color 0.1s, color 0.1s, opacity 0.1s;
  }
  .tta-btn:hover { background: var(--brand-tint-2); }
  .tta-btn.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
  }
  .tta-btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
  .tta-btn:disabled,
  .tta-btn.is-busy {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
  }

  /* Session 3: active client indicator in top bar */
  .topbar-active-client {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: var(--brand-tint);
    border: 0.5px solid var(--brand-3);
    border-radius: 999px;
    color: var(--brand);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.1s;
  }
  .topbar-active-client:hover { background: var(--brand-tint-2); }
  .topbar-active-client-label {
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 9px;
    color: var(--brand-2);
    opacity: 0.7;
    font-weight: 500;
  }
  .topbar-active-client-name {
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-active-client-x {
    color: var(--brand-2);
    opacity: 0.6;
    font-size: 13px;
    line-height: 1;
    padding-left: 2px;
  }
  .topbar-active-client:hover .topbar-active-client-x { opacity: 1; }

  /* Session 3: user pill menu */
  .user-pill-wrap { position: relative; }
  .user-pill-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 0.5px solid var(--line-2);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(15,23,21,0.08), 0 0 0 0.5px rgba(15,23,21,0.04);
    padding: 4px;
    z-index: 100;
    font-size: 12px;
  }
  .user-pill-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--ink);
    transition: background 0.1s;
  }
  .user-pill-menu-item:hover { background: var(--surface-2); }
  .user-pill-menu-item.muted-item {
    color: var(--ink-3);
    cursor: default;
  }
  .user-pill-menu-item.muted-item:hover { background: transparent; }
  .user-pill-menu-item .sub {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-4);
    background: var(--surface-2);
    padding: 1px 5px;
    border-radius: 999px;
  }
  .user-pill-menu-divider {
    height: 0.5px;
    background: var(--line);
    margin: 4px 6px;
  }

  /* Session 3: toast container (transient notifications) */
  .toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    box-shadow: 0 4px 16px rgba(15,23,21,0.18);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.18s ease-out;
  }
  @keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
  }
  .toast-icon { opacity: 0.7; font-size: 13px; }

  /* ─── Main grid ─── */
  .main {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 0;
    /* Session 3: .main needs a resolved height so the tool-mode iframe
       wrap (which uses flex: 1 inside a 100% tall .tool-canvas) can
       compute against something. Without this, .tool-iframe-wrap
       collapses to 0px and the iframe is invisible. */
    height: 100%;
    overflow: hidden;
  }

  /* ─── Left rail ─── */
  .rail {
    background: var(--surface);
    border-right: 0.5px solid var(--line);
    overflow-y: auto;
    padding: 8px 0 16px;
    scrollbar-width: thin;                       /* S44: branded teal scrollbar (Firefox) */
    scrollbar-color: var(--brand-3) transparent;
  }
  .rail::-webkit-scrollbar { width: 9px; }
  .rail::-webkit-scrollbar-track { background: transparent; }
  .rail::-webkit-scrollbar-thumb {
    background: var(--brand-3);
    border-radius: 6px;
    border: 2px solid var(--surface);            /* inset so the thumb reads as a pill */
  }
  .rail::-webkit-scrollbar-thumb:hover { background: var(--brand); }
  .rail-section {
    padding: 8px 0 4px;
  }
  .rail-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px 3px;
    padding: 5px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--brand);                 /* S44 (Option B): brand-teal label on a soft teal tint */
    font-weight: 600;
    background: var(--brand-tint);
    border-radius: var(--radius);
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
  }
  .rail-section-title:hover { background: color-mix(in srgb, var(--brand-tint), var(--brand) 12%); }
  .rail-caret {
    font-size: 9px;
    color: var(--brand-3);               /* S44: teal caret to sit on the tint */
    width: 9px;
    flex-shrink: 0;
    text-align: center;
  }
  .rail-section-label { flex: 1; }
  .rail-clear {
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-size: 10px;
    color: var(--brand-2);               /* S44: darker teal for contrast on the tint */
    font-weight: 500;
  }
  .rail-clear:hover { color: var(--accent-2); }
  .rail-section.collapsed > :not(.rail-section-title) { display: none; }
  .rail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    color: var(--ink-2);
    cursor: pointer;
    border-left: 2px solid transparent;
    font-size: 13px;
    transition: background 0.08s;
  }
  .rail-item:hover {
    background: var(--surface-2);
  }
  .rail-item.active {
    background: var(--brand-tint);
    color: var(--brand);
    border-left-color: var(--brand);
    font-weight: 500;
  }
  .rail-item .icon {
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    color: var(--ink-3);
  }
  .rail-item.active .icon { color: var(--brand); }
  .rail-item .sub {
    font-size: 10px;
    color: var(--ink-3);
    margin-left: auto;
    font-family: var(--font-mono);
  }
  .rail-item.active .sub { color: var(--brand-2); }

  .rail-item.new-case {
    color: var(--brand);
    font-weight: 500;
  }
  .rail-item.new-case .icon { color: var(--accent); }

  /* S44: owner-vs-team marker. Owner cases are unbadged (the common case); a
     case you've worked but don't own gets this tag — in the MY CASES rail
     (.rail-team-badge) and on the Home case tile (.case-team-tag). */
  .rail-team-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--brand-2);
    background: var(--brand-tint);
    border: 0.5px solid var(--brand-3);
    border-radius: 999px;
    padding: 0 7px;
    line-height: 15px;
    flex-shrink: 0;
  }
  .case-team-tag {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--brand-2);
    background: var(--brand-tint);
    border: 0.5px solid var(--brand-3);
    border-radius: 999px;
    padding: 1px 8px;
    flex-shrink: 0;
  }

  /* ─── Canvas ─── */
  .canvas {
    overflow-y: auto;
    background: var(--canvas-bg);
    min-height: 0;
    /* Session 3: explicit height so children using height:100% (the
       tool-mode iframe wrap) compute correctly. */
    height: 100%;
  }

  /* ─── Breadcrumb ─── */
  .breadcrumb {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 24px;
    background: var(--bg);
    border-bottom: 0.5px solid var(--line);
    font-size: 12px;
  }
  .breadcrumb-link {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--brand);
    text-decoration: none;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--brand-tint);
    border: 0.5px solid var(--brand-3);
    transition: background 0.1s, border-color 0.1s;
    font-weight: 600;
  }
  .breadcrumb-link:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
  }
  .breadcrumb-sep {
    color: var(--ink-4);
    font-size: 14px;
  }
  .breadcrumb-current {
    color: var(--ink-2);
  }

  /* Back-to-clients chip — same affordance as the breadcrumb link */
  .btn-back-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px;
    line-height: 1;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--brand-tint);
    border: 0.5px solid var(--brand-3);
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
  }
  .btn-back-chip:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
  }

  /* ─── Case header ─── */
  .case-header {
    background: var(--surface);
    border-bottom: 0.5px solid var(--line);
    padding: 16px 24px 0;
  }
  .case-header-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
  }
  .case-header-actions {
    display: flex; gap: 8px; flex-shrink: 0;
    padding-top: 6px;
  }
  .case-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.4px;
    display: flex; align-items: baseline; gap: 10px;
    flex-wrap: wrap;
  }
  .pill {
    display: inline-flex; align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-body);
    border-radius: 999px;
    letter-spacing: 0;
  }
  .pill-amber { background: var(--accent-amber-bg); color: var(--accent-amber); }
  .pill-blue { background: var(--accent-blue-bg); color: var(--accent-blue); }
  .pill-green { background: var(--brand-tint); color: var(--brand); }
  .pill-red { background: var(--accent-red-bg); color: var(--accent-red); }
  .pill-gray { background: var(--surface-3); color: var(--ink-2); }

  .case-meta {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--ink-3);
  }

  /* ─── Stage tracker ─── */
  .stages {
    display: flex;
    align-items: stretch;
    margin-top: 16px;
    padding-bottom: 0;
    overflow-x: auto;
  }
  .stage {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px 12px;
    cursor: pointer;
    position: relative;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s;
  }
  .stage:hover { background: var(--surface-2); }
  .stage.active { border-bottom-color: var(--brand); }
  .stage.complete { color: var(--brand-2); }
  .stage-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 500;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 6px;
    font-family: var(--font-mono);
  }
  .stage.complete .stage-num {
    background: var(--brand);
    color: white;
  }
  .stage.active .stage-num {
    background: var(--ink);
    color: white;
  }
  .stage-label {
    font-size: 11px;
    color: var(--ink-3);
    text-align: center;
  }
  .stage.active .stage-label { color: var(--ink); font-weight: 500; }
  .stage.complete .stage-label { color: var(--brand-2); }
  .stage::after {
    content: '';
    position: absolute;
    top: 19px;
    right: -50%;
    width: 100%;
    height: 0.5px;
    background: var(--line);
    z-index: 0;
  }
  .stage:last-child::after { display: none; }
  .stage-num { position: relative; z-index: 1; }

  /* ─── Stage body ─── */
  .stage-body {
    padding: 20px 24px 8px;
  }
  .stage-body-header {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 16px;
  }
  .stage-body-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.2px;
  }
  .stage-body-sub {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 2px;
  }
  .stage-body-actions {
    display: flex; gap: 8px;
  }

  /* ─── Banner ─── */
  .banner {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-left: 2px solid var(--accent-blue);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 12px;
  }
  .banner.warning { border-left-color: var(--accent-amber); }
  .banner.success { border-left-color: var(--brand-3); }
  .banner .banner-icon { color: var(--accent-blue); font-size: 14px; }
  .banner.warning .banner-icon { color: var(--accent-amber); }
  .banner.success .banner-icon { color: var(--brand-2); }
  .banner-text { flex: 1; color: var(--ink-2); }
  .banner-action {
    color: var(--accent-blue);
    font-weight: 500;
    text-decoration: none;
  }
  .banner-action:hover { text-decoration: underline; }

  /* ─── Card ─── */
  .card {
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
  }
  .card.read-only {
    background: var(--surface-2);
    color: var(--ink-2);
  }
  .card-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 8px;
  }
  .card-title {
    font-weight: 500;
    font-size: 13px;
  }
  .card-sub {
    font-size: 11px;
    color: var(--ink-3);
    font-family: var(--font-mono);
  }

  /* ─── Button ─── */
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border: 0.5px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.08s;
  }
  .btn:hover { background: var(--surface-2); }
  .btn-primary {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
  }
  .btn-primary:hover { background: var(--brand-2); }
  .btn-danger {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background: var(--surface);
  }
  .btn-danger:hover {
    background: var(--accent-red-bg);
  }
  .btn-danger-solid {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
  }
  .btn-danger-solid:hover {
    background: #7a2620;
  }
  .btn-ghost {
    border: none;
    color: var(--brand);
    padding: 6px 8px;
  }
  .btn-ghost:hover { background: var(--brand-tint); }
  .btn-sm { font-size: 11px; padding: 4px 8px; }
  .btn-icon {
    padding: 6px;
    width: 28px;
    justify-content: center;
  }

  /* ─── Drawer ─── */
  /* Drawer renders inline at the bottom of the canvas, not fixed.
     This eliminates fixed-height clipping. Cards size to content. */
  .drawer {
    background: var(--surface);
    border-top: 0.5px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: 0 24px 24px;
    overflow: hidden;
    box-shadow: 0 2px 0 rgba(15,23,21,0.03);
  }

  .drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px;
    border-bottom: 0.5px solid var(--line);
    cursor: pointer;
    background: var(--surface-2);
  }
  .drawer-header:hover {
    background: var(--surface-3);
  }
  .drawer-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink-2);
    font-weight: 500;
  }
  .drawer-title .count {
    color: var(--ink);
    margin-left: 6px;
    background: var(--surface);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0;
    border: 0.5px solid var(--line);
  }
  .drawer-toggle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-2);
    display: inline-flex; align-items: center; gap: 4px;
  }

  .drawer-body {
    padding: 14px 18px 16px;
  }

  .drawer-strip {
    display: flex; gap: 10px;
    overflow-x: auto;
    padding: 2px 0 6px;
    align-items: stretch;
  }
  /* ─── Artifact states: draft | marked | locked ─── */
  .artifact-card {
    flex: 0 0 220px;
    padding: 12px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.1s, transform 0.1s;
    position: relative;
    /* default = draft state */
    border: 0.5px solid var(--state-draft-border);
    background: var(--state-draft-bg);
    color: var(--state-draft-text);
  }
  .artifact-card:hover { border-color: var(--line-2); }

  /* Marked-for-packet: clearly intentional green */
  .artifact-card.marked {
    border: 1px solid var(--state-packet-border);
    background: var(--state-packet-bg);
    box-shadow: inset 4px 0 0 var(--state-packet-border);
    padding-left: 16px;
  }
  .artifact-card.marked .artifact-type { color: var(--state-packet-accent); }

  /* Locked / read-only: muted, striped, with a hatch pattern that screams "not editable" */
  .artifact-card.locked {
    border: 0.5px dashed var(--state-locked-border);
    background:
      repeating-linear-gradient(135deg,
        var(--state-locked-bg) 0 8px,
        rgba(255,255,255,0.5) 8px 9px),
      var(--state-locked-bg);
    color: var(--state-locked-text);
    cursor: default;
  }
  .artifact-card.locked .artifact-title,
  .artifact-card.locked .artifact-metric,
  .artifact-card.locked .artifact-type { color: var(--state-locked-text); }
  .artifact-card.locked .lock-icon {
    position: absolute;
    top: 8px; right: 8px;
    font-size: 11px;
    color: var(--state-locked-text);
    opacity: 0.7;
  }

  .artifact-card-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
  }
  .artifact-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-3);
    font-weight: 500;
  }
  .star {
    color: var(--ink-4);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    line-height: 1;
  }
  .star.on { color: var(--state-packet-accent); }
  .star:hover { color: var(--state-packet-accent); }

  /* Full-card variants used in stage bodies (Pricing/Modeling/etc.) */
  .card.state-draft {
    background: var(--state-draft-bg);
    border: 0.5px solid var(--state-draft-border);
  }
  .card.state-marked {
    background: var(--state-packet-bg);
    border: 1px solid var(--state-packet-border);
    box-shadow: inset 4px 0 0 var(--state-packet-border);
    padding-left: 20px;
  }
  .card.state-locked {
    background:
      repeating-linear-gradient(135deg,
        var(--state-locked-bg) 0 8px,
        rgba(255,255,255,0.5) 8px 9px),
      var(--state-locked-bg);
    border: 0.5px dashed var(--state-locked-border);
    color: var(--state-locked-text);
  }
  .card.state-locked .card-title { color: var(--state-locked-text); }
  .card.state-locked .card-sub { color: var(--state-locked-text); opacity: 0.8; }

  .state-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 999px;
  }
  .state-badge.draft   { background: var(--surface-2);          color: var(--ink-2); }
  .state-badge.marked  { background: var(--state-packet-bg);    color: var(--state-packet-accent); border: 0.5px solid var(--state-packet-border); }
  .state-badge.locked  { background: var(--state-locked-bg);    color: var(--state-locked-text); border: 0.5px solid var(--state-locked-border); }

  .artifact-title {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .artifact-metric {
    font-size: 11px;
    color: var(--ink-2);
    font-family: var(--font-mono);
  }
  .artifact-meta {
    font-size: 10px;
    color: var(--ink-3);
    margin-top: 4px;
  }

  .add-artifact-card {
    flex: 0 0 120px;
    border: 0.5px dashed var(--line-2);
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    color: var(--ink-3);
    font-size: 11px;
    cursor: pointer;
  }
  .add-artifact-card:hover {
    border-color: var(--brand);
    color: var(--brand);
  }

  /* ─── Expanded drawer table ─── */
  .drawer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .drawer-table th {
    text-align: left;
    padding: 6px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-3);
    border-bottom: 0.5px solid var(--line);
    font-weight: 500;
  }
  .drawer-table td {
    padding: 8px;
    border-bottom: 0.5px solid var(--line);
    vertical-align: middle;
  }
  .drawer-table tr:hover td { background: var(--surface-2); }

  /* ─── Grid layouts ─── */
  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  /* ─── Field ─── */
  .field {
    margin-bottom: 12px;
  }
  .field-label {
    font-size: 11px;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
    font-weight: 500;
  }
  .field-value-static {
    font-size: 13px;
    color: var(--ink);
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  /* ─── Tool mode ─── */
  .tool-mode-banner {
    background: var(--accent-blue-bg);
    border-bottom: 0.5px solid var(--line);
    padding: 10px 24px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px;
  }
  .tool-mode-banner.admin {
    background: var(--surface-2);
  }
  .tool-mode-banner .left {
    display: flex; align-items: center; gap: 8px;
    color: var(--accent-blue);
  }
  .tool-mode-banner.admin .left {
    color: var(--ink-2);
  }
  .tool-mode-body {
    padding: 24px;
  }

  /* Session 3: tool canvas with iframe — fills available height */
  .tool-canvas {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  /* Tool-mode iframe wrap (placeholder in the canvas flow). The actual iframe
     lives in #tool-overlay (outside #root) and is positioned over this region
     via #tool-overlay's fixed coordinates updated on render. We keep this
     wrap so the layout reserves space for the iframe and the breadcrumb/banner
     read correctly. The wrap itself is empty — no iframe inside it. */
  .tool-iframe-wrap {
    flex: 1;
    position: relative;
    min-height: 0;
    background: var(--surface-2);
    overflow: hidden;
  }
  /* The persistent overlay that holds the active tool iframe. Positioned by
     JS to overlap the .tool-iframe-wrap region. The iframe inside this
     element NEVER moves parents — that's what prevents the null-origin
     iframe reload loop on file:// builds. */
  #tool-overlay {
    position: fixed;
    background: var(--surface-2);
    overflow: hidden;
    z-index: 5;
    /* layout coordinates set dynamically; hidden by default */
  }
  #tool-overlay.tool-overlay-visible {
    display: block !important;
  }
  /* S83: presentation mode — the overlay expands to the viewport (the iframe
     never moves parents; only the overlay's fixed rect changes) and rises above
     the shell chrome (menus at z 100; toasts at z 1000 stay on top). */
  #tool-overlay.presenting {
    z-index: 500;
  }
  /* The shell-rendered exit pill inside the overlay (Esc can't cross the
     iframe document boundary, so this is the reliable exit affordance). */
  .tool-present-pill {
    position: absolute;
    top: 10px;
    right: 14px;
    display: flex;
    gap: 6px;
    z-index: 2;
    opacity: 0.55;
    transition: opacity 0.15s ease;
  }
  .tool-present-pill:hover { opacity: 1; }
  .tool-present-btn {
    background: var(--ink);
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15,23,21,0.25);
  }
  .tool-present-btn:hover { background: var(--brand); }
  .tool-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
  }
  .tool-iframe-fallback {
    position: absolute;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    gap: 12px;
  }
  .tool-iframe-fallback-icon {
    font-size: 28px;
    color: var(--ink-4);
  }
  .tool-iframe-fallback-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    color: var(--ink);
  }
  .tool-iframe-fallback-msg {
    font-size: 12px;
    color: var(--ink-2);
    max-width: 460px;
    line-height: 1.5;
  }
  .tool-iframe-fallback-msg code {
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink);
  }
  .tool-iframe-fallback-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
  }

  /* Tool connection status indicator (in the tool-mode-banner) */
  .tool-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 14px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
  }
  .tool-status.connecting {
    background: var(--surface);
    color: var(--ink-3);
    border: 0.5px solid var(--line);
  }
  .tool-status.connected {
    background: var(--state-packet-bg);
    color: var(--state-packet-accent);
    border: 0.5px solid var(--brand-3);
  }
  .tool-status-dot {
    font-size: 9px;
    line-height: 1;
  }
  .tool-status.connecting .tool-status-dot {
    animation: pulseDot 1.4s ease-in-out infinite;
  }
  @keyframes pulseDot {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
  }

  /* ─── Home / landing page ─── */
  .home {
    padding: 28px 32px 240px;
    max-width: 1280px;
  }
  .home-greeting {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
  }
  .home-greeting h1 {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -0.6px;
    margin-bottom: 4px;
  }
  .home-greeting .home-sub {
    color: var(--ink-2);
    font-size: 13px;
  }
  .home-greeting .home-actions {
    display: flex; gap: 8px;
  }

  /* Metrics row */
  .metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
  }
  .metric {
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
  }
  /* Teal gradient top accent (mirrors the LMP peak-card ::before treatment;
     --brand tokens are theme-adaptive). Shared by the Home and Client metric
     strips since both use .metric. The "Marked for packet" card keeps its
     distinct value color (--state-packet-accent) and shares this teal border. */
  .metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-3));
  }
  .metric .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink-3);
    font-weight: 500;
    margin-bottom: 6px;
  }
  .metric .value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.3px;
  }
  .metric .delta {
    font-size: 11px;
    color: var(--ink-3);
    margin-top: 2px;
  }

  /* Home section */
  .home-section {
    margin-bottom: 28px;
  }
  .home-section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 1.5px solid var(--brand-3);
  }
  .home-section-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.1px;
  }
  .home-section-meta {
    font-size: 11px;
    color: var(--ink-3);
    font-family: var(--font-mono);
  }

  /* Attention items: cases needing action */
  .attention-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .attention-item {
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-left: 3px solid var(--accent-amber);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    gap: 16px;
    align-items: center;
    transition: border-color 0.1s, transform 0.1s;
  }
  .attention-item:hover { transform: translateX(2px); }
  .attention-item.stale       { border-left-color: var(--accent-red); }
  .attention-item.in-progress { border-left-color: var(--accent-blue); }
  .attention-item.ready       { border-left-color: var(--state-packet-accent); }

  .attention-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    color: var(--ink-2);
    flex-shrink: 0;
  }
  .attention-main { flex: 1; min-width: 0; }
  .attention-title {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
    display: flex; align-items: center; gap: 8px;
  }
  .attention-reason {
    font-size: 11px;
    color: var(--ink-2);
  }
  .attention-meta {
    font-size: 11px;
    color: var(--ink-3);
    font-family: var(--font-mono);
    text-align: right;
    flex-shrink: 0;
  }

  /* Case cards (two-column) */
  .case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .case-tile {
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.1s, transform 0.1s;
  }
  .case-tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
  .case-tile-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px;
  }
  .case-tile-title {
    font-weight: 500;
    font-size: 14px;
  }
  .case-tile-stage-bar {
    display: flex;
    height: 4px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-3);
    margin: 8px 0 6px;
  }
  .case-tile-stage-bar .seg {
    flex: 1;
    border-right: 1px solid var(--bg);
  }
  .case-tile-stage-bar .seg:last-child { border-right: none; }
  .case-tile-stage-bar .seg.complete { background: var(--brand); }
  .case-tile-stage-bar .seg.active   { background: var(--brand-3); }
  .case-tile-meta {
    display: flex; justify-content: space-between;
    font-size: 11px;
    color: var(--ink-3);
    margin-top: 6px;
  }
  .case-tile-artifacts {
    display: flex; gap: 4px;
    font-size: 10px;
    color: var(--ink-3);
    font-family: var(--font-mono);
    margin-top: 6px;
  }
  .case-tile-artifacts .chip {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--surface-2);
  }
  .case-tile-artifacts .chip.packet {
    background: var(--state-packet-bg);
    color: var(--state-packet-accent);
  }

  /* Activity feed */
  .activity-list {
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .activity-item {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 0.5px solid var(--line);
    font-size: 12px;
    align-items: center;
    cursor: pointer;
  }
  .activity-item:last-child { border-bottom: none; }
  .activity-item:hover { background: var(--surface-2); }
  .activity-when {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-3);
  }
  .activity-text {
    color: var(--ink);
  }
  .activity-text .actor {
    color: var(--ink-2);
  }
  .activity-where {
    text-align: right;
    font-size: 11px;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Quick-start tiles (smaller, right-side column) */
  .quickstart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .quickstart-tile {
    padding: 16px 18px;
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.1s, transform 0.1s, box-shadow 0.1s;
    position: relative;
    box-shadow: var(--shadow-card);
  }
  /* S46: faint category tint over the surface (the 320% stop keeps it subtle,
     fading toward the tint at the bottom edge). Tints are theme-flipped tokens,
     so White/Grey/Night all resolve correctly. */
  .quickstart-tile.proposal { background: linear-gradient(180deg, var(--surface) 0%, var(--accent-blue-bg) 320%); }
  .quickstart-tile.tqm      { background: linear-gradient(180deg, var(--surface) 0%, var(--accent-amber-bg) 320%); }
  .quickstart-tile:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
  }
  .quickstart-tile.proposal:hover { border-color: var(--accent-blue); }
  .quickstart-tile.tqm:hover      { border-color: var(--accent-amber); }
  .quickstart-tile h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    display: flex; align-items: center; gap: 8px;
  }
  .quickstart-tile p {
    font-size: 11px;
    color: var(--ink-2);
    line-height: 1.5;
  }
  .quickstart-tile .ribbon {
    position: absolute;
    top: 14px; right: 14px;
    font-size: 18px;
    color: var(--ink-3);
  }
  .quickstart-tile.proposal h3 .dot { color: var(--accent-blue); }
  .quickstart-tile.tqm h3 .dot      { color: var(--accent-amber); }

  /* Home columns layout */
  .home-cols {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
  }
  @media (max-width: 1100px) {
    .home-cols { grid-template-columns: 1fr; }
  }

  /* ─── Session 3: Client view ─── */
  .client-view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 0.5px solid var(--line);
  }
  .client-view-header-main { flex: 1; min-width: 0; }
  .client-view-header-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink-3);
    font-weight: 500;
  }
  .client-view-header-main h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.4px;
    line-height: 1.15;
    word-break: break-word;
  }
  .client-view-key-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ink);
  }
  .client-view-key-facts .muted {
    color: var(--ink-3);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
    margin-right: 2px;
  }
  .client-view-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }
  .btn-link-style {
    background: transparent;
    border: none;
    cursor: pointer;
  }
  .btn-link-style:hover { color: var(--brand); }

  .contract-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    margin-bottom: 16px;
  }
  .contract-strip.empty {
    background: var(--surface-2);
    justify-content: flex-start;
  }
  .contract-strip-cells {
    display: flex;
    gap: 28px;
    flex: 1;
    flex-wrap: wrap;
  }
  .contract-cell-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-3);
    font-weight: 500;
    margin-bottom: 2px;
  }
  .contract-cell-value {
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
  }
  .contract-strip-actions { flex-shrink: 0; }
  .contract-strip-empty-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-2);
  }
  .contract-strip-icon {
    color: var(--ink-3);
    font-size: 14px;
  }

  /* Client library panel */
  .client-library-body { display: flex; flex-direction: column; gap: 14px; }
  .client-library-group {
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
  }
  .client-library-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--brand);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-bottom: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--brand-3);
  }
  .client-library-group-head .icon {
    color: var(--brand);
    font-size: 13px;
  }
  .client-library-group-head .home-section-meta {
    margin-left: auto;
    font-size: 10px;
    font-family: var(--font-mono);
  }
  .library-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.1s;
  }
  .library-row:hover { background: var(--surface-2); }
  .library-row-icon {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    color: var(--ink-3);
    font-size: 14px;
  }
  .library-row-main { flex: 1; min-width: 0; }
  .library-row-title {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .library-row-sub {
    font-size: 11px;
    color: var(--ink-3);
    margin-top: 1px;
  }
  .library-row-meta {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--ink-3);
    font-family: var(--font-mono);
  }
  /* Row action buttons — visible on hover, faded otherwise so rows stay scannable */
  .library-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.1s;
  }
  .library-row:hover .library-row-actions { opacity: 1; }
  .library-row-actions .row-action {
    padding: 3px 8px;
    font-size: 11px;
    min-width: 0;
  }
  .library-row-actions .row-action.danger-on-hover:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background: var(--accent-red-bg);
  }

  /* Case-pick-row used inside the attach-artifact modal */
  .case-pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0.5px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
  }
  .case-pick-row:hover {
    border-color: var(--line-2);
    background: var(--surface-2);
  }
  .case-pick-row.active {
    border-color: var(--brand);
    background: var(--brand-tint);
  }
  .case-pick-radio {
    color: var(--ink-3);
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
  }
  .case-pick-row.active .case-pick-radio { color: var(--brand); }

  /* ─── Modal ─── */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,21,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
  }
  .modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(15,23,21,0.25);
    overflow: hidden;
  }
  .modal-header {
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
  }
  .modal-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
  }
  .modal-body {
    padding: 20px;
  }
  .modal-footer {
    padding: 12px 20px;
    background: var(--surface-2);
    display: flex; justify-content: flex-end; gap: 8px;
    border-top: 0.5px solid var(--line);
  }
  .close-btn {
    color: var(--ink-3);
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
  }

  /* ─── Outcome options (close case modal) ─── */
  .outcome-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  /* ─── Commodity picker (new case modal) ─── */
  .commodity-pick {
    flex: 1;
    padding: 14px 16px;
    border: 0.5px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    transition: border-color 0.1s, background 0.1s;
    display: flex; align-items: center; justify-content: center;
  }
  .commodity-pick:hover { border-color: var(--ink-3); }
  .commodity-pick.active {
    border: 1px solid var(--brand);
    background: var(--brand-tint);
    color: var(--brand);
  }

  /* ─── Market Library ─── */
  .market-toolbar {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-lg);
  }
  .market-toolbar select,
  .market-toolbar input {
    background: var(--surface);
    border: 0.5px solid var(--line-2);
    border-radius: var(--radius);
    padding: 5px 10px;
    font-size: 12px;
    height: 30px;
    max-width: 220px;
  }
  .market-filter-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-3);
    font-weight: 500;
    margin-right: 4px;
    align-self: center;
  }

  .library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
  }
  .library-card {
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex; flex-direction: column;
    gap: 8px;
    transition: border-color 0.1s, transform 0.1s;
  }
  .library-card:hover {
    border-color: var(--line-2);
    transform: translateY(-1px);
  }
  .library-card-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 8px;
  }
  .library-card-title {
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    flex: 1;
  }
  .library-card-summary {
    font-size: 12px;
    color: var(--ink-2);
    line-height: 1.45;
    flex: 1;
  }
  .library-card-meta {
    display: flex; gap: 6px; flex-wrap: wrap;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--ink-3);
  }
  .library-card-actions {
    display: flex; gap: 6px; justify-content: space-between; align-items: center;
    padding-top: 6px;
    border-top: 0.5px solid var(--line);
    margin-top: 4px;
  }
  .commodity-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .commodity-chip.electricity { background: var(--accent-blue-bg); color: var(--accent-blue); }
  .commodity-chip.gas         { background: var(--accent-amber-bg); color: var(--accent-amber); }
  .commodity-chip.both        { background: var(--brand-tint); color: var(--brand); }

  .punch-list-banner {
    background: var(--surface-2);
    border: 0.5px dashed var(--line-2);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 11px;
    color: var(--ink-2);
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
  }
  .punch-list-banner .tag {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 1px 6px;
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
    border-radius: 999px;
    font-weight: 500;
  }

  /* ─── Outcome options (close case modal) ─── */
  .outcome-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 0.5px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
  }
  .outcome-option:hover {
    border-color: var(--line-2);
    background: var(--surface-2);
  }
  .outcome-option.active {
    border: 1px solid var(--accent-red);
    background: var(--accent-red-bg);
  }
  .outcome-option-radio {
    color: var(--ink-3);
    font-size: 16px;
    line-height: 1;
    padding-top: 1px;
  }
  .outcome-option.active .outcome-option-radio {
    color: var(--accent-red);
  }
  .outcome-option-label {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
  }
  .outcome-option.active .outcome-option-label {
    color: var(--accent-red);
  }
  .outcome-option-desc {
    font-size: 11px;
    color: var(--ink-2);
    line-height: 1.4;
  }
  .outcome-option.active .outcome-option-desc {
    color: var(--accent-red);
    opacity: 0.85;
  }

  /* ─── Misc ─── */
  .muted { color: var(--ink-3); }
  .mono { font-family: var(--font-mono); font-size: 11px; }
  .sep { height: 0.5px; background: var(--line); margin: 16px 0; }
  .stack-sm > * + * { margin-top: 8px; }
  .stack > * + * { margin-top: 12px; }
  .stack-lg > * + * { margin-top: 20px; }

  /* ─── Usage profile editor ─── */
  .usage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: var(--font-mono);
  }
  .usage-table th, .usage-table td {
    padding: 6px 8px;
    border-bottom: 0.5px solid var(--line);
    text-align: right;
  }
  .usage-table th {
    background: var(--surface-2);
    font-weight: 500;
    color: var(--ink-2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }
  .usage-table th:first-child, .usage-table td:first-child {
    text-align: left;
  }
  .usage-table td.adjusted {
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
  }
  .usage-table input {
    width: 80px;
    padding: 3px 6px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
  }

  /* ─── Empty state ─── */
  .empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--ink-3);
  }
  .empty-icon {
    font-size: 32px;
    color: var(--ink-4);
    margin-bottom: 8px;
  }

  /* ─── Stage body 'subview' (e.g. inside Pricing) ─── */
  .subview-tabs {
    display: flex;
    gap: 0;
    border-bottom: 0.5px solid var(--line);
    margin-bottom: 16px;
  }
  .subview-tab {
    padding: 8px 14px;
    font-size: 12px;
    color: var(--ink-2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -0.5px;
  }
  .subview-tab:hover { color: var(--ink); }
  .subview-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 500;
  }

  /* ─── Mock tool output ─── */
  .mock-output {
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
  }
  .mock-output-title {
    font-weight: 500;
    margin-bottom: 8px;
  }
  .mock-bars {
    display: flex; align-items: flex-end; gap: 4px;
    height: 80px;
    margin: 12px 0;
  }
  .mock-bar {
    flex: 1;
    background: var(--brand-3);
    border-radius: 2px 2px 0 0;
    opacity: 0.7;
  }

  /* ─── Packet section ─── */
  .packet-row {
    display: flex; align-items: center;
    padding: 12px 14px;
    background: var(--surface);
    border: 0.5px solid var(--line);
    border-radius: var(--radius);
    gap: 12px;
    margin-bottom: 6px;
  }
  .packet-row .order {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-3);
    width: 24px;
  }
  .packet-row .info {
    flex: 1;
  }
  .packet-row .info-title {
    font-size: 13px;
    font-weight: 500;
  }
  .packet-row .info-sub {
    font-size: 11px;
    color: var(--ink-3);
    margin-top: 2px;
  }

  /* Subtle utility: hidden helper */
  .sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
  }

  /* ── Appearance picker (S46) — replaces the S20 ☾/☀ toggle. A small menu of
     canvas appearances (Teal / White / Grey / Night). Mirrors .user-pill-menu;
     open-state rides Store.modal, cleared by the global outside-click handler. ── */
  .appearance-wrap { position: relative; display: inline-flex; }
  .appearance-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 156px;
    background: var(--surface);
    border: 0.5px solid var(--line-2);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(15,23,21,0.08), 0 0 0 0.5px rgba(15,23,21,0.04);
    padding: 4px;
    z-index: 100;
    font-size: 12px;
  }
  .appearance-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--ink-2);
    transition: background 0.1s;
  }
  .appearance-menu-item:hover { background: var(--surface-2); }
  .appearance-menu-item.active { color: var(--ink); font-weight: 600; }
  .appearance-menu-item .check { margin-left: auto; color: var(--brand); font-size: 11px; }
  /* Swatch chips show each appearance's canvas color (literal — they represent
     the option regardless of the active theme). */
  .appearance-sw {
    width: 16px; height: 16px;
    border-radius: 4px;
    border: 0.5px solid var(--line-2);
    flex-shrink: 0;
  }
  .appearance-sw.teal  { background: linear-gradient(158deg, #F2F8F6, #E4F0EC); }
  .appearance-sw.white { background: #FBFAF8; }
  .appearance-sw.grey  { background: #EDF0EE; }
  .appearance-sw.night { background: linear-gradient(158deg, #16302A, #1B3A33); }
  .appearance-sw.camo  { background: url('../assets/images/ses-camo-light.png') center / 220%, #E4F0EC; }
