/* lib/desk-shell.css — the ONE canonical desk shell.
 *
 * The 8 desks (desk/PMO, legal, consulting, career, tools, gtm, local, learning)
 * each carried their own copy of this shell, so it drifted. This file is the
 * single source of truth: the topbar, the app container (.wrap), the sidebar
 * (aside) + brand + gold .vs-link buttons + Velora meter + nav items, the main
 * content frame, base body/typography, and the shared :root tokens.
 *
 * It is linked AFTER each desk's inline <style>, so these canonical values win
 * and any per-desk drift is normalized here in one place. Reference desk = PMO
 * (desk/index.html); canonical values per docs/desk-shell-spec.md (decisions
 * D1–D3). Per-desk view CSS stays in each desk's own <style>.
 */

:root{
  color-scheme:dark; /* native selects, datalists and pickers render dark, on-brand (S8) */
  --font-serif:Georgia,'Times New Roman',Times,serif;
  --font-mono:'Courier New',Courier,monospace;
  --bg:#07090f;--bg1:#0e1320;--bg2:#141c2e;--bg3:#1b2540;
  --line:rgba(255,255,255,0.07);--line2:rgba(255,255,255,0.13);
  --text:#dce5f5;--dim:#7a90b8;--dim2:#4a5878;
  --blue:#1a56db;--blue-lt:#4f86f7;--teal:#0d9488;--gold:#c47f17;--gold-lt:#fbbf24;
  --rose:#be123c;--rose-lt:#fb7185;--green:#059669;--green-lt:#34d399;--amber:#d97706;
}
body{margin:0;background:var(--bg);color:var(--text);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px}
html{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.14) transparent}
html::-webkit-scrollbar{width:10px}
html::-webkit-scrollbar-track{background:transparent}
html::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:100px}
html::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.24)}

/* ---- Topbar ---- */
header.topbar{display:flex;align-items:center;gap:12px;padding:13px 20px;border-bottom:1px solid var(--line2);position:sticky;top:0;background:var(--bg1);z-index:30}
.nav-logo{font-family:var(--font-serif);font-size:1.08rem;font-weight:700}
.nav-logo-accent{color:var(--gold-lt)}
header.topbar .tsub{color:var(--dim);font-size:.82rem;border-left:1px solid var(--line2);padding-left:12px}
header.topbar .who{margin-left:auto;color:var(--dim2);font-size:.8rem}

