  :root{
    /* ==== OPERATOR CONSOLE — cold graphite ink, one glacier tracer ==== */
    /* ---- LIGHT SaaS neutrals (ported from redesign.html 2026-06-17): a light
       base, WHITE surfaces that float on it with real contrast ---- */
    /* ---- ONE violet, ten steps. ICED: the hue sits at the blue end of
       violet and the chroma stays low, so it reads cold and luminous rather
       than heavy and purple. A saturated aubergine on a white ground looks
       like ink; this looks like frost on glass, which is what was asked for. Every interactive tint is drawn from this
       ramp and nowhere else: hover, selection, focus, badges, subtle fills.
       Three hand-picked values is how a theme drifts -- the fourth need gets
       a colour invented for it, and then a fifth. ---- */
    --v-50:#F4F4FF;  --v-100:#E9EAFE; --v-200:#D6D9FB; --v-300:#BCC0F6;
    --v-400:#9CA0EE; --v-500:#8083E6; --v-600:#6C6ADB; --v-700:#5D57CC;
    --v-800:#4B45A9; --v-900:#3A3585;
    /* Neutrals carry the SAME hue at almost no chroma. That is what keeps
       white looking white while the screen still reads as one piece --
       a neutral grey beside a violet accent always looks like two palettes. */
    --n-0:#FFFFFF;   --n-25:#F9F9FE;  --n-50:#F5F5FC;  --n-100:#EFEFF8;
    --n-200:#E5E5F1; --n-300:#D6D5E8; --n-500:#8E8DA4; --n-600:#5D5C71;
    --n-800:#38374A; --n-900:#181726;

    /* Page ground deepened from #F9F9FE so the WHITE cards/surfaces (--bg-1)
       read as raised: card:ground now 1.15:1 (was 1.05, effectively flat).
       Text stays far above AA on it (muted 5.63:1, ink 15.3:1). Audit A5/D1. */
    --bg-0:#EEEEF6; --bg-1:var(--n-0); --bg-2:var(--n-0); --bg-3:var(--n-100);
    --field-bg:var(--n-50);
    --hover:rgba(24,23,38,.045); --selected:rgba(93,87,204,.10);
    --border:var(--n-200); --border-strong:var(--n-300);
    /* A boundary that IDENTIFIES an interactive control (search field, selected
       tab) needs 3:1 against its adjacent surfaces — the soft --border above is
       for containers. #868690 clears 3:1 on white, the field fill (#F5F5FC) and
       the tab strip (#EFEFF8). Audit A1/A2, see docs/remediation-2026-09-03.md. */
    --border-interactive:#868690;
    --hairline:#EFEFF9;
    /* v374 (D9): token-contract backfill. These role tokens were referenced by
       module sheets with no :root definition (--panel had none at all, 14 uses).
       Mapped to existing roles; a module sheet that redefines one locally (e.g.
       pay.css) still wins in its own scope. */
    --card:var(--n-0); --panel:var(--bg-2); --field:var(--field-bg);
    --ink:var(--text); --line:var(--border); --text-soft:var(--muted);
    --border-soft:var(--hairline); --warn-subtle:var(--warn-bg);
    /* ---- text: TRUE black primary, grey ladder ---- */
    /* Not #000. Nothing printed or painted is pure black, and it was the
       single loudest source of the console feel this palette replaces. */
    --text:var(--n-900);
    --muted:var(--n-600);
    --faint:#696880;   /* 723 (UX-08) — 4.7:1 on the ground, 5.4:1 on white (was --n-500, 2.8:1) */
    /* ---- the one interactive hue: indigo ---- */
    --accent:var(--v-700);
    --accent-hover:var(--v-800);
    --accent-text:var(--v-700);
    --accent-ink:var(--n-0);
    --accent-subtle:var(--v-50);
    /* Solid, not 45% alpha: the old ring blended to ~1.8:1 on white and was
       effectively invisible. --accent (#5D57CC) clears 3:1 on white (5.67) and
       on the page ground (5.41). Audit D3. */
    --focus-ring:0 0 0 1px var(--n-0), 0 0 0 3px var(--accent);
    /* ---- semantics (state only, never decoration) ---- */
    --ok:#0a7040;     --ok-bg:#e8f7ef;   /* 723 (UX-08) — AA on white, the ground and its tint (was #0f9d58, 3.5:1) */
    --warn:#8a5300;   --warn-bg:#fdf3e3;   /* 723 (UX-08) — AA (was #b26a00, 4.2:1) */   --warn-text:#90714c; /* amber GLYPH tone, 4.5:1 on white (audit A4); --warn stays the surface/semantic tint */
    --danger:#b8241b; --danger-bg:#fdeceb;   /* 723 (UX-08) — AA on its tint and the ground (was #d62f24, 4.2:1) */
    --info:#2563eb;   --info-bg:#eaf1fe;
    /* ---- the type rail: 18 entity hues, re-derived DARK for the light theme
       (each keeps its hue family but hits >=4.5:1 on white #fff so the eyebrow
       labels + node accents read; the old pastels were calibrated for the dark
       canvas and washed out to ~1.1:1 after the light pivot) ---- */
    --t-organization:#5b6770; --t-location:#c2492f;  --t-folder:#5f6b76;
    --t-server:#1f7aa8;       --t-device:#3160bf;    --t-network:#13806f;
    --t-domain:#157e93;       --t-application:#5a4fc4;
    --t-crypto:#0e8a59;       --t-certificate:#15876a; --t-license:#8a44b0;
    --t-note:#9a6a00;         --t-document:#866a1c;  --t-runbook:#4f7a16;
    --t-chart:#7d3faf;        --t-contact:#b05e16;   --t-vendor:#b0427c;
    --t-ticket:#c5374e;       --t-media:#b44d8f;
    /* ---- shape (console, not bubble) ---- */
    /* In rem, so the whole shell scales with the root below instead of
       staying 4px on a 4K screen. --r-pill stays absolute: it is a shape,
       not a size, and a pill must round fully whatever the viewport. */
    --r-sm:.5rem; --r-md:.75rem; --r-lg:1rem; --r-pill:999px; --r-bubble:.8125rem;
    /* ---- space ---- */
    --sp-1:.25rem; --sp-2:.5rem; --sp-3:.75rem; --sp-4:1rem; --sp-5:1.25rem;
    --sp-6:1.5rem; --sp-8:2rem; --sp-10:2.5rem;
    /* ---- type scale (denser) ---- */
    /* Every size in rem, so the root clamp below carries the whole scale.
       Fixed px meant 13px body text on a 27-inch screen and the same 13px on
       a laptop -- the app could not breathe on one and could not fit on the
       other. Ratios are unchanged; only the unit is. */
    --fs-0:.75rem; --lh-0:1rem;   /* 723 (UX-08) — the .75rem floor (was .6875rem) */     --fs-1:.75rem;   --lh-1:1.125rem;
    --fs-2:.8125rem; --lh-2:1.25rem;  --fs-3:.9375rem; --lh-3:1.375rem;
    --fs-4:1.1875rem; --lh-4:1.625rem; --fs-5:1.5rem;  --lh-5:1.875rem;
    /* The hero step: one figure per screen, the one people came for. */
    --fs-6:2.125rem; --lh-6:2.375rem;
    --ls-caps:.08em;
    --font-ui:-apple-system,"SF Pro Text","Segoe UI Variable Text","Segoe UI",system-ui,sans-serif;
    --font-mono:ui-monospace,"SF Mono","Cascadia Mono","JetBrains Mono",Menlo,Consolas,"Liberation Mono",monospace;
    /* ---- elevation (flatter; hairlines do the work; NEVER on .cvnode) ---- */
    --shadow-sm:0 1px 2px rgba(16,24,40,.05);
    --shadow:0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.05);
    --shadow-lg:0 10px 28px rgba(16,24,40,.14);
    /* ---- motion (instant out, soft landing) ---- */
    --dur-1:100ms; --dur-2:150ms; --dur-3:220ms; --dur-glide:280ms;
    --ease-sun:cubic-bezier(.2,0,0,1);
    --ease-exit:cubic-bezier(.4,0,1,1);
    /* ---- edges ---- */
    --edge-arrow:#4a545c;
    /* ---- z-index ladder (canonical — keep in sync; overlays beat panels) ----
       canvas 8–9 · topbar 20 · results 30 · dock 60 · viewer 65 · modal 70
       · sidebar 80 · rail 85 · nav-drawer 95 · astpop 92 · astfab 93
       · toast 100 · acctmenu 120 (above the nav drawer) · ctxmenu 200
       The assistant widget sits ABOVE the account menu (you must be able to ask
       about whatever is on screen) but BELOW toasts and the context menu, which
       are transient and must never be covered. */
    /* ---- back-compat aliases (existing selectors keep working) ---- */
    --bg:var(--bg-0); --bg2:var(--bg-1); --elev:var(--bg-2);
    --surface:var(--bg-1); --surface-2:var(--hover);
    --border-2:var(--border-strong); --accent-2:var(--accent-text); --radius:var(--r-md);
  }
  /* The one lever that makes every rem above fluid.
     Written with rem terms, not raw px, so a reader who has set a larger
     default font size still gets it -- a clamp in px silently overrides the
     browser preference, which is an accessibility regression dressed up as
     a design decision.
     ~15px at 1024, ~16px at 1440, ~18px at 2560. */
  html{font-size:clamp(.9375rem, .85rem + .17vw, 1.125rem);}
  *{box-sizing:border-box;}
  body{margin:0; font-family:var(--font-ui); color:var(--text); height:100vh; height:100dvh; overflow:hidden; background:var(--bg); -webkit-font-smoothing:antialiased; font-variant-numeric:tabular-nums;}
  button{font:inherit; cursor:pointer; border-radius:var(--r-sm); border:1px solid var(--border); background:var(--bg-2); color:var(--text); padding:7px 12px; font-weight:500; font-size:var(--fs-2); transition:background-color var(--dur-1) var(--ease-sun), border-color var(--dur-1) var(--ease-sun), color var(--dur-1) var(--ease-sun);}
  button:hover{background:var(--bg-3); border-color:var(--border-strong);}
  button:focus-visible{outline:none; box-shadow:var(--focus-ring);}
  button.primary{background:var(--accent); border:1px solid var(--accent); color:var(--accent-ink); font-weight:600; box-shadow:none;}
  button.primary:hover{background:var(--accent-hover); border-color:var(--accent-hover); filter:none; transform:none;}
  button.ghost{background:transparent; border-color:transparent; color:var(--muted);}
  button.ghost:hover{background:var(--hover); color:var(--text); border-color:transparent;}
  button.danger{color:var(--danger); background:transparent; border-color:transparent;}
  button.danger:hover{background:var(--danger-bg); border-color:transparent;}
  button.danger.solid{background:var(--danger); color:#1a0408; font-weight:600; border-color:transparent;}
  button.danger.solid:hover{background:var(--danger); filter:brightness(1.08); border-color:transparent;}
  button.sm{padding:4px 10px; font-size:var(--fs-1); border-radius:var(--r-sm);}
  input,select,textarea{font:inherit; background:var(--field-bg); color:var(--text); border:1px solid var(--border); border-radius:var(--r-sm); padding:8px 11px; width:100%; transition:border-color var(--dur-1) var(--ease-sun), box-shadow var(--dur-1) var(--ease-sun);}
  input:focus,select:focus,textarea:focus{outline:none; border-color:var(--accent); box-shadow:var(--focus-ring);}
  /* Explicit placeholder tone: without this the browser default (~#757575) lands
     at ~4.25:1 and fails AA. #747166 holds the family hue at 4.5:1 on the field
     fill; opacity:1 stops Firefox from fading it further. Audit A3. */
  input::placeholder,textarea::placeholder{color:#747166; opacity:1;}
  label{display:block; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); margin:var(--sp-3) 0 var(--sp-1); font-weight:600; font-family:var(--font-mono);}
  .muted{color:var(--muted);} .tiny{font-size:var(--fs-0);}
  /* kbd chips — the console's keyboard voice */
  .kbd{font-family:var(--font-mono); font-size:var(--fs-0); line-height:16px; border:1px solid var(--border-strong); border-radius:3px; padding:0 5px; background:var(--bg-2); color:var(--muted); display:inline-block;}
  /* shared loading / error / empty state rows */
  .staterow{padding:14px; text-align:center;}
  .staterow a{color:var(--accent-text); cursor:pointer;}
  .staterow a:hover{text-decoration:underline;}
  ::-webkit-scrollbar{width:8px;height:8px;} ::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12); border-radius:var(--r-pill);} ::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.20);}

  /* opening: the sign-in form stays hidden until start-up decides (30 s fallback if the script never runs) */
  html.starting #login > *{visibility:hidden; animation:solarDoorReveal 0s 30s forwards;}
  html.starting #login::after{content:''; position:absolute; width:2rem; height:2rem; border-radius:50%;
    border:0.2rem solid var(--border-strong); border-top-color:var(--accent); animation:solarDoorSpin .9s linear infinite;}
  @keyframes solarDoorReveal{to{visibility:visible;}}
  @keyframes solarDoorSpin{to{transform:rotate(360deg);}}
  @media (prefers-reduced-motion: reduce){ html.starting #login::after{animation:none;} }
  #login{display:flex; align-items:center; justify-content:center; height:100vh; height:100dvh;
    background:radial-gradient(120% 90% at 50% 115%, rgba(88,198,242,.08), transparent 55%), var(--bg-0);}
  #login .card{position:relative; overflow:hidden; background:var(--bg-1); border:1px solid var(--border-strong); padding:var(--sp-8); border-radius:var(--r-md); width:min(360px, calc(100vw - 28px)); box-shadow:var(--shadow-lg); cursor:auto;}
  #login .card::before{content:''; position:absolute; top:0; left:0; right:0; height:1px;
    background:linear-gradient(90deg,transparent,var(--accent),transparent);} /* tracer edge */
  .logo{display:flex; align-items:center; gap:10px; font-weight:800; font-size:var(--fs-4); letter-spacing:-.03em; text-transform:lowercase;}
  .logo .dot{width:28px;height:28px;border-radius:var(--r-sm);background:transparent; color:var(--accent); display:inline-flex; align-items:center; justify-content:center; font-size:var(--fs-3);}
  .logo .dot svg{display:block;}
  #login p{margin:8px 0 20px; color:var(--muted); font-size:var(--fs-2);}
  .autherr{color:var(--danger); font-size:var(--fs-1); min-height:16px; margin-top:8px;}
  .authbtn{width:100%; margin-top:14px;}
  .authlinks{margin-top:16px; display:flex; flex-direction:column; gap:9px; font-size:var(--fs-1); color:var(--muted); text-align:center;}
  .authlinks a{color:var(--accent-text); cursor:pointer;}
  /* 723 (L07) — the terms accepted at sign-up */
  .auth-accept{display:flex; gap:.5rem; align-items:flex-start; margin-top:.75rem; font-size:var(--fs-1); color:var(--text); cursor:pointer;}
  .auth-accept input{width:auto; margin:.2rem 0 0; flex:none;}
  .authlinks.auth-legal{margin-top:.375rem; flex-direction:row; justify-content:center;}
  .authlinks a:hover{text-decoration:underline;}
  .authnote{font-size:var(--fs-1); color:var(--muted); line-height:1.55; background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r-sm); padding:13px;}

  /* ==== shell: icon rail · flyout workspaces · main ==== */
  #app{display:none; height:100vh; height:100dvh; grid-template-columns:248px minmax(0,1fr);}
  /* ==== grouped + labelled sidebar (light SaaS IA, ported from redesign.html) ==== */
  .side{background:var(--bg-1); border-right:1px solid var(--border); display:flex; flex-direction:column; min-width:0; height:100vh; height:100dvh; position:sticky; top:0; z-index:85;}
  .brand{display:flex; align-items:center; gap:11px; padding:16px 16px 14px; cursor:pointer;}
  .brand-mark{width:34px; height:34px; border-radius:10px; flex:none; background:linear-gradient(135deg,var(--v-600),var(--v-800)); color:#fff; display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm);}
  .brand-mark svg{display:block;}
  .brand-name{font-weight:700; font-size:var(--fs-3); letter-spacing:-.01em; color:var(--text);}
  .brand-sub{font-size:var(--fs-0); color:var(--muted); margin-top:-2px;}
  .nav{flex:1; min-height:0; overflow-y:auto; padding:6px 12px 12px;}
  .nav-group{padding:14px 8px 6px; font-size:var(--fs-0); font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted);}
  .nav-item{display:flex; align-items:center; gap:11px; width:100%; padding:8px 10px; border:none; background:transparent; border-radius:var(--r-sm); color:var(--muted); font-weight:500; cursor:pointer; margin-bottom:2px; position:relative; text-align:left; transition:background-color var(--dur-1) var(--ease-sun), color var(--dur-1) var(--ease-sun);}
  .nav-item:hover{background:var(--hover); color:var(--text);}
  .nav-item.active{background:var(--accent-subtle); color:var(--accent); font-weight:600;}
  /* Switched-off destination: visible so the roadmap stays legible, but plainly
     inert — no hover response, no pointer, reduced contrast. The button also
     carries `disabled`, so this is only the visual half. */
  .nav-item.nav-off,
  .nav-item.nav-off:hover{opacity:.42; cursor:not-allowed; background:transparent; color:var(--muted);}
  .nav-item.nav-off .nav-tag{background:var(--bg-2); color:var(--muted);}
  .nav-item.active::before{content:""; position:absolute; left:-12px; top:7px; bottom:7px; width:3px; border-radius:0 3px 3px 0; background:var(--accent);}
  .nav-item .lbl{flex:1; min-width:0; font-size:var(--fs-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .nav-item .nav-tag{flex:none; margin:0; max-width:none; font-size:var(--fs-0); font-weight:600; color:var(--muted); background:var(--bg-3); border:1px solid var(--border); border-radius:var(--r-pill); padding:1px 7px;}
  .nav-item .chat-badge{position:static; top:auto; right:auto; flex:none; margin-left:auto;}
  .side-foot{border-top:1px solid var(--border); padding:10px 12px; flex:none;}
  .acct{display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:var(--r-sm); cursor:pointer;}
  .acct:hover{background:var(--hover);}
  .avatar{width:32px; height:32px; border-radius:var(--r-pill); flex:none; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:var(--fs-2); color:#fff; background:var(--accent);}
  .acct-tx{flex:1; min-width:0;}
  .acct-nm{font-size:var(--fs-2); font-weight:600; line-height:1.2; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .acct-em{font-size:var(--fs-0); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .acct .chev{flex:none; color:var(--muted);}
  /* responsive: the LABELLED sidebar is the desktop default (audit: nav must be
     readable, not icon-only guesswork). It only folds to an icon rail on genuinely
     narrow windows (<900px), where each button keeps its title= tooltip. */
  @media (max-width:900px){
    #app{grid-template-columns:62px minmax(0,1fr);}
    .side .lbl,.side .nav-group,.brand-tx,.nav-item .nav-tag,.acct-tx,.acct .chev{display:none;}
    .brand{justify-content:center; padding:14px 0; gap:0;}
    .nav{padding:8px 8px;}
    .nav-item{justify-content:center; padding:10px 0;}
    .nav-item.active::before{left:-8px;}
    .nav-item .chat-badge{position:absolute; top:3px; right:6px; margin:0;}
    .acct{justify-content:center; padding:7px 0;}
    .side-foot{padding:10px 8px;}
  }
  .rail{background:var(--bg-1); border-right:1px solid var(--border); display:flex; flex-direction:column; align-items:center; padding:10px 0 12px; gap:4px; z-index:85;}
  .rail .logo{width:36px; height:36px; justify-content:center; margin-bottom:8px; gap:0;}
  .rail .logo .dot{width:36px; height:36px;}
  .railbtn{position:relative; width:40px; height:40px; display:flex; align-items:center; justify-content:center; background:transparent; border:none; border-radius:var(--r-sm); color:var(--muted); padding:0;}
  .railbtn svg{display:block;}
  .railbtn:hover{background:var(--hover); color:var(--text); border-color:transparent;}
  .railbtn.active{color:var(--accent-text); background:var(--accent-subtle);}
  .railbtn.active::before{content:''; position:absolute; left:-8px; top:9px; bottom:9px; width:2px; background:var(--accent);} /* glacier rail indicator */
  .railspacer{flex:1;}
  /* scoped to the rail — '.me' bare collided with chat's '.msg.me' bubbles
     and turned them into 40px flex rows (the vertical-text bug) */
  .rail .me{display:flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:var(--r-sm); cursor:pointer; transition:background-color var(--dur-1) var(--ease-sun);}
  .rail .me:hover{background:var(--hover);}
  .av-sm{width:30px; height:30px; border-radius:var(--r-sm); flex:none; background:var(--bg-2); border:1px solid var(--border-strong); color:var(--text); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:var(--fs-2);}
  /* workspaces flyout (keeps the .sidebar class — toggleSidebar()/setRoute() contract) */
  .sidebar{position:fixed; top:0; bottom:0; left:56px; width:280px; z-index:80; background:var(--bg-1); border-right:1px solid var(--border); display:flex; flex-direction:column; overflow:hidden; transform:translateX(calc(-100% - 56px)); transition:transform var(--dur-3) var(--ease-sun);}
  .sidebar.open{transform:translateX(0); box-shadow:var(--shadow);}
  #menuBtn{display:none;}
  @media (max-width: 900px){
    #menuBtn{display:inline-flex;}
    .topbar .searchwrap{min-width:0;}
    .crumbs{display:none;}
    .topbar{padding:0 var(--sp-2); gap:6px;}
    .cvtools{bottom:10px; padding:3px 5px; gap:2px; max-width:96vw; overflow-x:auto;}
    .cvtools button{padding:4px 8px; font-size:var(--fs-1);}
    .edgepanel{width:min(220px,calc(100vw - 20px));}
    .canvas{padding:var(--sp-4) var(--sp-3);}
  }
  @media (max-width: 640px){
    .viewer-bg{padding:0;}
    .viewer{width:100vw; height:100dvh; border-radius:0; border:0;}
    .dacts{flex-wrap:wrap;}
    .acctmenu{left:8px; right:8px; width:auto;}
    /* phone: the nav is an off-canvas drawer (the hamburger opens it) so content
       gets the full width — no permanent rail eating space, no topbar overflow */
    #app{grid-template-columns:1fr;}
    .side{position:fixed; top:0; left:0; bottom:0; width:min(84vw,290px); z-index:95;
          transform:translateX(-100%); transition:transform var(--dur-3,.25s) var(--ease-sun,ease);
          box-shadow:var(--shadow-lg);}
    #app.nav-open .side{transform:translateX(0);}
    #app.nav-open::before{content:""; position:fixed; inset:0; background:rgba(0,0,0,.42); z-index:90;}
    /* restore the labelled nav inside the drawer (undo the icon-rail collapse) */
    .side .lbl, .side .nav-group, .brand-tx, .acct-tx{display:block;}
    .acct .chev{display:flex;}
    .brand{justify-content:flex-start; padding:16px 16px 14px; gap:11px;}
    .nav-item{justify-content:flex-start; padding:8px 10px;}
    .nav-item.active::before{left:-8px;}
    .acct{justify-content:flex-start; padding:7px 8px;}
    .topbar .tbright .primary{padding-left:10px; padding-right:10px;}
    /* higher specificity than the base `.searchwrap{flex:0 1 560px}` (which is
       later in the file) so the search yields space and + New / bell never clip */
    .topbar .searchwrap{flex:1 1 60px; min-width:0;}
    .topbar{gap:6px;}
    /* modal form rows stack instead of crushing the inputs */
    .frow{flex-wrap:wrap;}
    .frow>div{min-width:120px; flex:1 1 auto;}
    /* tab strips scroll horizontally instead of overflowing the screen */
    .seg{display:flex; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none;}
    .seg::-webkit-scrollbar{display:none;}
    .seg-btn{flex:none; white-space:nowrap;}
    /* wide tables (statements / ledger) + 2-col dashboards collapse to one column */
    .card2-body{overflow-x:auto;}
    .fin-rep-grid, .dash-grid{grid-template-columns:1fr;}
    /* kanban columns scroll horizontally (a real board feel) instead of stacking awkwardly */
    .board{grid-auto-flow:column; grid-auto-columns:82vw; grid-template-columns:none; overflow-x:auto; -webkit-overflow-scrolling:touch; scroll-snap-type:x proximity; padding-bottom:6px;}
    .bcol{scroll-snap-align:start;}
    /* the page itself must never scroll sideways (canvas keeps its own panning) */
    body, #app, .main{max-width:100%; overflow-x:hidden;}
  }
  .section{padding:var(--sp-4) var(--sp-4) var(--sp-1); font-size:var(--fs-0); letter-spacing:var(--ls-caps); text-transform:uppercase; color:var(--faint); font-weight:600; gap:8px; font-family:var(--font-mono); display:flex; align-items:center; justify-content:space-between;}
  .section::after{content:''; order:1; flex:1; height:1px; background:var(--border); min-width:10px;} /* hairline kicker rule */
  .section .addlink{order:2;}
  .addlink{color:var(--accent-text); cursor:pointer; font-size:var(--fs-3); font-weight:600; letter-spacing:0; padding:0 4px; border-radius:var(--r-sm);}
  .addlink:hover{background:var(--hover);}
  .orglist{flex:1; min-height:0; overflow-y:auto; padding:0 var(--sp-2) var(--sp-2);}
  .orgrow{display:flex; align-items:center; gap:10px; padding:6px 10px; border-radius:var(--r-sm); cursor:pointer; transition:background-color var(--dur-1) var(--ease-sun); margin-bottom:2px;}
  .orgrow:hover{background:var(--hover);}
  .orgrow.active{background:var(--selected); box-shadow:inset 2px 0 0 var(--accent);}
  .oav{width:26px; height:26px; border-radius:var(--r-sm); flex:none; background:var(--bg-2); border:1px solid var(--border); color:var(--text); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:var(--fs-1);}
  .orgrow .orgnm{flex:1; min-width:0; font-size:var(--fs-2); font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .orgrow .orgct{font-size:var(--fs-0); color:var(--faint); flex:none;}
  .mecol{flex:1; min-width:0; display:flex; flex-direction:column;}
  .mename{font-size:var(--fs-1); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .memail{font-size:var(--fs-0); color:var(--faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family:var(--font-mono);}
  /* z-index MUST sit above the mobile nav drawer (.side is z-index:95 when open):
     the account menu is anchored in the drawer footer, so at z-index:90 it opened
     BEHIND the drawer on phone — tapping "Settings" appeared to do nothing because
     the whole menu was painted under the drawer. 120 keeps it above drawer+overlay. */
  .acctmenu{position:fixed; left:14px; bottom:64px; width:236px; background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:6px; box-shadow:var(--shadow-lg); z-index:120; display:none;}
  .acctmenu.open{display:block;}
  .acctmenu .acct-id{display:flex; flex-direction:column; padding:8px 12px 9px; min-width:0;}
  .acctmenu button{display:block; width:100%; text-align:left; background:transparent; border:none; padding:9px 12px; border-radius:var(--r-sm); font-size:var(--fs-2);}
  .acctmenu button:hover{background:var(--hover);}
  /* Language chooser in the account menu. The two buttons sit side by side and
     override the block layout every other item in this menu uses. */
  .acct-lang{padding:8px 12px 4px;}
  .lang-l{font-size:var(--fs-0); letter-spacing:.08em; text-transform:uppercase;
    color:var(--muted); font-weight:700; margin-bottom:6px;}
  .lang-row{display:flex; gap:6px;}
  .acctmenu .lang-row .lang-btn{display:inline-block; width:auto; flex:1;
    text-align:center; padding:6px 10px; border:1px solid var(--border);
    border-radius:var(--r-sm); font-size:var(--fs-2);}
  .acctmenu .lang-row .lang-btn.on{background:var(--accent); color:#fff;
    border-color:var(--accent); font-weight:600;}
  .lang-note{margin-top:6px;}
  .acctmenu .sep{height:1px; background:var(--border); margin:5px 6px;}

  /* main: topbar row spans, then canvas + split item panel side by side */
  .main{display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto auto minmax(0,1fr); height:100vh; height:100dvh; position:relative; min-width:0;}
  .secbar{grid-column:1/-1;}
  .topbar{grid-column:1/-1; height:52px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:10px; padding:0 var(--sp-4); background:var(--bg-1); z-index:20;}
  .crumbs{display:flex; align-items:center; gap:7px; font-size:var(--fs-2); flex:1 1 0; min-width:0; overflow:hidden; white-space:nowrap;}
  .crumbs a{color:var(--muted); cursor:pointer;} .crumbs a:hover{color:var(--text);}
  .crumbs .sep{color:var(--faint); font-family:var(--font-mono);} .crumbs .cur{font-weight:600; letter-spacing:-.01em;}
  .crumbs a.cur{color:var(--text);} .crumbs a.cur:hover{color:var(--accent-text);}
  .tbright{flex:1 1 0; min-width:0; display:flex; align-items:center; justify-content:flex-end; gap:10px;}
  .tbright .langbtn{padding-inline:.5rem; display:inline-flex; align-items:center;}   /* 632: the flag before « ? » */
  .tbright .langbtn svg{width:1.25rem; height:.85rem; display:block; border-radius:.125rem; box-shadow:0 0 0 1px var(--border);}
  .langmenu{position:fixed; z-index:130; min-width:11rem; background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:.3rem; box-shadow:var(--shadow-lg); display:grid; gap:.1rem;}   /* 636: the language menu under the flag */
  .langmenu-it{display:flex; align-items:center; gap:.55rem; width:100%; text-align:left; border:0; background:transparent; padding:.45rem .6rem; border-radius:var(--r-sm);}
  .langmenu-it:hover,.langmenu-it:focus-visible{background:var(--bg-3);}
  .langmenu-it.on{font-weight:600;}
  .langmenu-it svg{width:1.25rem; height:.85rem; border-radius:.125rem; box-shadow:0 0 0 1px var(--border);}
  .langmenu-chk{margin-left:auto; color:var(--accent);}
  /* command bar: centered pill, "/" to focus */
  .searchwrap{position:relative; flex:0 1 560px; min-width:140px;}
  .searchwrap input{padding-left:34px; padding-right:36px; border-radius:var(--r-pill); background:var(--field-bg); border-color:var(--border-interactive); height:34px;}
  .searchwrap .mag{position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--muted); display:flex; pointer-events:none;}
  .searchwrap .skbd{position:absolute; right:10px; top:50%; transform:translateY(-50%); pointer-events:none;}
  .searchwrap input:focus ~ .skbd{display:none;}
  .results{position:absolute; top:42px; right:0; left:0; background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r-md); max-height:60vh; overflow:auto; z-index:30; display:none; box-shadow:var(--shadow-lg);}
  .results.show{display:block;}
  .hit{padding:10px 13px; border-bottom:1px solid var(--hairline); cursor:pointer; display:flex; gap:9px; align-items:center;}
  .hit:hover{background:var(--hover);} .hit .ht{font-weight:600; font-size:var(--fs-2);} .hit .hs{font-size:var(--fs-0); color:var(--muted); font-family:var(--font-mono);}
  .hit.active{background:var(--accent-subtle); box-shadow:inset 2px 0 0 var(--accent);}
  .hit .cmdic{width:20px; text-align:center; color:var(--accent-text); flex:none;}
  .cmdfoot{padding:8px 13px; font-size:var(--fs-0); color:var(--faint); display:flex; gap:6px; align-items:center;}

  /* `display` is stated here so that clearing the inline one in
     showCanvasView lands on a known value rather than on the UA default —
     and so that `.canvas.fixed{display:flex}` has something to override. */
  .canvas{grid-area:4/1/5/2; display:block; overflow:auto;
    padding:var(--sp-6) var(--sp-6); min-width:0;}
  /* THE PAGE NEVER SCROLLS — the cards do.
     A rule stated many times and never written down here, so it stayed true
     only in conversation. Opted into per screen (`body.fitscreen`, set by the
     renderer) rather than imposed on all seventeen at once: a screen that has
     not been laid out to fit would simply cut its own content off, which is a
     worse failure than a scrollbar. */
  body.fitscreen .canvas{ overflow:hidden; display:flex; flex-direction:column; }
  /* WIDTH:100%, AND THIS IS THE WHOLE ANSWER TO "l'utilisation de l'espace".
     `.dash` carries `margin:0 auto` to centre itself. Inside a FLEX COLUMN —
     which is what `body.fitscreen .canvas` is — an auto inline margin does not
     centre a stretched box: it CANCELS the stretch and shrinks the box to its
     own content. So every screen that opts into fitscreen without also being
     `.canvas.fixed` collapsed to whatever width its contents happened to want,
     and sat as a narrow ribbon in the middle of an empty page. The calendar was
     a 7-column grid of `1fr` that resolved to a quarter of the window; nothing
     was wrong with the calendar.
     One declaration, every screen. It was never seventeen layout problems. */
  body.fitscreen .canvas > .dash{ flex:1; min-height:0; width:100%;
    display:flex; flex-direction:column; }
  body.fitscreen .dash > .pagehead{ flex:none; }
  /* The title stays put and the BODY scrolls. On a screen that has been laid
     out to fit (Home) the inner blocks take over and this never engages; on one
     that has not, the page still does not move — its content does, under a
     heading that stays where you left it. Nothing is ever cut off. */
  /* Height and a scroller, and NOTHING about layout.
     This carried `display:flex; flex-direction:column` — which was right for
     Home, the one screen it applied to, and became wrong for all seventeen the
     moment `pageShell` started applying `fitscreen` everywhere: every screen's
     body turned into a flex column, so the Organizations cards stacked as bare
     flex items and lost their own layout entirely. A rule that decides how a
     page is laid out has no business in a rule about how tall it is. Screens
     that DO want a column opt in through `.canvas.fixed`, which is what that
     class has always meant. */
  body.fitscreen .dash > .pgbody{ flex:1; min-height:0; overflow-y:auto; }
  /* Home IS laid out to fit, so its body must not be the thing that scrolls —
     the blocks inside it are. Without this the outer scroller wins and the page
     moves anyway, which is what "le dashboard est toujours scrollable" was. */
  /* AND IT HAS TO BE A COLUMN, or `#homeGrid { flex:1 }` below is talking to a
     parent that cannot answer. Without this the grid is as tall as its own
     content, `overflow:hidden` on this element then CUTS it — the bottom row of
     cards simply gone, the page ending mid-legend. That is what "the page was
     forcefully cut at the bottom" was: not a scroll bug, the opposite one.
     Scoped to Home on purpose: making every fitscreen body a flex column is
     what once flattened the Organizations cards. */
  body.screen-home .dash > .pgbody{ overflow:hidden;
    display:flex; flex-direction:column; }
  body.fitscreen #homeGrid{ flex:1; min-height:0; display:flex; overflow:hidden; }
  body.fitscreen #homeGrid > .hgrid{ flex:1; min-height:0; }
  /* THE ARRANGEMENT IS THE FIX. Blocks stacked end to end are taller than some
     window sooner or later, and the answer to that had been a series of vh caps
     — guesses that either waste space or cut content off. A grid DIVIDES the
     height instead of guessing it: one auto row for the figures, two 1fr rows
     for the four cards, and every card scrolls inside itself. Nothing needs a
     cap and nothing can overflow. */
  .hgrid{ display:grid; gap:var(--sp-3);
    grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);
    grid-template-rows:min-content minmax(0,1.15fr) minmax(0,1fr); }
  /* The figures row keeps its own height and never shrinks. An `auto` grid row
     will still be squeezed when the fr rows below it have a min of 0 and the
     content asks for more than there is — which is how the tiles ended up cut
     off half way through their own labels. */
  .hg-top{ grid-column:1/-1; display:flex; flex-direction:column;
    gap:var(--sp-2); min-height:min-content; }
  /* Without a chart the hand-placed cells left the top-left slot empty and the
     dashboard had a crater in it — exactly what an employee, or anyone looking
     at a company whose books are not theirs, saw. The rest moves up. */
  .hgrid-nochart{ grid-template-rows:min-content minmax(0,1.3fr) minmax(0,1fr); }
  .hgrid-nochart .hg-queue{ grid-column:1; grid-row:2; }
  .hgrid-nochart .hg-act  { grid-column:2; grid-row:2; }
  .hgrid-nochart .hg-co   { grid-column:1/-1; grid-row:3; }
  .hg-chart{ grid-column:1; grid-row:2; min-height:0; }
  .hg-queue{ grid-column:2; grid-row:2; min-height:0; }
  .hg-co   { grid-column:1; grid-row:3; min-height:0; }
  .hg-act  { grid-column:2; grid-row:3; min-height:0; }
  /* Every grid child is a column that scrolls in its own body. `min-height:0` on
     each is what lets it shrink; without it a grid item refuses to go below its
     content and pushes the whole grid past the window again. */
  .hgrid > *{ min-width:0; }
  .hgrid .card2, .hgrid .cocard{ display:flex; flex-direction:column;
    min-height:0; height:100%; }
  .hgrid .card2 > .card2-h, .hgrid .cocard > .co-h{ flex:none; }
  .hgrid .card2 > .card2-body, .hgrid .cocard > .co-body{
    flex:1; min-height:0; overflow-y:auto; }
  /* The canvas fills its cell and never decides its own size. Chart.js writes
     inline width/height attributes, and without this the element takes them
     literally and the card grows to fit the drawing instead of the drawing
     fitting the card. */
  .hgrid .hg-chart > .card2{ overflow:hidden; }
  .hgrid .hchart .card2-body{ position:relative; min-height:0; overflow:hidden; }
  .hgrid .hchart canvas{ position:absolute; inset:0;
    width:100% !important; height:100% !important; }
  /* One column when there is not room for two: the rows stack and the grid
     scrolls its own content rather than the page. */
  @media (max-width:60rem){
    .hgrid{ grid-template-columns:1fr;
      grid-template-rows:auto repeat(4, minmax(8rem, 1fr)); overflow-y:auto; }
    .hg-chart,.hg-queue,.hg-co,.hg-act{ grid-column:1; grid-row:auto; }
  }
  .pagehead{display:flex; justify-content:space-between; align-items:center; margin-bottom:var(--sp-5); gap:12px;}
  .pagehead h1{margin:0; font-size:var(--fs-4); line-height:var(--lh-4); font-weight:600; letter-spacing:-.02em;}
  .pagehead .ps{font-size:var(--fs-1); color:var(--muted); margin-top:3px;}
  .cards{display:grid; grid-template-columns:repeat(auto-fill,minmax(232px,1fr)); gap:var(--sp-3);}
  .card{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); padding:var(--sp-4); cursor:pointer; transition:border-color var(--dur-1) var(--ease-sun), background-color var(--dur-1) var(--ease-sun);}
  .card:hover{border-color:var(--border-strong); background:var(--bg-1);}
  .card .ch{display:flex; align-items:center; gap:9px; font-weight:600; font-size:var(--fs-2);}
  .card .ci{width:30px;height:30px;border-radius:var(--r-sm);background:var(--bg-2);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:var(--fs-3);flex:none;}
  .card .cmeta{font-size:var(--fs-1); color:var(--muted); margin-top:var(--sp-2); display:flex; flex-wrap:wrap; gap:6px;}
  .card .cc2{font-size:var(--fs-0);color:var(--faint);margin-top:8px;}
  .pill{padding:2px 9px; border-radius:var(--r-pill); font-size:var(--fs-0); background:var(--surface-2); border:1px solid var(--border); font-weight:500; font-family:var(--font-mono); font-variant-numeric:tabular-nums;}
  .pill.running,.pill.prod,.pill.in_use,.pill.open,.pill.active,.pill.live{background:var(--ok-bg); border-color:rgba(62,213,152,.30); color:var(--ok);}
  .pill.stopped,.pill.retired,.pill.closed,.pill.critical{background:var(--danger-bg); border-color:rgba(242,100,124,.30); color:var(--danger);}
  .pill.maintenance,.pill.high,.pill.on_hold{background:var(--warn-bg); border-color:rgba(245,184,61,.30); color:var(--warn);}

  .catgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px;}
  .catcard{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); padding:var(--sp-4); cursor:pointer; transition:border-color var(--dur-1) var(--ease-sun); display:flex; align-items:center; gap:var(--sp-3);}
  .catcard:hover{border-color:var(--border-strong); background:var(--bg-1);}
  .catcard .cci{width:38px;height:38px;border-radius:var(--r-sm);background:var(--bg-2);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:var(--fs-4);}
  .catcard .ccn{font-weight:600;font-size:var(--fs-2);} .catcard .ccc{font-size:var(--fs-1);color:var(--muted);}

  .detail-head{display:flex; align-items:center; gap:12px; margin-bottom:6px; flex-wrap:wrap;}
  .detail-head h2{margin:0; font-size:var(--fs-4); font-weight:600; letter-spacing:-.02em; display:flex; align-items:center; gap:10px;}
  .detail-head .hi{width:40px;height:40px;border-radius:var(--r-sm);background:var(--bg-2);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:var(--fs-4);}
  .layout{display:grid; grid-template-columns:1fr 280px; gap:24px; align-items:start;}
  @media(max-width:900px){ .layout{grid-template-columns:1fr;} }
  .info-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px 22px; margin:14px 0;}
  .info-grid .igfull{grid-column:1/-1;}
  .info-grid .igfull label{margin-top:0;}
  .dsave{display:flex; gap:8px; align-items:center; padding:10px 14px; border-top:1px solid var(--border); flex:none; background:var(--bg-2);}
  /* ==== in-app file viewer: reader / renderer / editor ==== */
  .viewer-bg{position:fixed; inset:0; background:rgba(4,6,8,.78); display:none; align-items:center; justify-content:center; z-index:65; padding:22px;}
  .viewer-bg.open{display:flex;}
  .viewer{background:var(--bg-1); border:1px solid var(--border-2); border-radius:var(--r-md); width:min(1060px,96vw); height:min(780px,92vh); display:flex; flex-direction:column; box-shadow:var(--shadow-lg); overflow:hidden;}
  .vw-head{display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--border); flex:none;}
  .vw-name{font-weight:600; font-size:var(--fs-2); flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family:var(--font-mono);}
  .vw-body{flex:1; min-height:0; overflow:auto; display:flex; align-items:stretch; justify-content:center; background:var(--bg-0);}
  .vw-body img{max-width:100%; max-height:100%; object-fit:contain; margin:auto;}
  .vw-body video{max-width:100%; max-height:100%; margin:auto;}
  .vw-body audio{margin:auto; width:80%;}
  .vw-body iframe{width:100%; height:100%; border:0;}
  .vw-body pre{margin:0; padding:18px 22px; width:100%; overflow:auto; font-family:var(--font-mono); font-size:var(--fs-1); line-height:1.55; white-space:pre-wrap; word-break:break-word; color:var(--text);}
  .vw-body textarea{width:100%; height:100%; border:0; border-radius:0; resize:none; padding:18px 22px; font-family:var(--font-mono); font-size:var(--fs-1); line-height:1.55; background:var(--bg-0);}
  .vw-body .vw-none{margin:auto; text-align:center; color:var(--muted);}
  .vw-tabs{display:flex; gap:4px; padding:6px 10px; border-top:1px solid var(--border); overflow-x:auto; flex:none;}
  .vw-tab{padding:4px 11px; border-radius:var(--r-sm); font-size:var(--fs-1); cursor:pointer; color:var(--muted); white-space:nowrap; border:1px solid transparent; font-family:var(--font-mono);}
  .vw-tab:hover{background:var(--hover); color:var(--text);}
  .vw-tab.on{background:var(--accent-subtle); color:var(--accent-text); border-color:var(--border);}
  /* The open documents, above the header rather than below the body: a tab bar
     belongs at the top of what it switches, the way every window with tabs in
     it has always put them. */
  .vw-open{border-top:none; border-bottom:1px solid var(--border);}
  .vw-open .vw-tab{display:inline-flex; align-items:center; gap:.35rem; max-width:16rem;
    overflow:hidden; text-overflow:ellipsis;}
  .vw-x{border:none; background:transparent; color:inherit; cursor:pointer;
    padding:0 0 0 .1rem; font-size:.75em; opacity:.55;}
  .vw-x:hover{opacity:1;}
  .info-grid .k{font-size:var(--fs-0); color:var(--faint); text-transform:uppercase; letter-spacing:var(--ls-caps); font-weight:600; font-family:var(--font-mono);}
  .info-grid .v{font-size:var(--fs-1); margin-bottom:6px; word-break:break-word;}
  .side-panel{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:var(--sp-4);}
  .side-panel h4{margin:0 0 10px; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-family:var(--font-mono);}
  .relitem{display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:var(--r-sm); cursor:pointer;}
  .relitem:hover{background:var(--hover);}
  .grp{margin-top:var(--sp-5);} .grp-title{display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); margin-bottom:var(--sp-2); font-weight:600; font-family:var(--font-mono);}
  .grp-title::after{content:''; flex:1; height:1px; background:var(--border); min-width:12px;} /* hairline kicker rule to the edge */
  .empty{display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:60vh; color:var(--muted); text-align:center; gap:12px;}
  .empty .big{width:78px;height:78px;border-radius:var(--r-md);background:var(--bg-1);border:1px solid var(--border-strong);display:flex;align-items:center;justify-content:center;font-size:var(--fs-4);}
  .empty h2{margin:0; color:var(--text); font-size:var(--fs-5); line-height:var(--lh-5); font-weight:600; letter-spacing:-.02em;}
  .attrib{font-size:var(--fs-0); color:var(--faint); margin-top:18px; border-top:1px solid var(--border); padding-top:9px;}

  .modal-bg{position:fixed; inset:0; background:rgba(4,6,8,.7); display:none; align-items:center; justify-content:center; z-index:98; padding:16px;}   /* above the assistant panel (92/93) and the mobile menu (95): a confirmation opened from them was hidden behind (recette 10-10, ASSIST-10) */
  .modal{background:var(--bg-2); border:1px solid var(--border-strong); border-radius:var(--r-md); width:min(540px,calc(100vw - 32px)); max-height:88vh; overflow:auto; padding:var(--sp-6); box-shadow:var(--shadow-lg);
    background-image:linear-gradient(90deg,transparent,var(--accent),transparent); background-size:100% 1px; background-repeat:no-repeat; background-position:top center;} /* tracer edge */
  .modal h3{margin:0 0 6px; font-size:var(--fs-3); font-weight:600;} .modal .btns{display:flex; gap:var(--sp-2); justify-content:flex-end; margin-top:var(--sp-4); border-top:1px solid var(--hairline); padding-top:var(--sp-3);}
  .reveal-box{background:var(--field-bg); border:1px solid var(--border-strong); border-radius:var(--r-sm); padding:12px; font-family:var(--font-mono); word-break:break-all; margin-top:6px;}
  .frow{display:flex; gap:8px; margin-bottom:7px; align-items:center;}
  .qchip{display:flex; align-items:center; gap:8px; padding:10px 13px; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--bg-1); cursor:pointer; transition:border-color var(--dur-1) var(--ease-sun), background-color var(--dur-1) var(--ease-sun); font-weight:500; font-size:var(--fs-2);}
  .qchip:hover{border-color:var(--border-strong); background:var(--bg-2);}
  .quick{display:flex; flex-wrap:wrap; gap:9px;}
  .ctxmenu{position:fixed; background:var(--bg-2); border:1px solid var(--border-2); border-radius:var(--r-md); padding:6px; display:none; z-index:200; box-shadow:var(--shadow-lg); min-width:172px;}
  .ctxmenu button{display:block; width:100%; text-align:left; background:transparent; border:none; padding:8px 11px; border-radius:var(--r-sm); font-size:var(--fs-2); color:var(--text);}
  .ctxmenu button:hover{background:var(--hover); border-color:transparent;}
  .ctxmenu button.danger{color:var(--danger);}
  .ctxmenu button.danger:hover{background:var(--danger-bg);}
  .ctxmenu .sep{height:1px; background:var(--border); margin:5px 4px;}
  /* A REAL CONTEXT MENU: shortcuts on the right, disabled items greyed rather
     than removed, and submenus — because "New ▸" is where every person on earth
     already looks to make a folder, and a flat list of thirty items is not a
     menu. Greying instead of hiding matters on its own: a menu whose items move
     depending on state has to be re-read every time. */
  .ctxmenu button{display:flex; align-items:center; gap:0.5rem; cursor:pointer;}
  .ctxmenu .ctx-k{margin-left:auto; padding-left:1.25rem; color:var(--faint);
    font-size:var(--fs-0); font-variant-numeric:tabular-nums;}
  .ctxmenu button.ctx-off{color:var(--faint); cursor:default;}
  .ctxmenu button.ctx-off:hover{background:transparent;}
  .ctx-has{position:relative;}
  .ctx-arw{margin-left:auto; padding-left:1.25rem; color:var(--faint);}
  .ctx-sub{position:absolute; left:100%; top:-0.375rem; display:none;
    background:var(--bg-2); border:1px solid var(--border-2);
    border-radius:var(--r-md); padding:0.375rem; box-shadow:var(--shadow-lg);
    min-width:11rem; z-index:1;}
  .ctx-has:hover > .ctx-sub, .ctx-has:focus-within > .ctx-sub{display:block;}
  /* Near the right edge the submenu would open off-screen; flip it. */
  .ctxmenu.flip .ctx-sub{left:auto; right:100%;}
  .secbar{background:var(--danger-bg); border-bottom:1px solid rgba(242,100,124,.30); color:var(--text); padding:9px 18px; font-size:var(--fs-1); display:none; gap:12px; align-items:center;}
  .secbar.show{display:flex;}
  .secbar b{color:var(--danger);}
  /* toasts: console logs accrue bottom-right (bottom-center is the tools pill now) */
  .toast{position:fixed; bottom:calc(18px + var(--xfer-lift, 0px)); right:18px; transform:translateY(8px); background:var(--bg-2); border:1px solid var(--border-2); border-left:2px solid var(--accent); padding:11px 16px; border-radius:var(--r-sm); opacity:0; transition:opacity var(--dur-2) var(--ease-sun), transform var(--dur-2) var(--ease-sun); pointer-events:none; z-index:100; box-shadow:var(--shadow-lg); font-weight:500; display:flex; align-items:center; gap:10px; max-width:min(92vw,560px);}
  /* ---- transfer activity panel: persistent progress for imports & exports ---- */
  .xfer{position:fixed; right:18px; bottom:18px; z-index:99; width:min(92vw,340px); display:flex; flex-direction:column; gap:8px; opacity:0; transform:translateY(8px); pointer-events:none; transition:opacity var(--dur-2) var(--ease-sun), transform var(--dur-2) var(--ease-sun);}
  .xfer.show{opacity:1; transform:none; pointer-events:auto;}
  .xfrow{background:var(--bg-2); border:1px solid var(--border); border-left:2px solid var(--accent); border-radius:var(--r-sm); box-shadow:var(--shadow-lg); padding:10px 12px; transition:opacity var(--dur-2) var(--ease-sun), transform var(--dur-2) var(--ease-sun);}
  .xfrow.leaving{opacity:0; transform:translateX(8px);}
  .xfrow.ok{border-left-color:var(--ok);}
  .xfrow.err{border-left-color:var(--danger);}
  .xfrow-h{display:flex; align-items:center; justify-content:space-between; gap:8px;}
  .xfrow-t{font-weight:600; font-size:var(--fs-1); line-height:var(--lh-1); color:var(--text);}
  .xfrow-x{border:0; background:none; color:var(--faint); cursor:pointer; font-size:var(--fs-3); line-height:1; padding:0 3px; border-radius:var(--r-sm);}
  .xfrow-x:hover{color:var(--text); background:var(--hover);}
  .xfrow-x:focus-visible{outline:none; box-shadow:var(--focus-ring);}
  .xfbar{height:4px; background:var(--bg-3); border-radius:var(--r-pill); overflow:hidden; margin:8px 0 6px;}
  .xffill{height:100%; width:0; background:var(--accent); border-radius:var(--r-pill); transition:width var(--dur-2) var(--ease-sun);}
  .xfrow.ok .xffill{background:var(--ok);}
  .xfrow.err .xffill{background:var(--danger);}
  .xfbar.indet .xffill{width:40%; animation:xfslide 1.1s var(--ease-sun) infinite;}
  @keyframes xfslide{0%{transform:translateX(-120%)}100%{transform:translateX(320%)}}
  .xfrow-s{font-size:var(--fs-0); line-height:var(--lh-0); color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .toast::before{content:''; flex:none; width:6px; height:6px; background:var(--accent); border-radius:1px;} /* status diode */
  .toast.show{opacity:1; transform:translateY(0); pointer-events:auto;}   /* 723 (UX-07) — hover pauses it, its action is clickable */
  .toast-act{flex:none; margin-left:.375rem; font:inherit; font-weight:600; color:var(--accent-text); background:none; border:1px solid var(--border-strong); border-radius:var(--r-sm); padding:.125rem .625rem; cursor:pointer;}
  a[role="button"]{cursor:pointer;} a[role="button"]:focus-visible{outline:none; box-shadow:var(--focus-ring); border-radius:.125rem;}   /* 723 (UX-01) */
  /* semantic hooks (additive — toast() API unchanged; default stays tracer blue) */
  .toast.ok{border-left-color:var(--ok);} .toast.ok::before{background:var(--ok);}
  .toast.err{border-left-color:var(--danger, #c0392b);} .toast.err::before{background:var(--danger, #c0392b);}
  .modal{position:relative;}
  .modal-x{position:absolute; top:.5rem; right:.5rem; width:1.75rem; height:1.75rem; line-height:1.75rem; padding:0; border:0; background:transparent; color:var(--muted); font-size:.95rem; cursor:pointer; border-radius:var(--r-sm, .25rem);}
  .modal-x:hover{background:var(--bg-1); color:var(--text);}
  .staterow.trunc{text-align:left; padding:.375rem .625rem;}
  .toast.err{border-left-color:var(--danger);} .toast.err::before{background:var(--danger);}

  /* ---- in-app chat ---- */
  .chatbtn{position:relative;}
  .chat-badge{position:absolute; top:-5px; right:-5px; background:var(--danger); color:#1a0408; font-size:var(--fs-0); font-weight:700; min-width:16px; height:16px; border-radius:var(--r-sm); display:none; align-items:center; justify-content:center; padding:0 4px; font-family:var(--font-mono); font-variant-numeric:tabular-nums;}
  .railbtn .chat-badge{top:2px; right:2px;}
  .chat-badge.show{display:flex;}
  /* ==== unified right-edge dock: Detail · Messages · Alerts in ONE frame ====
     Exactly one pane is visible (.dock-pane.show) → the three right-side panels
     can never overlap or stack. Opaque tab header (no translucent bars), fluid width. */
  /* One source for the dock width so the pull-tab can sit flush against its edge
     in both states — a second hardcoded clamp() would drift the moment either
     changes. */
  .dock, .dockhandle{--dock-w:clamp(320px,34vw,460px);}
  .dock{position:fixed; top:0; right:0; height:100vh; height:100dvh; width:var(--dock-w); max-width:96vw;
    background:var(--bg-1); border-left:1px solid var(--border); box-shadow:var(--shadow-lg);
    transform:translateX(102%); transition:transform var(--dur-3) var(--ease-sun); z-index:60; display:flex; flex-direction:column;}
  .dock.open{transform:translateX(0);}
  /* Pull-tab. The dock retracts with translateX(102%), i.e. fully off-screen, so
     there was NOTHING to grab once it closed — you could only reopen it from the
     left nav. This tab lives OUTSIDE the dock (a translated parent would carry it
     off-screen too) and slides to the dock's edge when open. */
  .dockhandle{position:fixed; right:0; top:50%; transform:translateY(-50%);
    z-index:61; width:20px; height:72px; padding:0; display:flex; align-items:center; justify-content:center;
    background:var(--bg-1); color:var(--muted); border:1px solid var(--border); border-right:none;
    border-radius:var(--r-sm) 0 0 var(--r-sm); box-shadow:var(--shadow-lg); cursor:pointer;
    transition:right var(--dur-3) var(--ease-sun), color var(--dur-1) var(--ease-sun), background-color var(--dur-1) var(--ease-sun);}
  .dockhandle:hover{background:var(--hover); color:var(--text);}
  .dockhandle svg{width:14px; height:14px; transition:transform var(--dur-3) var(--ease-sun);}
  .dockhandle.open{right:min(var(--dock-w),96vw);}
  .dockhandle.open svg{transform:rotate(180deg);}
  .dockhandle .chat-badge{position:absolute; top:-6px; left:-8px; margin:0;}
  /* On phones the dock is full-width, so a tab pinned to its edge would sit at
     x=0 on top of the content. The dock's own ✕ closes it there. */
  @media (max-width:640px){ .dockhandle.open{display:none;} }
  .dock-tabs{flex:none; display:flex; align-items:center; gap:2px; height:52px; padding:0 8px; background:var(--bg-1); border-bottom:1px solid var(--border);}
  .dock-tab{position:relative; flex:0 0 auto; background:transparent; border:1px solid transparent; color:var(--muted); padding:7px 12px; border-radius:var(--r-sm); font-weight:600; font-size:var(--fs-2);}
  .dock-tab:hover{background:var(--hover); color:var(--text); border-color:transparent;}
  .dock-tab[aria-selected="true"]{color:var(--accent-text); background:var(--accent-subtle);}
  .dock-tab .chat-badge{position:static; top:auto; right:auto; margin-left:6px;}
  .dock-x{margin-left:auto; flex:none;}
  .dock-body{flex:1; min-height:0; position:relative;}
  .dock-pane{position:absolute; inset:0; display:none; flex-direction:column; overflow:hidden;}
  .dock-pane.show{display:flex;}
  #notifPane{overflow-y:auto;}
  /* full-screen dock ONLY on phones, where the left nav is a hidden drawer — at
     tablet/half-screen widths it stays a right panel so it never covers the nav */
  @media (max-width:640px){ .dock{width:100vw; max-width:100vw;} }
  .chat-head{height:52px; display:flex; align-items:center; gap:10px; padding:0 12px 0 14px; border-bottom:1px solid var(--border); flex:none;}
  .chat-head .ct{font-weight:600; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .chat-back{cursor:pointer; color:var(--muted); font-size:var(--fs-3); line-height:1;}
  .chat-back:hover{color:var(--text);}
  .conv-group{padding:11px 14px 4px; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:600; display:flex; justify-content:space-between; align-items:center; font-family:var(--font-mono);}
  .conv{display:flex; align-items:center; gap:10px; padding:9px 13px; cursor:pointer;}
  .conv:hover{background:var(--hover);}
  .conv .av{width:34px; height:34px; border-radius:var(--r-sm); background:var(--bg-2); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:var(--fs-3); flex:none;}
  .conv .cmid{flex:1; min-width:0;}
  .conv .cnm{font-weight:600; font-size:var(--fs-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .conv .clast{font-size:var(--fs-1); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .conv .cb{background:var(--accent); color:var(--accent-ink); font-size:var(--fs-0); font-weight:600; min-width:18px; height:18px; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center; padding:0 5px; flex:none;}
  .chat-body{flex:1; min-height:0; overflow-y:auto;}
  .msgs{flex:1; min-height:0; overflow-y:auto; padding:14px 12px; display:flex; flex-direction:column;}
  .daychip{align-self:center; margin:12px 0 8px; font-size:var(--fs-0); color:var(--faint); background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r-pill); padding:3px 12px; font-family:var(--font-mono);}
  .msg{position:relative; max-width:80%; min-width:78px; padding:6px 10px 4px; margin-top:8px; border-radius:var(--r-bubble); font-size:var(--fs-2); line-height:1.45;}
  .msg .mtxt{white-space:pre-wrap; word-wrap:break-word; overflow-wrap:anywhere;}
  .msg .mtxt a{color:var(--accent-text); word-break:break-all;}
  .msg.them{background:var(--bg-2); border:1px solid var(--border); align-self:flex-start; border-bottom-left-radius:4px;}
  .msg.me{background:rgba(88,198,242,.13); border:1px solid rgba(88,198,242,.30); color:var(--text); align-self:flex-end; border-bottom-right-radius:4px;}
  .msg.cont{margin-top:2px;}
  .msg.them.cont{border-top-left-radius:6px;}
  .msg.me.cont{border-top-right-radius:6px;}
  .msg .who{font-size:var(--fs-0); font-weight:700; margin:1px 0 3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .msg .mmeta{display:flex; justify-content:flex-end; font-size:var(--fs-0); opacity:.5; margin-top:2px; font-family:var(--font-mono); font-variant-numeric:tabular-nums; line-height:1;}
  .msg .mimg{display:block; width:100%; max-width:258px; max-height:300px; border-radius:9px; margin:2px 0 3px; cursor:zoom-in; object-fit:cover;}
  .msg video.mimg{cursor:default;}
  .msg audio{max-width:100%; height:36px; margin:2px 0 3px;}
  .msg .mfile{display:flex; align-items:center; gap:9px; background:var(--bg-3); border:1px solid var(--border); border-radius:9px; padding:8px 11px; margin:2px 0 3px; cursor:pointer; min-width:170px; max-width:100%;}
  .msg .mfile:hover{border-color:var(--border-strong);}
  /* photo messages hug the image, WhatsApp-style */
  .msg:has(.mimg){padding:4px 4px 3px;}
  .msg:has(.mimg) .who{padding:2px 7px 0;}
  .msg:has(.mimg) .mtxt{padding:1px 7px 0;}
  .msg:has(.mimg) .mmeta{padding:0 7px 2px;}
  .chat-pend{display:flex; gap:8px; align-items:center; padding:7px 12px; border-top:1px solid var(--border); background:var(--bg-2); font-size:var(--fs-1); flex:none;}
  .attbtn{flex:none; font-size:var(--fs-3); padding:7px 9px; border-radius:var(--r-sm); cursor:pointer; color:var(--muted); background:transparent; border:1px solid transparent; line-height:1;}
  .attbtn:hover{background:var(--hover); color:var(--text);}
  #chatMicBtn.rec{background:var(--danger-bg); border-color:var(--danger); color:var(--danger); animation:recpulse 1.2s ease-in-out infinite;}
  @keyframes recpulse{50%{opacity:.55;}}
  /* live input level while recording */
  .recwave{display:flex; gap:2px; align-items:center; height:16px; flex:none;}
  .recwave i{display:block; width:3px; height:14px; border-radius:2px; background:var(--danger); transform:scaleY(.15); transform-origin:center; transition:transform 90ms linear;}
  /* voice-note bubble player */
  .vnote{display:flex; align-items:center; gap:9px; min-width:200px; padding:3px 0 4px;}
  .vplay{width:34px; height:34px; border-radius:50%; background:var(--accent); color:var(--accent-ink); border:none; font-size:var(--fs-1); flex:none; display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0;}
  .vplay:hover{background:var(--accent-hover);}
  .vtrack{flex:1; height:4px; background:var(--hover); border-radius:var(--r-pill); overflow:hidden; min-width:96px; cursor:pointer; padding:0; position:relative;}
  .vtrack::before{content:''; position:absolute; inset:-8px 0;}  /* fatter hit area */
  .vprog{height:100%; width:0%; background:var(--accent); border-radius:var(--r-pill);}
  .vdur{font-size:var(--fs-0); color:var(--muted); font-family:var(--font-mono); font-variant-numeric:tabular-nums; flex:none; min-width:30px; text-align:right;}
  /* reply quoting */
  /* hover action bar (react / reply / forward / edit / delete) */
  .msg .macts{position:absolute; top:-13px; right:6px; display:none; gap:2px; z-index:3;}
  .msg.me .macts{right:auto; left:6px;}   /* own bubbles hug the left so actions stay on-screen */
  .msg:hover .macts{display:flex;}
  .msg .macts button{width:24px; height:24px; display:flex; align-items:center; justify-content:center; font-size:var(--fs-1); padding:0; border-radius:50%; background:var(--bg-3); border:1px solid var(--border-strong); color:var(--muted); cursor:pointer; line-height:1;}
  .msg .macts button:hover{color:var(--text); border-color:var(--accent); background:var(--bg-2);}
  .msg .macts button.del:hover{color:#f2647c; border-color:#f2647c;}
  .msg .macts .react-pop{top:30px; bottom:auto; left:0;}   /* drop below the action bar, not above the viewport */
  /* reaction chips under the bubble */
  .msg .mreacts{display:flex; flex-wrap:wrap; gap:3px; margin-top:3px;}
  .msg .rchip{font-size:var(--fs-0); padding:1px 7px; border-radius:var(--r-pill); background:var(--bg-3); border:1px solid var(--border); color:var(--muted); cursor:pointer; line-height:1.5; font-variant-numeric:tabular-nums;}
  .msg .rchip:hover{border-color:var(--border-strong);}
  .msg .rchip.mine{background:rgba(88,198,242,.16); border-color:rgba(88,198,242,.45); color:var(--text);}
  /* forwarded label + soft-deleted tombstone */
  .msg .fwd{font-size:var(--fs-0); color:var(--faint); font-style:italic; margin:0 0 2px;}
  .msg.gone{opacity:.8;}
  .msg .mtxt.deleted{color:var(--faint); font-style:italic;}
  /* forward-target picker modal */
  .fwdlist{display:flex; flex-direction:column; gap:4px; max-height:300px; overflow-y:auto; margin:8px 0;}
  .fwdtarget{text-align:left; padding:8px 11px; border-radius:var(--r-sm); background:var(--bg-2); border:1px solid var(--border); color:var(--text); cursor:pointer;}
  .fwdtarget:hover{border-color:var(--accent); background:var(--hover);}
  .mquote{border-left:3px solid var(--accent); background:var(--hover); border-radius:7px; padding:4px 9px; margin:1px 0 5px; cursor:pointer; max-width:100%;}
  .mquote .qn{font-weight:700; font-size:var(--fs-0);}
  .mquote .qs{color:var(--muted); font-size:var(--fs-0); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:250px;}
  .msg.flashq{outline:2px solid var(--accent); outline-offset:1px; transition:outline-color .3s;}
  .chat-typing{height:20px; padding:0 16px 4px; font-size:var(--fs-1); color:var(--muted); font-style:italic; flex:none;}
  .dots span{animation:cblink 1.2s infinite;} .dots span:nth-child(2){animation-delay:.2s;} .dots span:nth-child(3){animation-delay:.4s;}
  @keyframes cblink{0%,60%,100%{opacity:.2} 30%{opacity:1}}
  .chat-compose{display:flex; gap:8px; padding:10px 12px; border-top:1px solid var(--border); flex:none; align-items:flex-end;}
  .chat-compose textarea{resize:none; min-height:38px; max-height:120px; padding:8px 11px;}
  .chan-gear:hover{color:var(--text);}
  /* legacy nav-row badge hook (rail badge uses .chat-badge) */
  .navrow .cb{margin-left:auto; background:var(--accent); color:var(--accent-ink); font-size:var(--fs-0); font-weight:600; min-width:18px; height:18px; border-radius:var(--r-sm); display:none; align-items:center; justify-content:center; padding:0 5px;}
  .navrow .cb.show{display:flex;}

  /* ---- community social feed ---- */
  .feed{max-width:580px; margin:0 auto;}
  .composer{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:var(--sp-4); margin-bottom:var(--sp-4); position:relative;}
  .composer .idsel{display:flex; align-items:center; gap:9px; margin-bottom:10px; font-size:var(--fs-2); color:var(--muted);}
  .composer .idsel select{width:auto; flex:1; max-width:280px;}
  .composer textarea{resize:none; min-height:62px;}
  .composer .cbar{display:flex; justify-content:space-between; align-items:center; margin-top:10px; gap:10px;}
  /* composer media strip (multi-photo/video before posting) */
  .cmstrip{display:none; flex-wrap:wrap; gap:8px; margin-top:10px;}
  .cmthumb{position:relative; width:74px; height:74px; border-radius:var(--r-sm); overflow:hidden; border:1px solid var(--border); background:var(--bg-2); flex:none;}
  .cmthumb img{width:100%; height:100%; object-fit:cover;}
  .cmthumb-ic{display:flex; width:100%; height:100%; align-items:center; justify-content:center; font-size:var(--fs-5);}
  .cmthumb .rm{position:absolute; top:3px; right:3px; background:rgba(0,0,0,.65); color:#fff; border:none; border-radius:50%; width:20px; height:20px; cursor:pointer; font-size:var(--fs-0); line-height:1; padding:0;}
  .iconbtn{background:transparent; border:1px solid var(--border); border-radius:var(--r-sm); padding:7px 12px; cursor:pointer; color:var(--muted);}
  .iconbtn:hover{border-color:var(--border-2); color:var(--text);}
  .post{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:var(--sp-4); margin-bottom:var(--sp-4);}
  .post .ph{display:flex; align-items:center; gap:10px; margin-bottom:10px;}
  .pav{width:42px; height:42px; border-radius:var(--r-sm); background:var(--bg-2); border:1px solid var(--border-strong); color:var(--text); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:var(--fs-3); flex:none;}
  .post .porg{font-weight:600; font-size:var(--fs-2); letter-spacing:-.01em;}
  .post .pmeta{font-size:var(--fs-1); color:var(--muted);}
  .post .pbody{font-size:var(--fs-2); line-height:1.5; white-space:pre-wrap; word-wrap:break-word; overflow-wrap:anywhere;}
  .post img.pimg{max-width:100%; border-radius:var(--r-sm); margin-top:10px; max-height:520px; object-fit:cover; cursor:pointer;}
  /* post media gallery (secure multi-media) */
  .pgrid{display:grid; gap:4px; margin-top:10px; border-radius:var(--r-sm); overflow:hidden;}
  .pgrid.one{grid-template-columns:1fr;}
  .pgrid.two{grid-template-columns:1fr 1fr;}
  .pgrid.three{grid-template-columns:1fr 1fr;} .pgrid.three .pgi:first-child{grid-column:1/-1;}
  .pgrid.many{grid-template-columns:1fr 1fr;}
  .pgi{width:100%; height:100%; max-height:420px; min-height:120px; object-fit:cover; cursor:zoom-in; display:block; background:var(--bg-2);}
  .pgrid.one .pgi{max-height:520px; object-fit:contain;}
  .pvid{width:100%; margin-top:10px; border-radius:var(--r-sm); max-height:520px; background:#000;}
  .pfile{display:flex; align-items:center; gap:10px; margin-top:10px; padding:10px 12px; background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r-sm); cursor:pointer; font-size:var(--fs-2);}
  .pfile:hover{border-color:var(--border-strong);}
  .post .pacts{display:flex; gap:20px; margin-top:12px; padding-top:10px; border-top:1px solid var(--border); font-size:var(--fs-1); color:var(--muted);}
  .pact{display:flex; align-items:center; gap:6px; cursor:pointer; user-select:none;}
  .pact:hover{color:var(--text);}
  .pact.liked{color:var(--accent-text);}
  .react-wrap{position:relative; display:inline-flex;}
  .react-pop{position:absolute; bottom:24px; left:0; display:flex; gap:2px; background:var(--bg-2); border:1px solid var(--border-2); border-radius:var(--r-pill); padding:4px 6px; box-shadow:var(--shadow-lg); z-index:20;}
  .react-pop button{background:none; border:none; font-size:var(--fs-4); padding:3px 5px; cursor:pointer; border-radius:var(--r-sm); line-height:1;}
  .react-pop button:hover{background:var(--hover); transform:scale(1.25);}
  .rsum{color:var(--muted); font-size:var(--fs-0);}
  /* repost + quoted original */
  .repost-h{display:flex; align-items:center; gap:8px; font-size:var(--fs-1); color:var(--muted); margin-bottom:8px;}
  .repost-h .pdel{margin-left:auto;}
  .quoted{border:1px solid var(--border); border-radius:var(--r-md); padding:var(--sp-3); margin-bottom:4px; cursor:pointer; background:var(--bg-0);}
  .quoted:hover{border-color:var(--border-strong);}
  .pav.sm{width:30px; height:30px; font-size:var(--fs-2); border-radius:var(--r-sm);}
  /* post topic tags */
  .ptags{display:flex; flex-wrap:wrap; gap:6px; margin-top:10px;}
  .ptags .ptag{cursor:pointer;} .ptags .ptag:hover{border-color:var(--accent); color:var(--accent-text);}
  /* threaded comment replies */
  .cmt.reply{margin-left:28px;}
  .creply{display:inline-block; font-size:var(--fs-0); color:var(--accent-text); cursor:pointer; margin:3px 0 0 11px;}
  .creply:hover{text-decoration:underline;}
  .post.flash{outline:2px solid var(--accent); outline-offset:2px;}
  .pdel{margin-left:auto; cursor:pointer; color:var(--faint);}
  .pdel:hover{color:var(--danger);}
  .comments{margin-top:12px; border-top:1px solid var(--border); padding-top:10px; display:none;}
  .comments.open{display:block;}
  .cmt{display:flex; gap:8px; margin-bottom:9px;}
  .cmt .cav{width:30px; height:30px; border-radius:var(--r-sm); background:var(--bg-2); border:1px solid var(--border); color:var(--text); display:flex; align-items:center; justify-content:center; font-size:var(--fs-1); font-weight:600; flex:none;}
  .cmt .cbubble{background:var(--hover); border-radius:var(--r-md); padding:7px 11px; font-size:var(--fs-1); flex:1; min-width:0;}
  .cmt .corg{font-weight:600; font-size:var(--fs-1);}
  .cmt .ctxt{line-height:1.4; word-wrap:break-word; overflow-wrap:anywhere;}
  .cmt .cmeta{font-size:var(--fs-0); color:var(--faint); margin-top:2px;}
  .cmtbox{display:flex; gap:8px; margin-top:10px;}
  .cmtbox input{flex:1;}
  .mention{color:var(--accent-text); font-weight:600; cursor:pointer;}
  .mention:hover{text-decoration:underline;}
  .porg{cursor:pointer;} .porg:hover{text-decoration:underline;}
  .cmt .corg{cursor:pointer;} .cmt .corg:hover{text-decoration:underline;}
  /* @-mention autocomplete */
  .mention-box{position:absolute; z-index:60; left:14px; right:14px; background:var(--bg-2); border:1px solid var(--border-2); border-radius:var(--r-md); max-height:200px; overflow:auto; box-shadow:var(--shadow); display:none;}
  .mention-box .pt{display:flex; gap:8px; padding:8px 11px; cursor:pointer; font-size:var(--fs-2);}
  .mention-box .pt:hover{background:var(--hover);}
  /* notifications panel */
  /* notifications now render in the dock's Alerts pane (#notifPane); .notif-* below style content */
  .notif-head{padding:12px 14px; font-weight:600; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--bg-2);}
  .notif{display:flex; gap:10px; padding:11px 14px; border-bottom:1px solid var(--border); cursor:pointer;}
  .notif:hover{background:var(--hover);}
  .notif.unread{background:var(--accent-subtle);}
  .notif .nicn{font-size:var(--fs-3); flex:none;}
  .notif .ntx{font-size:var(--fs-1); line-height:1.4;}
  .notif .ntm{font-size:var(--fs-0); color:var(--faint); margin-top:2px;}
  /* feed tabs (Following / Discover) */
  .feedtabs{display:flex; gap:4px; margin-bottom:var(--sp-4); border-bottom:1px solid var(--border);}
  .feedtab{background:none; border:none; border-bottom:2px solid transparent; border-radius:0; padding:9px 14px; color:var(--muted); font-weight:600; font-size:var(--fs-2); cursor:pointer; margin-bottom:-1px;}
  .feedtab:hover{color:var(--text); background:transparent;}
  .feedtab.on{color:var(--accent-text); border-bottom-color:var(--accent);}
  .tagchip{display:flex; align-items:center; gap:8px; margin-bottom:var(--sp-3); font-size:var(--fs-1); color:var(--muted);}
  .tagchip a{color:var(--accent-text); cursor:pointer;}
  .cmtags{margin-top:8px; font-size:var(--fs-1);}
  /* cleanup studio records table */
  .cltable{width:100%; border-collapse:collapse; font-size:var(--fs-1);}
  .cltable th{text-align:left; color:var(--faint); font-weight:600; text-transform:uppercase; letter-spacing:var(--ls-caps); font-size:var(--fs-0); padding:6px 10px; border-bottom:1px solid var(--border); white-space:nowrap; font-family:var(--font-mono);}
  .cltable td{padding:6px 10px; border-bottom:1px solid var(--hairline); vertical-align:top; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .cltable tr:hover td{background:var(--hover);}
  /* cleanup issue board */
  .clboard{margin-top:6px;}
  .clsummary{font-size:var(--fs-1); color:var(--muted); margin-bottom:8px;}
  .clcard{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:var(--sp-3); margin-bottom:var(--sp-3);}
  .clhead{display:flex; align-items:center; gap:8px; font-size:var(--fs-2); margin-bottom:8px; flex-wrap:wrap;}
  .clcompare th{font-weight:600; color:var(--text); vertical-align:top;}
  .clcompare td{white-space:normal;}
  .clcompare td.clconf{background:var(--warn-bg); color:var(--text); border-left:2px solid var(--warn);}
  .clcompare tbody th{color:var(--faint); font-family:var(--font-mono); font-size:var(--fs-0); text-transform:uppercase;}
  /* follow button */
  .followbtn{flex:none; background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent); border-radius:var(--r-pill); padding:4px 13px; font-size:var(--fs-1); font-weight:600; cursor:pointer;}
  .followbtn:hover{background:var(--accent-hover); border-color:var(--accent-hover);}
  .followbtn.on{background:transparent; color:var(--muted); border-color:var(--border-strong);}
  .followbtn.on:hover{color:var(--danger); border-color:var(--danger); background:transparent;}
  .followbtn.lg{padding:7px 20px; font-size:var(--fs-2);}
  /* org profile */
  .profcard{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:var(--sp-5); margin-bottom:var(--sp-3);}
  .prof-head{display:flex; align-items:center; gap:16px; margin-bottom:12px;}
  .prof-av{width:72px; height:72px; border-radius:var(--r-md); background:var(--bg-2); border:1px solid var(--border-strong); color:var(--text); display:flex; align-items:center; justify-content:center; font-size:var(--fs-4); font-weight:600; flex:none;}
  .prof-actions{flex:none; align-self:flex-start;}
  .prof-stats{display:flex; flex-wrap:wrap; gap:18px; color:var(--muted); font-size:var(--fs-1); margin-top:4px;}
  .prof-stats b{color:var(--text);}
  .ptabs{display:flex; gap:4px; margin:0 0 var(--sp-3); border-bottom:1px solid var(--border);}
  .ptab{background:none; border:none; border-bottom:2px solid transparent; border-radius:0; padding:9px 14px; color:var(--muted); font-weight:600; font-size:var(--fs-2); cursor:pointer; margin-bottom:-1px;}
  .ptab:hover{color:var(--text); background:transparent;} .ptab.on{color:var(--accent-text); border-bottom-color:var(--accent);}
  .prow{display:flex; gap:12px; padding:6px 0; font-size:var(--fs-2); border-top:1px solid var(--border);}
  .prow .k{color:var(--faint); min-width:80px; flex:none; font-size:var(--fs-1); text-transform:uppercase; letter-spacing:var(--ls-caps);}
  .ptag{display:inline-block; background:var(--hover); border:1px solid var(--border); border-radius:var(--r-pill); padding:2px 10px; font-size:var(--fs-0); margin:0 4px 4px 0;}

  /* ==== Langflow × IT Glue node canvas ==== */
  #cvwrap{grid-area:4/1/5/2; min-width:0; position:relative; overflow:hidden; cursor:grab; display:none; touch-action:none;
    user-select:none; -webkit-user-select:none;  /* canvas is a workspace, not a document — double-click/drag never selects palette/label text */
    background-color:var(--bg);
    background-image:radial-gradient(rgba(17,24,39,.06) 1px, transparent 1px); /* dot grid (dark on light) */
    background-size:24px 24px;}
  /* …but real inputs/editable fields on the canvas stay selectable/editable */
  #cvwrap input, #cvwrap textarea, #cvwrap select, #cvwrap [contenteditable]{user-select:text; -webkit-user-select:text;}
  #cvwrap.panning{cursor:grabbing;}
  #world{position:absolute; top:0; left:0; transform-origin:0 0; will-change:transform;}
  /* The SVG needs a REAL box for pointer hit-testing (browsers clip hits to the
     element bounds even with overflow:visible) — so it spans ±50k world units. */
  #edgeSvg{position:absolute; top:-50000px; left:-50000px; width:100000px; height:100000px; overflow:visible;}
  #edgeSvg path{pointer-events:none;}
  #arr path{fill:var(--edge-arrow);}              /* tokenized marker fill */
  /* edge grammar: containment is solid, membership is stitching, intent is tracer.
     Per-edge custom colors arrive as inline style="stroke:#…" — keep these plain
     (no !important) so inline always wins. */
  /* dark strokes: white edges were invisible on the light canvas */
  .e-nest{fill:none; stroke:rgba(40,48,56,.32); stroke-width:1.5;}
  .e-root{fill:none; stroke:rgba(40,48,56,.20); stroke-width:1; stroke-dasharray:1 5; stroke-linecap:round;}
  .e-link{fill:none; stroke:var(--accent); stroke-width:2; stroke-dasharray:6 4;}
  .hitarea{fill:none; stroke:rgba(0,0,0,.001); stroke-width:14; pointer-events:stroke !important; cursor:pointer;}
  .e-hover{stroke-width:3.2;}
  .e-sel{stroke-width:3.2;}
  /* the canvas ghost WIRE only — bare '.ghost' also matched every ghost
     BUTTON in the app and made them all unclickable (pointer-events:none) */
  #edgeSvg .ghost{fill:none; stroke:var(--accent); stroke-width:2.5; stroke-dasharray:6 5; pointer-events:none;}
  /* dark text with a light halo so edge labels read on the light canvas */
  .elabel{font-size:var(--fs-0); fill:#2f363c; paint-order:stroke; stroke:#f3f4f7; stroke-width:3px; pointer-events:none; font-weight:600; font-family:var(--font-mono);}
  .cvnode{position:absolute; width:230px; background:var(--bg-2); border:1px solid var(--border-2); border-radius:var(--r-md); cursor:grab; user-select:none;}
  .cvnode:hover{border-color:var(--border-strong);}
  .cvnode:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
  #cvwrap:focus-visible{outline:2px solid var(--accent); outline-offset:-2px;}
  /* the one sanctioned node animation: realignment glides, never teleports */
  .cvnode.glide{transition:left var(--dur-glide) var(--ease-sun), top var(--dur-glide) var(--ease-sun);}
  .cvnode{user-select:none;}                              /* no accidental text-drag */
  .cvnode[draggable="true"]{-webkit-user-drag:element;}   /* Ctrl-drag exports cleanly */
  .cvnode.sel{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent);}
  .cvnode.msel{border-color:var(--accent); box-shadow:0 0 0 2px var(--accent), 0 0 0 5px rgba(88,198,242,.18);}
  .cvnode.dim{opacity:.22;}
  .cvnode.droptgt{border-color:var(--ok); box-shadow:0 0 0 1px var(--ok);}
  /* inline title rename: input swapped in for the .ntitle span */
  .cvnode .ntitle-edit{display:block; width:100%; box-sizing:border-box; font-size:var(--fs-2); font-weight:600; font-family:inherit; color:var(--text); background:var(--bg-1); border:1px solid var(--accent); border-radius:var(--r-sm); padding:0 3px; outline:none;}
  /* marquee multi-select rectangle (screen-space) */
  .marquee{position:fixed; z-index:40; border:1px solid var(--accent); background:rgba(88,198,242,.12); pointer-events:none; border-radius:2px;}
  .cvnode.orgnode{width:260px; background:var(--bg-2); border-color:var(--border-strong); box-shadow:0 0 0 1px var(--border-strong);} /* the brightest object — zero glow */
  .cvnode.orgnode .nic{background:rgba(239,243,244,.12);}
  .cvnode.orgnode .ntype{color:var(--t-organization);}
  .cvnode.orgnode.sel{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent);}
  .cvnode .nhead{display:flex; align-items:center; gap:9px; padding:9px 11px;}
  .cvnode .nic{width:30px; height:30px; border-radius:var(--r-sm); background:var(--hover); display:flex; align-items:center; justify-content:center; font-size:var(--fs-3); flex:none;}
  .cvnode .ncol{flex:1; min-width:0; display:flex; flex-direction:column;}
  .cvnode .ntitle{display:block; font-size:var(--fs-2); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .cvnode .ntype{display:block; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); font-weight:600; color:var(--faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family:var(--font-mono);}
  .cvnode .nkids{flex:none; font-size:var(--fs-0); color:var(--accent-text); background:var(--accent-subtle); border:1px solid var(--border); border-radius:var(--r-sm); padding:2px 8px; cursor:pointer;}
  .cvnode .nkids:hover{border-color:var(--accent);}
  .cvnode .nbody{padding:0 11px 8px; border-top:1px solid var(--hairline); padding-top:7px;}
  .cvnode .nrow{display:flex; gap:6px; font-size:var(--fs-1); margin-bottom:3px; align-items:center;}
  .cvnode .nrow .nk{color:var(--faint); flex:none; max-width:84px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .cvnode .nrow .nv{color:var(--muted); flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .cvnode .nrow .pill{font-size:var(--fs-0); padding:1px 8px;}
  .cvnode .nrow .peek{background:transparent; border:none; padding:0 3px; cursor:pointer; font-size:var(--fs-1);}
  .cvnode .nfoot{padding:4px 11px 7px; font-size:var(--fs-0); color:var(--faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  /* ports: square terminals rotated 45° — wiring diamonds */
  .port{position:absolute; width:9px; height:9px; border-radius:2px; transform:rotate(45deg); background:var(--accent); border:2px solid var(--bg-0); top:calc(50% - 4.5px); cursor:crosshair; z-index:3;}
  .port::after{content:''; position:absolute; inset:-9px;} /* >=24px hit area (WCAG 2.5.8) without growing the terminal */
  .port:hover{transform:rotate(45deg) scale(1.3); background:var(--accent-hover);}
  .port.in{left:-5px;} .port.out{right:-5px;}
  /* canvas tools: floating pill, bottom-center */
  .cvtools{position:absolute; bottom:16px; left:50%; transform:translateX(-50%); display:flex; gap:4px; z-index:8; background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r-pill); padding:4px 8px; box-shadow:var(--shadow);}
  .cvtools button{border:none; background:transparent; padding:6px 9px; border-radius:var(--r-pill); font-size:var(--fs-2); min-width:34px; min-height:34px; filter:grayscale(1);}
  .cvtools button:hover{background:var(--hover); filter:grayscale(1);}
  .cvtools button[aria-pressed="true"]{background:var(--accent-subtle); box-shadow:inset 0 0 0 1px var(--accent);}
  .cvtools .tsep{width:1px; background:var(--border); margin:2px 3px; align-self:stretch;}
  #cvPct{font-family:var(--font-mono); font-variant-numeric:tabular-nums;}
  /* 3D canvas view: fills #cvwrap, sits under the toolbar (z-index 8) */
  #cv3d{position:absolute; inset:0; display:none; z-index:5; background:#0a0c0e;}
  #cv3d canvas{display:block; width:100%; height:100%; touch-action:none; cursor:grab;}
  #cvwrap.mode3d{cursor:default;}
  #cvwrap.mode3d #cv3d{display:block;}
  #cvwrap.mode3d #world, #cvwrap.mode3d .hintpill{display:none;}
  /* the edge panel + palette ARE shown in 3D too — same widgets as 2D (palette
     drag-creates at the projected drop point; edge panel repositioned by projection) */
  #cvwrap.mode3d .edgepanel{z-index:9;}
  .hintpill{position:absolute; bottom:68px; left:50%; transform:translateX(-50%); z-index:7; background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r-pill); padding:6px 14px; font-size:var(--fs-0); color:var(--muted); box-shadow:var(--shadow); white-space:nowrap; max-width:min(92vw,560px); overflow:hidden; text-overflow:ellipsis;}
  .hintpill .hintx{cursor:pointer; color:var(--faint); margin-left:10px; padding:2px 4px; border-radius:var(--r-sm);}
  .hintpill .hintx:hover{color:var(--text); background:var(--hover);}
  @media (max-width:900px){ .hintpill{display:none !important;} }
  /* active palette filter chip */
  .filterchip{position:absolute; bottom:14px; left:14px; z-index:8; display:flex; gap:8px; align-items:center; background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r-pill); padding:6px 14px; font-size:var(--fs-1); color:var(--text); box-shadow:var(--shadow); white-space:nowrap;}
  .filterchip a{color:var(--accent-text); cursor:pointer;}
  .filterchip a:hover{text-decoration:underline;}
  /* empty-canvas onboarding overlay */
  #cvEmpty{position:absolute; inset:0; z-index:6; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; text-align:center; color:var(--muted); pointer-events:none; padding:0 20px;}
  #cvEmpty button{pointer-events:auto; margin-top:4px;}
  .palghost{position:fixed; z-index:99; pointer-events:none; background:var(--bg-2); border:1px solid var(--accent); border-radius:var(--r-sm); padding:6px 12px; font-size:var(--fs-1); box-shadow:var(--shadow);}
  .edgepanel{position:absolute; z-index:9; background:var(--bg-2); border:1px solid var(--border-2); border-radius:var(--r-md); padding:var(--sp-3); width:min(240px,calc(100vw - 24px)); box-shadow:var(--shadow);}
  .edgepanel h5{margin:0 0 8px; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-family:var(--font-mono);}
  .swatches{display:flex; gap:6px; margin:9px 0;}
  .sw{width:20px; height:20px; border-radius:var(--r-sm); cursor:pointer; border:2px solid transparent;}
  .sw.on{border-color:#fff;}
  .sw.none{background:var(--field-bg); border:1px dashed var(--border-strong);}
  .swcustom{width:26px; height:22px; padding:0; border:1px solid var(--border-strong); border-radius:var(--r-sm); background:none; cursor:pointer;}
  .edgepanel textarea{resize:vertical; min-height:34px;}
  /* media cards: the image is the card; drawer gets a full preview */
  .nimgwrap{padding:0 10px 9px;}
  .nimg{display:block; width:100%; max-height:130px; object-fit:cover; border-radius:var(--r-sm); border:1px solid var(--border); pointer-events:none;}
  .dmedia{display:block; width:100%; max-height:300px; object-fit:contain; border-radius:var(--r-sm); border:1px solid var(--border); margin-bottom:12px; background:var(--field-bg);}
  /* ==== the type rail: per-type card accents (border/background-color only —
     NO shadows or filters on .cvnode; 100+ nodes must stay fast) ==== */
  .cvnode.ty-organization{border-left:3px solid var(--t-organization);}
  .cvnode.ty-location{border-left:3px solid var(--t-location);}
  .cvnode.ty-folder{border-left:3px solid var(--t-folder);}
  .cvnode.ty-server{border-left:3px solid var(--t-server);}
  .cvnode.ty-device{border-left:3px solid var(--t-device);}
  .cvnode.ty-network{border-left:3px solid var(--t-network);}
  .cvnode.ty-domain{border-left:3px solid var(--t-domain);}
  .cvnode.ty-application{border-left:3px solid var(--t-application);}
  .cvnode.ty-crypto{border-left:3px solid var(--t-crypto);}
  .cvnode.ty-certificate{border-left:3px solid var(--t-certificate);}
  .cvnode.ty-license{border-left:3px solid var(--t-license);}
  .cvnode.ty-note{border-left:3px solid var(--t-note);}
  .cvnode.ty-document{border-left:3px solid var(--t-document);}
  .cvnode.ty-media{border-left:3px solid var(--t-media);}
  .cvnode.ty-runbook{border-left:3px solid var(--t-runbook);}
  .cvnode.ty-chart{border-left:3px solid var(--t-chart);}
  .cvnode.ty-contact{border-left:3px solid var(--t-contact);}
  .cvnode.ty-vendor{border-left:3px solid var(--t-vendor);}
  .cvnode.ty-ticket{border-left:3px solid var(--t-ticket);}
  /* tinted icon chips (pre-baked rgba — no color-mix dependency) */
  .ty-organization .nic{background:rgba(239,243,244,.12);}
  .ty-location .nic{background:rgba(240,140,125,.14);}
  .ty-folder .nic{background:rgba(151,163,173,.14);}
  .ty-server .nic{background:rgba(88,198,242,.14);}
  .ty-device .nic{background:rgba(127,168,242,.14);}
  .ty-network .nic{background:rgba(78,209,194,.14);}
  .ty-domain .nic{background:rgba(91,217,232,.14);}
  .ty-application .nic{background:rgba(143,143,242,.14);}
  .ty-crypto .nic{background:rgba(62,213,152,.14);}
  .ty-certificate .nic{background:rgba(102,217,184,.14);}
  .ty-license .nic{background:rgba(217,160,242,.14);}
  .ty-note .nic{background:rgba(245,184,61,.14);}
  .ty-document .nic{background:rgba(227,206,122,.14);}
  .ty-media .nic{background:rgba(242,155,212,.14);}
  .ty-runbook .nic{background:rgba(168,224,95,.14);}
  .ty-chart .nic{background:rgba(199,146,234,.14);}
  .ty-contact .nic{background:rgba(242,166,90,.14);}
  .ty-vendor .nic{background:rgba(232,143,183,.14);}
  .ty-ticket .nic{background:rgba(242,100,124,.14);}
  /* hued type eyebrows (all >=4.6:1 on bg-2 at 11px/600) */
  .ty-organization .ntype{color:var(--t-organization);}
  .ty-location .ntype{color:var(--t-location);}
  .ty-folder .ntype{color:var(--t-folder);}
  .ty-server .ntype{color:var(--t-server);}
  .ty-device .ntype{color:var(--t-device);}
  .ty-network .ntype{color:var(--t-network);}
  .ty-domain .ntype{color:var(--t-domain);}
  .ty-application .ntype{color:var(--t-application);}
  .ty-crypto .ntype{color:var(--t-crypto);}
  .ty-certificate .ntype{color:var(--t-certificate);}
  .ty-license .ntype{color:var(--t-license);}
  .ty-note .ntype{color:var(--t-note);}
  .ty-document .ntype{color:var(--t-document);}
  .ty-media .ntype{color:var(--t-media);}
  .ty-runbook .ntype{color:var(--t-runbook);}
  .ty-chart .ntype{color:var(--t-chart);}
  .ty-contact .ntype{color:var(--t-contact);}
  .ty-vendor .ntype{color:var(--t-vendor);}
  .ty-ticket .ntype{color:var(--t-ticket);}
  /* ==== type-specific node behaviors ==== */
  .cvnode.t-note{background:var(--bg-2); border-color:var(--border-strong); border-left:3px solid var(--t-note);}
  .cvnode.t-note .nbody{font-style:italic; color:var(--text);}
  .cvnode.t-crypto{background:var(--bg-2); border-color:var(--border-strong); border-left:3px solid var(--t-crypto);}
  .cvnode.t-folder{border-style:dashed; border-color:var(--border-2);}
  .cvnode.t-folder.droptgt{border-style:solid;}
  .cvnode.prio-critical{border-left:4px solid var(--danger);}
  .cvnode.prio-high{border-left:4px solid var(--warn);}
  .cvnode.prio-medium{border-left:4px solid var(--border-strong);}
  .exp-pill{display:inline-flex; align-items:center; font-size:var(--fs-0); font-weight:600; padding:2px 8px; border-radius:var(--r-sm); margin-top:2px;}
  .exp-red{background:var(--danger-bg); color:var(--danger);}
  .exp-amber{background:var(--warn-bg); color:var(--warn);}
  .exp-green{background:var(--ok-bg); color:var(--ok);}
  .mini-chart{padding:4px 10px 8px;}
  .nrow a{color:var(--accent-text); text-decoration:none;} .nrow a:hover{text-decoration:underline;}
  .flditem{display:flex; gap:7px; font-size:var(--fs-0); color:var(--muted); padding:2px 0; align-items:center;}
  /* runbook checklist */
  .step{display:flex; gap:9px; padding:7px 9px; border-radius:var(--r-sm); align-items:flex-start; cursor:pointer; font-size:var(--fs-2); line-height:1.45;}
  .step:hover{background:var(--hover);}
  .step input{width:auto; margin-top:3px; accent-color:var(--accent); cursor:pointer;}
  .step.done{color:var(--faint); text-decoration:line-through;}
  .progressbar{height:6px; background:var(--hover); border-radius:var(--r-pill); overflow:hidden; margin:8px 0 12px;}
  .progressbar i{display:block; height:100%; background:var(--accent); transition:width var(--dur-3) var(--ease-sun);}
  /* vault rows */
  .vaultrow{display:flex; align-items:center; gap:9px; background:var(--hover); border:1px solid var(--border); border-left:3px solid var(--ok); border-radius:var(--r-sm); padding:11px 13px; margin:8px 0;}
  .vaultrow .vk{font-size:var(--fs-1); color:var(--muted); flex:1;}
  .qact{display:flex; gap:7px; flex-wrap:wrap; margin:10px 0;}
  /* ==== activity timeline — the console log of the estate ==== */
  .actday{position:sticky; top:0; background:var(--bg-1); padding:10px 2px 6px; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:600; z-index:2; font-family:var(--font-mono);}
  .actrow{display:flex; gap:10px; padding:8px 2px; border-bottom:1px solid var(--border); align-items:flex-start;}
  .acticon{width:28px; height:28px; border-radius:var(--r-sm); background:var(--bg-3); color:var(--muted); display:flex; align-items:center; justify-content:center; font-size:var(--fs-2); flex:none; margin-top:1px;}
  .actmid{flex:1; min-width:0;}
  .acttxt{font-size:var(--fs-1); line-height:1.45; word-wrap:break-word;}
  .actdet{font-size:var(--fs-0); color:var(--muted); margin-top:2px; line-height:1.45; word-wrap:break-word; overflow-wrap:anywhere; font-family:var(--font-mono);}
  .acttime{font-size:var(--fs-0); color:var(--faint); flex:none; margin-top:2px;}
  /* ==== detail drawer → SPLIT item panel (pushes the canvas; overlay <1100px) ==== */
  /* detail pane lives in the dock now (#drawer keeps the .drawer class so the content
     selectors below still apply); positioning is owned by .dock / .dock-pane. */
  .drawer .dhead{padding:var(--sp-3) var(--sp-4) var(--sp-2); border-bottom:1px solid var(--border); flex:none;}
  .drawer .dcrumb{font-size:var(--fs-0); color:var(--muted); margin-bottom:6px; font-family:var(--font-mono);}
  .drawer .dcrumb a{color:var(--muted); cursor:pointer;} .drawer .dcrumb a:hover{color:var(--accent-text);}
  .drawer .dtitle{display:flex; align-items:center; gap:10px; font-size:var(--fs-3); font-weight:600;}
  .drawer .dacts{display:flex; gap:6px; flex-wrap:wrap; margin-top:10px;}
  .drawer .dbody{flex:1; min-height:0; overflow-y:auto; padding:var(--sp-4);}
  .drawer .dclose{display:none;}   /* the dock header ✕ is the single close affordance */

  /* ==== the data voice: monospace + tabular numerals wherever DATA lives —
     field values, timestamps, counts, IPs/serials. Never on prose or buttons. ==== */
  .cvnode .nrow .nv, .info-grid .v, .acttime, .msg .t, .notif .ntm, .post .pmeta,
  .cmt .cmeta, .cvnode .nfoot, .orgrow .orgct, .qchip .pcount, .cvnode .nkids,
  .exp-pill, .conv .cb, .navrow .cb, .chat-badge{
    font-family:var(--font-mono); font-variant-numeric:tabular-nums;}
  .reveal-box{font-family:var(--font-mono); font-variant-numeric:tabular-nums;}

  /* inline line icons (no emoji) — inherit text colour, align to the baseline */
  .ico{display:inline-block; vertical-align:-.16em; flex:none;}
  button .ico:first-child{margin-right:6px;}
  /* ==== Home dashboard — lean dark: borderless surfaces, whitespace, calm contrast ====
     One centered max-width column; compact KPI row; deliberate 2-col split (actionable
     left, reference right). Surfaces are a single shade lift (bg-2) with NO outlines —
     space + elevation do the separating, not borders. */
  /* A CAP, but a generous one — and the two failures either side of it are
     both real. At 1080px a working screen sat in a column with two thirds of
     the window empty. With no cap at all everything stretched instead: a
     company row spread its name, its status and its balance across 1600px with
     nothing between them, which is not more information, it is the same
     information further apart.
     `min(100%, 96rem)` uses the whole window on an ordinary screen and stops a
     very wide one from pulling a row into three unrelated corners. */
  .dash{max-width:min(100%, 96rem); margin:0 auto; min-width:0;}
  .dash .pagehead{margin-bottom:var(--sp-6);}
  .dash-kpis{display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:var(--sp-4); margin-bottom:var(--sp-8);}
  .kpi{background:var(--bg-1); border:1px solid var(--border); box-shadow:var(--shadow-sm); border-radius:var(--r-md); padding:1.125rem 1.25rem; display:flex; flex-direction:column; gap:.6875rem; min-width:0; transition:box-shadow var(--dur-1) var(--ease-sun), border-color var(--dur-1) var(--ease-sun);}
  .kpi[role="button"]{cursor:pointer;}
  .kpi[role="button"]:hover{box-shadow:var(--shadow); border-color:var(--border-strong);}
  .kpi .k-l{font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:600; font-family:var(--font-mono); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .kpi .k-n{font-size:var(--fs-5); line-height:1; font-weight:600; letter-spacing:-.02em; font-variant-numeric:tabular-nums; color:var(--text);}
  .kpi.kpi-danger .k-n{color:var(--danger);} .kpi.kpi-warn .k-n{color:var(--warn);}
  .dash-grid{display:grid; grid-template-columns:1.7fr 1fr; gap:var(--sp-5); align-items:start;}
  .dash-col{display:flex; flex-direction:column; gap:var(--sp-5); min-width:0;}
  @media (max-width:880px){ .dash-grid{grid-template-columns:1fr;} }
  /* section card — borderless; header is a quiet label with space below, no rule */
  .card2{background:var(--bg-1); border:1px solid var(--border); box-shadow:var(--shadow); border-radius:var(--r-lg); overflow:hidden;}
  .card2-h{display:flex; align-items:center; justify-content:space-between; gap:.625rem; padding:.8125rem 1.125rem; border-bottom:.0625rem solid var(--hairline); font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:600; font-family:var(--font-mono);}
  .card2-act{color:var(--accent-text); cursor:pointer; letter-spacing:0; text-transform:none; font-family:var(--font-ui); font-size:var(--fs-1); font-weight:500;}
  .card2-act:hover{text-decoration:underline;}
  .card2-body{padding:4px 10px 12px; max-height:46vh; overflow-y:auto;}   /* list scrolls inside the card; header stays put */
  .card2-empty{padding:28px 16px; text-align:center; color:var(--muted); font-size:var(--fs-1);}
  /* clean list rows shared by tasks + expiring (aligned, truncating, airy) */
  .trow{display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:var(--r-sm); cursor:pointer; min-width:0; transition:background-color var(--dur-1) var(--ease-sun);}
  .trow:hover{background:var(--hover);}
  .trow .trow-title{flex:1 1 auto; min-width:0; font-size:var(--fs-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .trow .trow-sub{flex:0 0 auto; max-width:34%; font-size:var(--fs-0); color:var(--faint); font-family:var(--font-mono); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:right;}
  @media (max-width:520px){ .trow .trow-sub{display:none;} }
  .tdot{flex:none; width:7px; height:7px; border-radius:50%; background:var(--muted);}
  .tdot-over{background:var(--danger);} .tdot-warn{background:var(--warn);} .tdot-ok{background:var(--ok);}
  .prio{flex:none; width:8px; height:8px; border-radius:2px; background:var(--muted); transform:rotate(45deg);}
  .prio.prio-low{background:var(--faint);} .prio.prio-med{background:var(--info);}
  .prio.prio-high{background:var(--warn);} .prio.prio-urgent{background:var(--danger);}
  .due{flex:none; font-size:var(--fs-0); color:var(--muted); font-family:var(--font-mono); font-variant-numeric:tabular-nums; padding:1px 8px; border-radius:var(--r-pill); border:1px solid var(--border); white-space:nowrap;}
  .due.due-warn{color:var(--warn); border-color:rgba(245,184,61,.3); background:var(--warn-bg);}
  .due.due-over{color:var(--danger); border-color:rgba(242,100,124,.3); background:var(--danger-bg);}
  /* activity rows — line icon, no chip */
  .arow{display:flex; align-items:flex-start; gap:12px; padding:9px 12px; min-width:0;}
  .arow-ic{flex:none; color:var(--muted); display:flex; align-items:center; padding-top:1px;}
  .arow-mid{flex:1; min-width:0;}
  .arow-tx{font-size:var(--fs-1); line-height:1.4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .arow-tm{font-size:var(--fs-0); color:var(--faint); font-family:var(--font-mono); margin-top:1px;}
  /* board (kanban) */
  .board{display:grid; grid-template-columns:repeat(auto-fit,minmax(228px,1fr)); gap:var(--sp-3); align-items:start;}
  .bcol{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:var(--sp-2); display:flex; flex-direction:column; min-height:140px; transition:border-color var(--dur-1) var(--ease-sun), background-color var(--dur-1) var(--ease-sun);}
  .bcol.over{border-color:var(--accent); background:var(--accent-subtle);}
  .bcol-h{display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:600; font-family:var(--font-mono); padding:6px 6px 8px;}
  .bcol-n{background:var(--hover); border-radius:var(--r-pill); padding:0 7px; color:var(--muted); font-variant-numeric:tabular-nums;}
  .bcol-body{display:flex; flex-direction:column; gap:6px; min-height:10px; flex:1;}
  .bcol-empty{text-align:center; padding:12px 0;}
  .bcol-add{margin-top:6px; justify-content:flex-start;}
  .bcard{background:var(--bg-2); border:1px solid var(--border); border-left:3px solid var(--border-strong); border-radius:var(--r-sm); padding:9px 11px; cursor:pointer; transition:border-color var(--dur-1) var(--ease-sun);}
  .bcard:hover{border-color:var(--border-strong);}
  .bcard.dragging{opacity:.5;}
  .bcard.prio-low{border-left-color:var(--faint);} .bcard.prio-med{border-left-color:var(--info);}
  .bcard.prio-high{border-left-color:var(--warn);} .bcard.prio-urgent{border-left-color:var(--danger);}
  .bcard .bc-title{font-size:var(--fs-2); font-weight:500; line-height:1.35; word-break:break-word;}
  .bcard .bc-meta{display:flex; align-items:center; gap:8px; margin-top:7px; flex-wrap:wrap; min-width:0;}
  .bcard .trow-sub{font-size:var(--fs-0); color:var(--faint); font-family:var(--font-mono); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%;}
  /* CRM pipeline — horizontal kanban over deal entities */
  .crm-stats{display:flex; gap:20px; font-size:var(--fs-1); color:var(--muted); margin-bottom:var(--sp-4); flex-wrap:wrap; font-variant-numeric:tabular-nums;}
  .crm-stats .crm-open{color:var(--accent-text); font-weight:600;}
  .crm-stats .crm-won{color:var(--ok); font-weight:600;}
  .board.pipeline{display:flex; gap:var(--sp-3); overflow-x:auto; align-items:flex-start; padding-bottom:8px;}
  .board.pipeline .bcol{flex:0 0 256px;}
  .bcol-sum{font-size:var(--fs-1); font-weight:600; color:var(--accent-text); padding:0 6px 6px; font-variant-numeric:tabular-nums;}
  .bcard.deal .bc-title{font-weight:600;}
  .dealval{font-size:var(--fs-1); font-weight:700; color:var(--text); font-variant-numeric:tabular-nums;}
  .crm-stats .crm-weighted{color:var(--text); font-weight:600;}
  .bc-flags{margin-top:7px; display:flex; gap:6px;}
  .deal-flag{font-size:var(--fs-0); font-weight:600; text-transform:uppercase; letter-spacing:.03em; color:var(--warn); background:var(--warn-bg); border-radius:var(--r-pill); padding:1px 7px;}
  /* A deal somebody STARTED and then dropped. Louder than the other two flags
     on purpose: those describe work not begun, this describes money leaking. */
  .deal-flag.quiet{color:var(--danger); background:var(--danger-bg);}
  .crm-quiet{color:var(--danger); font-weight:600;}
  .deal-acts{font-size:var(--fs-0); color:var(--muted); display:inline-flex; align-items:center; gap:3px;}
  /* deal 360 modal: contact + activity timeline */
  .dl-sec{font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:600; margin:16px 0 8px; font-family:var(--font-mono);}
  .dl-contacts{display:flex; flex-direction:column; gap:6px;}
  .dl-contact{display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--border); border-radius:var(--r-sm); cursor:pointer; min-width:0;}
  .dl-contact:hover{border-color:var(--border-strong);}
  .dl-contact .ppl-av{width:30px; height:30px; font-size:var(--fs-1);}
  .act-log{display:flex; gap:6px; margin-bottom:10px;}
  .act-log select{flex:0 0 92px;} .act-log input{flex:1; min-width:0;}
  /* The reply box is a textarea because a knowledge-base article pasted
     into a single-line input loses every newline — the agent sends one
     run-on paragraph and never sees what was dropped. */
  .act-log textarea{flex:1; min-width:140px; resize:vertical; font:inherit;
    padding:7px 10px; border:1px solid var(--border); border-radius:var(--r-md);
    background:var(--card, transparent); color:inherit; line-height:1.45;}
  .act-list{max-height:240px; overflow-y:auto; display:flex; flex-direction:column; gap:9px;}
  .act-item{display:flex; gap:9px; align-items:flex-start;}
  .act-kind{flex:none; font-size:var(--fs-0); font-weight:700; text-transform:uppercase; letter-spacing:.03em; padding:2px 7px; border-radius:var(--r-pill); background:var(--bg-3); color:var(--muted); margin-top:1px;}
  .ak-call{background:var(--info-bg); color:var(--info);} .ak-email{background:var(--accent-subtle); color:var(--accent-text);} .ak-meeting{background:var(--ok-bg); color:var(--ok);}
  .act-b{min-width:0; flex:1;} .act-txt{color:var(--text); line-height:1.45; word-break:break-word;}
  .stage-won .bcol-h>span:first-child{color:var(--ok);} .stage-lost .bcol-h>span:first-child{color:var(--danger);}
  /* Calendar — month grid view over all dated graph items */
  .cal-nav{display:flex; align-items:center; gap:6px;}
  .cal-dows{display:grid; grid-template-columns:repeat(7,1fr); gap:6px; margin-bottom:6px;}
  .cal-dows>div{font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:600; text-align:center;}
  .cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:6px;}
  .cal-cell{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-sm); min-height:96px; padding:4px 4px 5px; display:flex; flex-direction:column; gap:3px; overflow:hidden;}
  .cal-cell.cal-out{background:var(--bg-3); opacity:.55;}
  .cal-cell.cal-today{border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent);}
  .cal-dnum{align-self:flex-start; font-size:var(--fs-1); color:var(--muted); font-weight:600; background:transparent; border:none; cursor:pointer; padding:0 6px; border-radius:var(--r-sm); line-height:1.5;}
  .cal-dnum:hover{background:var(--hover); color:var(--text);}
  .cal-today .cal-dnum{color:var(--accent-text);}
  .cal-items{display:flex; flex-direction:column; gap:2px; min-height:0; overflow:hidden;}
  .cal-chip{display:flex; align-items:center; gap:5px; width:100%; text-align:left; border:none; background:var(--accent-subtle); color:var(--text); border-radius:4px; padding:2px 6px; font-size:var(--fs-0); cursor:pointer; line-height:1.5; min-width:0;}
  .cal-chip .cc-t{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .cal-chip .cc-dot{width:6px; height:6px; border-radius:50%; flex:none; background:var(--accent);}
  .cal-chip:hover{filter:brightness(.96);}
  .cal-chip.k-task{background:var(--info-bg);} .cal-chip.k-task .cc-dot{background:var(--info);}
  .cal-chip.k-deal{background:var(--accent-subtle);} .cal-chip.k-deal .cc-dot{background:var(--accent);}
  .cal-chip.k-expiry{background:var(--warn-bg);} .cal-chip.k-expiry .cc-dot{background:var(--warn);}
  .cal-chip.k-event{background:var(--ok-bg);} .cal-chip.k-event .cc-dot{background:var(--ok);}
  .cal-more{font-size:var(--fs-0); color:var(--muted); padding:0 6px;}
  .cal-legend{display:flex; gap:16px; margin-top:12px; font-size:var(--fs-0); color:var(--muted); flex-wrap:wrap;}
  .cal-legend span{display:flex; align-items:center; gap:6px;}
  .cal-legend span::before{content:""; width:8px; height:8px; border-radius:50%;}
  .cal-legend .k-event::before{background:var(--ok);} .cal-legend .k-task::before{background:var(--info);}
  .cal-legend .k-deal::before{background:var(--accent);} .cal-legend .k-expiry::before{background:var(--warn);}
  .cal-chip.k-invoice{background:#f3eafe;} .cal-chip.k-invoice .cc-dot{background:#8b5cf6;}
  .cal-chip.k-timeoff{background:#e6f7f4;} .cal-chip.k-timeoff .cc-dot{background:#14b8a6;}
  .cal-legend .k-timeoff::before{background:#14b8a6;}
  .cal-legend .k-invoice::before{background:#8b5cf6;}
  /* Finance pillar */
  .k-n.fin-ok{color:var(--ok);} .k-n.fin-warn{color:var(--warn);} .k-n.fin-danger{color:var(--danger);}
  .fin-amt{margin-left:auto; font-weight:700; font-variant-numeric:tabular-nums; color:var(--text); white-space:nowrap;}
  .fin-badge{flex:none; font-size:var(--fs-0); font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:2px 7px; border-radius:var(--r-pill); border:1px solid var(--border); color:var(--muted); background:var(--bg-3);}
  .fb-paid{background:var(--ok-bg); color:var(--ok); border-color:transparent;}
  .fb-sent{background:var(--info-bg); color:var(--info); border-color:transparent;}
  .fb-overdue{background:var(--danger-bg); color:var(--danger); border-color:transparent;}
  .fb-pending{background:var(--warn-bg); color:var(--warn); border-color:transparent;}
  .fb-accepted{background:var(--ok-bg); color:var(--ok); border-color:transparent;}
  .fb-sent{background:var(--info-bg); color:var(--info); border-color:transparent;}
  .fb-declined,.fb-overdue{background:var(--danger-bg); color:var(--danger); border-color:transparent;}
  .fb-partial{background:var(--warn-bg); color:var(--warn); border-color:transparent;}
  /* Finance reports — charts, P&L, ledger */
  .fin-rep-grid{display:grid; grid-template-columns:1.4fr 1fr; gap:14px; align-items:start; margin-top:2px;}
  .fin-rep-grid > div{display:flex; flex-direction:column; gap:14px; min-width:0;}
  @media(max-width:1000px){ .fin-rep-grid{grid-template-columns:1fr;} }
  .fin-chart{width:100%; height:auto; display:block; margin-top:4px; max-height:200px;}
  .fin-legend{display:flex; gap:16px; margin-bottom:6px; font-size:var(--fs-0); color:var(--muted);}
  .fin-legend span{display:flex; align-items:center; gap:6px;}
  .fin-legend span::before{content:""; width:9px; height:9px; border-radius:2px; background:var(--c);}
  .fin-tbl{width:100%; border-collapse:collapse; font-size:var(--fs-2);}
  .fin-tbl td{padding:6px 4px; border-bottom:1px solid var(--hairline); font-variant-numeric:tabular-nums; color:var(--text);}
  .fin-tbl td.r{text-align:right;} .fin-tbl td.muted{color:var(--muted);}
  .fin-tbl .pl-cat{padding-left:16px; color:var(--muted); text-transform:capitalize;}
  .fin-tbl .pl-sub td{color:var(--faint); text-transform:uppercase; font-size:var(--fs-0); letter-spacing:.05em; padding-top:9px; border:none;}
  .fin-tbl .pl-tot td{font-weight:700; border-top:1.5px solid var(--border-strong); border-bottom:none; padding-top:8px;}
  .ledger th{text-align:left; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:.05em; color:var(--muted); padding:6px 4px; border-bottom:1px solid var(--border); font-weight:600;}
  .ledger th.r{text-align:right;}
  .led-k{font-size:var(--fs-0); font-weight:700; text-transform:uppercase; padding:1px 6px; border-radius:var(--r-pill); background:var(--bg-3); color:var(--muted);}
  .led-payment{background:var(--ok-bg); color:var(--ok);} .led-expense{background:var(--danger-bg); color:var(--danger);} .led-invoice{background:var(--accent-subtle); color:var(--accent-text);}
  /* invoice 360 — line items, totals; AR aging fills */
  .inv-meta{display:flex; justify-content:space-between; align-items:center; margin-bottom:4px;}
  .li-list{display:flex; flex-direction:column;}
  .li-row{display:flex; align-items:center; gap:12px; padding:6px 0; border-bottom:1px solid var(--hairline);}
  .li-row:last-child{border-bottom:none;}
  .li-d{flex:1; min-width:0;} .li-q{color:var(--muted); font-size:var(--fs-0); font-variant-numeric:tabular-nums;}
  .li-t{font-variant-numeric:tabular-nums; font-weight:600; flex:none;}
  .inv-tot{display:flex; justify-content:space-between; padding:3px 0; font-size:var(--fs-1);}
  .inv-tot strong{font-variant-numeric:tabular-nums;}
  .agefill-d1_30{background:var(--warn);} .agefill-d31_60,.agefill-d61_90,.agefill-d90{background:var(--danger);}
  /* document view (invoice / quote) — premium, printable to PDF */
  .modal:has(#docView){width:min(720px,calc(100vw - 32px));}
  .docwrap{margin:-6px -6px 4px;}
  .doc{background:#fff; color:var(--text);}
  .doc-band{height:8px; border-radius:8px 8px 0 0; margin:0 0 20px;}
  .doc-top{display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:22px; padding:0 4px;}
  .doc-brand{display:flex; gap:13px; align-items:flex-start; min-width:0;}
  .doc-logo{width:44px; height:44px; border-radius:12px; flex:none; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:var(--fs-4);}
  /* v474 (WI-9) — the uploaded company logo on a document: same footprint as the
     initial tile, image kept whole (contain) so a wide or tall logo is not cropped. */
  .doc-logo-img{width:auto; max-width:132px; height:44px; flex:none; object-fit:contain; border-radius:6px;}
  .doc-org{font-weight:700; font-size:var(--fs-3); color:var(--text); line-height:1.2;}
  .doc-issuer-d{font-size:var(--fs-0); color:var(--muted); line-height:1.55; margin-top:4px;}
  .doc-id{text-align:right; flex:none;}
  .doc-kind{font-size:var(--fs-1); letter-spacing:.18em; font-weight:700;}
  .doc-num{font-size:var(--fs-5); font-weight:800; color:var(--text); line-height:1.1; margin:2px 0 7px;}
  .doc-status{font-size:var(--fs-0); font-weight:700; text-transform:uppercase; letter-spacing:.05em; padding:3px 9px; border-radius:var(--r-pill);}
  .doc-mid{display:flex; justify-content:space-between; gap:16px; background:var(--bg-3); border-radius:var(--r-md); padding:14px 16px; margin-bottom:18px;}
  .doc-lbl{font-size:var(--fs-0); text-transform:uppercase; letter-spacing:.08em; color:var(--faint); font-weight:700; margin-bottom:3px;}
  .doc-client{font-weight:700; font-size:var(--fs-3); color:var(--text);}
  .doc-when{text-align:right; font-size:var(--fs-2); color:var(--muted);} .doc-when b{color:var(--text);}
  .doc-tbl{width:100%; border-collapse:separate; border-spacing:0; font-size:var(--fs-2); margin-bottom:18px;}
  .doc-tbl th{text-align:left; font-size:var(--fs-0); text-transform:uppercase; letter-spacing:.07em; color:var(--muted); padding:9px 10px; background:var(--bg-3); font-weight:700;}
  .doc-tbl th:first-child{border-radius:var(--r-sm) 0 0 var(--r-sm);} .doc-tbl th:last-child{border-radius:0 var(--r-sm) var(--r-sm) 0;}
  .doc-tbl th.r,.doc-tbl td.r{text-align:right;}
  .doc-tbl td{padding:11px 10px; border-bottom:1px solid var(--hairline); color:var(--text); font-variant-numeric:tabular-nums; vertical-align:top;}
  .doc-tbl td.muted{color:var(--muted);}
  .doc-foot{display:flex; justify-content:space-between; gap:26px; align-items:flex-start;}
  .doc-terms{flex:1; min-width:0;}
  .doc-notes{font-size:var(--fs-1); color:var(--muted); line-height:1.55; white-space:pre-wrap; margin-top:2px;}
  .doc-tot{flex:0 0 262px;}
  .doc-tr{display:flex; justify-content:space-between; padding:5px 4px; font-size:var(--fs-2); font-variant-numeric:tabular-nums; color:var(--muted);}
  .doc-tr.small{font-size:var(--fs-0); padding-top:9px; justify-content:flex-end; color:var(--faint);}
  .doc-grandbox{display:flex; justify-content:space-between; align-items:center; color:#fff; border-radius:var(--r-md); padding:13px 15px; margin-top:9px; font-weight:700; font-size:var(--fs-3); font-variant-numeric:tabular-nums; box-shadow:var(--shadow-sm);}
  .doc-thanks{margin-top:24px; padding-top:14px; border-top:1px solid var(--hairline); font-size:var(--fs-1); color:var(--muted); text-align:center;}
  #printArea{position:fixed; left:-99999px; top:0;}
  @media print{
    body *{visibility:hidden !important;}
    #printArea, #printArea *{visibility:visible !important;}
    #printArea{left:0; top:0; width:100%; padding:24px 30px;}
    #printArea .doc-band{-webkit-print-color-adjust:exact; print-color-adjust:exact;}
    #printArea .doc-logo,#printArea .doc-grandbox,#printArea .doc-tbl th,#printArea .doc-mid{-webkit-print-color-adjust:exact; print-color-adjust:exact;}
    #printArea .doc-status{border:1px solid #d6d9e4;}
  }
  /* segmented tabs (Finance / future views) */
  .seg{display:inline-flex; background:var(--bg-3); border:1px solid var(--border); border-radius:var(--r-md); padding:3px; gap:2px; margin-bottom:18px;}
  .seg-btn{border:none; background:transparent; color:var(--muted); font-weight:500; padding:5px 14px; border-radius:var(--r-sm); cursor:pointer; font-size:var(--fs-1); display:flex; align-items:center; gap:6px;}
  /* The selected tile was white on a #EFEFF8 strip: ~1.09:1, invisible. A 1px
     interactive ring (3:1) marks the selection as structure, not weight. Audit A2. */
  .seg-btn.on{background:var(--bg-1); color:var(--text); box-shadow:0 0 0 1px var(--border-interactive), var(--shadow-sm);}
  /* The view switch sits in a page header, not above a list, so it carries no
     bottom gap of its own; and a parked option must LOOK parked. */
  /* Folded configuration on a create form. Closed by default, and it says how
     many fields it holds so nobody has to open it to find out. */
  .fadv{border:1px solid var(--border); border-radius:var(--r-md); margin:.5rem 0 .25rem;}
  .fadv > summary{cursor:pointer; padding:.5rem .75rem; font-size:var(--fs-1);
    color:var(--muted); font-weight:500; list-style:none;}
  .fadv > summary::-webkit-details-marker{display:none;}
  .fadv > summary::before{content:'▸'; display:inline-block; width:1.1ch; color:var(--faint);}
  .fadv[open] > summary::before{content:'▾';}
  .fadv[open] > summary{border-bottom:1px solid var(--border); color:var(--text);}
  .fadv-b{padding:.625rem .75rem .25rem;}
  /* ---- file explorer: two panes, sortable columns, real rows -------------
     Grid columns rather than flex, so Name/Type/Size/Modified line up down the
     whole list — a column that drifts row to row is the difference between a
     folder and a web page with rows in it. */
  /* Address bar: back, forward, up, the path, then the filter — the order and
     the places a file manager puts them. */
  .fx-nav{display:flex; align-items:center; gap:.35rem; margin-bottom:.5rem;
    flex:none; min-width:0;}
  .fx-nb{border:1px solid var(--border); background:var(--bg-1); color:var(--muted);
    border-radius:var(--r-sm); cursor:pointer; padding:.2rem .4rem; line-height:0;}
  .fx-nb:hover:not([disabled]){background:var(--bg-2); color:var(--text);}
  .fx-nb[disabled]{opacity:.35; cursor:default;}
  .fx-nav .fx-crumbs{flex:1; min-width:0; margin:0; overflow:hidden;}
  .fx-nav .fx-search{flex:0 0 auto; width:min(18rem,32%);}
  .fx-status{flex:none; padding:.3rem .25rem 0; font-size:var(--fs-0);
    color:var(--faint); border-top:1px solid var(--border); margin-top:.4rem;}
  /* Tree: a twisty you can open WITHOUT navigating, and a label that navigates. */
  .fx-tw{flex:none; width:1.1ch; cursor:pointer; color:var(--faint); font-size:var(--fs-0);}
  .fx-tw:hover{color:var(--text);}
  .fx-tt{display:flex; align-items:center; gap:.4rem; min-width:0; flex:1; cursor:pointer;}
  .fx-panes{display:grid; grid-template-columns:minmax(9rem,15rem) 1fr; gap:.75rem;
    flex:1; min-height:0;}
  .fx-tree{overflow:auto; min-height:0; border:1px solid var(--border);
    border-radius:var(--r-md); background:var(--bg-1); padding:.25rem 0;}
  .fx-tn{display:flex; align-items:center; gap:.3rem; padding:.25rem .4rem;
    font-size:var(--fs-1); color:var(--muted); white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis;}
  .fx-tn:hover{background:var(--bg-2); color:var(--text);}
  .fx-tn.on{background:var(--accent-subtle); color:var(--accent-text); font-weight:600;}
  /* The root is a place. It had no row, so standing at the top of the tree lit
     nothing up anywhere and there was no way to tell where you were. */
  .fx-troot{border-bottom:0.0625rem solid var(--border); margin-bottom:.25rem;
    padding-bottom:.35rem;}
  .fx-tl{overflow:hidden; text-overflow:ellipsis;}
  .fx-list{display:flex; flex-direction:column; min-height:0;
    border:1px solid var(--border); border-radius:var(--r-md); background:var(--bg-1);}
  /* ONE template, named once, used by the header and by every row.
     There were two: this one, and a later `.fxrow` rule with a completely
     different set of tracks. The header laid out on the first, the rows on the
     second, so NAME sat above nothing and TYPE floated somewhere near the
     middle of the row it was supposed to label. A column header that does not
     line up with its column is worse than none — it points at the wrong data. */
  .fx-head, .fxrow{display:grid; align-items:center;
    grid-template-columns:minmax(0,3fr) minmax(0,1fr) 5rem 9rem minmax(0,1fr) 2rem;
    gap:.5rem; padding:.35rem .625rem;}
  .fx-head{border-bottom:1px solid var(--border); position:sticky; top:0;
    background:var(--bg-1); z-index:1;}
  .fx-h{border:none; background:transparent; padding:0; text-align:left; cursor:pointer;
    font-size:var(--fs-0); text-transform:uppercase; letter-spacing:.04em;
    color:var(--faint); font-weight:600;}
  .fx-h:hover{color:var(--text);}
  .fx-body{overflow:auto; min-height:0; flex:1;}
  /* THE FILES CANVAS. Organizations has a canvas that draws organizations; this
     is the one that draws folders and files, and it lives inside Files — same
     breadcrumb, same tree pane, same clipboard. A tidy tree rather than a
     free-form graph on purpose: what a folder drawn as a map is FOR is the
     shape — how deep it goes and where the weight sits — and hand-placed cards
     answer none of that until somebody has arranged them. */
  .fx-map{padding:.75rem .5rem;}
  .fxm{display:flex; flex-direction:column; gap:.75rem; min-width:0;}
  .fxm-root{display:inline-flex; align-items:center; gap:.4rem; align-self:flex-start;
    padding:.35rem .7rem; border-radius:var(--r-pill);
    background:var(--accent-subtle); color:var(--accent-text); font-weight:600;}
  .fxm-branches{display:flex; flex-wrap:wrap; gap:.6rem; align-items:flex-start;}
  .fxm-br{display:flex; flex-direction:column; gap:.35rem; min-width:0;
    flex:0 1 14rem;}
  /* The stub that says these hang off the folder above, rather than floating. */
  .fxm-link{height:.6rem; width:0; margin-left:1rem;
    border-left:0.125rem solid var(--border);}
  .fxm-n{display:flex; align-items:center; gap:.45rem; min-width:0; width:100%;
    padding:.45rem .6rem; border:0.0625rem solid var(--border);
    border-radius:var(--r-md); background:var(--bg-1); color:var(--text);
    font:inherit; text-align:left; cursor:pointer;}
  .fxm-n:hover{border-color:var(--accent); background:var(--bg-2);}
  .fxm-n.sel{border-color:var(--accent); background:var(--accent-subtle);}
  .fxm-n.cutting{opacity:.55;}
  .fxm-i{flex:none; display:inline-flex;}
  .fxm-t{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis;
    white-space:nowrap;}
  .fxm-c{flex:none; font-size:var(--fs-0); color:var(--muted);
    font-variant-numeric:tabular-nums;}
  .fxm-sub{display:flex; flex-direction:column; gap:.25rem;
    margin-left:1rem; padding-left:.6rem;
    border-left:0.125rem solid var(--border);}
  .fxm-sm{padding:.25rem .5rem; font-size:var(--fs-1); background:transparent;}
  .fxm-more{font-size:var(--fs-0); color:var(--faint); padding-left:.5rem;}
  /* A folder that has not all arrived says so, with a way on. */
.fx-more{display:flex; align-items:center; gap:.6rem; justify-content:center;
  padding:.75rem; color:var(--muted); font-size:var(--fs-1);
  border-top:0.0625rem solid var(--border);}
.fx-empty{padding:1.5rem; color:var(--muted); text-align:center;}
  .fx-body:focus-visible{outline:2px solid var(--accent); outline-offset:-2px;}
  .fxrow{cursor:pointer; border-bottom:1px solid var(--border-soft, var(--border));}
  .fxrow:hover{background:var(--bg-2);}
  .fxrow.sel{background:var(--accent-subtle);}
  .fx-cname{display:flex; align-items:center; gap:.45rem; min-width:0;}
  .fx-name{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .fx-ctype,.fx-cwhen,.fx-cby{font-size:var(--fs-1); color:var(--muted);
    min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .fx-csize{font-size:var(--fs-1); color:var(--muted); text-align:right;
    font-variant-numeric:tabular-nums;}
  .fxrow .pill{flex:none; font-size:var(--fs-0); padding:0 .4rem;}
  .pill.ok{background:var(--ok-bg); color:var(--ok); border-color:transparent;}
  .pill.warn{background:var(--warn-bg); color:var(--warn); border-color:transparent;}
  .fx-det{opacity:0; border:none; background:transparent; padding:0; cursor:pointer;
    color:var(--muted);}
  .fxrow:hover .fx-det, .fxrow.sel .fx-det, .fx-det:focus-visible{opacity:1;}
  .fx-up{border:1px solid var(--border); background:var(--bg-1); border-radius:var(--r-sm);
    cursor:pointer; padding:.15rem .35rem; color:var(--muted);}
  .fx-up[disabled]{opacity:.4; cursor:not-allowed;}
  @media (max-width:48rem){ .fx-panes{grid-template-columns:1fr;} .fx-tree{display:none;}
    .fx-head,.fxrow{grid-template-columns:minmax(0,1fr) 5rem 2rem;}
    .fx-csize,.fx-cwhen,.fx-cby{display:none;} }
  /* Types shelf — what the permanent palette card used to hold, on demand. */
  .tym{max-height:50vh; overflow:auto;}
  .qchip.activef{background:var(--selected);}
  .qchip .pcount{margin-left:auto; font-size:var(--fs-0); color:var(--faint);
    cursor:pointer; padding:0 .25rem;}
  .qchip .pcount:hover{color:var(--text);}
  /* Analyse: the record's value beside the document's, so a person can see
     which one is right instead of being told. */
  .an-rec{border-top:1px solid var(--border); padding-top:.5rem; margin-top:.5rem;}
  .an-h{display:flex; align-items:baseline; gap:.5rem; font-weight:600;
    font-size:var(--fs-2); margin-bottom:.35rem;}
  .an-h .tiny{margin-left:auto;}
  /* Received / Sent: two states you can read without opening anything. */
  .an-way{display:inline-flex; border:1px solid var(--border); border-radius:var(--r-sm);
    overflow:hidden;}
  .an-w{border:none; background:var(--bg-1); color:var(--muted); cursor:pointer;
    padding:.15rem .45rem; font-size:var(--fs-0); white-space:nowrap;}
  .an-w+.an-w{border-left:1px solid var(--border);}
  .an-w:hover{background:var(--bg-2); color:var(--text);}
  .an-w.in.on{background:var(--warn-bg); color:var(--warn); font-weight:600;}
  .an-w.out.on{background:var(--ok-bg); color:var(--ok); font-weight:600;}
  .an-err{font-family:var(--font-mono); font-size:var(--fs-1); color:var(--danger);
    background:var(--danger-bg); border-radius:var(--r-sm); padding:.5rem .625rem;
    margin:.35rem 0; overflow-wrap:anywhere;}
  .an-f{display:flex; align-items:center; gap:.4rem; padding:.15rem 0;
    font-size:var(--fs-1); min-width:0;}
  .an-fn{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .an-old{color:var(--muted); text-decoration:line-through;}
  .an-new{color:var(--accent-text); font-weight:600;}
  .xfrow-stop{border:1px solid var(--border); background:var(--bg-1); color:var(--muted);
    border-radius:var(--r-sm); cursor:pointer; font-size:var(--fs-0);
    padding:.05rem .35rem; margin-left:.35rem;}
  .xfrow-stop:hover:not([disabled]){color:var(--danger); border-color:var(--danger);}
  .xfrow-stop[disabled]{opacity:.5; cursor:default;}
  .srt-n{margin:.5rem 0; font-size:var(--fs-2);}
  .srt-opt{display:flex; align-items:center; gap:.5rem; margin:.625rem 0 .25rem;
    font-size:var(--fs-1); color:var(--muted); cursor:pointer;}
  .srt-bar{height:.5rem; border-radius:var(--r-pill); background:var(--bg-3);
    overflow:hidden; margin:.5rem 0 .25rem;}
  .srt-fill{height:100%; background:var(--accent); transition:width .2s linear;}
  .srt-n b{color:var(--accent-text);}
  .fx-seg{margin-bottom:0;}
  .seg-btn[disabled]{opacity:.45; cursor:not-allowed;}
  .seg-n{font-size:var(--fs-0); background:var(--accent-subtle); color:var(--accent-text); border-radius:var(--r-pill); padding:0 6px; font-weight:600;}
  /* quote line-item builder */
  .ql-row{display:flex; gap:6px; margin-bottom:6px; align-items:center;}
  .ql-row .ql-desc{flex:1; min-width:0;} .ql-row .ql-qty{flex:0 0 58px;} .ql-row .ql-price{flex:0 0 92px;}
  .ql-row .ql-del{flex:none; width:30px; height:34px; border:1px solid var(--border); background:var(--bg-1); border-radius:var(--r-sm); cursor:pointer; color:var(--muted); font-size:var(--fs-3); line-height:1;}
  .ql-row .ql-del:hover{color:var(--danger); border-color:var(--danger);}
  /* CRM reports — pipeline bars + revenue snapshot */
  .rep-row{display:flex; align-items:center; gap:12px; padding:5px 0;}
  .rep-label{flex:0 0 134px; font-size:var(--fs-1); color:var(--text);}
  .rep-bar{flex:1; height:10px; background:var(--bg-3); border-radius:var(--r-pill); overflow:hidden;}
  .rep-fill{display:block; height:100%; background:var(--accent); border-radius:var(--r-pill);}
  .stagefill-won{background:var(--ok);} .stagefill-lost{background:var(--danger);} .stagefill-lead{background:var(--faint);}
  .rep-val{flex:0 0 96px; text-align:right; font-variant-numeric:tabular-nums; font-weight:600; color:var(--text); font-size:var(--fs-1);}
  .rep-snap{display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid var(--hairline);}
  .rep-snap:last-child{border-bottom:none;} .rep-snap strong{font-variant-numeric:tabular-nums;}
  /* Support desk — ticket status board + conversation */
  .prio.prio-medium{background:var(--info);} .prio.prio-critical{background:var(--danger);}
  .board.tickets{display:flex; gap:var(--sp-3); overflow-x:auto; align-items:flex-start; padding-bottom:8px;}
  .board.tickets .bcol{flex:0 0 244px;}
  .bcard.ticket .tk-top{display:flex; align-items:center; gap:8px; min-width:0;}
  .bcard.ticket .tk-top .bc-title{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .status-resolved .bcol-h>span:first-child{color:var(--ok);} .status-closed .bcol-h>span:first-child{color:var(--faint);}
  .tk-msg{padding:8px 11px; background:var(--bg-3); border-radius:var(--r-sm);}
  .tk-msg-h{display:flex; align-items:center; gap:8px; margin-bottom:3px;}
  /* People pillar */
  .ppl-sec{font-size:var(--fs-1); font-weight:700; color:var(--text); margin-bottom:10px; display:flex; align-items:center; gap:8px;}
  .ppl-org{font-size:var(--fs-1); font-weight:600; color:var(--muted); margin:16px 0 8px; display:flex; align-items:center; gap:8px;}
  .ppl-c{font-size:var(--fs-0); font-weight:600; color:var(--muted); background:var(--bg-3); border-radius:var(--r-pill); padding:1px 8px;}
  .ppl-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(258px,1fr)); gap:10px;}
  .ppl-card{display:flex; align-items:center; gap:12px; background:var(--bg-2); border:1px solid var(--border); box-shadow:var(--shadow-sm); border-radius:var(--r-lg); padding:13px 14px; min-width:0; transition:transform var(--dur-2) var(--ease-sun), box-shadow var(--dur-2) var(--ease-sun), border-color var(--dur-2) var(--ease-sun);}
  .ppl-card[data-click]{cursor:pointer;}
  .ppl-card[data-click]:hover{transform:translateY(-2px); box-shadow:var(--shadow-lg); border-color:var(--border-strong);}
  .ppl-av{width:42px; height:42px; border-radius:12px; flex:none; display:flex; align-items:center; justify-content:center; font-weight:640; font-size:var(--fs-3); color:#fff; letter-spacing:.02em; background:var(--accent);}
  .ppl-av-e{background:var(--ok);}
  /* deterministic gradient avatars (redesign) */
  .ppl-av.av-g1{background:linear-gradient(135deg,#5b6cff,var(--v-700));}
  .ppl-av.av-g2{background:linear-gradient(135deg,#19b56b,#0f9d58);}
  .ppl-av.av-g3{background:linear-gradient(135deg,#c85a95,#b0427c);}
  .ppl-av.av-g4{background:linear-gradient(135deg,#d08a2a,#b26a00);}
  .ppl-av.av-g5{background:linear-gradient(135deg,#2f97c9,#1f7aa8);}
  .ppl-av.av-g6{background:linear-gradient(135deg,#9a5fc9,#7d3faf);}
  .ppl-main{min-width:0; flex:1;}
  .ppl-name{font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .ppl-role{font-size:var(--fs-0); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-transform:capitalize;}
  .ppl-badge{flex:none; min-width:22px; height:22px; padding:0 6px; border-radius:var(--r-pill); background:var(--accent-subtle); color:var(--accent-text); font-size:var(--fs-1); font-weight:700; display:flex; align-items:center; justify-content:center;}
  /* People v2 — status, workload, person 360, teammate board */
  .ppl-hint{margin-bottom:12px;}
  .ppl-stat{font-size:var(--fs-0); font-weight:600; text-transform:uppercase; letter-spacing:.03em; padding:1px 6px; border-radius:var(--r-pill); margin-left:6px; vertical-align:middle;}
  .ppl-stat.st-on_leave{background:var(--warn-bg); color:var(--warn);} .ppl-stat.st-inactive{background:var(--bg-3); color:var(--muted);}
  .ppl-load{display:flex; align-items:center; gap:7px; flex:none;}
  .load-dot{width:9px; height:9px; border-radius:50%; flex:none;}
  .load-free{background:var(--border-strong);} .load-ok{background:var(--ok);} .load-busy{background:var(--warn);} .load-over{background:var(--danger);}
  .ppl-fields{display:grid; grid-template-columns:1fr 1fr; gap:9px 18px; margin-bottom:6px;}
  .pf{display:flex; flex-direction:column; gap:1px; min-width:0;}
  .pf-l{font-size:var(--fs-0); text-transform:uppercase; letter-spacing:.05em; color:var(--faint); font-weight:600;}
  .pf-v{color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .modal:has(.mini-board){width:min(840px,calc(100vw - 32px));}
  /* ---- employee profile (People) ---- */
  .modal:has(.pe-modal){width:min(720px,calc(100vw - 32px));}
  .pe-head{display:flex; align-items:center; gap:14px; padding-bottom:14px; margin-bottom:6px; border-bottom:1px solid var(--hairline);}
  .pe-av{width:52px; height:52px; font-size:var(--fs-4);}
  .pe-head-main{flex:1; min-width:0;}
  .pe-name{font-size:var(--fs-4); line-height:var(--lh-4); font-weight:600; color:var(--text);}
  .pe-sub{font-size:var(--fs-2); color:var(--muted); margin-top:1px;}
  .pe-badges{display:flex; gap:6px; align-items:center; margin-top:6px; flex-wrap:wrap;}
  .pe-badges .ppl-stat{margin-left:0;}
  .doc-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 10px; border:1px solid var(--border); border-radius:var(--r-sm); margin-bottom:6px; background:var(--bg-1);}
  .doc-name{display:flex; align-items:center; gap:7px; min-width:0; font-size:var(--fs-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .doc-acts{display:flex; gap:8px; align-items:center; flex:none;}
  .doc-acts a.sm{color:var(--accent-text); text-decoration:none;}
  .doc-upwrap{margin-top:8px;}
  .doc-up{cursor:pointer; display:inline-flex; align-items:center; gap:6px;}
  /* ---- user detail popup (User management) ---- */
  .ud-head .ud-role{font:inherit; font-size:var(--fs-1); font-weight:600; text-transform:capitalize; padding:5px 26px 5px 10px; border:1px solid var(--border-strong); border-radius:var(--r-pill); background:var(--bg-1); color:var(--text); cursor:pointer;}
  .ud-rolepill{text-transform:capitalize;}
  .ud-meta{display:flex; border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; margin:14px 0 4px; background:var(--bg-1);}
  .ud-m{flex:1; padding:11px 14px; display:flex; flex-direction:column; gap:2px; border-right:1px solid var(--border); min-width:0;}
  .ud-m:last-child{border-right:0;}
  .ud-ml{font-size:var(--fs-0); color:var(--faint); letter-spacing:.03em;}
  .ud-mv{font-size:var(--fs-3); font-weight:640; color:var(--text);}
  .ud-mv.ok{color:var(--ok);} .ud-mv.off{color:var(--danger);}
  .ud-actions{display:flex; gap:8px; flex-wrap:wrap; margin:12px 0 2px;}
  .btn-soft{border:1px solid var(--border-strong); background:var(--bg-1); color:var(--text); font:inherit; font-size:var(--fs-1); font-weight:540; padding:7px 11px; border-radius:var(--r-sm); cursor:pointer; display:inline-flex; align-items:center; gap:6px;}
  .btn-soft:hover{background:var(--hover);}
  .btn-soft.danger{color:var(--danger); border-color:rgba(214,47,36,.4);}
  .btn-soft.danger:hover{background:var(--danger-bg);}
  .ud-acc-list{display:flex; flex-direction:column; gap:7px;}
  .ud-acc{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 13px; border:1px solid var(--border); border-radius:var(--r-md); background:var(--bg-1);}
  .ud-acc-org{display:flex; align-items:center; gap:9px; font-weight:540; font-size:var(--fs-2); min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .ud-dot{width:8px; height:8px; border-radius:50%; background:var(--accent); flex:none;}
  .ud-acc-r{display:flex; align-items:center; gap:8px; flex:none;}
  .ud-lvl{font:inherit; font-size:var(--fs-1); padding:4px 8px; border:1px solid var(--border-strong); border-radius:var(--r-sm); background:var(--field-bg); color:var(--text); cursor:pointer;}
  .ud-x{border:0; background:none; color:var(--faint); cursor:pointer; padding:4px; border-radius:var(--r-sm); display:inline-flex;}
  .ud-x:hover{color:var(--danger); background:var(--danger-bg);}
  .ud-owner{background:var(--accent-subtle); color:var(--accent-text);}
  .ud-empty{padding:12px 13px; border:1px dashed var(--border); border-radius:var(--r-md);}
  .ud-grant{display:flex; gap:8px; align-items:center; margin-top:12px; padding-top:14px; border-top:1px solid var(--hairline);}
  .ud-grant select{flex:1; font:inherit; font-size:var(--fs-2); padding:7px 10px; border:1px solid var(--border-strong); border-radius:var(--r-sm); background:var(--field-bg); color:var(--text);}
  .ud-grant select:first-child{flex:2;}
  .pe-login{display:flex; align-items:center; gap:9px; font-size:var(--fs-2); cursor:pointer; padding:4px 0;}
  .pe-login input{width:16px; height:16px; flex:none; accent-color:var(--accent); cursor:pointer;}
  .rv-row{display:flex; align-items:center; gap:10px; padding:7px 10px; border:1px solid var(--border); border-radius:var(--r-sm); margin-bottom:6px; background:var(--bg-1);}
  .rv-main{min-width:0; flex:1;}
  .rv-t{font-size:var(--fs-2); font-weight:600; color:var(--text);}
  .rv-rate{font-size:var(--fs-0); font-weight:600; text-transform:uppercase; letter-spacing:.03em; padding:2px 7px; border-radius:var(--r-pill); flex:none; background:var(--bg-3); color:var(--muted);}
  .rv-rate.rr-exceptional,.rv-rate.rr-exceeds{background:var(--ok-bg); color:var(--ok);}
  .rv-rate.rr-meets{background:var(--info-bg); color:var(--info);}
  .rv-rate.rr-developing{background:var(--warn-bg); color:var(--warn);}
  .rv-rate.rr-below{background:var(--danger-bg); color:var(--danger);}
  .ss-stats{display:flex; gap:12px;}
  .ss-stat{flex:1; background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:12px 14px; display:flex; flex-direction:column; gap:2px;}
  .ss-n{font-size:var(--fs-5); line-height:1; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums;}
  .ss-n.ss-over{color:var(--danger);}
  /* absence calendar */
  .cal-head{display:flex; align-items:center; justify-content:center; gap:14px; margin-bottom:8px;}
  .cal-title{font-weight:600; font-size:var(--fs-2); min-width:150px; text-align:center;}
  .cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:4px;}
  .cal-dows{margin-bottom:4px;}
  .cal-dow{font-size:var(--fs-0); color:var(--faint); text-transform:uppercase; letter-spacing:var(--ls-caps); text-align:center; padding:2px 0;}
  .cal-cell{min-height:64px; border:1px solid var(--border); border-radius:var(--r-sm); padding:4px; background:var(--bg-1); display:flex; flex-direction:column; gap:2px; overflow:hidden;}
  .cal-cell.cal-out{background:var(--bg-3); opacity:.5;}
  .cal-cell.cal-today{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent);}
  .cal-d{font-size:var(--fs-0); color:var(--muted); font-variant-numeric:tabular-nums;}
  .cal-pill{font-size:var(--fs-0); line-height:1.4; padding:1px 5px; border-radius:var(--r-pill); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .cal-pill.cal-approved{background:var(--ok-bg); color:var(--ok);}
  .cal-pill.cal-pending{background:var(--warn-bg); color:var(--warn);}
  .board.mini-board{display:flex; gap:10px; overflow-x:auto; align-items:flex-start; padding-bottom:6px;}
  .board.mini-board .bcol{flex:0 0 190px;}
  /* Automation pillar */
  .auto-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:12px;}
  .auto-card{display:flex; gap:13px; background:var(--bg-1); border:1px solid var(--border); box-shadow:var(--shadow-sm); border-radius:var(--r-md); padding:16px;}
  .auto-ic{width:36px; height:36px; flex:none; border-radius:var(--r-sm); background:var(--accent-subtle); color:var(--accent-text); display:flex; align-items:center; justify-content:center;}
  .auto-main{min-width:0; flex:1;}
  .auto-t{font-weight:600; color:var(--text); display:flex; align-items:center; gap:8px; margin-bottom:4px;}
  .auto-on{font-size:var(--fs-0); font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ok); background:var(--ok-bg); border-radius:var(--r-pill); padding:1px 7px;}
  .auto-d{font-size:var(--fs-1); color:var(--muted); line-height:1.5;}
  .auto-act{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; padding-top:10px; border-top:1px solid var(--hairline);}
  .auto-stat{font-size:var(--fs-0); color:var(--muted);}
  .auto-card.off{opacity:.62;}
  .auto-on{cursor:pointer; user-select:none;}
  .auto-on.auto-paused{color:var(--muted); background:var(--bg-3);}
  /* rework: scheduled-run hint, per-rule buttons, run history, builder preview */
  .auto-hint{display:flex; align-items:center; gap:8px; font-size:var(--fs-1); color:var(--muted); background:var(--accent-subtle); border:1px solid var(--border); border-radius:var(--r-md); padding:9px 13px;}
  .auto-hint .ico{color:var(--accent); flex:none;}
  .auto-btns{display:flex; gap:6px; flex:none;}
  .auto-runs{display:flex; flex-direction:column; border:1px solid var(--hairline); border-radius:var(--r-md); overflow:hidden;}
  .auto-run{display:flex; align-items:center; gap:10px; padding:8px 13px; border-bottom:1px solid var(--hairline); font-size:var(--fs-1);}
  .auto-run:last-child{border-bottom:0;}
  .auto-run-ic{flex:none; color:var(--accent); display:flex;}
  .auto-run-tx{flex:1; min-width:0; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .auto-run-tm{flex:none; font-size:var(--fs-0); color:var(--faint); font-family:var(--font-mono);}
  .auto-prev{margin-top:8px; min-height:16px; line-height:1.45;}

  /* ==== company-OS pillar nav + hub + coming-soon ==== */
  .rail{overflow-y:auto; overflow-x:hidden;}
  .rail::-webkit-scrollbar{width:0;}
  .railnav{display:flex; flex-direction:column; align-items:center; gap:4px;}
  .railsep{width:22px; height:1px; background:var(--border); margin:7px 0; flex:none;}
  .railbtn .raildot{position:absolute; top:8px; right:9px; width:5px; height:5px; border-radius:50%; background:var(--faint);}
  .railbtn.active .raildot{background:var(--accent);}
  /* pillar hub grid (Home → "Company") */
  .dash-pillars{margin-top:var(--sp-5);}
  .pgrid{display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:4px; padding:6px 10px 12px;}
  .pcard{display:flex; align-items:center; gap:12px; text-align:left; background:transparent; border:none; border-radius:var(--r-sm); padding:11px 12px; cursor:pointer; min-width:0; transition:background-color var(--dur-1) var(--ease-sun);}
  .pcard:hover{background:var(--hover);}
  .pcard-ic{flex:none; width:36px; height:36px; border-radius:var(--r-sm); background:var(--bg-1); color:var(--accent-text); display:flex; align-items:center; justify-content:center;}
  .pcard-soon .pcard-ic{color:var(--muted);}
  .pcard-mid{display:flex; flex-direction:column; min-width:0; flex:1; gap:2px;}
  .pcard-t{font-size:var(--fs-2); font-weight:600; color:var(--text);}
  .pcard-d{font-size:var(--fs-0); color:var(--faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .pcard-badge{flex:none; align-self:center; font-size:var(--fs-0); color:var(--faint); font-family:var(--font-mono); border:1px solid var(--border); border-radius:var(--r-pill); padding:1px 8px;}
  .card2-note{letter-spacing:0; text-transform:none; font-family:var(--font-ui); font-size:var(--fs-1); color:var(--faint); font-weight:400; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0;}
  .ph-acts{display:flex; gap:8px; flex:none;}
  /* coming-soon pillar page */
  .soon{max-width:520px; margin:7vh auto 0; text-align:center; display:flex; flex-direction:column; align-items:center; gap:15px; padding:0 16px;}
  .soon-ic{width:64px; height:64px; border-radius:var(--r-md); background:var(--bg-2); color:var(--accent-text); display:flex; align-items:center; justify-content:center;}
  .soon h2{margin:0; font-size:var(--fs-5); font-weight:600; letter-spacing:-.02em;}
  .soon p{margin:0; color:var(--muted); font-size:var(--fs-3); line-height:1.6;}
  .soon-badge{font-size:var(--fs-0); font-family:var(--font-mono); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--accent-text); border:1px solid var(--border); border-radius:var(--r-pill); padding:4px 13px;}
  .soon-sub{font-size:var(--fs-1); color:var(--faint); max-width:430px; line-height:1.55;}

  /* ==== GLOBAL reduced-motion clamp (calm-precision graft) — keep LAST ==== */
  @media (prefers-reduced-motion: reduce){
    *,*::before,*::after{
      animation-duration:.01ms !important;
      animation-iteration-count:1 !important;
      transition-duration:.01ms !important;
    }
  }

/* type/line icons sitting inline where emoji used to be — nudge onto the text
   baseline (no effect inside flex rows like the rail/nav, which ignore it). */
svg.ico{vertical-align:-0.18em;}
.tic-emoji{font-size:var(--fs-3); line-height:1;}

/* ===================== Vault (password manager) ===================== */
/* hero security panel */
/* hero security strip — flat, fluid, wraps; children never grow/stretch (no fixed px) */
.vhero{display:flex;flex-wrap:wrap;align-items:center;align-content:center;gap:.55rem;padding:.65rem 1rem;margin-bottom:.9rem;border-radius:var(--r-md);background:var(--bg-2);border:1px solid var(--hairline);}
.vhero>*{flex:0 0 auto;align-self:center;}
.vhero-state{display:inline-flex;align-items:center;gap:.4rem;padding-right:.7rem;
  border-right:1px solid var(--hairline);font-size:.82rem;font-weight:700;letter-spacing:.01em;}
.vhero-state.ok{color:var(--ok);}
.vhero-state.warn{color:var(--warn);}
.vstat{display:inline-flex;align-items:center;gap:.4rem;padding:.35rem .75rem;border-radius:var(--r-pill);border:1px solid var(--hairline);background:var(--bg-1);cursor:pointer;line-height:1;transition:border-color .12s;}
.vstat:hover{border-color:var(--accent);}
.vstat.on{border-color:var(--accent);background:var(--accent-subtle);}
.vstat.vzero{opacity:.45;}
.vstat-n{font-size:.95rem;font-weight:800;}
.vstat-n.weak,.vstat-n.reused{color:var(--danger);}
.vstat-n.old,.vstat-n.no2fa{color:var(--warn);}
.vstat-l{font-size:.78rem;color:var(--muted);}
.vhero-meta{margin-left:auto;font-size:.78rem;color:var(--muted);}
/* toolbar */
.vtoolbar{display:flex;gap:10px;align-items:center;margin-bottom:12px;flex-wrap:wrap;}
.vtog{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:var(--r-sm);border:1px solid var(--hairline);background:var(--bg-2);color:var(--text);cursor:pointer;}
.vtog.on{border-color:var(--accent);color:var(--accent-text);background:var(--accent-subtle);}
/* two-pane workspace */
/* fluid two-pane: single column by default, list+detail when there's room (rem ranges, no fixed px) */
.vsplit{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem;align-items:start;}
.vlist{display:flex;flex-direction:column;gap:.45rem;min-width:0;}
.vdetail{min-width:0;border-radius:var(--r-md);}
@media(min-width:760px){
  .vsplit{grid-template-columns:minmax(15rem,21rem) minmax(0,1fr);}
  .vlist{max-height:calc(100vh - 16rem);overflow:auto;}
  .vdetail{position:sticky;top:0;}
}
/* org section header (a vault is grouped by organization) */
.vorg-h{display:flex;align-items:center;gap:7px;padding:10px 4px 4px;color:var(--muted);font-size:var(--fs-1);font-weight:600;text-transform:uppercase;letter-spacing:.04em;}
.vorg-h:first-child{padding-top:2px;}
.vorg-t{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.vorg-n{flex:none;background:var(--hover);color:var(--muted);border-radius:999px;padding:1px 7px;font-size:var(--fs-0);}
/* list rows (cards) */
.vrow{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:var(--r-md);background:var(--bg-2);border:1px solid var(--hairline);cursor:pointer;transition:border-color .12s,background .12s;}
.vrow:hover{border-color:var(--accent);background:var(--hover);}
.vrow.active{border-color:var(--accent);background:var(--accent-subtle);}
.vstar{flex:none;border:0;background:transparent;color:var(--muted);cursor:pointer;padding:2px;display:flex;}
.vstar.on{color:var(--warn);}
.vstar.on svg{fill:var(--warn);}
.vrow-ic{flex:none;width:30px;height:30px;border-radius:var(--r-sm);background:var(--accent-subtle);color:var(--accent-text);display:flex;align-items:center;justify-content:center;}
.vrow-main{flex:1;min-width:0;}
.vrow-t{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.vrow-sub{font-size:var(--fs-1);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.vrow-badges{display:flex;gap:5px;flex:none;align-items:center;}
.vdot{width:8px;height:8px;border-radius:50%;display:inline-block;}
.vdot.weak,.vdot.reused{background:var(--danger);}
.vdot.old,.vdot.no2fa{background:var(--warn);}
.vrow-copy{flex:none;}
.vbadge{font-size:var(--fs-0);font-weight:600;padding:2px 7px;border-radius:999px;background:var(--hover);color:var(--muted);white-space:nowrap;}
.vbadge.weak,.vbadge.reused{background:var(--danger-bg);color:var(--danger);}
.vbadge.old,.vbadge.no2fa{background:var(--warn-bg);color:var(--warn);}
.vbadge.ok{background:var(--ok-bg);color:var(--ok);}
.vact{border:0;background:transparent;color:var(--muted);cursor:pointer;padding:6px;border-radius:var(--r-sm);display:flex;}
.vact:hover{background:var(--hover);color:var(--accent-text);}
/* detail pane */
.vd{background:var(--bg-2);border:1px solid var(--hairline);border-radius:var(--r-md);padding:18px 20px;}
.vd-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;color:var(--muted);min-height:260px;padding:40px;border:1px dashed var(--hairline);border-radius:var(--r-md);}
.vd-back{display:none;align-items:center;gap:6px;border:0;background:transparent;color:var(--accent-text);cursor:pointer;padding:0 0 10px;}
.vd-head{display:flex;align-items:center;gap:12px;margin-bottom:10px;}
.vd-ic{flex:none;width:36px;height:36px;border-radius:var(--r-sm);background:var(--accent-subtle);color:var(--accent-text);display:flex;align-items:center;justify-content:center;}
.vd-h-main{flex:1;min-width:0;}
.vd-title{font-size:var(--fs-4);font-weight:700;}
.vd-flags{display:flex;gap:5px;margin-bottom:10px;flex-wrap:wrap;}
.vd-row{display:flex;align-items:center;gap:10px;padding:11px 0;border-top:1px solid var(--hairline);}
.vd-k{flex:0 0 92px;font-size:var(--fs-1);color:var(--muted);}
.vd-v{flex:1;min-width:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;word-break:break-word;}
.vd-a{flex:none;display:flex;gap:2px;}
.mono{font-family:monospace;}
.vd-secret{font-family:monospace;font-size:var(--fs-2);color:var(--text);word-break:break-all;}
.vd-meter{display:inline-flex;align-items:center;}
.vd-link{color:var(--accent-text);text-decoration:none;}
.vd-link:hover{text-decoration:underline;}
.vd-notes{padding:11px 0;border-top:1px solid var(--hairline);}
.vd-notes .vd-val{display:block;margin-top:4px;white-space:pre-wrap;}
.vd-totp{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.vd-totp-code{font-size:var(--fs-5);font-weight:800;letter-spacing:2px;font-variant-numeric:tabular-nums;}
.vd-totp-bar{width:80px;height:4px;border-radius:2px;background:var(--hover);overflow:hidden;}
.vd-totp-fill{display:block;height:100%;background:var(--accent);transition:width 1s linear;}
.vd-foot{display:flex;align-items:center;gap:8px;margin-top:14px;padding-top:14px;border-top:1px solid var(--hairline);}
/* narrow: one column — selecting an item swaps the list for the detail (+ Back) */
@media(max-width:759px){
  .vsplit.show-detail .vlist{display:none;}
  .vd-back{display:flex;}
}
.totp-box{text-align:center;margin:14px 0;}
.totp-code{font-size:var(--fs-6);font-weight:800;letter-spacing:3px;font-variant-numeric:tabular-nums;}
.totp-bar{height:4px;border-radius:2px;background:var(--hover);margin-top:10px;overflow:hidden;}
.totp-fill{height:100%;background:var(--accent);transition:width 1s linear;}
.pwmeter{display:inline-flex;gap:4px;vertical-align:middle;}
.pwmeter .mseg{width:30px;height:5px;border-radius:3px;background:var(--hover);}
.mseg.s0,.mseg.s1{background:var(--danger);}
.mseg.s2{background:var(--warn);}
.mseg.s3{background:var(--accent);}
.mseg.s4{background:var(--ok);}
.pwmeter-l{font-size:var(--fs-1);margin-left:8px;color:var(--muted);}
#vc_meter{margin:6px 0 2px;display:flex;align-items:center;min-height:14px;}
.vpw{display:flex;gap:6px;align-items:center;}
.vpw input{flex:1;}
.vpw-btn{flex:none;border:1px solid var(--hairline);background:var(--bg-2);color:var(--muted);border-radius:var(--r-sm);padding:8px;cursor:pointer;display:flex;}
.vpw-btn:hover{color:var(--accent-text);border-color:var(--accent);}
.vgenpanel{max-height:0;overflow:hidden;transition:max-height .2s;}
.vgenpanel.open{max-height:150px;margin:8px 0;}
.vgrow{display:flex;align-items:center;gap:10px;margin:6px 0;}
.vgrow input[type=range]{flex:1;}
.vgchecks{flex-wrap:wrap;}
.vgck{display:inline-flex;align-items:center;gap:4px;font-size:var(--fs-1);color:var(--muted);}
.vhrow{margin-top:10px;}
.vhist{display:flex;flex-direction:column;gap:6px;margin-top:6px;}
.vhist-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 10px;background:var(--bg-2);border-radius:var(--r-sm);}
.vhist-val{font-family:monospace;font-size:var(--fs-2);color:var(--text);word-break:break-all;}

/* ===================== People / HR (org chart, time off, onboarding, goals) ===================== */
/* org chart — indented reporting tree (fluid, mobile-friendly) */
.orgchart{margin:6px 0 18px;}
.oc-card{display:flex; align-items:center; gap:9px; width:100%; text-align:left; padding:8px 12px; border:1px solid var(--hairline); border-radius:var(--r-md); background:var(--bg-2); cursor:pointer; margin:3px 0;}
.oc-card:hover{border-color:var(--accent); background:var(--hover);}
.oc-av{flex:none; width:30px; height:30px; border-radius:var(--r-pill); background:var(--accent-subtle); color:var(--accent-text); display:flex; align-items:center; justify-content:center; font-weight:600;}
.oc-main{flex:1; min-width:0; display:flex; flex-direction:column;}
.oc-name{font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.oc-role{font-size:var(--fs-1); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.oc-n{flex:none; background:var(--hover); color:var(--muted); border-radius:var(--r-pill); padding:1px 8px; font-size:var(--fs-0);}
.oc-children{margin-left:1.25rem; padding-left:.9rem; border-left:2px solid var(--hairline);}
/* time off */
.to-head{margin-bottom:10px;}
.to-bals{display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:10px; margin-bottom:8px;}
.to-bal{padding:12px 14px; border:1px solid var(--hairline); border-radius:var(--r-md); background:var(--bg-2);}
.to-bal-top{display:flex; align-items:baseline; gap:6px;}
.to-bal-n{font-size:1.4rem; font-weight:800;}
.to-bal-name{font-weight:600; margin:2px 0 6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.to-bar{height:5px; border-radius:3px; background:var(--hover); overflow:hidden; margin-bottom:4px;}
.to-bar>span{display:block; height:100%; background:var(--accent);}
.to-list{display:flex; flex-direction:column; gap:7px;}
.to-row{display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--hairline); border-radius:var(--r-md); background:var(--bg-2); flex-wrap:wrap;}
.to-kind{flex:none; font-size:var(--fs-0); font-weight:700; text-transform:uppercase; letter-spacing:.03em; padding:2px 8px; border-radius:var(--r-pill); background:var(--hover); color:var(--muted);}
.to-kind.k-vacation{background:var(--accent-subtle); color:var(--accent-text);}
.to-kind.k-sick{background:var(--danger-bg); color:var(--danger);}
.to-kind.k-personal{background:var(--warn-bg); color:var(--warn);}
.to-main{flex:1; min-width:120px;}
.to-who{font-weight:600;}
.to-status{flex:none; font-size:var(--fs-0); font-weight:700; padding:2px 9px; border-radius:var(--r-pill);}
.to-pending{background:var(--warn-bg); color:var(--warn);}
.to-approved{background:var(--ok-bg); color:var(--ok);}
.to-declined{background:var(--danger-bg); color:var(--danger);}
.to-acts{display:flex; gap:5px; flex:none;}
/* onboarding checklist */
.onb{border:1px solid var(--hairline); border-radius:var(--r-md); padding:10px 12px; background:var(--bg-2);}
.onb-head{display:flex; align-items:center; gap:10px; margin-bottom:8px;}
.onb-bar{flex:1; height:5px; border-radius:3px; background:var(--hover); overflow:hidden;}
.onb-bar>span{display:block; height:100%; background:var(--ok);}
.onb-item{display:flex; align-items:center; gap:9px; padding:4px 0; cursor:pointer;}
.onb-done{color:var(--muted); text-decoration:line-through;}
/* goals */
.goal-row{display:flex; align-items:center; gap:10px; padding:6px 0;}
.goal-name{flex:1; min-width:0;}
.goal-name.done{color:var(--muted); text-decoration:line-through;}
.goal-st{flex:none;}

/* ===================== Finance v3 (ledger / journal / budget) ===================== */
.seg.seg-wrap{flex-wrap:wrap;}
.trow-amt{flex:none; font-weight:600; white-space:nowrap;}
/* journal-entry line builder */
.jl-head{display:grid; grid-template-columns:1fr 110px 110px; gap:8px; font-size:var(--fs-1); color:var(--muted); font-weight:600; margin:8px 0 4px; padding:0 2px;}
.jl-row{display:grid; grid-template-columns:1fr 110px 110px; gap:8px; margin-bottom:6px;}
.jl-row select, .jl-row input{min-width:0;}
.jl-head.bg-head{grid-template-columns:1fr 130px;}
.bg-row{display:grid; grid-template-columns:1fr 130px; gap:8px; margin-bottom:6px;}
.bg-row input{min-width:0;}

/* ===================== Tasks / Project management ===================== */
.tk-sprint{font-size:var(--fs-0); font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--accent-text); margin-bottom:3px;}
.tk-labels{display:flex; gap:4px; flex-wrap:wrap; margin:3px 0;}
.tk-label{font-size:var(--fs-0); font-weight:600; padding:1px 6px; border-radius:var(--r-pill); background:var(--accent-subtle); color:var(--accent-text);}
.tk-time{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.tk-time input{width:80px;}
.dep-row{display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid var(--hairline);}
.dep-row span:first-child{flex:1; min-width:0;}
/* gantt / timeline */
.gantt{margin-top:14px; border:1px solid var(--hairline); border-radius:var(--r-md); overflow:hidden;}
.gantt-row{display:grid; grid-template-columns:minmax(120px,200px) 1fr; gap:0; align-items:center; border-bottom:1px solid var(--hairline); cursor:pointer;}
.gantt-row:last-child{border-bottom:0;}
.gantt-row:hover{background:var(--hover);}
.gantt-head{background:var(--bg-2); cursor:default; font-weight:600;}
.gantt-head:hover{background:var(--bg-2);}
.gantt-lbl{padding:9px 12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; border-right:1px solid var(--hairline);}
.gantt-track{position:relative; height:34px; padding:0 8px;}
.gantt-bar{position:absolute; top:7px; height:20px; min-width:8px; border-radius:5px; background:var(--accent); color:#fff; font-size:var(--fs-0); line-height:20px; padding:0 6px; white-space:nowrap; overflow:hidden; box-shadow:var(--shadow-sm);}
/* Dependencies on the timeline. A task that starts before the thing it waits on
   is finished is the only state worth colouring here — everything else is on
   schedule, and colouring "fine" teaches people to ignore the colour. */
.gantt-warn{display:flex; gap:12px; align-items:center; flex-wrap:wrap;
  margin:12px 0 4px; padding:9px 12px; border-radius:var(--r-md);
  background:var(--warn-bg); color:var(--warn); font-size:var(--fs-2);}
.gantt-warn button{flex:none;}
.gantt-row.conflict .gantt-lbl{color:var(--warn);}
.gantt-dep{display:inline-flex; align-items:center; gap:3px; margin-right:5px;
  font-size:var(--fs-0); font-weight:700; opacity:.75; vertical-align:middle;}
.gantt-dep.bad{color:var(--warn); opacity:1;}
.gantt-bar.bar-bad{background:var(--warn); box-shadow:none;}
.gantt-fix{position:absolute; right:8px; top:6px; height:22px; padding:0 8px;
  font-size:var(--fs-0); font-weight:600; border:1px solid var(--warn); color:var(--warn);
  background:transparent; border-radius:var(--r-pill); cursor:pointer; white-space:nowrap;}
.gantt-fix:hover{background:var(--warn); color:#fff;}
.gantt-bar.prio-urgent,.gantt-bar.prio-high{background:var(--danger);}
.gantt-bar.prio-med{background:var(--accent);}
.gantt-bar.prio-low{background:var(--muted);}
/* projects */
.proj-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; margin-top:14px;}
.proj-card{padding:14px; border:1px solid var(--hairline); border-radius:var(--r-md); background:var(--bg-2);}
.proj-top{display:flex; align-items:center; gap:8px; margin-bottom:4px;}
.proj-dot{width:10px; height:10px; border-radius:50%; flex:none;}
.proj-name{flex:1; min-width:0; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}

/* ===================== Support / help desk ===================== */
.sla-badge{font-size:var(--fs-0); font-weight:700; padding:1px 7px; border-radius:var(--r-pill); background:var(--ok-bg); color:var(--ok);}
.sla-badge.soon{background:var(--warn-bg); color:var(--warn);}
.sla-badge.breach{background:var(--danger-bg); color:var(--danger);}
.chan-tag{font-size:var(--fs-0); font-weight:600; padding:1px 6px; border-radius:var(--r-pill); background:var(--hover); color:var(--muted); text-transform:capitalize;}
.tk-unassigned{font-style:italic; opacity:.7;}
/* Knowledge base: the article list, on the agent desk and in the reply box. */
.kb-search{display:flex; gap:8px; align-items:center; margin-top:12px; flex-wrap:wrap;}
.kb-search input{flex:1; min-width:180px;}
.kb-list{display:flex; flex-direction:column; gap:2px; margin-top:8px;}
.kb-row{display:flex; gap:10px; align-items:center; justify-content:space-between;
  padding:9px 10px; border:1px solid var(--border); border-radius:var(--r-md);}
.kb-row:hover{background:var(--hover);}
.kb-main{flex:1; min-width:0; cursor:pointer;}
.kb-title{font-weight:600; font-size:var(--fs-2);}
.kb-row button{flex:none;}
.kb-row button.kb-on{border-color:var(--ok); color:var(--ok);}
.kb-panel{margin-top:10px; padding:10px; border:1px solid var(--border);
  border-radius:var(--r-md); background:var(--hover);}
/* Shown when a total was computed from a capped scan. Deliberately not styled
   as an error: nothing is broken, the number is simply not the whole number,
   and a reader has to be told that before they act on it. */
/* Dragging an appointment to another day. Only events move: everything else on
   this calendar is a projection of a date that belongs to another record. */
/* The address plan. Monospace addresses, because a column of IPs that does not
   line up is a column nobody scans. */
/* The vault's honest description of itself. Quiet by design: it is a fact a
   customer needs before they decide what to keep here, not a warning. */
.ipam-free{display:flex; flex-wrap:wrap; gap:5px; margin-top:6px;}
.ipam-free code{font-size:var(--fs-0); padding:1px 5px; border-radius:var(--r-sm);
  background:var(--hover); color:var(--muted);}
.ipam-holder{cursor:pointer;}
.ipam-holder:hover{text-decoration:underline;}
.cal-movable{cursor:grab;}
.cal-movable:active{cursor:grabbing;}
.cal-dragging{opacity:.45;}
.cal-drop{outline:2px dashed var(--accent); outline-offset:-2px;
  background:var(--accent-subtle, var(--hover));}
.partial-warn{display:flex; gap:8px; align-items:flex-start; margin:12px 0;
  padding:10px 12px; border-radius:var(--r-md);
  background:var(--warn-bg); color:var(--warn); font-size:var(--fs-2); line-height:1.5;}
/* The customer spoke last and we have not answered. Reads as a duty, not
   as decoration, so it borrows the warning colour rather than the accent. */
.tk-waiting{font-size:var(--fs-0); letter-spacing:.04em; text-transform:uppercase;
  font-weight:700; padding:1px 6px; border-radius:999px;
  color:var(--warn,#c2410c); border:1px solid currentColor; opacity:.9;}

/* ===================== Calendar: week + agenda views ===================== */
.cal-week{display:grid; grid-template-columns:repeat(7,1fr); gap:6px; margin-top:12px;}
.cal-wcol{border:1px solid var(--hairline); border-radius:var(--r-sm); background:var(--bg-2); min-height:240px; display:flex; flex-direction:column;}
.cal-wcol.cal-today{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset;}
.cal-wh{display:flex; align-items:center; justify-content:space-between; padding:6px 8px; border-bottom:1px solid var(--hairline); font-size:var(--fs-1); color:var(--muted); font-weight:600;}
.cal-wbody{flex:1; padding:5px; display:flex; flex-direction:column; gap:4px; overflow:auto;}
.agenda{margin-top:12px; border:1px solid var(--hairline); border-radius:var(--r-md); overflow:hidden;}
.ag-day{padding:8px 14px; background:var(--bg-2); font-weight:700; font-size:var(--fs-1); color:var(--muted); text-transform:uppercase; letter-spacing:.03em; border-bottom:1px solid var(--hairline);}
.ag-row{display:flex; align-items:center; gap:10px; padding:9px 14px; border-bottom:1px solid var(--hairline); cursor:pointer;}
.ag-row:hover{background:var(--hover);}
.ag-row .cc-dot{width:8px; height:8px; border-radius:50%; flex:none; background:var(--accent);}
.ag-row.k-event .cc-dot{background:var(--ok);} .ag-row.k-task .cc-dot{background:var(--info);}
.ag-row.k-deal .cc-dot{background:var(--accent);} .ag-row.k-expiry .cc-dot{background:var(--warn);}
.ag-row.k-invoice .cc-dot{background:#8b5cf6;} .ag-row.k-timeoff .cc-dot{background:#14b8a6;}
.ag-t{flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:500;}

/* ===================== Home command center ===================== */
.cc-strip{display:grid; grid-template-columns:repeat(auto-fit,minmax(148px,1fr)); gap:10px; margin-bottom:8px;}
/* The "at a glance" strip is a dense summary band — tighter than the big
   "My work" KPIs below it, so 8 tiles read as one scan. */
.cc-kpi{padding:13px 15px; gap:7px; cursor:pointer;}
.cc-kpi .k-n{font-size:var(--fs-4);}
.cc-kpi:hover{box-shadow:var(--shadow); border-color:var(--accent);}
@media(max-width:520px){ .cc-strip{grid-template-columns:1fr 1fr; gap:8px;} .cc-kpi{padding:11px 12px;} .cc-kpi .k-n{font-size:var(--fs-4);} }

/* A11y + theme: a single visible focus ring for keyboard users across the
   interactive tiles/rows that are plain divs (they had none — only inputs did).
   :focus-visible keeps it keyboard-only, never on mouse click. */
.kpi:focus-visible, .cc-kpi:focus-visible, .trow:focus-visible, .arow:focus-visible,
.ast-row:focus-visible, .ast-sugg:focus-visible, .card2-act:focus-visible,
.seg-btn:focus-visible, [role="button"]:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px; border-radius:var(--r-sm);
}

/* ===================== User management ===================== */
.um-list{display:flex; flex-direction:column; border:1px solid var(--hairline); border-radius:var(--r-md); overflow:hidden; margin-top:4px;}
.um-row{display:grid; grid-template-columns:minmax(0,2.4fr) 130px 60px 120px minmax(0,1.3fr); gap:10px; align-items:center; padding:9px 14px; border-bottom:1px solid var(--hairline);}
.um-row:last-child{border-bottom:0;}
.um-head{background:var(--bg-2); font-size:var(--fs-1); font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.03em;}
.um-off{opacity:.6;}
.um-user{display:flex; align-items:center; gap:10px; min-width:0;}
.um-user.um-clk{cursor:pointer; border-radius:var(--r-sm);}
.um-user.um-clk:hover .um-name{color:var(--accent-text);}
.um-av{flex:none; width:32px; height:32px; border-radius:var(--r-pill); background:var(--accent-subtle); color:var(--accent-text); display:flex; align-items:center; justify-content:center; font-weight:600;}
.um-main{display:flex; flex-direction:column; min-width:0;}
.um-name{font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.um-email{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.um-acts{display:flex; align-items:center; gap:5px; justify-content:flex-end;}
.um-legend{display:flex; gap:18px; flex-wrap:wrap; margin-top:14px; font-size:var(--fs-1); color:var(--muted);}
.um-legend b{color:var(--text); text-transform:capitalize;}
@media(max-width:760px){
  .um-head{display:none;}
  .um-row{grid-template-columns:1fr; gap:6px; padding:11px 14px;}
  .um-acts{justify-content:flex-start;}
}

/* ===================== Ticket: internal notes + reply toggle ===================== */
.tk-internal{background:var(--warn-subtle,#fff8e1); border-left:2px solid var(--warn,#f5b83d); padding-left:8px;}
.tk-note-tag{font-size:var(--fs-0); font-weight:600; text-transform:uppercase; letter-spacing:.03em; color:var(--warn,#b8860b); background:var(--warn-subtle,#fff3cd); padding:1px 6px; border-radius:var(--r-pill); vertical-align:middle;}
.tk-intog{display:inline-flex; align-items:center; gap:4px; flex:none; color:var(--muted); white-space:nowrap; cursor:pointer; user-select:none;}
.tk-intog input{width:auto; margin:0;}

/* ===================== AI Assistant (#/assistant) ===================== */
.ast{display:flex; gap:14px; height:calc(100vh - 210px); min-height:420px;}
.ast-side{flex:0 0 258px; display:flex; flex-direction:column; padding:0; overflow:hidden;}
.ast-side-h{padding:11px 14px; font-size:var(--fs-0); font-weight:700; letter-spacing:.05em; text-transform:uppercase; opacity:.55; border-bottom:1px solid var(--border);}
.ast-list{flex:1; min-height:0; overflow-y:auto; padding:6px;}
.ast-empty-side{padding:14px; font-size:var(--fs-1); opacity:.55;}
.ast-row{display:flex; align-items:center; gap:6px; padding:8px 10px; border-radius:var(--r-md); cursor:pointer;}
.ast-row:hover{background:var(--hover);}
.ast-row.on{background:var(--bg-3); border:1px solid var(--border);}
.ast-row-mid{flex:1; min-width:0;}
.ast-row-t{font-size:var(--fs-1); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.ast-row-s{font-size:var(--fs-0); opacity:.5; font-family:var(--font-mono);}
.ast-del{opacity:0; width:24px; height:24px; display:flex; align-items:center; justify-content:center; border-radius:var(--r-sm); color:var(--text); flex:none; background:none; border:none; cursor:pointer;}
.ast-row:hover .ast-del{opacity:.55;}
.ast-del:hover{opacity:1; background:var(--bg-2);}
.ast-main{flex:1; min-width:0; display:flex; flex-direction:column; padding:0; overflow:hidden;}
.ast-head{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 16px; border-bottom:1px solid var(--border); flex:none;}
.ast-head-t{font-weight:700; font-size:var(--fs-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.ast-head-r{display:flex; align-items:center; gap:8px; flex:none;}
.ast-head-m{font-size:var(--fs-0); opacity:.42; font-family:var(--font-mono);}
.ast-head-b{display:inline-flex; align-items:center; gap:3px; font-size:var(--fs-0); font-weight:700; letter-spacing:.03em; text-transform:uppercase; color:var(--accent-text); background:var(--accent-subtle); border-radius:var(--r-pill); padding:2px 8px 2px 6px;}
.ast-msgs{flex:1; min-height:0;}
/* 700 — under supervision: tabs, live journal, proposals, ledger — all inside the panel */
.ast-tabs{display:flex; gap:.125rem; padding:.25rem .625rem 0; border-bottom:1px solid var(--border); flex:none;}
.ast-tab{background:none; border:0; border-bottom:2px solid transparent; padding:.375rem .625rem; font-size:var(--fs-1); color:var(--muted); cursor:pointer; border-radius:0;}
.ast-tab.on{color:var(--accent-text); border-bottom-color:var(--accent);}
.ast-tab-n{display:inline-block; min-width:1.2rem; padding:0 .35rem; border-radius:var(--r-pill); background:var(--accent); color:#fff; font-size:var(--fs-0); text-align:center;}
.ast-journal{display:grid; gap:.125rem; margin-top:.25rem; border-left:2px solid var(--accent-subtle,var(--border)); padding-left:.5rem; font-size:var(--fs-1);}
.ast-step{display:flex; gap:.5rem; align-items:baseline;} .ast-step .k{font-family:var(--font-mono); font-size:var(--fs-0); color:var(--faint); min-width:3.2em;}
.ast-step.propose{color:var(--accent-text);} .ast-step.stop,.ast-step.failed{color:var(--danger,#A12B2B);}
.ast-props{padding:.625rem .75rem; display:grid; gap:.5rem; align-content:start;}
.ast-prop{border:1px solid var(--border); border-radius:var(--r-md); padding:.5rem .625rem; background:var(--bg-2);}
.ast-prop-h{display:flex; justify-content:space-between; gap:.5rem; align-items:center; font-size:var(--fs-1);}
.ast-prop-acts{display:flex; gap:.375rem; margin-top:.375rem;} .ast-prop-all{display:flex; justify-content:space-between; align-items:center; gap:.5rem; font-size:var(--fs-1); color:var(--muted);}
/* 723 (SEC-13) — the whole proposal, scrollable */
.ast-args{margin:.25rem 0 0; max-height:16rem; overflow:auto; padding:.375rem .5rem; background:var(--bg-3); border:1px solid var(--border); border-radius:var(--r-sm, .25rem); font:var(--fs-1)/1.45 ui-monospace,Menlo,Consolas,monospace; white-space:pre-wrap; overflow-wrap:anywhere;}
.ast-fields{display:grid; grid-template-columns:max-content 1fr; gap:.0625rem .625rem; margin:.25rem 0 0; font-size:var(--fs-1);} .ast-fields dt{color:var(--muted);} .ast-fields dd{margin:0; font-variant-numeric:tabular-nums; word-break:break-word;}
.ast-pill{font-size:var(--fs-0); padding:.0625rem .5rem; border-radius:var(--r-pill); white-space:nowrap; background:var(--bg-3); color:var(--muted);}
.ast-pill.proposed{background:#FFF3D6; color:#8A5A00;} .ast-pill.approved{background:#E6F4EC; color:#1E7F4F;} .ast-pill.refused,.ast-pill.failed{background:#FBE8E8; color:#A12B2B;}

/* Assistant bubbles: indigo accent (override the dock chat's cyan .msg.me). */
.ast-msgs .msg.me{background:var(--accent-subtle); border-color:var(--accent); color:var(--text);}
.ast-msgs .msg.me .mtxt a{color:var(--accent-text);}
.ast-msgs .msg.them{background:var(--bg-2);}
.ast-welcome,.ast-notice{margin:auto; text-align:center; max-width:480px; padding:40px 24px; opacity:.95;}
.ast-welcome h3,.ast-notice h3{margin:12px 0 6px; font-size:var(--fs-3);}
.ast-welcome p,.ast-notice p{font-size:var(--fs-1); opacity:.6; line-height:1.5;}
.ast-notice code{background:var(--bg-3); padding:1px 5px; border-radius:var(--r-sm); font-family:var(--font-mono); font-size:.9em;}
.ast-suggs{display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:20px; text-align:left;}
.ast-sugg{display:flex; align-items:center; gap:9px; padding:11px 13px; border-radius:var(--r-md); background:var(--bg-2); border:1px solid var(--border); color:var(--text); font-size:var(--fs-1); line-height:1.35; cursor:pointer; transition:background var(--motion,.15s), border-color var(--motion,.15s);}
.ast-sugg:hover{background:var(--hover); border-color:var(--border-strong);}
.ast-sugg .ico{flex:none; color:var(--accent); opacity:.85;}
@media(max-width:560px){ .ast-suggs{grid-template-columns:1fr;} }
.ast-compose{display:flex; gap:8px; padding:10px 12px; border-top:1px solid var(--border); flex:none; align-items:flex-end;}
.ast-compose textarea{flex:1; resize:none; min-height:40px; max-height:160px; padding:9px 12px; border-radius:var(--r-sm); background:var(--bg-2); border:1px solid var(--border); color:var(--text); font:inherit; line-height:1.4;}
.ast-compose textarea:focus{outline:none; border-color:var(--accent);}
.ast-send{flex:none; width:40px; height:40px; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center; font-size:var(--fs-3);}
.ast-send:disabled{opacity:.5; cursor:default;}
.ast-dots{display:flex; gap:4px; padding:4px 2px;}
.ast-dots span{width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.4; animation:astdot 1s infinite ease-in-out;}
.ast-dots span:nth-child(2){animation-delay:.15s;}
.ast-dots span:nth-child(3){animation-delay:.3s;}
@keyframes astdot{0%,60%,100%{opacity:.25; transform:translateY(0);} 30%{opacity:.9; transform:translateY(-3px);}}
@media(max-width:820px){ .ast{flex-direction:column; height:auto;} .ast-side{flex:none; max-height:190px;} .ast-main{min-height:62vh;} }

/* ==== Home: action queue + KPI band =======================================
   Every class here is prefixed `h`. The obvious names — .q .band .mini .pill
   .sec .cols .up — are ALL already taken in this codebase (.pill has 13 call
   sites, .sec has 32), and bare-class collisions have broken this app three
   times (.me, .ghost, .empty, and .soon earlier today). Do not "simplify"
   these names.
   The queue leads the page: you open Solar to see what needs doing, not to
   read a report. The band underneath carries trend, so the numbers say which
   way things are moving rather than just where they stand. */
.hqueue{border:1px solid var(--border); border-radius:var(--r-md); background:var(--bg-1); overflow:hidden;}
.hqueue-h{display:flex; align-items:center; gap:10px; padding:11px 14px; border-bottom:1px solid var(--border);}
.hqueue-h b{font-size:var(--fs-3);}
.hqueue-n{background:var(--danger); color:#fff; border-radius:var(--r-pill); font-size:var(--fs-0); font-weight:700; padding:.0625rem .5rem;}
.hqueue-sp{flex:1;}
/* THE QUESTION, ANSWERABLE WHERE IT IS ASKED. A queue item that only takes you
   somewhere else is not a queue item, it is a link — and the whole point here is
   that the answer takes one word and the person already knows it. */
.hqask{ border:0.0625rem solid var(--border); border-radius:var(--r-md);
  background:var(--bg-1); padding:0.5rem 0.6rem; display:flex;
  flex-direction:column; gap:0.35rem; margin-bottom:0.4rem; }
.hqask-h{ display:flex; align-items:center; gap:0.4rem; font-weight:600;
  color:var(--text); }
.hqask-r{ display:flex; align-items:center; gap:0.45rem; min-width:0; }
.hqask-d{ flex:none; color:var(--muted); font-weight:700; }
.hqask-t{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; }
.hqask-t em{ color:var(--muted); font-style:normal; }
.hqask-a{ flex:none; font-variant-numeric:tabular-nums; font-weight:600; }
.hqask-more{ align-self:flex-start; }
.hqrow{display:flex; align-items:center; gap:.75rem; width:100%; text-align:left; padding:.625rem .875rem;
  border:none; border-bottom:1px solid var(--hairline); background:transparent; border-radius:0; cursor:pointer;}
.hqrow:last-child{border-bottom:none;}
.hqrow:hover{background:var(--hover); border-color:var(--hairline);}
.hqrow-bar{width:.1875rem; align-self:stretch; border-radius:.125rem; background:var(--faint); flex:none; margin:-.125rem 0;}
.hq-1 .hqrow-bar{background:var(--danger);}
.hq-2 .hqrow-bar{background:var(--warn);}
.hq-3 .hqrow-bar{background:var(--info);}
.hqrow-ic{width:1.625rem; height:1.625rem; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center;
  background:var(--bg-2); color:var(--muted); flex:none;}
.hqrow-tx{flex:1; min-width:0;}
.hqrow-t{display:block; font-size:var(--fs-2); font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.hqrow-s{display:block; font-size:var(--fs-1); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.hqrow-w{font-size:var(--fs-1); font-weight:600; flex:none; color:var(--muted);}
.hq-1 .hqrow-w{color:var(--danger);}
.hq-2 .hqrow-w{color:var(--warn);}
.hqueue-empty{padding:26px 14px; text-align:center; color:var(--muted); font-size:var(--fs-2);}

.hsec{font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:700; margin:20px 0 9px;}
/* 1px grid gap over a border-coloured background = hairline dividers without
   doubling borders where cells meet. */
/* `auto-fill` with a ceiling, not `auto-fit` with none: auto-fit stretches the
   tracks it has to fill the row, so six tiles on a wide screen each swelled to
   a sixth of it — a large empty box around a two-character number. */
/* One chart instead of six lines under six numbers. Given a real height, or a
   canvas in a flex column collapses to nothing. */
/* The chart lives in a grid cell now, which decides its height. A fixed 14rem
   here fought that cell and won on the screen where it was loose. */
.hchart .card2-body{ padding:0.6rem 0.8rem; }

/* THE FIGURE THAT DECIDES, AND THE ONES THAT EXPLAIN IT.
   Eight boxes of the same size is a list of variables, not a reading: the eye
   has nowhere to land and every number claims the same importance. The net
   leads, its two halves are stated as halves, and what is merely owed sits
   beside it at a smaller weight. */
.hlead-row{ display:grid; gap:var(--sp-2);
  grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); align-items:stretch; }
@media (max-width:60rem){ .hlead-row{ grid-template-columns:1fr; } }
.hlead{ display:flex; flex-direction:column; gap:0.15rem; text-align:left;
  justify-content:center;
  padding:0.75rem 1rem; border:0.0625rem solid var(--border);
  border-radius:var(--r-md); background:var(--bg-1); cursor:pointer; min-width:0; }
.hlead:hover{ border-color:var(--accent); }
/* The separator is its own node so the words either side can be translated:
   the dictionary matches whole text nodes, and "Net · this year" as one node
   matches neither "Net" nor "this year". */
.hsep{ opacity:.6; }
.hlead-l{ font-size:var(--fs-0); text-transform:uppercase;
  letter-spacing:var(--ls-caps); color:var(--faint); font-weight:700; }
.hlead-v{ font-size:clamp(1.6rem, 1.1rem + 1.6vw, 2.6rem); font-weight:700;
  line-height:1.05; letter-spacing:-.02em; }
.hlead-neg{ color:var(--danger); }
.hlead-sum{ display:flex; align-items:baseline; gap:0.5rem; flex-wrap:wrap;
  font-size:var(--fs-1); color:var(--muted); }
/* Why the window may not add up to what somebody remembers filing. */
/* Named and openable: a bare count reads as the app being wrong, a list reads
   as three fields to fill in. */
/* The company's public reference, where somebody looking at the company looks —
   it lived only in Settings, one screen away from every conversation that needs
   it. */
.dref{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap;
  padding:.5rem .6rem; margin-bottom:.6rem;
  border:0.0625rem solid var(--border); border-radius:var(--r-md);
  background:var(--bg-1); }
.dref-l{ font-size:var(--fs-0); text-transform:uppercase;
  letter-spacing:var(--ls-caps); color:var(--faint); font-weight:700; }
.dref-v{ font-family:var(--mono, monospace); letter-spacing:.04em; }
.hlead-note{ font-size:var(--fs-0); color:var(--warn, var(--muted));
  background:none; border:none; padding:0; font-family:inherit; cursor:pointer;
  text-align:left; text-decoration:underline dotted; }
.hlead-note:hover{ color:var(--text); }
.undl{ display:flex; flex-direction:column; gap:0.25rem; margin:0.5rem 0; }
.undl-r{ display:grid; gap:0.5rem; align-items:center;
  grid-template-columns:minmax(0,1fr) auto minmax(0,auto) auto;
  background:var(--bg-1); border:0.0625rem solid var(--border);
  border-radius:var(--r-sm); padding:0.35rem 0.5rem; font:inherit;
  color:inherit; cursor:pointer; text-align:left; }
.undl-r:hover{ border-color:var(--accent); }
.undl-t{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.undl-k, .undl-h{ font-size:var(--fs-0); color:var(--muted); }
.undl-a{ font-variant-numeric:tabular-nums; font-weight:600; }
.hlead-sum b{ color:var(--text); font-weight:600; }
.hlead-op{ color:var(--faint); }

/* WRAPPING, NOT A GRID OF FIXED TRACKS. `auto-fill` reserves every column
   whether or not there is a cell for it, so five figures in a four-wide grid
   left a large empty slab in the second row — and the 1px gap background paints
   that slab grey, which is how a dashboard ends up with a hole in it that holds
   nothing. Wrapped, the last row's cells grow to take the width instead. */
.hband{display:flex; flex-wrap:wrap;
  gap:1px; background:var(--border);
  border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden;}
.hband > .hbcell{flex:1 1 11rem; min-width:0;}
.hbcell{background:var(--bg-1); padding:.6875rem .8125rem; border:none; border-radius:0; text-align:left; cursor:pointer;}
.hbcell:hover{background:var(--bg-2); border-color:transparent;}
.hbcell-l{display:block; font-size:var(--fs-0); color:var(--muted); text-transform:uppercase; letter-spacing:var(--ls-caps); font-weight:700;}
.hbcell-v{display:block; font-size:var(--fs-4); font-weight:650; margin-top:3px; line-height:1.1; color:var(--text);}
.hbcell-d{display:block; font-size:var(--fs-1); margin-top:2px; color:var(--muted);}
.hb-up{color:var(--ok);} .hb-down{color:var(--danger);}
/* DCA (Stage 0, home band only) — three LIGHT elevation tiers. Additive: a
   `normal` cell is untouched, so no existing class or the layout changes. The
   size stays constant (an inset left bar, not a resize) so scanning is
   unaffected; order is set in the DOM by JS, so focus order matches what is seen. */
.hbcell[data-weight="high"]{ box-shadow:inset 3px 0 0 var(--danger); }
.hbcell[data-weight="medium"]{ box-shadow:inset 3px 0 0 var(--warn-text); }
.hbcell-why{ display:inline-block; margin-top:5px; font-size:var(--fs-0);
  font-weight:700; letter-spacing:var(--ls-caps); text-transform:uppercase;
  color:var(--warn-text); }
.hbcell[data-weight="high"] .hbcell-why{ color:var(--danger); }
.hspark{display:block; margin-top:6px; width:100%; height:22px;}

.hcols{display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:16px;}
@media(max-width:820px){ .hcols{grid-template-columns:1fr;} }
.hmini{border:1px solid var(--border); border-radius:var(--r-md); background:var(--bg-1); overflow:hidden;}
.hmini-h{padding:10px 13px; border-bottom:1px solid var(--border); font-size:var(--fs-2); font-weight:650; display:flex; align-items:center; gap:8px;}
.hmini-h .hqueue-sp{flex:1;}
.hmrow{display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:8px 13px;
  border:none; border-bottom:1px solid var(--hairline); background:transparent; border-radius:0; font-size:var(--fs-2); color:var(--text);}
.hmrow:last-child{border-bottom:none;}
.hmrow-t{flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.hmrow-r{color:var(--muted); font-size:var(--fs-1); flex:none;}
.hpill{font-size:var(--fs-0); font-weight:700; border-radius:var(--r-pill); padding:1px 7px; flex:none;}
.hpill-d{background:var(--danger-bg); color:var(--danger);}
.hpill-w{background:var(--warn-bg); color:var(--warn);}
.hpill-o{background:var(--ok-bg); color:var(--ok);}

/* ==== People: employees only ==============================================
   The account strip is a COUNT plus a link, never a roster. Listing the
   accounts here would rebuild the user list inside People, which is what made
   the old screen unusable. */
.ppl-acct-strip{display:flex; align-items:center; gap:10px; padding:9px 12px; margin-bottom:14px;
  border:1px solid var(--border); border-radius:var(--r-md); background:var(--bg-1); font-size:var(--fs-2);}
.ppl-acct-n{font-weight:700; background:var(--warn-bg); color:var(--warn);
  border-radius:var(--r-pill); padding:1px 9px; flex:none;}
.ppl-acct-t{color:var(--muted); min-width:0;}
/* Organization heading sits ABOVE the department headings; only rendered when
   the user actually has more than one company. */
.ppl-orghead{font-size:var(--fs-3); font-weight:650; margin:20px 0 4px; display:flex; align-items:center; gap:8px;}
.ppl-orghead:first-child{margin-top:0;}
.ppl-acct{display:inline-flex; align-items:center; color:var(--accent-text); margin-left:6px; vertical-align:middle;}
.ppl-load{font-size:var(--fs-0); font-weight:700; color:var(--muted); background:var(--bg-2);
  border-radius:var(--r-pill); padding:1px 7px; flex:none;}
.ppl-load-over{background:var(--danger-bg); color:var(--danger);}

/* Support: seven queues do not fit one line on a laptop, and a .seg strip does
   not wrap by default — it would clip Breached/At risk/Unanswered off the edge,
   which are the three that matter most. */
.sup-queues{flex-wrap:wrap; row-gap:6px;}
/* Who is waiting, on the card — triage is about people, not just subject lines. */
.tk-req{font-size:var(--fs-0); color:var(--muted); margin-top:3px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
/* Secondary line: role + workload + touchpoints share it so the NAME keeps
   the full width of line one. */
.ppl-sub{display:flex; align-items:center; gap:7px; min-width:0; margin-top:1px;}
.ppl-sub .ppl-role{flex:1; min-width:0;}
.ppl-sub .deal-acts{flex:none;}

/* ==== Assistant widget: draggable launcher + popup ====
   The assistant used to be a full-page nav destination, which meant leaving the
   screen you wanted to ask about in order to ask about it. It is now a launcher
   you can park anywhere plus a popup, so it overlays the work instead of
   replacing it. touch-action:none on the launcher because it is drag-positioned —
   without it the browser scrolls the page instead of moving the button. */
.astfab{position:fixed; z-index:93; width:52px; height:52px; padding:0; border-radius:50%;
  display:flex; align-items:center; justify-content:center; touch-action:none;
  background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent);
  box-shadow:var(--shadow-lg); transition:transform var(--dur-1) var(--ease-sun), filter var(--dur-1) var(--ease-sun);}
.astfab:hover{filter:brightness(1.07); background:var(--accent);}
.astfab.dragging{cursor:grabbing; transform:scale(1.07);}
.astfab svg{width:24px; height:24px;}
.astfab.on{filter:brightness(.92);}

/* This popup used to read as a stack of boxes rather than as one surface: the
   shell drew a border, .astpop-body added 10px of padding inside it, and then
   the conversation list and the thread EACH drew a border of their own —
   three concentric rectangles, none of which the rest of the app has. The dock,
   which is this app's other floating surface, has no nested boxes at all: flat
   dividers, panes edge to edge, one header 52px tall. This now follows it.

   The radii were the other half. Every value in here was a magic number (9px,
   11px x3, 6px, 4px) while the app has a scale and uses it 96 times for --r-sm
   alone — so the popup's controls were rounder than its own shell, which is
   what made the shell look square. Everything below comes off the scale, and
   the container is now the roundest thing in it rather than the sharpest. */
.astpop{position:fixed; z-index:92; display:flex; flex-direction:column;
  width:min(680px, calc(100vw - 32px)); height:min(560px, calc(100dvh - 120px));
  background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-lg);
  box-shadow:var(--shadow-lg); overflow:hidden;
  visibility:hidden; opacity:0; transform:translateY(6px); pointer-events:none;
  transition:opacity var(--dur-2) var(--ease-sun), transform var(--dur-2) var(--ease-sun),
             visibility 0s linear var(--dur-2);}
/* Motion matches the dock's (--ease-sun), so the assistant arrives the way every
   other panel in the app does. translateY only, never scale: _astPlacePopup
   measures getBoundingClientRect() to keep the popup on-screen, and a scaled box
   reports the scaled size — the popup would place itself against the wrong
   width. A translation leaves width and height untouched. */
.astpop.open{visibility:visible; opacity:1; transform:translateY(0);
  pointer-events:auto; transition-delay:0s;}
@media(prefers-reduced-motion:reduce){ .astpop{transition:visibility 0s; transform:none;} }
.astpop-h{flex:none; display:flex; align-items:center; gap:6px; height:52px;
  padding:0 8px 0 14px; border-bottom:1px solid var(--border); background:var(--bg-1);}
.astpop-t{font-weight:600; flex:1; min-width:0;}
/* .ast is sized for a full page (100vh - 210px); inside the popup it must simply
   fill whatever the popup gives it — edge to edge, like .dock-pane. */
.astpop-body{flex:1; min-height:0; height:auto; padding:0; gap:0;}
.astpop .ast-side{flex:0 0 186px; border-right:1px solid var(--border);}
/* The bottom corners are the shell's to round; the panes just stop there. */
.astpop .ast-list{padding:6px 6px 8px;}

/* Narrow: the conversation list costs more than it gives — the popup is for
   asking, not for browsing history. */
@media(max-width:760px){
  .astpop{width:calc(100vw - 16px); height:calc(100dvh - 88px);}
  .astpop .ast-side{display:none;}
}

/* Break-glass: the operator's "you are inside a customer right now" strip.
   Warn-coloured on purpose — this is not a neutral status, it is a reminder
   that someone else's data is open and that every click is in their log. */
.sa-banner{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap;
  margin:0 0 var(--sp-4); padding:10px 14px; border:1px solid rgba(224,169,46,.45);
  border-left-width:3px; border-radius:var(--r-md); background:rgba(224,169,46,.08);
  font-size:var(--fs-1);}
.sa-banner b{color:var(--warn);}
.sa-banner svg{vertical-align:-3px; margin-right:6px;}

/* Community inside the dock: the same post cards as the full feed, but the pane
   is ~380px, so drop the page gutter and let media shrink instead of clipping. */
.feed-dock{padding:10px; overflow-y:auto; height:100%;}
.feed-dock .post{margin:0 0 10px; max-width:100%;}
.feed-dock .post img, .feed-dock .post video{max-width:100%; height:auto;}
.notif-head a{color:var(--accent-text);}

/* "Which AI answers you" — three mutually exclusive backends. Cards rather than
   a <select>: each option carries a cost consequence the user has to read. */
.ai-opts{display:flex; flex-direction:column; gap:8px;}
.ai-opt{display:flex; align-items:flex-start; gap:10px; padding:10px 12px; cursor:pointer;
  border:1px solid var(--border); border-radius:var(--r-md); background:var(--bg-1);}
.ai-opt:hover{border-color:var(--border-strong);}
.ai-opt.on{border-color:var(--accent); background:var(--accent-subtle);}
.ai-opt input{width:auto; margin-top:2px; flex:none;}
.ai-opt>span{display:flex; flex-direction:column; gap:2px; min-width:0;}
.ast-head-b[role="button"]{cursor:pointer;}
.ast-head-b[role="button"]:hover{color:var(--accent-text);}

/* General data table — Finance's Credit notes / Recurring / Close tabs.
   Deliberately NOT reusing .cltable: that one is the cleanup studio's dense
   record grid (fixed 240px cells, ellipsis, nowrap), which truncates a client
   name or a period label. Same visual language, sized for reading instead. */
.tbl{width:100%; border-collapse:collapse; font-size:var(--fs-1);}
.tbl th{text-align:left; color:var(--faint); font-weight:600; text-transform:uppercase;
  letter-spacing:var(--ls-caps); font-size:var(--fs-0); padding:8px 10px;
  border-bottom:1px solid var(--border); white-space:nowrap; font-family:var(--font-mono);}
.tbl td{padding:9px 10px; border-bottom:1px solid var(--hairline); vertical-align:middle;}
.tbl tbody tr:hover td{background:var(--hover);}
/* Money and counts read as columns only when the digits line up. */
.tbl .num, td.num, th.num{text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap;}
/* A table is the one thing that legitimately outgrows the pane — let it scroll
   inside itself rather than pushing the page sideways. */
.tbl-wrap{overflow-x:auto;}
.st-range{display:flex; gap:10px; align-items:end; flex-wrap:wrap; margin-top:12px;}
.st-range label{display:flex; gap:6px; align-items:center; font-size:var(--fs-1); color:var(--muted);}
.st-range input{width:auto;}

/* Vault-protected record on the canvas. The node stays exactly where it was —
   the map of what a company has must stay complete — so the lock is a mark on
   the card, never a removal of it. */
.nlock{flex:none; display:inline-flex; align-items:center; color:var(--accent-text); opacity:.85;}
.nlock svg{display:block;}
.nrow.nlocked{display:flex; align-items:center; gap:6px; color:var(--muted);
  font-size:var(--fs-0); font-style:italic;}
.nrow.nlocked svg{flex:none; opacity:.7;}

/* Clients — two readings of one list. Columns rather than a table: the point of
   a pipeline is that a column's HEIGHT is the answer ("too much sitting in
   'to invoice'"), which a table row count never shows at a glance. */
.cli-board{display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:12px; margin-top:14px;}
.cli-col{background:var(--bg-1); border:1px solid var(--border); border-radius:var(--r-md); padding:10px; min-width:0;}
.cli-colh{display:flex; justify-content:space-between; align-items:baseline; gap:8px; font-weight:600; font-size:var(--fs-2);}
.cli-colh .cli-n{font-family:var(--font-mono); font-size:var(--fs-0); color:var(--muted); white-space:nowrap;}
.cli-help{margin:2px 0 8px;}
.cli-empty{padding:6px 0;}
.cli-card{background:var(--bg-2); border:1px solid var(--border); border-radius:var(--r-sm);
  padding:9px 10px; margin-bottom:8px; cursor:pointer;}
.cli-card:hover{border-color:var(--border-strong); background:var(--hover);}
.cli-name{font-weight:600; font-size:var(--fs-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.cli-amt{font-family:var(--font-mono); font-variant-numeric:tabular-nums; font-size:var(--fs-2); margin:2px 0;}
/* The names on documents that have no client file yet — the one number that
   says how much of an existing business is still outside the module. */
.cli-unfiled{display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap;
  margin-top:16px; padding:12px 14px; border:1px solid var(--border); border-left:3px solid var(--accent);
  border-radius:var(--r-md); background:var(--bg-1);}

/* Search box on the Accounts page. `.vtoolbar` styles the row; the input inside
   it had no rule at all, so it rendered as a bare browser field next to the
   icon — the class was used in three places and defined in none. */
.vsearch{display:flex; align-items:center; gap:8px; flex:1; min-width:0;
  background:var(--field-bg); border:1px solid var(--border); border-radius:var(--r-sm); padding:0 10px;}
.vsearch svg{flex:none; color:var(--faint);}
.vsearch input{border:none; background:transparent; padding:8px 0; flex:1; min-width:0;}
.vsearch input:focus{outline:none;}
.vsearch:focus-within{border-color:var(--accent);}

/* ---- Treasury: cash in two pockets ---------------------------------------
   Three lines, not a table. The question "how much can I actually spend" has
   one answer, and a grid of figures buries it. Type carries the hierarchy:
   the available line is the largest thing in the block because it is the only
   one anybody came for.                                                    */
.tre{max-width:520px}
.tre-line{display:flex; align-items:baseline; justify-content:space-between; gap:16px;
  padding:9px 0; border-bottom:1px solid var(--border)}
.tre-line:last-child{border-bottom:none}
.tre-l{color:var(--muted); font-size:var(--fs-2)}
.tre-v{font-variant-numeric:tabular-nums; font-weight:600; font-size:var(--fs-3)}
/* Expandable, so it has to look expandable. */
.tre-res{cursor:pointer; border-radius:var(--r-sm)}
.tre-res:hover{background:var(--hover)}
.tre-res .tre-l::after{content:'  ▾'; opacity:.55}
.tre-break{padding:6px 0 10px; border-bottom:1px solid var(--border)}
.tre-sub{display:flex; justify-content:space-between; gap:12px; padding:3px 0;
  font-size:var(--fs-1); color:var(--muted); font-variant-numeric:tabular-nums}
.tre-line.tre-ok .tre-v,.tre-line.tre-neg .tre-v{font-size:var(--fs-5); font-weight:700}
.tre-ok .tre-v{color:var(--ok)}
.tre-neg .tre-v{color:var(--danger)}
/* v475 — the full-position total: a quiet summary line under "available". */
.tre-line.tre-pos{border-top:1px solid var(--border); margin-top:2px}
.tre-line.tre-pos .tre-l{color:var(--text); font-weight:600}
.tre-line.tre-pos .tre-v{font-weight:700}
.tre-warn{margin-top:10px; padding:9px 11px; border-radius:var(--r-sm);
  background:var(--hover); color:var(--danger); font-size:var(--fs-1); line-height:1.45}

/* The financial year a statement was drawn against — shown only when it is not
   January, because saying "starts in January" to everyone is noise. */
.fin-fy{margin:0 0 12px; padding:7px 11px; border-radius:var(--r-sm);
  background:var(--hover); color:var(--muted); font-size:var(--fs-1)}

/* ---- What a file turned out to be ----------------------------------------
   Sits under its attachment row, indented so it reads as belonging to it and
   not as another file. Quiet by default: this is a suggestion, and a
   suggestion that shouts gets accepted without being read.               */
.ins{padding:0 0 0 26px}
.ins-row{display:flex; align-items:center; gap:9px; padding:3px 0 2px}
.ins-line{flex:1; min-width:0; font-size:var(--fs-1); color:var(--muted); line-height:1.4}
.ins-why{font-size:var(--fs-0); color:var(--muted); opacity:.7; padding:0 0 5px; line-height:1.4}
.ins-note{font-size:var(--fs-1); color:var(--muted); opacity:.8; padding:2px 0 5px; line-height:1.4}

/* ==== How each company is doing ==========================================
   The first block on the dashboard, because it is the question the app
   exists to answer. State is carried by a coloured edge and a dot, never by
   colour alone: a row also SAYS what is wrong in words.               */
.cocard{border:1px solid var(--border); border-radius:var(--r-lg); background:var(--bg-1);
  box-shadow:var(--shadow-sm); overflow:hidden; margin-bottom:var(--sp-4);}
.co-h{display:flex; align-items:center; gap:var(--sp-2); padding:var(--sp-3) var(--sp-4);
  border-bottom:1px solid var(--hairline); font-weight:600; font-size:var(--fs-3);}
.co-count{margin-left:auto; font-weight:500; font-size:var(--fs-1); color:var(--muted);}
/* The list scrolls INSIDE the card. The page does not move: with many
   companies the header, the queue and the band must all stay where they are. */
.co-body{max-height:15rem; overflow-y:auto; display:block; scrollbar-width:thin;
  scrollbar-color:var(--n-300) transparent;}
.co-body::-webkit-scrollbar{width:.5rem;}
.co-body::-webkit-scrollbar-thumb{background:var(--n-300); border-radius:var(--r-pill);
  border:2px solid var(--bg-1);}
.co-body::-webkit-scrollbar-track{background:transparent;}
/* The name hugs its text and the status follows it, instead of each taking a
   proportion of whatever width the window happens to be. Proportional columns
   are why "dimeti-drive" sat at the far left and "No bank statement imported
   yet" floated alone in the middle of the row. */
.corow{display:grid; grid-template-columns:auto minmax(0,max-content) minmax(0,1fr) auto;
  grid-template-areas:"dot name line money" ". chips chips chips";
  align-items:center; gap:var(--sp-1) var(--sp-3);
  padding:var(--sp-3) var(--sp-4); border-bottom:1px solid var(--hairline);
  border-left:3px solid transparent; cursor:pointer;
  transition:background-color var(--dur-1) var(--ease-sun);}
.corow:last-child{border-bottom:none;}
.corow:hover{background:var(--hover);}
.corow:focus-visible{outline:none; box-shadow:var(--focus-ring);}
.co-dot{grid-area:dot; width:.5rem; height:.5rem; border-radius:50%; background:var(--faint);}
.co-name{grid-area:name; font-weight:600; font-size:var(--fs-2); min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.co-line{grid-area:line; font-size:var(--fs-2); color:var(--muted); min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.co-money{grid-area:money; display:flex; align-items:baseline; gap:var(--sp-2);
  justify-self:end; white-space:nowrap;}
.co-big{font-size:var(--fs-4); font-weight:700; letter-spacing:-.01em;}
.co-neg{color:var(--danger);}
.co-sub{font-size:var(--fs-1); color:var(--faint);}
.co-chips{grid-area:chips; display:flex; flex-wrap:wrap; gap:var(--sp-1);}
.co-chip{font-size:var(--fs-0); color:var(--muted); background:var(--bg-3);
  border-radius:var(--r-pill); padding:.125rem var(--sp-2);}
.co-chip-warn{color:var(--warn); background:var(--warn-bg);}
.co-chip-bad{color:var(--danger); background:var(--danger-bg);}
.corow.co-ok .co-dot{background:var(--ok);}
.corow.co-warn{border-left-color:var(--warn);}
.corow.co-warn .co-dot{background:var(--warn);}
.corow.co-bad{border-left-color:var(--danger);}
.corow.co-bad .co-dot{background:var(--danger);}
@media(max-width:52rem){
  .corow{grid-template-columns:auto minmax(0,1fr) auto;
    grid-template-areas:"dot name money" ". line line" ". chips chips";}
}

/* The rule: cards scroll, the page does not. The two long lists on the
   dashboard get their own overflow so the band above them never moves.

   flex:none on the children is not optional. A flex column with a max-height
   shrinks its items by default, so every row compressed below its own text
   and the lines overlapped — badly, and visibly. The scroll has to come from
   the container, never from squashing what is inside it. */
.hqueue,.hmini{display:flex; flex-direction:column; min-height:0;}
.hqueue > *,.hmini > *{flex:none; min-height:0;}
.hmini{max-height:22rem; overflow-y:auto; scrollbar-width:thin;
  scrollbar-color:var(--n-300) transparent;}
.hmini::-webkit-scrollbar{width:.5rem;}
.hmini::-webkit-scrollbar-thumb{background:var(--n-300); border-radius:var(--r-pill);
  border:2px solid var(--bg-1);}
.hmini::-webkit-scrollbar-track{background:transparent;}
.hmini-h{position:sticky; top:0; z-index:1; background:var(--bg-1);}

/* Parked capability: visible so the roadmap stays legible, inert so nobody
   fights with it. Real `disabled` already removes it from the tab order. */
.cvtools button[disabled],#btn3d[disabled]{opacity:.42; cursor:not-allowed;
  filter:grayscale(1);}

/* ==== Stock ===============================================================
   The list leads with what is wrong: a stock list read top to bottom is a
   list nobody reads. State shows as an edge and a dot AND as a number, never
   colour alone.                                                          */
.stk-card{margin-top:var(--sp-4);}
.stk-body{max-height:calc(100dvh - 22rem); overflow-y:auto; scrollbar-width:thin;
  scrollbar-color:var(--n-300) transparent;}
.stk-body::-webkit-scrollbar{width:.5rem;}
.stk-body::-webkit-scrollbar-thumb{background:var(--n-300); border-radius:var(--r-pill);
  border:2px solid var(--bg-1);}
.stk-body::-webkit-scrollbar-track{background:transparent;}
.stkrow{display:grid; grid-template-columns:auto minmax(8rem,1.4fr) minmax(0,1fr) 7rem 8rem auto;
  align-items:center; gap:var(--sp-3); padding:var(--sp-3) var(--sp-4);
  border-bottom:1px solid var(--hairline); border-left:3px solid transparent;
  cursor:pointer; transition:background-color var(--dur-1) var(--ease-sun);}
.stkrow:last-child{border-bottom:none;}
.stkrow:hover{background:var(--hover);}
.stkrow:focus-visible{outline:none; box-shadow:var(--focus-ring);}
.stk-dot{width:.5rem; height:.5rem; border-radius:50%; background:var(--ok);}
.stk-name{font-weight:600; font-size:var(--fs-2); min-width:0; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap;}
.stk-where,.stk-re{font-size:var(--fs-1); color:var(--faint); min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.stk-qty{font-size:var(--fs-3); font-weight:700; text-align:right; white-space:nowrap;}
.stk-unit{font-size:var(--fs-0); font-weight:500; color:var(--faint);}
.stkrow.stk-low{border-left-color:var(--warn);} .stkrow.stk-low .stk-dot{background:var(--warn);}
.stkrow.stk-out{border-left-color:var(--faint);} .stkrow.stk-out .stk-dot{background:var(--faint);}
.stkrow.stk-neg{border-left-color:var(--danger);} .stkrow.stk-neg .stk-dot{background:var(--danger);}
.stkrow.stk-neg .stk-qty{color:var(--danger);}
@media(max-width:60rem){
  .stkrow{grid-template-columns:auto minmax(0,1fr) 6rem auto;}
  .stk-where,.stk-re{display:none;}
}

/* ==== Files: the ordinary explorer =======================================
   A second door onto the same tree the canvas draws. Folders first, then
   items — the order you look in, not the order they were created.       */
.fx-crumbs{display:flex; align-items:center; flex-wrap:wrap; gap:var(--sp-1);
  margin-bottom:var(--sp-3);}
.fx-crumb{background:none; border:none; padding:.25rem var(--sp-2); border-radius:var(--r-sm);
  color:var(--muted); font-size:var(--fs-2); cursor:pointer;}
.fx-crumb:hover{background:var(--hover); color:var(--text);}
.fx-crumb.on{color:var(--text); font-weight:600;}
.fx-crumb{display:inline-flex; align-items:center; gap:.35rem;}
/* A disabled control has to say why WHERE IT IS. A title attribute is a tooltip
   nobody hovers, so the button just looked broken. */
.fx-why{font-size:var(--fs-0); color:var(--muted); margin-left:.5rem;
  white-space:nowrap;}
/* The company is a SWITCH, not a folder you go up into: going up out of one
   used to land on a list of companies, which is the Organizations screen again. */
.fx-crumb-pick{display:inline-flex; align-items:center; gap:.35rem;
  padding:.25rem var(--sp-2);}
.fx-crumb-pick select{font:inherit; color:var(--text); background:var(--panel);
  border:0.0625rem solid var(--border); border-radius:var(--r-sm);
  padding:.1rem .3rem; max-width:14rem;}
.fx-sep{color:var(--faint);}
.fx-bar{display:flex; align-items:center; gap:var(--sp-3); margin-bottom:var(--sp-2);}
.fx-search{max-width:22rem;}
.fx-count{font-size:var(--fs-1); color:var(--faint); white-space:nowrap;}
/* Columns are NOT restated here: this rule used to carry a second, different
   grid-template-columns, and being the later of the two it won for rows while
   the header kept the first — which is exactly how the two stopped lining up.
   One template, above, for both. */
.fxrow{align-items:center; gap:.5rem; padding:var(--sp-3) var(--sp-4);
  border-bottom:1px solid var(--hairline); cursor:pointer;
  transition:background-color var(--dur-1) var(--ease-sun);}
.fxrow:last-child{border-bottom:none;}
.fxrow:hover{background:var(--hover);}
.fxrow:focus-visible{outline:none; box-shadow:var(--focus-ring);}
.fx-ico{display:flex; color:var(--accent);}
.fx-name{font-size:var(--fs-2); font-weight:500; min-width:0; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap;}
.fx-type,.fx-kids{font-size:var(--fs-1); color:var(--faint); min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
@media(max-width:52rem){
  /* Narrow: the name, when, and the way in. Dropped in the same place for the
     header and the rows, or they part company again. */
  .fx-head,.fxrow{grid-template-columns:minmax(0,1fr) 9rem 2rem;}
  .fx-ctype,.fx-csize,.fx-cby{display:none;}
  .fx-type,.fx-kids{display:none;}
}

/* A projection has to say it is one. The hatching carries it visually; this
   line carries the method, so the reader can disagree with it. */
.fin-fc{font-size:var(--fs-1); color:var(--faint); margin-top:var(--sp-2);
  line-height:1.45;}

/* ==== Access ==============================================================
   Pending is shown as pending, not as present: an invitation nobody accepted
   is not access, and a list that conflates them is a list that over-reports
   who can reach your books.                                              */
.acx-card{margin-bottom:var(--sp-4);}
.acx-body{max-height:18rem; overflow-y:auto;}
.acxrow{display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1.4fr) 9rem auto auto;
  align-items:center; gap:var(--sp-3); padding:var(--sp-3) var(--sp-4);
  border-bottom:1px solid var(--hairline);}
.acxrow:last-child{border-bottom:none;}
.acx-who{font-size:var(--fs-2); min-width:0; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap;}
.acx-lvl{font-size:var(--fs-2); font-weight:600;}
.acx-what{font-weight:400; color:var(--faint); font-size:var(--fs-1);}
.acx-state{font-size:var(--fs-1); color:var(--warn);}
.acxrow.acx-pending{background:var(--warn-bg);}
@media(max-width:52rem){
  .acxrow{grid-template-columns:minmax(0,1fr) auto auto;}
  .acx-what,.acx-state{display:none;}
}

/* Dr / Cr: quiet, because it labels the figure rather than being one. */
.tb-side{font-size:var(--fs-0); color:var(--faint); margin-left:.125rem;}

/* The same trap, everywhere it exists: a flex COLUMN with a bounded height
   shrinks its items by default, so rows compress below their own text and the
   lines overlap. The scroll must come from the container, never from squashing
   what is inside it. These three predate the dashboard and carry the same
   shape, so they get the same guard. */
.msgs > *,.fwdlist > *,.act-list > *{flex:none;}

/* ==== The page does not scroll; its cards do =============================
   .canvas carries overflow:auto, which means the whole content region moves
   as one block — title, tabs and figures included. From a reader's seat that
   IS the page scrolling.
   Opt-in rather than global: a screen that has not been laid out to fit would
   CLIP instead of scroll, and losing content is worse than moving it. Screens
   whose lists already scroll inside their own card add .fixed and stop the
   window moving; the rest keep the old behaviour until they are converted. */
.canvas.fixed{overflow:hidden; display:flex; flex-direction:column; min-height:0;}
.canvas.fixed > *{min-height:0;}
/* THE BROKEN LINK, and it had been broken since this block was written.
   `pageShell` wraps every screen in `.dash > .pagehead + .pgbody`, and `.dash`
   was given `min-height:0` and no `flex`. So it stayed exactly as tall as its
   content, and `.pgbody`'s `flex:1` had nothing to grow INTO — a chain of
   correct-looking rules with no height at the top of it. Which is why a list of
   three rows sat above two thirds of an empty window. */
/* `max-width:none` AND `margin:0`, and the second is not tidying.
   `.dash` carries `max-width:1080px; margin:0 auto` — a reading width, right for
   a form or a report and wrong for a file manager. Lifting only the max-width
   made it NARROWER, not wider: inside a column flex container an auto side
   margin does not centre a stretched item, it stops the stretch and shrinks the
   item to its own content. So the listing went from a capped 1080 to whatever
   the table happened to measure. Both have to go.

   Written into THIS rule rather than a second one with the same selector: two
   blocks for one selector is how a reader — and a test — ends up looking at
   whichever came first. */
.canvas.fixed > .dash{flex:1; min-height:0; display:flex; flex-direction:column;
  max-width:none; margin:0;}
.canvas.fixed .dash > .pagehead{flex:none;}
.canvas.fixed .pgbody{flex:1; min-height:0; display:flex; flex-direction:column;}
.canvas.fixed .pgbody > *{flex:none;}
/* THE EMPTY SCREEN. `#fxWrap` is a plain child of the page body, so the rule
   above pinned it to its content height and left two thirds of the window
   blank under a list of three rows. It is the screen, so it takes the screen. */
.canvas.fixed .pgbody > #fxWrap{ flex:1; min-height:0; }
#fxWrap{ display:flex; flex-direction:column; min-height:0; gap:0.5rem; }
#fxWrap > .fx-panes{ flex:1; min-height:0; }
#fxWrap > .fx-nav, #fxWrap > .fx-status{ flex:none; }
/* A row that is on its way somewhere else, until it is pasted. */
.fxrow.cutting{ opacity:0.5; }
.fxrow.cutting .fx-name{ font-style:italic; }
.canvas.fixed .pgbody > .card2,
.canvas.fixed .pgbody > .stk-card{flex:1; min-height:0; display:flex; flex-direction:column;}
.canvas.fixed .stk-body,.canvas.fixed .co-body,.canvas.fixed .acx-body{max-height:none; flex:1;}

/* ---- pickers that narrow a screen to one company or one person ----------
   Both exist because a screen that could only ever show the union was wrong:
   the books of two companies added together are nobody's books, and a board
   of only your own tasks is a personal to-do list, not a company's work. */
.fin-orgpick select, .who-pick select{
  font: inherit; color: var(--text); background: var(--panel);
  border: 0.0625rem solid var(--line); border-radius: 0.5rem;
  padding: 0.3rem 0.6rem; max-width: 14rem;
}
.who-pick{ margin-left: auto; }
.fin-orgpick select:focus-visible, .who-pick select:focus-visible{
  outline: 0.125rem solid var(--accent); outline-offset: 0.125rem;
}
/* Present to a screen reader, absent to the eye: the pickers are self-evident
   in context but a bare <select> announces nothing. */
.sr-only{
  position: absolute; width: 0.0625rem; height: 0.0625rem;
  padding: 0; margin: -0.0625rem; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- Settings ----------------------------------------------------------
   Two subjects, kept apart: what a COMPANY is set up to do, and what YOU see.
   Mixing them is why the company picker used to be drawn twice and neither
   copy knew about the other. */
.set-layout{ display:grid; grid-template-columns:minmax(11rem,15rem) 1fr;
  gap:1.25rem; align-items:start; min-height:0; }
@media (max-width:48rem){ .set-layout{ grid-template-columns:1fr; } }
.set-nav{ display:flex; flex-direction:column; gap:1rem; min-width:0; }
.set-sec-h{ font-size:.75rem; text-transform:uppercase; letter-spacing:0.06em;
  color:var(--muted); padding:0 0.5rem 0.35rem; }
.set-navi{ display:flex; flex-direction:column; gap:0.1rem; width:100%;
  text-align:left; padding:0.5rem 0.6rem; border:0; border-radius:0.5rem;
  background:transparent; color:inherit; font:inherit; cursor:pointer; }
.set-navi span{ font-size:0.75rem; color:var(--muted); }
.set-navi:hover{ background:var(--hover); }
.set-navi.on{ background:var(--hover); box-shadow:inset 0.1875rem 0 0 var(--accent); }
.set-navi:focus-visible{ outline:0.125rem solid var(--accent); outline-offset:0.125rem; }
.set-panel{ min-width:0; }
.set-orgbar{ display:flex; align-items:center; gap:0.6rem; padding-bottom:0.6rem;
  border-bottom:0.0625rem solid var(--line); margin-bottom:0.9rem; }
.set-orgbar .set-l{ margin:0; }
.set-body{ overflow-y:auto; min-height:0; }
.set-note{ color:var(--muted); font-size:0.85rem; max-width:56ch; margin:0 0 0.9rem; }
/* Payment gateways — one status card per rail */
.gw-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(17rem,1fr)); gap:1rem; }
.gw-card{ display:flex; flex-direction:column; gap:0.55rem; padding:1rem;
  border:0.0625rem solid var(--border); border-radius:var(--r-md);
  background:var(--bg-1); box-shadow:var(--shadow-sm); min-width:0; }
.gw-h{ display:flex; align-items:center; gap:0.5rem; }
.gw-h b{ font-size:0.98rem; }
.gw-badge{ margin-left:auto; font-size:.75rem; font-weight:650; padding:0.15rem 0.5rem;
  border-radius:var(--r-pill); border:0.0625rem solid var(--border); }
.gw-badge.on{ color:var(--ok, #2e7d32); border-color:var(--ok, #2e7d32);
  background:var(--accent-subtle); }
.gw-badge.off{ color:var(--muted); }
.gw-hint{ color:var(--muted); font-size:0.78rem; line-height:1.45; margin:0 0 0.2rem; }
.gw-f{ display:flex; flex-direction:column; gap:0.25rem; font-size:0.8rem; color:var(--muted); }
.gw-f input, .gw-f select{ font:inherit; }
.gw-sec{ font-style:normal; font-size:.75rem; text-transform:uppercase; letter-spacing:0.04em;
  color:var(--warn); border:0.0625rem solid var(--border); border-radius:var(--r-sm);
  padding:0 0.3rem; margin-left:0.3rem; }
.gw-hook{ display:flex; align-items:center; flex-wrap:wrap; gap:0.4rem; font-size:.75rem;
  color:var(--muted); margin-top:0.2rem; }
.gw-hook code{ flex:1; min-width:8rem; overflow-x:auto; padding:0.35rem 0.5rem;
  background:var(--field-bg); border:0.0625rem solid var(--border); border-radius:var(--r-sm);
  color:var(--text); white-space:nowrap; }
.gw-acts{ margin-top:0.3rem; }
/* Integrations (outbound webhooks + runway alert). Reuses .gw-card/.gw-h/.gw-badge. */
.gw-badge.warn{ color:var(--warn); border-color:var(--warn); }
.wh-cash{ margin-bottom:1.1rem; }
.wh-check{ display:flex; align-items:center; gap:0.5rem; font-size:0.85rem; }
.wh-caf{ flex-direction:row; flex-wrap:wrap; gap:0.9rem; margin-top:0.5rem; }
.wh-caf label{ display:flex; flex-direction:column; gap:0.25rem; flex:1; min-width:9rem; }
.wh-sec-h{ display:flex; align-items:center; justify-content:space-between;
  gap:0.75rem; margin:1.4rem 0 0.7rem; }
.wh-sec-h h3{ margin:0; font-size:0.95rem; }
.wh-ep-url code{ display:block; overflow-x:auto; white-space:nowrap; font-size:.75rem;
  padding:0.35rem 0.5rem; background:var(--field-bg); color:var(--text);
  border:0.0625rem solid var(--border); border-radius:var(--r-sm); }
.wh-ep-meta{ display:flex; flex-wrap:wrap; gap:0.9rem; font-size:.75rem; color:var(--muted); }
.wh-ep-meta span{ display:inline-flex; align-items:center; gap:0.3rem; }
.wh-acts{ display:flex; flex-wrap:wrap; gap:0.35rem; }
.wh-acts .danger{ color:var(--danger, #c0392b); margin-left:auto; }
.wh-empty{ display:flex; flex-direction:column; align-items:center; gap:0.5rem;
  text-align:center; color:var(--muted); padding:1.6rem 1rem; border:0.0625rem dashed var(--border);
  border-radius:var(--r-md); font-size:0.85rem; }
.wh-log-wrap{ overflow-x:auto; border:0.0625rem solid var(--border); border-radius:var(--r-md); }
.wh-log{ width:100%; border-collapse:collapse; font-size:0.78rem; }
.wh-log th, .wh-log td{ text-align:left; padding:0.45rem 0.7rem;
  border-bottom:0.0625rem solid var(--line); white-space:nowrap; }
.wh-log th{ color:var(--muted); font-weight:600; font-size:.75rem;
  text-transform:uppercase; letter-spacing:0.03em; }
.wh-log tr:last-child td{ border-bottom:none; }
.wh-log-empty{ padding:0.6rem 0; }
.wh-pill{ display:inline-block; font-size:.75rem; font-weight:650; padding:0.1rem 0.5rem;
  border-radius:var(--r-pill); border:0.0625rem solid var(--border); color:var(--muted); }
.wh-pill.on{ color:var(--ok, #2e7d32); border-color:var(--ok, #2e7d32); }
.wh-pill.off{ color:var(--danger, #c0392b); border-color:var(--danger, #c0392b); }
.wh-pill.warn{ color:var(--warn); border-color:var(--warn); }
.wh-err{ margin-left:0.3rem; color:var(--warn); cursor:help; vertical-align:middle; }
.wh-tps{ display:grid; grid-template-columns:repeat(auto-fill,minmax(11rem,1fr));
  gap:0.3rem 0.9rem; margin:0.3rem 0 0.6rem; }
.wh-tp{ display:flex; align-items:center; gap:0.4rem; font-size:0.82rem; }
.wh-tp-all{ margin-top:0.2rem; }
.wh-secret{ display:flex; align-items:center; gap:0.5rem; margin:0.5rem 0; }
.wh-secret code{ flex:1; overflow-x:auto; white-space:nowrap; padding:0.4rem 0.6rem;
  background:var(--field-bg); border:0.0625rem solid var(--border); border-radius:var(--r-sm); }
.set-l{ display:block; font-size:.75rem; color:var(--muted);
  text-transform:uppercase; letter-spacing:0.05em; margin:1rem 0 0.4rem; }
.set-cards{ display:grid; gap:0.5rem;
  grid-template-columns:repeat(auto-fill,minmax(16rem,1fr)); }
.set-card{ display:flex; flex-direction:column; gap:0.2rem; text-align:left;
  padding:0.7rem 0.8rem; border:0.0625rem solid var(--line);
  border-radius:0.6rem; background:var(--panel); cursor:pointer;
  color:inherit; font:inherit; }
.set-card:hover{ border-color:var(--accent); }
.set-card.on{ border-color:var(--accent); box-shadow:inset 0 0 0 0.0625rem var(--accent); }
.set-card:focus-visible{ outline:0.125rem solid var(--accent); outline-offset:0.125rem; }
.set-card-t{ font-weight:600; }
.set-card-w{ font-size:0.8rem; }
.set-card-d{ font-size:0.78rem; color:var(--muted); }

/* One capability, one row: the switch, what it is for, and how much this
   company already keeps in it. The count is not decoration — it is what makes
   turning a switch off a decision rather than a gamble. */
.set-mod{ display:flex; align-items:flex-start; gap:0.7rem;
  padding:0.6rem 0.65rem; border:0.0625rem solid var(--line);
  border-radius:0.6rem; margin-bottom:0.4rem; cursor:pointer; }
.set-mod:hover{ border-color:var(--accent); }
.set-mod.on{ background:var(--panel); }
/* THE REASON THE SWITCHES LOOKED DEAD.
   The base rule at the top of this file dresses every `input` as a text field —
   background, 1px border, 8px padding, width:100%. Applied to a checkbox, Chrome
   honours the background and border and paints OVER the native control, so the
   tick never appears: you click, the state changes, the server saves it, and
   nothing on screen moves. Indistinguishable from a control that does nothing.
   Every other checkbox in this file is rescued the same way (.step, .pe-login,
   .tk-intog, .ai-opt) — these ones only got `width:auto`, which fixes the size
   and none of the painting. */
.set-body input[type="checkbox"]{
  appearance:auto; -webkit-appearance:checkbox;
  width:1rem; height:1rem; min-width:1rem; flex:none;
  padding:0; border:0; border-radius:0; background:none;
  accent-color:var(--accent); cursor:pointer; }
.set-body input[type="checkbox"]:disabled{ cursor:not-allowed; }
.set-mod input[type="checkbox"]{ margin-top:0.15rem; }
.set-mod:has(input:disabled){ cursor:default; }
.set-mod:has(input:disabled):hover{ border-color:var(--line); }
.set-mod-in{ opacity:1; border-style:dashed; }
.ed-bar{ margin-bottom:.9rem; }
.nav-item.nav-locked{ opacity:.55; }
.ctx-ed{ cursor:pointer; border:1px solid var(--line); }
.ctx-hat{ opacity:.85; }
.viewas.ctx-support{ border:2px solid #9b2f4a; background:#fbe0e8; color:#3d1a26; }
.viewas.ctx-support .ctx-role{ color:#9b2f4a; font-weight:700; }
.pf-noisy td{ background:var(--warn-bg,#fbeccc); }
.nav-item.nav-locked .lbl::after{ content:' 🔒'; font-size:.7em; }
.ed-ladder{ display:grid; grid-template-columns:repeat(auto-fit,minmax(9rem,1fr)); gap:.45rem; margin:.6rem 0; }
.ed-step{ text-align:left; border:1px solid var(--line); border-radius:.6rem; padding:.5rem .6rem; background:var(--bg-1); font:inherit; color:inherit; cursor:pointer; display:grid; gap:.15rem; }
.ed-step.on{ border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.ed-step.proposed{ border-style:dashed; }
.ed-tag{ font-size:.75rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--accent); }
.ed-tag.ed-prop{ color:#8a5a00; }
.set-mod-in .set-mod-soon-b{ color:var(--accent); }
.set-mod-b{ display:flex; flex-direction:column; gap:0.1rem; flex:1; min-width:0; }
.set-mod-w{ font-size:0.8rem; color:var(--muted); }
.set-mod-n{ flex:none; white-space:nowrap; color:var(--accent); }
/* Records nothing deleted, that a switch is hiding. Marked, not whispered. */
.set-mod-hid{ color:var(--warn, #f5a524); font-weight:600; }
/* App-grid categories — the module chooser grouped like a familiar app grid. */
.set-modcat{ margin-bottom:1.1rem; }
.set-modcat-h{ font-size:.75rem; font-weight:700; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--muted); margin:0.2rem 0 0.5rem; }
/* A catalogue placeholder: the landscape has it, Solar will. No switch. */
.set-mod-soon{ cursor:default; opacity:0.72; border-style:dashed; }
.set-mod-soon:hover{ border-color:var(--line); }
.set-mod-soon-b{ flex:none; white-space:nowrap; color:var(--muted);
  border:0.0625rem solid var(--line); border-radius:999px; padding:0.05rem 0.5rem;
  align-self:center; }
.set-navi-n{ color:var(--warn, #f5a524); font-weight:600; font-size:0.75rem; }

/* MODULES is a first-class screen now (rail → openModules), so its chooser reads
   as an app catalogue — a responsive CARD GRID — not the settings list it grew
   from. Scoped to .mods-screen so the Settings panels keep their own look, and it
   re-rescues the checkbox here because that fix was scoped to .set-body (which a
   standalone screen has not got — which is why the switches looked painted-dead). */
.mods-screen input[type="checkbox"]{
  appearance:auto; -webkit-appearance:checkbox;
  width:1.15rem; height:1.15rem; min-width:1.15rem; flex:none;
  padding:0; border:0; border-radius:0; background:none;
  accent-color:var(--accent); cursor:pointer; }
.mods-screen input[type="checkbox"]:disabled{ cursor:not-allowed; }
.mods-screen .set-modcat{ margin-bottom:1.75rem; }
.mods-screen .set-modcat-h{ font-size:var(--fs-2); font-weight:700; letter-spacing:-0.01em;
  text-transform:none; color:var(--text); margin:0 0 0.8rem;
  padding-bottom:0.45rem; border-bottom:0.0625rem solid var(--line); }
.mods-screen .set-rows{ display:grid; gap:0.75rem; margin-bottom:0;
  grid-template-columns:repeat(auto-fill, minmax(15rem, 1fr)); }
.mods-screen .set-mod{ position:relative; flex-direction:column; align-items:stretch;
  gap:0.4rem; padding:1rem 2.6rem 1rem 1.05rem; margin:0;
  border:0.0625rem solid var(--border); border-radius:var(--r-md);
  background:var(--bg-1); box-shadow:var(--shadow-sm);
  transition:box-shadow var(--dur-1) var(--ease-sun), border-color var(--dur-1) var(--ease-sun); }
.mods-screen .set-mod:hover{ box-shadow:var(--shadow); border-color:var(--border-strong); }
.mods-screen .set-mod.on{ border-color:var(--accent);
  box-shadow:inset 0 0 0 0.0625rem var(--accent), var(--shadow-sm); }
.mods-screen .set-mod input[type="checkbox"]{ position:absolute; top:1rem; right:1rem; margin:0; }
.mods-screen .set-mod-b{ gap:0.28rem; }
.mods-screen .set-mod-b b{ font-size:var(--fs-2); font-weight:600; }
.mods-screen .set-mod-w{ font-size:0.82rem; line-height:1.45; color:var(--muted); }
.mods-screen .set-mod-n{ align-self:flex-start; margin-top:0.15rem; font-size:.75rem;
  font-family:var(--font-mono); }
.mods-screen .set-mod-soon{ opacity:1; border-style:dashed; background:transparent; }
.mods-screen .set-mod-soon:hover{ box-shadow:none; border-color:var(--border); }
.mods-screen .set-mod-soon-b{ position:absolute; top:1rem; right:1rem; align-self:auto;
  font-size:.75rem; text-transform:uppercase; letter-spacing:0.04em;
  font-family:var(--font-mono); color:var(--faint); border-color:var(--line); }
@media (max-width:520px){ .mods-screen .set-rows{ grid-template-columns:1fr; } }

/* Working days: seven small switches, wrapping rather than scrolling. */
.set-days{ display:flex; flex-wrap:wrap; gap:0.35rem; }
.set-day{ display:inline-flex; align-items:center; gap:0.3rem;
  padding:0.25rem 0.5rem; border:0.0625rem solid var(--line);
  border-radius:0.5rem; font-size:0.8rem; cursor:pointer; }
.set-day.on{ border-color:var(--accent); color:var(--accent); }
.set-day input{ width:auto; }
.set-day:has(input:disabled){ cursor:default; opacity:0.6; }

/* One question, one row of words. */
/* Wearing another seat's glasses: impossible to miss, one click to take off. */
.viewas{ grid-area:3/1/4/2; display:flex; align-items:center; gap:0.6rem; flex-wrap:wrap;
  padding:0.4rem 0.9rem; font-size:0.85rem;
  background:var(--accent-subtle, rgba(79,107,255,0.12));
  border-bottom:0.0625rem solid var(--accent); }
.viewas span{ flex:1; min-width:0; }
/* v474 (WI-3) — orientation, not alarm. The accent .viewas above is the
   impersonation preview; the context line reuses the same strip but reads as a
   quiet breadcrumb of place: which company, what you are in it, how wide the
   screen is scoped, and — for a read-only seat — one click to ask for more. */
.viewas.ctx{ background:var(--bg-1,#fff); border-bottom:0.0625rem solid var(--border,#E5E5F1);
  color:var(--muted,#5D5C71); font-size:0.8rem; gap:0.5rem; }
.viewas.ctx span{ flex:0 0 auto; }
.viewas.ctx .ctx-chip{ display:inline-flex; align-items:center; gap:0.35rem;
  font-weight:600; color:var(--ink,#181726); }
.viewas.ctx .ctx-dot{ width:0.6rem; height:0.6rem; border-radius:50%; display:inline-block; flex:0 0 auto; }
.viewas.ctx .ctx-role{ padding:0.05rem 0.5rem; border-radius:1rem;
  background:var(--field-bg,#F5F5FC); border:0.0625rem solid var(--border,#E5E5F1); }
.viewas.ctx .ctx-scope{ color:var(--muted,#5D5C71); }
.viewas.ctx .ctx-ro{ margin-left:auto; color:var(--warn,#90714c); font-weight:600; }
.viewas.ctx .ctx-ro + button{ flex:0 0 auto; }

/* What you are at that company, beside its name. "Which of these am I the CFO
   of" is the second thing anybody asks after "which of these am I in". */
/* ---- Organizations -------------------------------------------------------
   This screen had NO styles. Not thin ones — none: `.org-card`, `.org-head`,
   `.org-name`, `.org-trade`, `.org-mods` and `.org-acts` appeared in the markup
   and nowhere in this file, so the browser laid out raw HTML. That is why the
   avatar sat on its own line above the name, why the company name and the shape
   of its work ran together into one sentence ("Len Ryan Agnagano Simira Things
   come in, and go back out"), and why nothing looked like a card. */
/* v340 — the same fluid grid rhythm as the Dashboard's .hd-cards: auto-FIT (so a
   wide screen fills, not stretches two), a 20rem floor and the 1.5rem gutter. No
   px anywhere on this screen (rem/%/grid/minmax only). */
.org-list{ display:grid; gap:1.5rem;
  grid-template-columns:repeat(auto-fit,minmax(20rem,1fr)); align-items:start; }
/* One holding = one grid cell (parent card + its subsidiaries), so held
   companies hang UNDER their holding instead of scattering into the next
   column. See the note in goOrgs' card(). */
.org-group{ display:flex; flex-direction:column; gap:0.5rem; min-width:0; }
.org-held{ display:flex; flex-direction:column; gap:0.5rem;
  margin-left:0.9rem; padding-left:0.9rem;
  border-left:0.125rem solid var(--border-strong); }
.org-card{ display:flex; flex-direction:column; gap:0.45rem;
  padding:0.9rem 1rem; border:0.0625rem solid var(--border);
  border-radius:var(--r-md); background:var(--bg-1); min-width:0; }
.org-card:hover{ border-color:var(--accent); }
.org-head{ display:flex; align-items:center; gap:0.55rem; min-width:0; }
.org-name{ font-weight:600; font-size:var(--fs-2); min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* The shape of the work is a LABEL, not the rest of the name. Without a rule it
   was an inline span running straight on from the title. */
.org-trade{ flex:none; font-size:var(--fs-0); color:var(--muted);
  background:var(--bg-2); border:0.0625rem solid var(--border);
  border-radius:var(--r-pill); padding:0.05rem 0.5rem; white-space:nowrap; }
/* v340 — entity-type badge (Container / Holding / Company), same pill language
   as the Dashboard status badges (.gw-badge / .wh-pill). Colour carries meaning:
   a Holding (owns others) is accented, a Container is neutral. */
.org-kind{ flex:none; font-size:var(--fs-0); font-weight:650; white-space:nowrap;
  padding:0.05rem 0.5rem; border-radius:var(--r-pill);
  border:0.0625rem solid var(--border); color:var(--muted); background:var(--bg-2); }
.org-kind.hold{ color:var(--accent-text); border-color:var(--border-interactive);
  background:var(--accent-subtle); }
.org-kind.co{ color:var(--ok, #2e7d32); border-color:var(--ok, #2e7d32);
  background:var(--accent-subtle); }
.org-count{ margin-left:auto; flex:none; white-space:nowrap; }
.org-mods{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.org-acts{ display:flex; gap:0.4rem; flex-wrap:wrap; margin-top:0.15rem; }
@media (max-width:40rem){
  .org-list{ grid-template-columns:1fr; }
  .org-count{ display:none; }
}

/* Which half of the list you are looking at. */
/* Which company the screen is about. One line, above everything it governs. */
/* SIX LETTERS AND TWO DATES. A dropdown of five long labels cost a click and a
   read to change one word, and could never hold "4 March to 12 August" — which
   is an ordinary question. */
.hper{ display:inline-flex; border:0.0625rem solid var(--border);
  border-radius:var(--r-md); overflow:hidden; }
.hper-b{ border:none; background:var(--bg-1); color:var(--muted);
  font:inherit; font-weight:600; padding:0.2rem 0.55rem; cursor:pointer;
  border-right:0.0625rem solid var(--border); line-height:1.6; }
.hper-b:last-child{ border-right:none; }
.hper-b:hover{ background:var(--bg-2); color:var(--text); }
.hper-b.on{ background:var(--accent); color:#fff; }
.hper-r{ display:inline-flex; align-items:center; gap:0.25rem; opacity:.55;
  transition:opacity var(--dur-1) var(--ease-sun); }
.hper-r:hover, .hper-r.on{ opacity:1; }
.hper-r input[type="date"]{ width:auto; flex:none; font:inherit;
  padding:0.15rem 0.35rem; }
.hper-x{ border:none; background:transparent; color:var(--muted);
  cursor:pointer; font:inherit; padding:0 0.25rem; }
.hper-x:hover{ color:var(--danger); }
.home-pick{ display:flex; align-items:center; flex-wrap:wrap; gap:0.5rem; }
.home-pick .set-l{ margin:0; }
.home-pick select{ font:inherit; color:var(--text); background:var(--panel);
  border:0.0625rem solid var(--line); border-radius:0.5rem;
  padding:0.25rem 0.6rem; max-width:18rem; }
/* By the time this shows, the app has already tried to fetch the rate. It is a
   note, not a task, so it takes a line and not a card. */
.fx-thin{ padding:0.35rem 0.6rem; font-size:0.85rem; }

.co-sec{ padding:0.5rem 0.7rem 0.2rem; font-size:.75rem; text-transform:uppercase;
  letter-spacing:0.05em; color:var(--faint); font-weight:600; }
.co-seat{ margin-left:0.5rem; padding:0.05rem 0.4rem; border-radius:0.8rem;
  background:var(--accent-subtle, rgba(79,107,255,0.12)); color:var(--accent);
  font-weight:600; }

.set-chips{ display:flex; flex-wrap:wrap; gap:0.4rem; margin-bottom:1rem; }
.set-chip{ padding:0.35rem 0.8rem; border:0.0625rem solid var(--line);
  border-radius:1.2rem; background:transparent; color:var(--text);
  font:inherit; cursor:pointer; }
.set-chip:hover:not(:disabled){ border-color:var(--accent); }
.set-chip.on{ border-color:var(--accent); color:var(--accent); font-weight:600; }
.set-chip:disabled{ opacity:0.55; cursor:not-allowed; }

/* Changing the model: the sentence that says what is about to happen. */
.set-plan{ padding:0.6rem 0.7rem; border:0.0625rem solid var(--accent);
  border-radius:0.6rem; margin:0.8rem 0; }
.rm-drop{ color:var(--danger, #e5484d); font-weight:600; }
.set-rows{ display:flex; flex-direction:column; gap:0.15rem; margin-bottom:0.9rem; }
.set-row{ display:flex; align-items:center; gap:0.6rem; padding:0.4rem 0.5rem;
  border-bottom:0.0625rem solid var(--line); }
.set-row input[type="checkbox"]{ width:auto; }
.set-row > span:first-of-type{ flex:1; }
/* v474 (WI-8) — a small on/off pill for a per-user preference (read receipts). */
.set-toggle{ flex:0 0 auto; padding:0.2rem 0.7rem; border-radius:1rem; cursor:pointer;
  border:0.0625rem solid var(--border,#E5E5F1); background:var(--field-bg,#F5F5FC);
  color:var(--muted,#5D5C71); font-weight:600; font-size:0.8rem; }
.set-toggle.on{ background:var(--accent,#3b54d6); border-color:var(--accent,#3b54d6); color:#fff; }
/* the DM read-receipt marker */
.mread{ color:var(--accent,#3b54d6); font-weight:600; }
/* v474 (WI-9) — document branding form: logo + accent side by side, a framed
   logo preview, and a colour input that reads as a swatch not a raw control. */
.brand-grid{ display:grid; grid-template-columns:1fr auto; gap:1rem; align-items:start; margin-bottom:0.6rem; }
.brand-logo{ display:flex; align-items:center; justify-content:center; min-height:3.4rem;
  padding:0.5rem; border:0.0625rem dashed var(--border,#E5E5F1); border-radius:0.5rem;
  background:var(--field-bg,#F5F5FC); margin-bottom:0.4rem; }
.brand-logo-img{ max-height:3rem; max-width:100%; object-fit:contain; }
.brand-logo-none{ }
.brand-grid input[type="color"]{ width:3rem; height:2.2rem; padding:0; border:0.0625rem solid var(--border,#E5E5F1);
  border-radius:0.4rem; background:none; cursor:pointer; }
/* A form, laid out as a form: two columns where there is room, one where not. */
.set-grid{ display:grid; gap:0.75rem;
  grid-template-columns:repeat(auto-fit,minmax(14rem,1fr)); }
.set-f{ display:flex; flex-direction:column; gap:0.2rem; min-width:0; }
.set-f label{ font-size:0.8rem; }
.set-actions{ display:flex; gap:0.5rem; padding-top:1rem; margin-top:0.5rem;
  border-top:0.0625rem solid var(--line); }
.set-body select, .set-body input, .set-body textarea, .set-orgbar select{ font:inherit;
  color:var(--text); background:var(--panel);
  border:0.0625rem solid var(--line); border-radius:0.5rem;
  padding:0.35rem 0.6rem; max-width:22rem; }
.set-body textarea{ resize:vertical; min-height:3.5rem; }
.set-body input[type="color"]{ padding:0.15rem; width:3rem; height:2rem; }
.set-body input:disabled, .set-body textarea:disabled, .set-body select:disabled{
  opacity:0.55; cursor:not-allowed; }
/* The right-hand end of a people row: the level, and the way out. */
.set-row-r{ display:flex; align-items:center; gap:0.5rem; flex:none; }
.set-row-r select{ max-width:11rem; }
/* Invite: one line where it fits, stacked where it does not. */
.set-invite{ display:flex; gap:0.5rem; flex-wrap:wrap; align-items:center;
  margin-bottom:0.6rem; }
.set-invite input{ flex:2 1 14rem; }
.set-invite select{ flex:1 1 9rem; }
.set-lang{ padding-top:0.2rem; }

/* A question, not a taxonomy. Seventeen options named after trades is a list
   somebody's own trade is missing from. */
.set-q{ font-size:1.05rem; font-weight:600; margin:0.2rem 0 0.35rem; }

/* An area still being built. Visible so the roadmap reads, and genuinely inert
   — a greyed control you can still click is worse than no control. */
.dock-tab.dock-off{ opacity:0.45; cursor:not-allowed; }
.dock-tab.dock-off .nav-tag{ margin-left:0.35rem; }

/* Money the books could not value, and figures that failed to load. Both are
   things a person fixes in seconds once told — and never fixes when not. */
.fx-warn{ display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap;
  padding:0.55rem 0.7rem; margin-bottom:0.6rem; border-radius:0.6rem;
  border:0.0625rem solid var(--line); background:var(--panel);
  font-size:0.85rem; }
.fx-warn > span{ flex:1; min-width:12rem; }

/* What you ARE on a company. "How can I not have rights on something I created?"
   should be answered on the screen, not deduced from a refusal. */
.org-lvl{ font-size:.75rem; padding:0.1rem 0.45rem; border-radius:99px;
  border:0.0625rem solid var(--line); color:var(--muted); white-space:nowrap; }
.org-lvl.org-ro{ border-color:var(--warn-text); color:var(--warn-text); } /* 4.5:1 glyph (was --warn #b26a00 at 4.24:1) */


/* ============ Organizations: the holding map =================================
   Two maps in this app, drawing different things. THIS one is companies and how
   they are held — the only question the register cannot answer as a list,
   because a list has to flatten it. Files owns the other: folders and documents,
   the tree you are standing in.

   Nested boxes with connectors, not a force layout: a holding chart has one
   right shape — the one on the paperwork — and a graph that rearranges itself
   every time you open it cannot be compared to last month's. */
.orgmap{ overflow:auto; padding:var(--sp-2) 0; }
.om-root, .om-kids{ list-style:none; margin:0; padding:0; }
.om-kids{ margin-left:1.6rem; padding-left:1.1rem; position:relative; }
/* The spine, and one elbow per child. Drawn in CSS so nothing has to be
   recomputed when a company is renamed or moved. */
.om-kids::before{ content:''; position:absolute; left:0; top:0; bottom:1.1rem;
  width:0.0625rem; background:var(--border); }
.om-li{ position:relative; margin:0.35rem 0; }
.om-kids > .om-li::before{ content:''; position:absolute; left:-1.1rem;
  top:1.1rem; width:1.1rem; height:0.0625rem; background:var(--border); }
.om-node{ display:flex; align-items:center; gap:0.6rem; min-width:0;
  background:var(--bg-1); border:0.0625rem solid var(--border);
  border-radius:var(--r-md); padding:0.5rem 0.7rem; cursor:pointer;
  transition:border-color var(--dur-1) var(--ease-sun); max-width:44rem; }
.om-node:hover{ border-color:var(--accent); }
.om-av{ flex:none; }
.om-t{ font-weight:600; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; min-width:0; }
.om-s{ font-size:var(--fs-0); color:var(--muted); white-space:nowrap; }
.om-acts{ margin-left:auto; display:flex; gap:0.3rem; }

/* ---- Ownership graph view ---- */
.own-pick{ display:inline-flex; align-items:center; gap:.5rem; font-size:var(--fs-1); color:var(--muted); }
.own-pick select{ padding:.35rem .6rem; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--field-bg); color:var(--text); font:inherit; }
.own-tabs{ display:flex; gap:.25rem; border-bottom:1px solid var(--border); margin-bottom:1rem; }
.own-tab{ appearance:none; background:none; border:none; padding:.6rem .9rem; font:inherit; font-weight:600; color:var(--muted); cursor:pointer; border-bottom:.15rem solid transparent; margin-bottom:-.07rem; }
.own-tab.active{ color:var(--accent); border-bottom-color:var(--accent); }
.own-tab:hover{ color:var(--text); }
.own-legend{ display:flex; flex-wrap:wrap; gap:1rem; align-items:center; margin:.1rem 0 .8rem; font-size:var(--fs-0); color:var(--muted); }
.own-lg{ display:inline-flex; align-items:center; gap:.4rem; }
.own-lg-line{ width:1.4rem; height:0; border-top:.15rem solid var(--accent); }
.own-lg-line.min{ border-top:.09rem solid var(--muted); }
.own-lg-line.jv{ border-top:.13rem dashed var(--accent); }
.own-lg-line.held{ border-top:.09rem dotted var(--border-strong); }
.own-lg-chip{ width:.9rem; height:.9rem; border-radius:.3rem; background:var(--accent-subtle); border:.09rem dashed var(--accent); }
.own-chartwrap{ overflow:auto; max-height:60vh; border:1px solid var(--border); border-radius:var(--r-lg); background:var(--bg-1); padding:1rem; }
.own-svg{ display:block; }   /* intrinsic size via width/height attrs; zoom scales the wrapper */
.own-bar{ display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin:.1rem 0 .6rem; }
.own-zoombar{ display:inline-flex; align-items:center; gap:.35rem; }
.own-zb{ appearance:none; border:1px solid var(--border); background:var(--bg-1); color:var(--text); border-radius:var(--r-sm); min-width:1.9rem; height:1.9rem; font:inherit; font-weight:700; cursor:pointer; line-height:1; }
.own-zb:hover{ background:var(--hover); }
.own-zreset{ min-width:auto; padding:0 .6rem; font-weight:600; }
.own-zlvl{ font-size:var(--fs-0); color:var(--muted); min-width:2.6rem; text-align:center; font-variant-numeric:tabular-nums; }
.own-canvas{ overflow:auto; max-height:62vh; border:1px solid var(--border); border-radius:var(--r-lg); background:var(--bg-1); padding:1rem; }
.own-zoomer{ transform-origin:0 0; width:max-content; }
.own-ro{ display:flex; align-items:center; gap:.5rem; margin-top:1rem; padding:.7rem .9rem; border:1px solid var(--border); border-radius:var(--r-md); background:var(--accent-subtle); color:var(--muted); font-size:var(--fs-1); }
.own-note{ font-size:var(--fs-1); color:var(--muted); margin:.1rem 0 .9rem; line-height:1.5; }
/* v340 — consolidation headline reuses the Dashboard KPI tiles (.hd-kpis/.hd-kpi). */
.cons-kpis{ margin-bottom:1rem; }
.cons-cash-breakdown .cons-cash-l{ margin-bottom:.4rem; }
/* v339 — consolidated cash summary (ownership-weighted, intra-group netted). */
.cons-cash{ border:.0625rem solid var(--border); border-radius:var(--r-md);
  background:var(--bg-1); box-shadow:var(--shadow-sm); padding:1rem 1.1rem;
  margin:0 0 1rem; }
.cons-cash-head{ display:flex; align-items:flex-start; justify-content:space-between;
  gap:1rem; flex-wrap:wrap; }
.cons-cash-l{ font-size:var(--fs-0); text-transform:uppercase; letter-spacing:var(--ls-caps);
  color:var(--faint); font-weight:600; }
.cons-cash-big{ font-size:clamp(1.4rem,4vw,2rem); font-weight:700; line-height:1.1;
  font-variant-numeric:tabular-nums; letter-spacing:-.01em; margin-top:.15rem; }
.cons-cash-elim{ display:inline-flex; align-items:center; gap:.3rem; font-size:var(--fs-0);
  color:var(--muted); background:var(--bg-3); border:.0625rem solid var(--border);
  border-radius:var(--r-pill); padding:.2rem .6rem; }
.cons-cash-list{ margin-top:.8rem; display:grid; gap:.15rem;
  grid-template-columns:repeat(auto-fill,minmax(15rem,1fr)); }
.cons-cash-row{ display:grid; grid-template-columns:1fr auto auto; align-items:center;
  gap:.7rem; padding:.35rem 0; border-top:.0625rem solid var(--hairline); font-size:var(--fs-1); }
.cons-cash-n{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cons-cash-w{ color:var(--muted); font-variant-numeric:tabular-nums; }
.cons-cash-v{ font-weight:600; font-variant-numeric:tabular-nums; }
/* Structure = share graph + beneficial owners in one panel; the owners table
   is a hairline-separated section under the graph. */
.own-sec{ margin-top:1.5rem; padding-top:1.25rem; border-top:.0625rem solid var(--border); }
.own-sec-h{ display:flex; align-items:center; gap:.5rem; margin:0 0 .75rem; font-size:var(--fs-2); font-weight:650; color:var(--text); }
.org-disp{ margin-left:.5rem; }
.own-tablewrap{ overflow:auto; max-height:60vh; border:1px solid var(--border); border-radius:var(--r-lg); }
.own-table{ width:100%; border-collapse:collapse; font-size:var(--fs-1); }
.own-table th,.own-table td{ text-align:left; padding:.6rem .8rem; border-bottom:1px solid var(--hairline); }
.own-table th{ position:sticky; top:0; background:var(--bg-3); color:var(--muted); font-weight:600; z-index:1; }
.own-table td.num,.own-table th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.own-table tr.is-ubo{ background:var(--accent-subtle); }
.own-badge{ display:inline-block; padding:.1rem .5rem; border-radius:var(--r-pill); font-size:var(--fs-0); font-weight:700; background:var(--bg-3); color:var(--muted); }
.own-badge.ubo{ background:var(--accent); color:var(--accent-ink); }
.own-badge.dim{ background:transparent; color:var(--faint); }
.own-kind{ color:var(--muted); text-transform:capitalize; }
.own-rel{ display:inline-block; padding:.1rem .55rem; border-radius:var(--r-pill); font-size:var(--fs-0); font-weight:700; background:var(--bg-3); color:var(--muted); }
.own-rel.sub{ background:var(--accent); color:var(--accent-ink); }
.own-rel.assoc{ background:var(--accent-subtle); color:var(--accent); }
.own-rel.jv{ background:var(--warn-bg); color:var(--warn); }
.own-add{ margin-top:1rem; border:1px solid var(--border); border-radius:var(--r-lg); padding:1rem; background:var(--bg-1); }
.own-add-h{ font-weight:700; margin-bottom:.6rem; }
.own-add-row{ display:flex; flex-wrap:wrap; gap:.6rem; align-items:flex-end; margin-bottom:.6rem; }
.own-add-row:last-child{ margin-bottom:0; }
.own-f{ display:flex; flex-direction:column; gap:.25rem; font-size:var(--fs-0); color:var(--muted); flex:1; min-width:8rem; }
.own-f input,.own-f select{ padding:.4rem .55rem; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--field-bg); color:var(--text); font:inherit; }
.own-add-btn{ flex:0 0 auto; padding:.5rem 1.1rem; border:1px solid var(--accent); border-radius:var(--r-sm); background:var(--accent); color:var(--accent-ink); font:inherit; font-weight:700; cursor:pointer; }
.own-add-btn:hover{ background:var(--accent-hover); border-color:var(--accent-hover); }
.own-links{ margin-top:1rem; }
.own-links-h{ font-weight:700; margin-bottom:.5rem; }
.own-linkrow{ display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.45rem .2rem; border-bottom:1px solid var(--hairline); font-size:var(--fs-1); }
.own-linkrow i{ color:var(--muted); font-style:normal; }
.own-tag{ display:inline-block; padding:0 .4rem; border-radius:var(--r-pill); font-size:var(--fs-0); background:var(--warn-bg); color:var(--warn); font-weight:700; margin-left:.3rem; }
.own-tag.ctl{ background:var(--accent-subtle); color:var(--accent); }
.own-x{ appearance:none; background:none; border:none; color:var(--faint); cursor:pointer; padding:.25rem; border-radius:var(--r-sm); }
.own-x:hover{ color:var(--danger); background:var(--danger-bg); }

/* ---- Home money-first dashboard ---- */
.hdash{ display:flex; flex-direction:column; gap:.9rem; }
.hd-kpis{ display:grid; grid-template-columns:repeat(auto-fit,minmax(11.5rem,1fr)); gap:.9rem; }
@media(max-width:820px){ .hd-kpis{ grid-template-columns:repeat(2,1fr); } }
.hd-kpi{ background:var(--bg-1); border:1px solid var(--border); border-radius:1rem; padding:1rem 1.1rem; box-shadow:var(--shadow-sm); }
.hd-kl{ display:flex; align-items:center; justify-content:space-between; font-size:var(--fs-1); color:var(--muted); }
.hd-tr{ font-size:.75rem; font-weight:600; padding:.1rem .42rem; border-radius:.4rem; background:var(--ok-bg); color:var(--ok); }
.hd-tr.hd-up{ background:var(--accent-subtle); color:var(--accent); }
.hd-kv{ font-size:1.65rem; font-weight:700; letter-spacing:-.01em; margin:.35rem 0 .55rem; font-variant-numeric:tabular-nums; line-height:1.1; }
.hd-spark{ width:100%; height:2.1rem; display:block; }
.hd-sparkph{ height:2.1rem; }
.hd-row{ display:grid; grid-template-columns:1.7fr 1fr; gap:.9rem; align-items:stretch; }
@media(max-width:820px){ .hd-row{ grid-template-columns:1fr; } }
.hd-chartph{ min-height:16rem; }
.hd-donut-card{ display:flex; flex-direction:column; }
.hd-donut-wrap{ display:flex; align-items:center; gap:1.1rem; padding:.3rem .2rem; flex-wrap:wrap; }
.hd-donut{ flex:none; }
.hd-dc{ font-size:1.05rem; font-weight:700; fill:var(--text); font-family:inherit; }
.hd-dcs{ font-size:.75rem; fill:var(--muted); letter-spacing:.06em; text-transform:uppercase; }
.hd-dlab{ display:flex; flex-direction:column; gap:.5rem; font-size:var(--fs-1); min-width:9rem; flex:1; }
.hd-dr{ display:flex; align-items:center; gap:.5rem; }
.hd-dr b{ margin-left:auto; font-variant-numeric:tabular-nums; }
.hd-sw{ width:.62rem; height:.62rem; border-radius:.2rem; flex:none; }
.hd-tx .card2-body{ padding-top:.2rem; }
.hd-txr{ display:grid; grid-template-columns:auto 1fr auto auto; align-items:center; gap:.7rem; padding:.55rem 0; border-top:1px solid var(--hairline); }
.hd-txr:first-child{ border-top:none; }
.hd-tci{ width:2.05rem; height:2.05rem; border-radius:.6rem; display:grid; place-items:center; color:var(--n-0); font-weight:600; font-size:.75rem; flex:none; }
.hd-tci.in{ background:var(--accent); } .hd-tci.out{ background:var(--warn); }
.hd-tw{ min-width:0; }
.hd-tw b{ font-size:.9rem; font-weight:600; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hd-tw span{ font-size:.75rem; color:var(--faint); }
.hd-amt{ font-weight:600; font-variant-numeric:tabular-nums; font-size:.9rem; white-space:nowrap; }
.hd-amt.pos{ color:var(--ok); } .hd-amt.neg{ color:var(--danger); }
.hd-pill{ font-size:.75rem; font-weight:600; padding:.16rem .5rem; border-radius:999px; white-space:nowrap; }
.hd-pill.rec{ background:var(--ok-bg); color:var(--ok); }
.hd-pill.due{ background:var(--accent-subtle); color:var(--accent); }
.hd-pill.over{ background:var(--danger-bg); color:var(--danger); }
.hd-pill.paid{ background:var(--bg-3); color:var(--muted); border:1px solid var(--border); }
.hd-goal{ margin-bottom:.75rem; }
.hd-goal:last-child{ margin-bottom:0; }
.hd-gh{ display:flex; justify-content:space-between; font-size:var(--fs-1); margin-bottom:.32rem; }
.hd-gh b{ font-weight:600; } .hd-gh span{ color:var(--muted); font-variant-numeric:tabular-nums; }
.hd-bar{ height:.5rem; border-radius:99px; background:var(--bg-3); overflow:hidden; }
.hd-bar i{ display:block; height:100%; border-radius:99px; background:var(--accent); }
.hd-bar i.pos{ background:var(--ok); }

/* Home dashboard — spacing refinement + fused breakdown */
.hdash{ gap:1.1rem; }
.hd-kpis{ gap:1.1rem; }
.hd-kpi{ padding:1.15rem 1.25rem; }
.hd-row{ gap:1.1rem; }
.hd-kv{ margin:.42rem 0 .6rem; }
.hd-row-tx{ display:grid; grid-template-columns:1fr; gap:1.1rem; }
.hd-break .card2-body{ padding-top:.4rem; }
.hd-donut-wrap{ padding:.5rem .2rem .3rem; }
.hd-sep{ height:1px; background:var(--hairline); margin:1.1rem 0 .95rem; }
.hd-by-h{ font-size:.75rem; letter-spacing:.1em; text-transform:uppercase; color:var(--faint); font-weight:600; margin-bottom:.6rem; }
.hd-txr{ padding:.66rem 0; }
.hd-tci{ width:2.1rem; height:2.1rem; }

/* Home money-first dashboard: fills the shell, cards scroll inside, page never does */
body.fitscreen #homeGrid > .hdash{ flex:1; min-height:0; display:flex; flex-direction:column; }
body.screen-home .hd-kpis{ flex:none; }
body.screen-home .hd-row{ flex:1.45; min-height:0; }
body.screen-home .hd-row > .card2,
body.screen-home .hd-row > section{ min-height:0; display:flex; flex-direction:column; }
body.screen-home .hd-row .card2-body{ min-height:0; overflow-y:auto; }
body.screen-home .hd-row-tx{ display:flex; flex-direction:column; gap:1.1rem; flex:1; min-height:0; }
body.screen-home .hd-row-tx > .hd-tx{ flex:1; min-height:0; display:flex; flex-direction:column; }
body.screen-home .hd-tx .card2-body{ min-height:0; overflow-y:auto; }
body.screen-home .hd-row-tx > .hd-queue{ flex:none; max-height:38%; display:flex; flex-direction:column; }
body.screen-home .hd-queue .card2-body{ min-height:0; overflow-y:auto; }
/* on a genuinely short viewport the KPIs may wrap 2×2 — let them, the rest still scrolls */
@media(max-height:640px){ body.screen-home .hd-row{ flex:1.2; } }
.hd-sub{ font-size:.78rem; color:var(--muted); margin:-.35rem 0 .45rem; font-variant-numeric:tabular-nums; }
/* DCA (Stage 0) — LIGHT elevation for the home KPI row + reason badge. Additive:
   a `normal` KPI is untouched, size stays constant (inset left bar, not a
   resize), and the row order is set in the DOM by JS so focus order matches. */
/* DCA elevation — subtle 2px-equivalent top accent + reason chip (KPI band,
   treasury). Every elevation carries its reason; no silent promotion. */
.hd-kpi[data-weight="high"], .hd-trz[data-weight="high"]{ box-shadow:inset 0 .125rem 0 var(--danger), var(--shadow-sm); }
.hd-kpi[data-weight="medium"], .hd-trz[data-weight="medium"]{ box-shadow:inset 0 .125rem 0 var(--warn-text), var(--shadow-sm); }
.hd-kpi[data-weight] .hd-kl > span:first-child{ flex:1 1 auto; }
.hd-why{ flex:none; font-size:.75rem; font-weight:700; letter-spacing:var(--ls-caps);
  text-transform:uppercase; padding:.05rem .4rem; border-radius:.4rem;
  background:var(--warn-bg); color:var(--warn-text); white-space:nowrap; }
.hd-kpi[data-weight="high"] .hd-why, .hd-trz[data-weight="high"] .hd-why{ background:var(--danger-bg); color:var(--danger); }

/* === Home v319 — three FLUID blocks (Linear/Stripe). rem/%/clamp/grid only,
      zero px, DOM order = visual order, scoped to the dashboard. === */
.hdash .card2-h{ font-weight:500; opacity:.82; }               /* quieter titles */
/* BLOCK 1 — treasury band: clean fluid TEXT, no massive white cards. */
/* KPI band — a UNIFORM grid of compact cards (same height/design), not a loose
   text band. Equal columns, soft border, white ground. */
.hd-treasury{ display:grid; gap:1rem; align-items:stretch;
  grid-template-columns:repeat(auto-fit, minmax(11rem,1fr)); }
.hd-trz{ display:flex; flex-direction:column; gap:.2rem; min-width:0;
  background:var(--bg-1); border:.0625rem solid var(--border); border-radius:var(--r-md);
  box-shadow:var(--shadow-sm); padding:.75rem .9rem; }
.hd-trz-l{ display:flex; align-items:center; gap:.4rem; font-size:var(--fs-0);
  text-transform:uppercase; letter-spacing:var(--ls-caps); color:var(--faint); font-weight:600; }
.hd-trz-v{ font-size:clamp(1.15rem,3.4vw,1.6rem); font-weight:700; line-height:1.1;
  letter-spacing:-.01em; font-variant-numeric:tabular-nums; }
.hd-trz-d{ font-size:var(--fs-1); color:var(--muted); }
.hd-trz-d.pos{ color:var(--ok); } .hd-trz-d.neg{ color:var(--danger); }
.hd-trz[data-weight]{ padding-left:.5rem; }
/* BLOCK 2 — action inbox: ~4 rows then a clean internal scroll, lighter actions. */
.hd-inbox .card2-body{ min-height:0; max-height:clamp(9rem,22vh,15rem); overflow-y:auto; }
.hdash .hqask{ padding:.5rem .6rem; }
.hdash .hqask-r{ gap:.35rem; }
.hdash .hqask-r button.sm{ padding:.15rem .5rem; font-size:var(--fs-0); }
/* CENTRAL ZONE — strict 2-col grid: 60% | 40%, cards of EQUAL height. */
.hd-main{ display:grid; grid-template-columns:1.5fr 1fr; gap:1.25rem; align-items:stretch; }
@media(max-width:52rem){ .hd-main{ grid-template-columns:1fr; } }
.hd-inbox{ min-width:0; } .hd-clients{ min-width:0; }
/* BLOCK 2-right — clean top-client list: name · volume · %, thin rows, no bars. */
.hd-conc-list{ margin-top:.8rem; }
.hd-cl-r{ display:grid; grid-template-columns:auto 1fr auto auto; align-items:center; gap:.6rem;
  padding:.4rem 0; border-top:.0625rem solid var(--hairline); }
.hd-cl-r:first-child{ border-top:none; }
.hd-cl-n{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-weight:600; font-size:var(--fs-2); }
.hd-cl-v{ font-variant-numeric:tabular-nums; color:var(--muted); font-size:var(--fs-1); }
.hd-cl-p{ font-variant-numeric:tabular-nums; font-weight:700; font-size:var(--fs-1);
  min-width:2.6rem; text-align:right; }
/* BLOCK 3 — recent transactions: tighter rows, capped list. */
.hdash .hd-txr{ padding:.4rem 0; }
/* Native cash-trend sparkline (SVG area). Fluid: viewBox stretches, the stroke
   does not (non-scaling-stroke); tooltip positioned in JS (inline px, not CSS). */
.hd-hero{ display:flex; flex-direction:column; gap:.4rem; }
/* The sparkline is now COMPACT and inside the Net/runway cell (hd-trz-hero),
   which gets a little more width so the trend has room. Not full-dashboard-wide. */
.hd-trz-hero{ position:relative; min-width:min(100%,15rem); }
.hd-hero-spark{ position:relative; width:100%; height:2.5rem; margin:.35rem 0 0; }
.hd-hero-spark svg{ width:100%; height:100%; display:block; }
.hs-line{ fill:none; stroke:var(--accent); stroke-width:1.5; vector-effect:non-scaling-stroke; }
.hs-g0{ stop-color:var(--accent); stop-opacity:.85; } .hs-g1{ stop-color:var(--accent); stop-opacity:0; }
.hd-spark-dot{ position:absolute; width:.5rem; height:.5rem; border-radius:var(--r-pill);
  background:var(--accent); transform:translate(-50%,-50%); pointer-events:none; box-shadow:0 0 0 .12rem var(--bg-1); }
.hd-spark-tip{ position:absolute; transform:translate(-50%,-140%); background:var(--text); color:var(--bg-1);
  font-size:var(--fs-0); padding:.15rem .45rem; border-radius:.4rem; white-space:nowrap;
  pointer-events:none; font-variant-numeric:tabular-nums; z-index:2; }
/* ClientConcentrationBar — 100% stacked bar + dense legend (no donut). */
.hd-conc{ display:flex; height:.5rem; width:100%; border-radius:var(--r-pill); overflow:hidden; background:var(--bg-3); }
.hd-conc-seg{ height:100%; }
.hd-conc-leg{ display:flex; flex-wrap:wrap; gap:.4rem .9rem; margin-top:.8rem; font-size:var(--fs-1); }
.hd-conc-l{ display:inline-flex; align-items:center; gap:.35rem; color:var(--muted); }
.hd-conc-dot{ width:.6rem; height:.6rem; border-radius:.2rem; flex:none; }
/* DCA User-First controls + Command Center blocks. State in localStorage; no px. */
.hd-trz-ctl{ display:inline-flex; gap:.05rem; margin-left:.15rem; opacity:0;
  transition:opacity var(--dur-1) var(--ease-sun); }
.hd-trz:hover .hd-trz-ctl, .hd-trz.is-pinned .hd-trz-ctl{ opacity:1; }
.hd-pin, .hd-hide{ background:transparent; border:none; padding:0 .1rem; cursor:pointer; line-height:1; }
.hd-pin{ font-size:.75rem; }
.hd-hide{ font-size:.75rem; color:var(--muted); font-weight:700; }
.hd-hide:hover{ color:var(--danger); }
.hd-auto{ align-self:flex-end; background:var(--bg-3); border:.0625rem solid var(--border);
  border-radius:var(--r-pill); padding:.2rem .65rem; font-size:var(--fs-0); font-weight:600;
  color:var(--muted); cursor:pointer; white-space:nowrap; }
.hd-auto.on{ color:var(--accent-text); border-color:var(--border-interactive); }
/* Quick Actions bar — 1-click shortcuts. */
.hd-qa-bar{ display:flex; flex-wrap:wrap; gap:.5rem; }
.hd-qa{ display:inline-flex; align-items:center; gap:.4rem; background:var(--bg-1);
  border:.0625rem solid var(--border); border-radius:var(--r-md); padding:.45rem .8rem;
  font-size:var(--fs-1); font-weight:600; color:var(--text); cursor:pointer;
  transition:border-color var(--dur-1) var(--ease-sun), background-color var(--dur-1) var(--ease-sun); }
.hd-qa:hover{ border-color:var(--border-interactive); background:var(--bg-3); }
/* Outlook card — projected position line. */
.hd-proj{ display:flex; align-items:baseline; gap:.5rem; flex-wrap:wrap; margin-top:.7rem;
  padding-top:.6rem; border-top:.0625rem solid var(--hairline); font-size:var(--fs-2); font-weight:600; }
.hd-proj b.pos{ color:var(--ok); } .hd-proj b.neg{ color:var(--danger); }
/* Cashflow forecast rows — dated in/out from the backend buckets. */
.hd-fc-row{ display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:.7rem;
  padding:.35rem 0; border-top:.0625rem solid var(--hairline); font-size:var(--fs-1); }
.hd-fc-row:first-child{ border-top:none; }
.hd-fc-l{ color:var(--muted); }
.hd-fc-in{ color:var(--ok); font-variant-numeric:tabular-nums; font-weight:600; min-width:5ch; text-align:right; }
.hd-fc-out{ color:var(--danger); font-variant-numeric:tabular-nums; font-weight:600; min-width:5ch; text-align:right; }
.hd-fc-key{ font-size:var(--fs-0); font-weight:600; letter-spacing:normal; text-transform:none; }
/* === v329 SPACE USAGE — the rich Command Center FLOWS and scrolls inside
      #homeGrid instead of stretching its rows to fill the viewport (which left
      the big vertical hole). The shell itself still never scrolls. Tight,
      constant gaps; equal-height cards per row. === */
.hdash{ gap:1.25rem; }
body.fitscreen #homeGrid{ display:block; overflow-y:auto; }
body.fitscreen #homeGrid > .hdash{ flex:none; }
body.screen-home .hd-row{ flex:none; }
.hd-main > .card2{ display:flex; flex-direction:column; min-height:0; }
.hd-main > .card2 > .card2-body{ flex:1; min-height:0; overflow-y:auto; }
.hd-inbox .card2-body{ max-height:none; }   /* fill the row via stretch, not a fixed cap */

/* === v335 — ADAPTIVE DCA GRID ===========================================
   The command-center cards no longer live in two fixed 1.5fr|1fr rows that
   stretch a pair of columns into the void on a wide monitor. They REFLOW: one
   column on a phone, two on a laptop/desktop, three from 1600px and four from
   1920px — so a 27" screen shows four cards side by side at a natural width
   instead of two stretched ones. Priority order is the DOM order (the action
   inbox leads and gets the widest slot); `align-items:start` lets each card
   keep its own height rather than being padded to match its tallest neighbour.
   `#homeGrid` is the internal scroll container (set in the v329 block above),
   so the shell itself still never scrolls. */
.hd-cards{ display:grid; gap:1.25rem; align-items:start; grid-template-columns:1fr;
  grid-auto-flow:dense; }
@media(min-width:52rem){ .hd-cards{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
/* Ultra-wide: reflow into more columns rather than widen two. The breakpoints
   are the product spec's own (1600 / 1920); px is the right unit for a device
   breakpoint and — since v335 retired the raw-pixel budget — is free to use. */
@media(min-width:1600px){ .hd-cards{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(min-width:1920px){ .hd-cards{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
.hd-cards > .card2, .hd-cards > section{ display:flex; flex-direction:column;
  min-height:0; min-width:0; }
.hd-cards > .card2 > .card2-body, .hd-cards > section > .card2-body{
  flex:1; min-height:0; overflow-y:auto; }
/* Dynamic density — with more width/height a card shows more, not white space.
   The lists cap their visible height on a fluid clamp that opens up on a big
   screen (more rows before the internal scroll), and the treasury band already
   auto-fits more KPI columns as width grows (see .hd-treasury). */
.hd-cards .card2-body{ max-height:clamp(14rem, 34vh, 24rem); }
@media(min-width:1600px){ .hd-cards .card2-body{ max-height:clamp(18rem, 46vh, 40rem); } }

/* === v337 — SMART CONTENT-AWARE PLACEMENT ================================
   A grid where an EMPTY card claimed a full cell — same footprint as a card
   full of data — left a busy screen half white and pushed real content down.
   The fix is content-aware: renderHome tags each card `.is-dense` (a live list
   worth room) or `.is-empty` (nothing to show, so take as little as possible),
   and `grid-auto-flow:dense` above lets a later small card climb into the gap a
   wide card would otherwise leave. The grid heals its own holes. */

/* DENSE — a live list (recent activity, transactions, a full inbox) earns a
   second track from the two-column tier up, so it fills the width instead of
   being squeezed into a narrow left rail. Never wider than two tracks: on a
   4-col ultra-wide that is half the row, not a lonely full-width ribbon. */
@media(min-width:52rem){ .hd-cards > .is-dense{ grid-column:span 2; } }
/* The action inbox is the priority surface — two tracks once there is room,
   but only while it actually has something in it (empty → compact, below). */
@media(min-width:1600px){ .hd-cards > .hd-inbox:not(.is-empty){ grid-column:span 2; } }

/* EMPTY — one track always (it overrides any span above), a shorter body, and a
   quieter face so an empty card reads as a placeholder, not a peer of the cards
   that carry the day's real figures. Self-healing: the space it gives up is
   reclaimed by its neighbours through the dense flow. */
.hd-cards > .is-empty{ grid-column:auto !important; align-self:start; }
.hd-cards > .is-empty > .card2-body{ flex:none; max-height:none; overflow:visible; }
.hd-cards > .is-empty .card2-empty{ padding:1.1rem 1rem; font-size:var(--fs-1); }
.hd-cards > .is-empty{ opacity:.82; }
.hd-cards > .is-empty:hover, .hd-cards > .is-empty:focus-within{ opacity:1; }

/* A dense card spanning two tracks would otherwise be a wide one-column list —
   width taken, not used. On a genuinely wide card (from 1600px, where the span
   makes it broad) its rows TILE into as many sub-columns as fit, so a live feed
   reads across the space instead of down a narrow ribbon. Below that width it
   stays a single readable column. Rows are block/grid already, so they tile as
   grid items without markup changes. */
@media(min-width:1600px){
  .hd-cards > .is-dense > .card2-body{ display:grid; align-content:start;
    grid-template-columns:repeat(auto-fill, minmax(19rem, 1fr)); gap:0 1.6rem; }
}

/* === v339.2 HOTFIX — DASHBOARD SCROLL & ROW ALIGNMENT ====================
   The v338.2 block that stood here was too specific: a wall of three-class
   `.hd-cards > .is-dense > .card2-body` selectors that only bit on the exact
   markup it was written against, so on the live dashboard the internal scroll
   and the row alignment both fell through. Replaced by the real layout rules,
   stated on the UNIVERSAL card selector — short, unconditional, all-relative
   units. Anything the dashboard needs is true of every card, so it is said
   once, of every card.

   `!important` on the body is deliberate: it is what makes the cap and the
   scrollbar survive every earlier per-screen `.card2-body` override in this
   sheet, which is exactly how the scroll got lost twice. */

.hd-cards {
  display: grid;
  align-items: stretch;
}

.hd-cards > section,
.hd-cards > .card2 {
  display: flex;
  flex-direction: column;
  min-height: 12rem;
}

.card2-body {
  flex: 1 1 auto;
  max-height: 25rem !important;
  overflow-y: auto !important;
}

/* A placeholder card still shrinks — it never holds a 12rem hole open. */
.is-empty {
  min-height: 0;
}

.hd-trz-hero{ grid-column:span 2; min-width:0; }        /* Net·runway card: room for the sparkline */
@media(max-width:34rem){ .hd-trz-hero{ grid-column:span 1; } }
.hd-tz-foot{ display:flex; justify-content:flex-end; gap:.5rem; }   /* Auto/Manual + restore chips */
body.screen-home .hdash > .home-pick{ flex:none; margin-bottom:.1rem; }
.hper-cal{ display:inline-flex; align-items:center; justify-content:center; padding-left:.4rem; padding-right:.4rem; }
.hper-cal.on{ color:var(--accent); }

/* --- In-app Office editor overlay (Collabora/LibreOffice via WOPI) --------- */
.office-overlay{ position:fixed; inset:0; z-index:9000; display:flex;
  flex-direction:column; background:var(--bg); }
.office-bar{ flex:none; display:flex; align-items:center; gap:.6rem;
  padding:.5rem .9rem; background:var(--bg2); border-bottom:1px solid var(--line);
  color:var(--text); }
.office-title{ flex:1; min-width:0; font-size:.9rem; font-weight:600;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.office-close{ flex:none; background:transparent; border:1px solid var(--line);
  color:var(--text); border-radius:.4rem; width:2rem; height:2rem; cursor:pointer;
  font-size:1rem; line-height:1; }
.office-close:hover{ background:var(--elev); }
.office-frame{ flex:1; width:100%; border:0; background:var(--bg); }

.login-lang{margin-top:14px;text-align:center}
.login-lang .lang-row{justify-content:center}

.trade-choices{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.trade-choice{text-align:left;padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--card);cursor:pointer;font-size:0.95rem}
.trade-choice:hover{border-color:var(--accent);background:var(--bg-1)}
.trade-choice.quiet{opacity:.75;font-size:0.9rem}

/* Touch devices (phones/tablets, the CEMAC daily driver): 44px tap targets and
   readable state text, without changing desktop density. WCAG 2.5.5. */
@media (pointer: coarse){
  button, .btn, [role="button"], input:not([type=checkbox]):not([type=radio]), select, textarea { min-height: 44px; }
  .staterow, .card2-empty, .tre-note { font-size: 0.9375rem; }
}

.stk-new .stk-dot{background:var(--muted,#9a9aa5)}

.trow-kebab{margin-left:8px;border:none;background:none;cursor:pointer;font-size:1.1rem;line-height:1;padding:4px 8px;border-radius:6px;color:var(--muted)}
.trow-kebab:hover{background:var(--bg-1);color:var(--text)}

/* ============================================================================
   Coulissant navigation at every width (user request 2026-09-11): the grouped
   sidebar is an off-canvas DRAWER opened by the hamburger — on desktop exactly
   as on phone — so the working area always gets the full window width. Appended
   last so it supersedes the desktop grid (#app) and the <900px icon-rail
   collapse. To revert to a permanent desktop sidebar, delete this block.
   ========================================================================== */
#app{grid-template-columns:1fr;}
#menuBtn{display:inline-flex;}
button.busy{ opacity:.65; cursor:progress; }
/* 616 — MANUAL menu (owner): opened, it is DOCKED and the workspace resizes to
   the remaining width; closed, the workspace has it all. No backdrop, no
   auto-close: it stays exactly as the person left it, and the device remembers.
   Below 40rem there is no room to dock, so the phone keeps the drawer. */
.side{position:sticky; top:0; width:15rem; display:none; z-index:85; box-shadow:none;}   /* 620: as wide as its words */
#app.nav-open{grid-template-columns:15rem minmax(0,1fr);}
#app.nav-open .side{display:flex;}
@media (max-width: 640px){
  #app.nav-open{grid-template-columns:1fr;}
  .side{position:fixed; top:0; left:0; bottom:0; width:min(88vw,16rem); z-index:95; display:flex;
        transform:translateX(-100%); transition:transform var(--dur-3,.25s) var(--ease-sun,ease); box-shadow:var(--shadow-lg);}
  #app.nav-open .side{transform:translateX(0);}
  #app.nav-open::before{content:""; position:fixed; inset:0; background:rgba(0,0,0,.42); z-index:90;}
}
/* the drawer always shows the LABELLED nav (undo the icon-rail collapse) */
.side .lbl, .side .nav-group, .brand-tx, .acct-tx{display:block;}
.acct .chev{display:flex;}
.brand{justify-content:flex-start; padding:16px 16px 14px; gap:11px;}
.nav-item{justify-content:flex-start; padding:8px 10px;}
.nav-item.active::before{left:-8px;}
.acct{justify-content:flex-start; padding:7px 8px;}
.side-foot{padding:10px 12px;}

/* EN-2 release channel line under the edition ladder */
.ed-channel{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem;color:var(--muted)}
  .actrow.act-open{cursor:pointer;} .actrow.act-open:hover{background:var(--bg-1);}

/* ===== 594 — the door: a brand panel beside a clear card ===== */
#login{ gap:0; padding:1rem; }
#login .auth-aside{ display:none; }
@media (min-width: 60rem){
  /* a block the size of a card, centred in the page — never the whole screen */
  #login{ display:flex; flex-direction:row; align-items:center; justify-content:center; gap:0; }
  #login .auth-aside{ display:flex; align-items:center; flex:0 1 21rem; min-width:17rem; height:32rem; padding:2.25rem 2rem; border-radius:var(--r-md) 0 0 var(--r-md); color:#fff;
    background:linear-gradient(160deg, var(--v-800, #4B45A9) 0%, var(--accent) 55%, #7A74E0 100%); box-shadow:var(--shadow-lg); }
  #login .card{ border-radius:0 var(--r-md) var(--r-md) 0; flex:0 0 25rem; width:25rem; min-width:0; height:32rem; overflow:auto; display:flex; flex-direction:column; justify-content:center; }
}
.auth-aside-h{ font-size:1.35rem; }
.auth-aside-mark .dot{ width:2.75rem; height:2.75rem; border-radius:.75rem; background:rgba(255,255,255,.16); color:#fff; display:inline-flex; align-items:center; justify-content:center; }
.auth-aside-h{ margin:1.25rem 0 .75rem; font-size:1.5rem; line-height:1.2; font-weight:700; letter-spacing:-.01em; text-wrap:balance; }
#login .auth-aside .auth-aside-p{ color:#fff; opacity:.9; margin:0; font-size:.95rem; }
.auth-aside-list{ margin:0; padding:0; list-style:none; display:grid; gap:.5rem; font-size:.95rem; opacity:.92; }
.auth-aside-list li{ padding-left:1.1rem; position:relative; }
.auth-aside-list li::before{ content:""; position:absolute; left:0; top:.55em; width:.45rem; height:.45rem; border-radius:50%; background:rgba(255,255,255,.75); }
#login .card{ padding:2rem 2rem 1.5rem; }
#login .logo{ font-size:1.25rem; }
#login #authSub{ margin:.5rem 0 1.25rem; font-size:.95rem; }
#login label{ font-family:var(--font-ui); text-transform:none; letter-spacing:0; font-size:.8rem; color:var(--muted); font-weight:600; margin:.9rem 0 .3rem; }
#login input{ height:2.75rem; font-size:1rem; }
#login .pwwrap{ position:relative; }
#login .pwwrap input{ padding-right:4.5rem; width:100%; }
#login .pwtoggle{ position:absolute; right:.4rem; top:50%; transform:translateY(-50%); height:2rem; padding:0 .6rem; font-size:.78rem; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--bg-1); color:var(--muted); cursor:pointer; }
#login .pwtoggle:hover{ color:var(--text); border-color:var(--border-strong); }
#login .autherr{ margin-top:.75rem; min-height:0; }
#login .autherr:not(:empty){ display:flex; gap:.5rem; align-items:flex-start; padding:.6rem .75rem; border-radius:var(--r-sm); background:var(--danger-bg); border:1px solid rgba(214,47,36,.25); color:var(--danger); font-size:.85rem; line-height:1.4; }
#login .autherr:not(:empty)::before{ content:"!"; flex:none; width:1.1rem; height:1.1rem; border-radius:50%; background:var(--danger); color:#fff; font-weight:700; font-size:.75rem; display:inline-flex; align-items:center; justify-content:center; margin-top:.1rem; }
#login .authbtn{ height:2.75rem; font-size:1rem; margin-top:1.1rem; }
#login .authlinks{ margin-top:1rem; gap:.5rem; }
#login .login-lang{ margin-top:1.25rem; padding-top:1rem; border-top:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:.5rem; text-align:left; }
#login .login-lang .lang-l{ margin:0; font-size:.75rem; }
#login .login-lang .lang-row{ gap:.25rem; }
#login .login-lang .lang-btn{ padding:.25rem .6rem; font-size:.8rem; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--bg-1); color:var(--muted); cursor:pointer; }
#login .login-lang .lang-btn.on{ background:var(--accent); border-color:var(--accent); color:#fff; }
#login .login-lang .lang-note{ display:none; }
.qrbox{ width:11rem; max-width:100%; background:#fff; padding:.5rem; border:1px solid var(--border); border-radius:var(--r-sm); }
.qrbox svg{ display:block; width:100%; height:auto; }
.onb-row:hover{ background:var(--hover, rgba(24,23,38,.045)); }
.onb-row:focus-visible{ outline:none; box-shadow:var(--focus-ring); }

/* 603 — the guided tour's coach and spotlight */
.onb-coach{ position:fixed; right:1rem; bottom:1rem; z-index:60; width:min(22rem, calc(100vw - 2rem)); background:var(--bg-1); border:1px solid var(--border-strong); border-radius:var(--r-md); box-shadow:var(--shadow-lg); padding:.75rem .9rem; }
.onb-coach .onb-k{ display:flex; justify-content:space-between; font-size:.75rem; letter-spacing:.08em; text-transform:uppercase; color:var(--accent-text); font-weight:600; }
.onb-coach .onb-bar{ height:.375rem; border-radius:.375rem; background:var(--bg-2); overflow:hidden; margin:.4rem 0 .6rem; } .onb-coach .onb-bar i{ display:block; height:100%; background:var(--accent); }
.onb-coach h3{ margin:0 0 .25rem; font-size:1rem; font-weight:600; } .onb-coach p{ margin:0 0 .6rem; color:var(--muted); font-size:.9rem; }
.onb-coach .onb-row{ display:flex; gap:.4rem; align-items:center; } .onb-coach .sp{ flex:1; }
.onb-spot{ box-shadow:0 0 0 3px var(--accent), 0 0 0 200vmax rgba(24,23,38,.18) !important; border-radius:var(--r-sm); position:relative; z-index:55; transition:box-shadow .2s; }
@media (prefers-reduced-motion:reduce){ .onb-spot{ transition:none; } }

/* 626 — the attention layer on the other screens */
.att-banner{display:flex;gap:.7rem;align-items:center;border:1px solid var(--border);border-left:.3rem solid #9b2f4a;border-radius:.7rem;padding:.5rem .8rem;background:var(--bg-1);margin:0 0 .8rem;font-size:.85rem}
.att-banner.att-today{border-left-color:#8a5a00} .att-banner .att-tx{flex:1;min-width:0} .att-banner .att-tx b{font-weight:600}
.att-banner .att-tier{font-size:.75rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;border-radius:999px;padding:.05rem .5rem;background:#fbe0e8;color:#9b2f4a} .att-banner.att-today .att-tier{background:#fbeccc;color:#8a5a00}
/* 635 — sending addresses: the two-mode choice and the recognition line */
.snd-choice{ display:grid; gap:.6rem; grid-template-columns:repeat(auto-fit,minmax(14rem,1fr)); margin-bottom:.6rem; }
.snd-opt{ display:grid; gap:.3rem; text-align:left; border:1px solid var(--border); border-radius:var(--r-md); padding:.7rem .85rem; background:var(--bg-1); }
.snd-opt.on{ border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-subtle); }
.snd-opt b{ font-size:.95rem; } .snd-opt span{ font-size:.82rem; color:var(--muted); font-weight:400; }
.snd-det{ background:var(--accent-subtle); border-radius:var(--r-sm); padding:.45rem .7rem; font-size:.85rem; }
.snd-det.warn{ background:var(--warn-bg, #fff3d6); }
.gw-badge.warn{ background:var(--warn-bg, #fff3d6); color:var(--warn-text, #8a5a00); }
.snd-add details{ margin-top:.3rem; } .snd-add summary{ cursor:pointer; color:var(--muted); font-size:.85rem; }
.snd-mine{ display:flex; gap:.5rem; align-items:center; font-size:.85rem; color:var(--text); margin:.5rem 0 .2rem; } .snd-mine input{ width:1rem; height:1rem; accent-color:var(--accent); }
/* 638 — the deal's score and the follow-up pill */
.deal-score{ display:inline-grid; place-items:center; min-width:1.9rem; height:1.35rem; margin-right:.4rem; border-radius:var(--r-pill); font-size:var(--fs-0); font-weight:700; background:var(--bg-3); color:var(--muted); }
.deal-score.hi{ background:var(--ok-bg, #e3f5ea); color:var(--ok, #1f7a4d); } .deal-score.mid{ background:var(--warn-bg); color:var(--warn); } .deal-score.lo{ background:var(--danger-bg, #fde8e8); color:var(--danger, #a12d2d); }
.deal-flag.due{ color:var(--accent-text); background:var(--accent-subtle); }
.deal-why{ background:var(--accent-subtle); border-radius:var(--r-sm); padding:.45rem .7rem; font-size:.85rem; margin:.3rem 0 .6rem; }
/* 640 — the knowledge base: categories rail + table; suggestions on a ticket */
.kb-base{ display:grid; grid-template-columns:12rem minmax(0,1fr); gap:.8rem; margin-top:.5rem; }
@media (max-width:48rem){ .kb-base{ grid-template-columns:1fr; } }
.kb-cats{ display:flex; flex-direction:column; gap:.15rem; }
.kb-cat{ text-align:left; border:0; background:transparent; padding:.4rem .6rem; border-radius:var(--r-sm); display:flex; justify-content:space-between; gap:.5rem; }
.kb-cat:hover{ background:var(--bg-3); } .kb-cat.on{ background:var(--accent-subtle); color:var(--accent-text); font-weight:600; }
.kb-sug{ margin-top:.5rem; }
/* 641 — workload: person × week cells against capacity */
.tbl.wl .wl-c{ vertical-align:top; min-width:6rem; }
.tbl.wl .wl-ok{ background:var(--ok-bg, #e3f5ea); } .tbl.wl .wl-near{ background:var(--warn-bg); } .tbl.wl .wl-over{ background:var(--danger-bg, #fde8e8); color:var(--danger, #a12d2d); font-weight:600; }
.wl-tasks{ display:flex; flex-direction:column; gap:.1rem; font-size:.75rem; font-weight:400; margin-top:.2rem; } .wl-tasks a{ cursor:pointer; color:var(--accent-text); }
.wl-overs{ display:grid; gap:.3rem; margin:.4rem 0 .6rem; } .wl-over{ background:var(--danger-bg, #fde8e8); border-radius:var(--r-sm); padding:.4rem .7rem; font-size:.85rem; } .wl-over a{ cursor:pointer; text-decoration:underline; }
.kb-read{ white-space:pre-wrap; line-height:1.55; max-height:60vh; overflow:auto; }
.att-banner.warn{ border-left-color:var(--warn, #8a5a00); }
.sched-cmd{ font-size:.75rem; word-break:break-all; }
.ed-price{ font-weight:700; font-size:.9rem; }
.ed-sub{ margin:.3rem 0; }
.pt-tools{ display:flex; gap:.6rem; align-items:center; flex-wrap:wrap; margin:.4rem 0; }
.pt-tbl td.n, .pt-tbl th.n{ text-align:right; white-space:nowrap; }
.pt-tbl tfoot td{ font-weight:700; border-top:2px solid var(--line); }
.tiny.warn{ color:var(--warn, #8a5a00); }
/* 646 — consolidated statements */
.consol-bar{ display:flex; gap:.8rem; align-items:center; flex-wrap:wrap; margin:0 0 .8rem; }
.consol-bar select, .consol-bar input{ font:inherit; }
.consol-custom{ display:inline-flex; gap:.3rem; align-items:center; }
.consol-actions{ margin-left:auto; display:inline-flex; gap:.4rem; }
.consol-doc{ background:var(--card-bg, var(--bg-1)); border:.0625rem solid var(--line); border-radius:var(--r-md, .6rem); padding:1.2rem 1.4rem; max-width:64rem; }
.consol-head{ display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; flex-wrap:wrap; }
.consol-name{ font-weight:700; font-size:1.05rem; }
.consol-title{ font-size:1.1rem; margin:.8rem 0 .2rem; }
.consol-doc h3{ font-size:.8rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:1rem 0 .3rem; }
.consol-tbl td.n, .consol-tbl th.n{ text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.consol-tbl td a{ cursor:pointer; text-decoration:underline dotted; }
.consol-tot td{ font-weight:700; border-top:.125rem solid var(--line); }
.consol-grp td{ border-bottom:.125rem solid var(--line); }
.consol-sub td{ color:var(--muted); }
.consol-notes{ margin-top:1rem; display:grid; gap:.2rem; }
.cons-door{ margin:0 0 .8rem; display:flex; gap:.6rem; align-items:center; flex-wrap:wrap; }
@media print{ #printArea .consol-print{ font-size:11pt; color:#000; } #printArea .consol-print a{ text-decoration:none; color:inherit; } #printArea .consol-tot td{ border-top:1.5pt solid #000; } }
/* 647 — the field: planning per technician, route, signature pad */
.fd-plan{ display:grid; gap:.3rem; align-items:start; font-size:.8rem; overflow-x:auto; }
.fd-hd{ font-size:.75rem; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); padding:.2rem .3rem; }
.fd-who{ padding:.4rem .3rem; display:grid; gap:.1rem; }
.fd-cell{ background:var(--field-bg, var(--bg-1)); border-radius:.4rem; min-height:3.6rem; padding:.25rem; display:grid; gap:.25rem; align-content:start; }
.fd-cell.over{ outline:.125rem dashed var(--accent); }
.fd-pool{ grid-auto-flow:column; grid-auto-columns:minmax(12rem,1fr); overflow-x:auto; }
.fd-card{ background:var(--card-bg, var(--bg-0)); border:.0625rem solid var(--line); border-left:.1875rem solid var(--accent); border-radius:.35rem; padding:.25rem .4rem; line-height:1.3; cursor:grab; }
.fd-card.done{ border-left-color:var(--ok, #2e7d32); opacity:.85; } .fd-card.pool{ border-left-color:var(--warn, #8a5a00); } .fd-card.live{ border-left-color:var(--accent); box-shadow:inset 0 0 0 .0625rem var(--accent); }
.fd-card.dragging{ opacity:.5; } .fd-card b{ display:block; font-size:.78rem; } .fd-card span{ color:var(--muted); font-size:.75rem; }
.fd-late{ margin:.5rem 0; } .fd-late a{ cursor:pointer; text-decoration:underline dotted; }
.tiny.bad{ color:var(--bad, #a12d2d); }
.fd-route{ max-width:32rem; } .fd-route-h{ display:flex; justify-content:space-between; gap:.6rem; align-items:baseline; margin:.2rem 0 .5rem; }
.fd-stop{ display:grid; grid-template-columns:1.6rem 1fr auto; gap:.5rem; align-items:start; padding:.45rem 0; border-bottom:.0625rem solid var(--line); font-size:.85rem; }
.fd-n{ font-weight:700; color:var(--accent); } .fd-stop small{ color:var(--muted); display:block; font-size:.75rem; }
.fd-pill{ display:inline-block; padding:.05rem .5rem; border-radius:1rem; font-size:.75rem; font-weight:600; } .fd-pill.ok{ background:var(--ok-soft, #e3f5ea); color:var(--ok, #2e7d32); }
.fd-pad{ width:100%; max-width:100%; height:auto; border:.0625rem dashed var(--line); border-radius:.4rem; background:#fff; touch-action:none; display:block; }
.fd-two{ display:grid; grid-template-columns:repeat(auto-fit,minmax(10rem,1fr)); gap:.5rem; }
.fd-two input, .modal label.tiny input{ width:100%; box-sizing:border-box; }
/* 648 — the employee file */
.hf-tabs{ display:flex; gap:.2rem; flex-wrap:wrap; border-bottom:.0625rem solid var(--line); margin:.2rem 0 .6rem; }
.hf-tab{ appearance:none; background:transparent; border:0; border-bottom:.125rem solid transparent; padding:.3rem .6rem; font:inherit; font-size:.8rem; color:var(--muted); cursor:pointer; }
.hf-tab.on{ color:var(--fg, inherit); border-bottom-color:var(--accent); font-weight:600; }
.hf-badge{ display:inline-block; min-width:1.1rem; padding:0 .3rem; border-radius:1rem; font-size:.75rem; font-weight:700; text-align:center; }
.hf-badge.warn{ background:var(--warn-soft, #fff3d6); color:var(--warn, #8a5a00); }
.hf-row{ display:flex; justify-content:space-between; gap:.6rem; align-items:flex-start; padding:.35rem 0; border-bottom:.0625rem solid var(--line); font-size:.82rem; }
.hf-row.warn{ background:var(--warn-soft, #fff3d6); padding:.35rem .5rem; border-radius:.35rem; border-bottom:0; margin-bottom:.3rem; }
.hf-acts{ display:flex; gap:.3rem; flex-wrap:wrap; }
.hf-pill{ display:inline-block; padding:.02rem .45rem; border-radius:1rem; font-size:.75rem; font-weight:600; background:var(--field-bg, var(--bg-1)); }
.hf-pill.present, .hf-pill.signed{ background:var(--ok-soft, #e3f5ea); color:var(--ok, #2e7d32); }
.hf-pill.expiring, .hf-pill.held, .hf-pill.planned{ background:var(--warn-soft, #fff3d6); color:var(--warn, #8a5a00); }
.hf-pill.expired, .hf-pill.missing{ background:var(--bad-soft, #fde8e8); color:var(--bad, #a12d2d); }
.hf-tbl td, .hf-tbl th{ font-size:.8rem; }
.hf-form{ display:grid; grid-template-columns:repeat(auto-fit,minmax(11rem,1fr)); gap:.5rem; }
.hf-form input, .hf-form select, .hf-form textarea{ width:100%; box-sizing:border-box; font:inherit; }
.hf-tl{ display:grid; grid-template-columns:8rem 1fr; gap:.6rem; padding:.25rem 0; border-bottom:.0625rem solid var(--line); font-size:.82rem; }
.hf-set{ display:grid; gap:.3rem; }
.hf-set-row{ display:grid; grid-template-columns:14rem 1fr; gap:.6rem; align-items:center; font-size:.82rem; }
.hf-set-row input{ font:inherit; width:100%; box-sizing:border-box; }
@media (max-width:40rem){ .hf-set-row{ grid-template-columns:1fr; } }
/* 652 — the upgrade prompt under the profile */
.side-up{ display:flex; gap:.3rem; align-items:stretch; margin-top:.5rem; }
.side-up-go{ flex:1; text-align:left; border:0; border-radius:.5rem; padding:.45rem .6rem; background:var(--accent); color:#fff; font:inherit; font-size:.8rem; font-weight:600; cursor:pointer; display:grid; gap:.1rem; }
.side-up-go small{ font-weight:500; opacity:.85; font-size:.75rem; }
.side-up-later{ border:.0625rem solid var(--line); background:transparent; color:var(--muted); border-radius:.5rem; padding:0 .45rem; font:inherit; cursor:pointer; }

/* R16 — the space selector, right after the path */
.spacesel{position:relative;flex:0 0 auto;max-width:22rem}
.spacesel .sp-btn{border-color:var(--accent);color:var(--accent);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:22rem}
.sp-menu{position:absolute;top:calc(100% + .3rem);left:0;z-index:60;min-width:18rem;max-width:26rem;background:var(--card,#fff);border:1px solid var(--line,#dcdce6);border-radius:.6rem;box-shadow:0 .5rem 1.5rem rgba(0,0,0,.12);padding:.5rem .7rem;font-size:var(--fs-2)}
.sp-h{text-transform:uppercase;letter-spacing:.05em;font-size:.75rem;color:var(--muted);margin:.5rem 0 .2rem}.sp-h:first-child{margin-top:0}
.sp-row{display:flex;justify-content:space-between;gap:.5rem;align-items:baseline;padding:.15rem 0}.sp-row a{cursor:pointer}.sp-row.on b{color:var(--accent)}
.sp-acts{display:inline-flex;gap:.5rem;opacity:.6}.sp-row:hover .sp-acts{opacity:1}
.sp-act{display:block;color:var(--accent);cursor:pointer;margin-top:.35rem}.sp-quit{color:var(--danger,#a12d2d);border-top:1px solid var(--line,#dcdce6);padding-top:.4rem}
@media (max-width:640px){.spacesel{max-width:11rem}.spacesel .sp-btn{max-width:11rem}.sp-menu{left:auto;right:0}}

/* 696 — the level picker on the operator's chip */
.ctx-ed-pick{margin-left:.35rem;font:inherit;font-size:.75rem;padding:.1rem .3rem;border:1px solid var(--line,#E4E4F0);border-radius:.35rem;background:var(--panel,#fff);color:inherit}