/* ---- App container + sidebar ---- */
.wrap{display:flex;min-height:calc(100vh - 49px)}
aside{width:236px;flex:none;background:var(--bg1);border-right:1px solid var(--line);padding:6px 10px 14px;position:sticky;top:49px;height:calc(100vh - 49px);overflow:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.14) transparent}
aside::-webkit-scrollbar{width:8px}
aside::-webkit-scrollbar-track{background:transparent}
aside::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:100px}
aside::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.24)}
aside .vs-links{display:flex;flex-direction:column;gap:6px;padding:2px 2px 8px}
aside .vs-link{display:block;text-align:center;text-decoration:none;background:linear-gradient(135deg,var(--gold) 0%,var(--gold-lt) 100%);color:#0e1320;font-weight:700;font-size:13.5px;border-radius:9px;padding:8px 12px;letter-spacing:.01em;transition:filter .15s}
aside .vs-link:hover{filter:brightness(1.1)}
aside .substep{color:#93a4c9;font-size:9.5px;letter-spacing:.17em;text-transform:uppercase;margin:9px 8px 1px 12px;font-weight:700}
aside .step{color:#93a4c9;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;margin:14px 6px 4px;font-weight:700}
/* D1: dedicated brand-label class (bright/bold), so the "VelorStrategy" sidebar
   line is styled independently of the .step section headers. */
aside .brand-label{color:#93a4c9;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;margin:14px 6px 4px;font-weight:700}
aside button{display:flex;width:100%;text-align:left;gap:9px;align-items:center;background:none;border:0;color:var(--text);padding:7px 9px;border-radius:9px;cursor:pointer;font:inherit;font-size:13.5px}
aside button:hover{background:var(--bg2)}
aside button.on{background:var(--bg3)}
[data-setcur]:focus-visible,[data-jset]:focus-visible{outline:2px solid var(--gold);outline-offset:2px;border-radius:6px}
aside button .n{display:inline-flex;color:var(--dim);width:17px}
aside button.on .n{color:var(--gold-lt)}
/* Side-nav icons are simple monochrome glyphs that inherit the nav colour (dim,
   gold when active) — never colour emoji. Some glyphs (☑ ✉ ✔ ✏ ⚒ ⚖ ⛓ ✂ ✴ ↗)
   default to an emoji face on Windows/Chrome; force text presentation so they
   stay monochrome and follow the gold-on-active scheme. The markup also carries
   a U+FE0E selector on those glyphs for browsers without font-variant-emoji. */
aside .n{font-variant-emoji:text}
aside .cnt{margin-left:auto;font-size:11px;background:var(--bg3);border-radius:100px;padding:1px 8px;color:var(--dim)}
aside .cnt.hot{background:rgba(196,127,23,.25);color:var(--gold-lt)}
aside select.proj-pick{width:100%;background:var(--bg2);border:1px solid var(--line2);color:var(--text);border-radius:9px;padding:7px 8px;font:inherit;font-size:12.5px;margin:4px 0 2px}

/* ---- Velora meter (class-based; D2 upsell link forward-declared). Meter
   padding stays per-desk to avoid a cosmetic shift during extraction. ---- */
#vmeter .vm-row{display:flex;justify-content:space-between;font-size:11px;color:var(--dim)}
#vmeter .vm-track{height:5px;background:var(--bg2);border-radius:100px;margin-top:4px;overflow:hidden}
#vmeter .vm-bar{height:100%;width:0%;background:var(--green-lt);border-radius:100px;transition:width .3s}
#vmeter .vm-up{display:none;margin-top:6px;font-size:11px;color:var(--gold-lt);text-decoration:none}
#vmeter .vm-up:hover{text-decoration:underline}
#vmeter.low .vm-up{display:inline-block}
.powered{color:var(--dim2);font-size:11px;margin:16px 6px 6px}
.powered b{color:var(--text)}.powered .g{color:var(--gold-lt)}

/* ---- Main content frame ----
   Only the invariant flex props are shared. The content padding / max-width
   (S3: PMO pads main directly at 1150px; Family-B pads an inner wrapper) stays
   in each desk's own CSS so extraction never double-pads a desk. */
main{flex:1;min-width:0}

/* ---- Canonical footer ---- */
footer.vs-foot{margin:26px -26px -22px;padding:24px 40px;background-color:#07090f;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:12px;text-align:center}
@media(min-width:640px){footer.vs-foot{flex-direction:row;align-items:center;justify-content:space-between;text-align:left}}
@media(max-width:800px){footer.vs-foot{margin:26px -14px -16px;padding:22px 18px}}
footer.vs-foot .foot-logo{font-family:var(--font-serif);font-size:1.04rem;font-weight:700}footer.vs-foot .foot-logo-accent{color:#fbbf24}
footer.vs-foot .foot-meta{font-family:'Courier New',Courier,monospace;font-size:.66rem;color:#7a90b8;letter-spacing:.06em}footer.vs-foot .foot-copy{font-size:.72rem;color:#4a5878;margin:0}
footer.vs-foot a{color:var(--dim2,#7a90b8);text-decoration:none}footer.vs-foot a:hover{color:var(--gold-lt,#fbbf24)}

/* ---- Responsive shell (must live here, not per-desk) ----
   This sheet is linked AFTER each desk's inline <style>, so its base
   aside{position:sticky} and header padding would otherwise win over a
   desk's own mobile @media overrides and clobber the off-canvas sidebar.
   Declaring the mobile shell here — last — makes the canonical mobile
   behavior authoritative and identical on every desk. Burger/#scrim
   toggling stays per-desk (those elements are desk-local). */
@media(max-width:999px){
  aside{position:fixed;left:0;top:49px;z-index:40;transform:translateX(-100%);transition:transform .2s ease;box-shadow:0 0 40px rgba(0,0,0,.5)}
  aside.open{transform:translateX(0)}
}
@media(max-width:800px){
  header.topbar{padding:11px 14px}
}

/* ---- Shared desk-content mobile safety (NOT shell; applies inside <main>) ----
   Two cross-desk content patterns that overflow on phones, fixed once here so
   every desk behaves the same: wide data tables scroll within their own box
   instead of pushing the page sideways, and the native Velora chat drops its
   54vh cap so each answer's output bar (Copy/Email/Export/Save) sits in page
   flow rather than being clipped below the chat's internal scroll. */
@media(max-width:800px){
  main table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .chat{max-height:none}
}

/* ---- In-page menus / action toolbars must FIT the phone (NOT shell) ----
   Every desk builds toolbars and row-actions as flex `.row` / `.it-act` /
   `.actbar` clusters, and many carry inline `flex:none` or `flex-wrap:nowrap`
   that size them to their content and push the page sideways on phones (the
   "menu bleed": the row runs off-screen and drags the whole view left). Here,
   once, for every desk: content rows wrap (overriding the inline nowrap), and
   button/action groups that were pinned to one line fall back to full-width
   wrapping so they fit. Desktop is untouched. */
@media(max-width:640px){
  /* PMO-lineage desks (desk, legal, consulting, career, gtm, learning) build
     toolbars as flex .row / .it-act / .actbar; force them to wrap and cap
     content-sized (flex:none) button groups. */
  main .row{flex-wrap:wrap !important}
  main .row .row{max-width:100%}
  main .it-act,main .actbar{display:flex;flex-wrap:wrap;gap:6px;white-space:normal;max-width:100%}
  /* tools/local use their own action clusters; make the few non-wrapping ones fit too. */
  main .ec-acts,main .lb-macts,main .lb-urlrow,main .md-mini{flex-wrap:wrap}
  /* Text must never bleed past a card edge: long unbreakable tokens (contract
     IDs, emails, URLs) wrap inside the card, pill/badge labels break instead of
     running off, and long table-cell values break rather than force the row wide. */
  main .card{overflow-wrap:break-word}
  main .badge{overflow-wrap:anywhere;white-space:normal}
  main td,main th{overflow-wrap:break-word}
  main pre{white-space:pre-wrap;overflow-wrap:break-word;max-width:100%}
}

/* ---- Dashboard KPI tiles: one gold liner on every desk ----
   Product decision: every dashboard stat/KPI tile carries the gold border on
   every desk for a uniform look (previously only "attention" tiles went gold on
   some desks, plain on others). Attention tiles keep a gold number so urgency
   still reads. Applies at all widths; the tile classes are .stat (PMO, legal,
   career, gtm, learning) and .today-chip (consulting, tools). */
main .stat,main .today-chip{border-color:var(--gold)}
main .stat.warn .v{color:var(--gold-lt)}
