/* Signed-in workspace frame (AMD-510 items 1 and 2; mockup approved by the Director, D-4, 21 Nov 2026 10:00 UK).
   Drawn by /assets/js/workspace-frame.js on a page whose <body> carries data-workspace-frame. Needs tokens.css and
   site-nav.css (the header is the shared navigation's markup and styling, with the workspace links). The rules below
   are the approved mockup's CSS (AILANE-HANDOVER-AMD510-WORKSPACE-FRAME-PHASE1-2026-11-21, Appendix A); the frame
   additions (header controls, main column) are marked. Governed by AILANE-AMD-REG-001. */
body.wsf { background: radial-gradient(1200px 600px at 70% -10%, var(--ws-page-glow, var(--ac-a855f7-a7, rgba(168,85,247,0.07))), transparent 60%), var(--surface-base); color: var(--text-body); font-family: var(--font-body); margin: 0; }
.wsf-governance { --wsf-tier: var(--tier-governance); --wsf-tier-glow: var(--tier-governance-glow); }
.wsf-operational { --wsf-tier: var(--tier-operational); --wsf-tier-glow: var(--tier-operational-glow); }
.wsf-tier { font: 600 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--wsf-tier); border: 1px solid var(--wsf-tier); border-radius: 999px; padding: 6px 10px; margin-right: 8px; }
.wsf-shell { display: grid; grid-template-columns: 248px minmax(0,1fr); gap: 28px; max-width: 1360px; margin: 0 auto; padding: 28px 24px 56px; }
/* Sidebar: index tabs of a binder */
.wsf-rail { position: sticky; top: 92px; align-self: start; background: var(--surface-card); border: 1px solid var(--border-mid); border-radius: 14px; padding: 14px 10px; box-shadow: var(--ws-rail-shadow, 0 18px 40px var(--ac-000000-a35, rgba(0,0,0,.35))); }
.wsf-rail::before { content: ''; position: absolute; inset: 6px; border: 1px dashed var(--ws-rail-stitch, var(--ac-94a3b8-a18, rgba(148,163,184,.18))); border-radius: 10px; pointer-events: none; }
.wsf-rail-h { font: 600 10px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute); margin: 6px 10px 12px; }
.wsf-tab { display: block; position: relative; color: var(--text-sec); text-decoration: none; font-size: 14px; padding: 9px 12px 9px 14px; border-radius: 8px; margin: 2px 0; }
.wsf-tab:hover { background: var(--surface-hover); color: var(--text-prime); }
.wsf-tab.is-on { color: var(--text-prime); background: var(--wsf-tier-glow); }
.wsf-tab.is-on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--wsf-tier); }
/* Document Vault: gold band on every tier (AMD-279, CEO-RAT-GOLD-DV-001). */
.wsf-tab-vault { border: 1px solid var(--ws-gold-edge, var(--ac-f59e0b, #F59E0B)); border-left-width: 3px; background: var(--ws-gold-fill, var(--ac-f59e0b-a10, rgba(245,158,11,.10))); color: var(--ws-gold-text, var(--ac-f8fafc, #F8FAFC)); font-weight: 600; margin-bottom: 8px; }
/* The header's Workspace link: the same gold band as the Document Vault (Director-authorised, 21 Nov 2026 15:45 UK; AMD-279; AMD-510-TASKS-019). */
.wsf-nav .sn-links a.wsf-ws-home { border: 1px solid var(--ws-gold-edge, var(--ac-f59e0b, #F59E0B)); border-left-width: 3px; background: var(--ws-gold-fill, var(--ac-f59e0b-a10, rgba(245,158,11,.10))); color: var(--ws-gold-text, var(--ac-f8fafc, #F8FAFC)); font-weight: 600; border-radius: 8px; padding: 8px 16px; }
.wsf-nav .sn-links a.wsf-ws-home:hover, .wsf-nav .sn-links a.wsf-ws-home:focus-visible { background: var(--ws-gold-fill-hover, var(--ac-f59e0b-a18, rgba(245,158,11,.18))); color: var(--ws-gold-text, var(--ac-f8fafc, #F8FAFC)); }
.wsf-nav .sn-panel a.sn-row.wsf-ws-home { border: 1px solid var(--ws-gold-edge, var(--ac-f59e0b, #F59E0B)); border-left-width: 3px; background: var(--ws-gold-fill, var(--ac-f59e0b-a10, rgba(245,158,11,.10))); color: var(--ws-gold-text, var(--ac-f8fafc, #F8FAFC)); font-weight: 600; border-radius: 8px; }
/* The binder: rounded card, fine stitched line inset from the edge, tier-coloured spine */
.wsf-binder { position: relative; background: var(--ws-binder-bg, linear-gradient(180deg, var(--ac-0f172a-a92, rgba(15,23,42,.92)), var(--ac-0c1525-a96, rgba(12,21,37,.96)))); border: 1px solid var(--border-mid); border-radius: 16px; padding: 30px 32px; box-shadow: var(--ws-binder-shadow, 0 1px 0 var(--ac-ffffff-a4, rgba(255,255,255,.04)) inset, 0 22px 48px var(--ac-000000-a38, rgba(0,0,0,.38))); margin-bottom: 24px; }
.wsf-binder::before { content: ''; position: absolute; inset: 8px; border: 1px dashed var(--ws-stitch, var(--ac-cbd5e1-a20, rgba(203,213,225,.20))); border-radius: 11px; pointer-events: none; }
.wsf-binder::after { content: ''; position: absolute; left: -1px; top: 22px; bottom: 22px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--wsf-tier), transparent); opacity: .85; }
.wsf-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1.1; color: var(--text-prime); margin: 10px 0 12px; }
.wsf-lede { color: var(--text-sec); font-size: 17px; margin: 0 0 10px; }
.wsf-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 24px; }
.wsf-side { padding: 24px 24px; }
.wsf-side h2 { font-family: var(--font-display); font-weight: 400; font-size: 20px; color: var(--text-prime); margin: 0 0 12px; }
.wsf-side p { color: var(--text-sec); font-size: 14px; margin: 0 0 8px; }
.wsf-hero.tk-hero { max-width: none; padding: 30px 32px; }

/* Lists and briefings in the binder finish (mockup rules). On the Ticker the same rules apply to its own classes, so
   the Ticker in the frame matches the mockup while visitors keep the public page. */
.wsf-list, body.wsf .tk-list { list-style: none; margin: 14px 0 0; padding: 0; }
body.wsf .tk-list { border: 0; background: transparent; border-radius: 0; overflow: visible; }
.wsf-item, body.wsf .tk-item { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 16px; padding: 16px 4px; border-top: 1px solid var(--border-dim); }
.wsf-item:first-child, body.wsf .tk-item:first-child { border-top: 0; }
.wsf-title, body.wsf .tk-head, body.wsf .tk-open { color: var(--text-prime); font-size: 16px; margin: 0 0 6px; }
.wsf-tags, body.wsf .tk-sub { margin: 0; color: var(--text-mute); font-size: 13px; }
.wsf-rel, body.wsf .tk-rel-badge { color: var(--ws-rel-text, var(--ac-fcd34d, #FCD34D)); border: 1px solid var(--ws-rel-edge, var(--ac-f59e0b-a50, rgba(245,158,11,.5))); border-radius: 4px; padding: 2px 6px; font-size: 11px; margin-left: 6px; }
.wsf-item.is-open, body.wsf .tk-item:has(.tk-open[aria-expanded="true"]) { background: var(--ws-item-open, var(--ac-1e293b-a35, rgba(30,41,59,.35))); border-radius: 10px; padding: 16px 14px; }
.wsf-brief, body.wsf .tk-brief { margin-top: 12px; padding: 14px 16px; border-top: 0; border-left: 2px solid var(--wsf-tier); background: var(--ws-brief-bg, var(--ac-06080f-a45, rgba(6,8,15,.45))); border-radius: 0 8px 8px 0; color: var(--text-body); font-size: 15px; line-height: 1.6; }
.wsf-brief p, body.wsf .tk-brief p { margin: 0 0 10px; }
.wsf-acts, body.wsf .tk-acts { display: flex; gap: 12px; align-items: center; margin: 0 !important; }
.wsf-src, body.wsf .tk-src { color: var(--ws-link, var(--ac-67e8f9, #67E8F9)); text-decoration: none; font-size: 14px; }
.wsf-ask, body.wsf .tk-ask { background: var(--wsf-tier-glow); color: var(--text-prime); border: 1px solid var(--wsf-tier); border-radius: 999px; padding: 7px 14px; font: 500 13px var(--font-body); cursor: pointer; }
.wsf-num, body.wsf .tk-stat strong { font-family: var(--font-display); font-size: 26px; color: var(--text-prime); font-weight: 400; margin-right: 6px; }
body.wsf .tk-card.wsf-binder { background: var(--ws-binder-bg, linear-gradient(180deg, var(--ac-0f172a-a92, rgba(15,23,42,.92)), var(--ac-0c1525-a96, rgba(12,21,37,.96)))); border-color: var(--border-mid); border-radius: 16px; }

/* Frame additions (not in the mockup CSS). The page's own <main> fills the frame's content column. */
.wsf-main { min-width: 0; }
.wsf-shell > * { min-width: 0; }
.wsf-main > main { max-width: none; margin: 0; padding: 0; }
.site-nav.wsf-nav .sn-right { gap: 8px; }
.site-nav.wsf-nav .wsf-out { cursor: pointer; font-family: inherit; }

@media (max-width: 900px) { .wsf-shell { grid-template-columns: minmax(0, 1fr); padding: 16px 14px 40px; } .wsf-rail { position: relative; top: 0; padding: 10px; } .wsf-tabs { display: flex; overflow-x: auto; gap: 6px; } .wsf-rail-h { display: none; } .wsf-tab { white-space: nowrap; margin: 0; } .wsf-tab.is-on::before { left: 10px; right: 10px; top: auto; bottom: 2px; width: auto; height: 2px; } .wsf-grid { grid-template-columns: 1fr; } .wsf-item, body.wsf .tk-item { grid-template-columns: 1fr; gap: 4px; } .wsf-binder { padding: 22px 18px; } .wsf-hero h1 { font-size: 32px; } .wsf-tier { display: none; } }
/* A binder's first block sits on the binder's own padding. */
.wsf-binder > :first-child { margin-top: 0; }
/* Blocks shown only in the frame, or hidden in it (data-wsf-only, data-wsf-hide). */
body:not(.wsf) [data-wsf-only] { display: none !important; }
body.wsf [data-wsf-hide] { display: none !important; }
/* A page's own toolbar (the documents, cases and Evidence Lab top bars) sits in the frame as a binder, not a sticky bar. */
body.wsf .wsf-binder.topbar { position: relative; top: auto; z-index: auto; padding: 18px 24px; border-bottom: 1px solid var(--border-mid); }
/* The workspace hub in the frame (AMD-510; Director, 21 Nov 2026 12:00 UK). The conversation ("What can I help you with
   today?") is the whole page; the hub's conversations list (New Conversation, Remembered matters, History) is shown in
   the frame's sidebar (#wsf-hub-slot); a workspace panel opens in a window over the faded conversation, beside the
   sidebar. The hub's own brand, tool bar, tier badge, sign-out button and "Your workspace" list give way to the frame. */
/* The page itself scrolls (AMD-510; Director, 21 Nov 2026 13:48 UK). The engine locks html and body to the window
   height for its own page; in the frame the document is the one scroll, as on every other workspace page. */
html.wsf-doc { height: auto !important; overflow-x: hidden !important; overflow-y: visible !important; }
html.wsf-doc body.wsf.wsf-app { height: auto !important; min-height: 100vh; overflow: visible !important; }
/* On a computer the page behind an open workspace panel stays still and the panel scrolls on its own. On a phone the
   panel is part of the page (below), so the page scrolls as every other workspace page does. */
@media (min-width: 768px) { html.wsf-doc.wsf-sheet-open, html.wsf-doc.wsf-sheet-open body.wsf.wsf-app { overflow: hidden !important; } }
body.wsf-app #kl-root.wsf-binder { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--kl-panel-rail-width, 48px); grid-template-rows: auto auto; grid-template-areas: "main panelrail" "advisory advisory"; height: auto; min-height: calc(100vh - 150px); padding: 0; margin: 0; overflow: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
body.wsf-app #kl-root.wsf-binder.drawer-open { grid-template-columns: minmax(0, 1fr) 468px; }
body.wsf-app #kl-root.wsf-binder::before, body.wsf-app #kl-root.wsf-binder::after { display: none; }
body.wsf-app #kl-root .kl-topbar, body.wsf-app #op-signout-btn, body.wsf-app .kl-hub-facets { display: none !important; }
body.wsf-app #kl-root .kl-main { overflow: visible; background: transparent; min-height: calc(100vh - 190px); }
body.wsf-app #kl-root .kl-welcome, body.wsf-app #kl-root .kl-messages { overflow: visible; flex: 1 0 auto; }
body.wsf-app #kl-root .kl-conversation { min-height: calc(100vh - 190px); }
body.wsf-app #kl-root .kl-conversation-input { position: sticky; bottom: 0; z-index: 5; border-radius: 14px 14px 0 0; }
body.wsf-app #kl-root .kl-panelrail { background: transparent; border-left: 1px solid var(--border-dim); }
body.wsf-app #kl-root .kl-advisory { background: transparent; border-top: 1px solid var(--border-dim); min-height: 36px; }
/* The conversations list in the frame's sidebar. */
.wsf-hub-slot:empty { display: none; }
.wsf-hub-slot { margin: 0 0 12px; padding: 0 0 10px; border-bottom: 1px solid var(--border-dim); }
.wsf-hub-slot .kl-sidebar { position: static !important; transform: none !important; width: auto !important; max-width: none !important; min-width: 0 !important; height: auto !important; box-shadow: none !important; background: transparent !important; border: 0 !important; overflow: visible !important; display: block !important; }
.wsf-hub-slot .kl-sidebar-section { padding: 8px 4px; }
/* A workspace panel as a window over the faded conversation. */
body.wsf-app .kl-facet-layer { position: absolute; inset: 0; z-index: 30; }
body.wsf-app .kl-facet-fade { position: absolute; inset: 0; background: var(--ws-fade, var(--ac-05080f-a62, rgba(5, 8, 15, 0.62))); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); border-radius: 16px; }
body.wsf-app .kl-facet-window { position: sticky; top: 96px; margin: 12px auto 0; width: min(1100px, calc(100% - 32px)); max-height: calc(100vh - 120px); display: flex; flex-direction: column; background: var(--ws-window-bg, linear-gradient(180deg, var(--ac-0f172a-a97, rgba(15,23,42,.97)), var(--ac-0c1525-a98, rgba(12,21,37,.98)))); border: 1px solid var(--border-mid); border-radius: 16px; box-shadow: var(--ws-window-shadow, 0 30px 80px var(--ac-000000-a55, rgba(0,0,0,.55))); overflow: hidden; }
/* The panel window carries the binder finish of every workspace page: the stitched inner border and the tier edge. */
body.wsf-app .kl-facet-window::before { content: ''; position: absolute; inset: 8px; border: 1px dashed var(--ws-stitch, var(--ac-cbd5e1-a20, rgba(203,213,225,.20))); border-radius: 11px; pointer-events: none; z-index: 1; }
body.wsf-app .kl-facet-window::after { content: ''; position: absolute; left: -1px; top: 22px; bottom: 22px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--wsf-tier), transparent); opacity: .85; pointer-events: none; }
body.wsf-app .kl-facet-window .kl-main { grid-area: auto; flex: 1 1 auto; min-height: 0; max-height: calc(100vh - 120px); overflow: hidden; display: flex; flex-direction: column; background: transparent; }
body.wsf-app .kl-facet-window .kl-action-btn[aria-label="Back to Eileen"] { display: none; }
/* AMD-510-TASKS-036: larger text (Settings, Accessibility) zooms #kl-root by 1.12 or 1.25, and the zoom also scales
   the viewport-based heights above, so the open panel drew taller than the screen and its bottom (Accessibility itself)
   could not be reached: page scroll is locked while a panel is open, and the panel is sticky. Divide the panel's
   heights and offset by the chosen scale so it always fits the screen and scrolls inside. #kl-root is in the selector
   so this outranks body.wsf-app #kl-root .kl-main { min-height }. Inactive at standard size (no .kl-a11y-scaled) and on
   phones, where the panel is laid out in the page and the page scrolls (max-width 767px rules below). */
@media (min-width: 768px) {
  html.kl-a11y-scaled body.wsf-app #kl-root .kl-facet-window { top: calc(96px / var(--kl-a11y-font-scale, 1)); max-height: calc((100vh - 120px) / var(--kl-a11y-font-scale, 1)); }
  html.kl-a11y-scaled body.wsf-app #kl-root .kl-facet-window .kl-main { min-height: 0; max-height: calc((100vh - 120px) / var(--kl-a11y-font-scale, 1)); }
}
body.wsf-app .kl-facet-close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-mid); background: transparent; color: var(--text-prime); font-size: 20px; line-height: 1; cursor: pointer; }
body.wsf-app .kl-facet-close:hover { background: var(--surface-hover); }
body.wsf-app .kl-facet-close:focus-visible { outline: 2px solid var(--wsf-tier); outline-offset: 2px; }
/* The Research drawer sits below the workspace header, so its title and close button can be seen and tapped
   (AMD-510; Director, 21 Nov 2026 13:21 UK). */
body.wsf-app .kl-panel-drawer { top: var(--wsf-nav-h, 70px); right: 0; height: calc(100vh - var(--wsf-nav-h, 70px)); height: calc(100dvh - var(--wsf-nav-h, 70px)); z-index: 60; }
body.wsf-app .kl-panel-drawer-close { min-width: 44px; min-height: 44px; font-size: 18px; border: 1px solid var(--border-mid); border-radius: 10px; color: var(--text-prime); }
body.wsf-app .kl-panel-drawer-close:focus-visible { outline: 2px solid var(--wsf-tier); outline-offset: 2px; }
@media (max-width: 767px) {
  body.wsf-app #kl-root.wsf-binder { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "main" "advisory" !important; min-height: 60vh; }
  /* On a phone the Research library is closed until asked for: a "Research" button at the top right of the
     conversation opens it as a full-screen sheet over the header, and its close button returns to the conversation. */
  body.wsf-app #kl-root .kl-panelrail { display: flex !important; position: absolute; top: 10px; right: 10px; z-index: 6; flex-direction: row; width: auto; height: auto; padding: 0; gap: 6px; background: transparent !important; border: 0 !important; }
  body.wsf-app #kl-root .kl-panelrail .kl-panel-rail-divider { display: none; }
  body.wsf-app #kl-root .kl-panel-rail-btn { width: auto; min-height: 44px; padding: 0 14px; gap: 8px; display: inline-flex; align-items: center; border: 1px solid var(--border-mid); border-radius: 999px; background: var(--ws-chip-bg, var(--ac-0a0e1a-a85, rgba(10, 14, 26, 0.85))); color: var(--text-prime); }
  body.wsf-app #kl-root .kl-panel-rail-btn::after { content: attr(aria-label); font: 500 13px/1 var(--font-body, 'DM Sans', sans-serif); }
  body.wsf-app .kl-panel-drawer { top: 0; left: 0; right: 0; width: 100%; max-width: 100vw; height: 100vh; height: 100dvh; z-index: 900; }
  body.wsf-app .kl-panel-drawer-header { padding: 10px 12px 10px 16px; }
  /* On a phone a workspace panel is laid out as every other workspace page is (Director, 21 Nov 2026 14:54 UK): the
     sidebar tabs at the top, then the panel in a stitched binder card, and the page scrolls. The conversation and its
     list step aside while a panel is open; the close button returns to them. */
  body.wsf-app.wsf-panel-open .wsf-hub-slot { display: none; }
  body.wsf-app.wsf-panel-open #kl-root > :not(.kl-facet-layer) { display: none !important; }
  body.wsf-app.wsf-panel-open #kl-root.wsf-binder { min-height: 0; display: block; }
  body.wsf-app .kl-facet-layer { position: static; }
  body.wsf-app .kl-facet-fade { display: none; }
  body.wsf-app .kl-facet-window { position: relative; top: auto; margin: 0 0 24px; width: auto; max-height: none; overflow: visible; box-shadow: var(--ws-binder-shadow, 0 1px 0 var(--ac-ffffff-a4, rgba(255,255,255,.04)) inset, 0 22px 48px var(--ac-000000-a38, rgba(0,0,0,.38))); }
  body.wsf-app .kl-facet-window .kl-main { max-height: none; overflow: visible; }
  body.wsf-app .kl-facet-window .kl-main > div { overflow: visible !important; flex: 0 0 auto !important; }
}
/* The Eileen of the workspace home (AMD-510; Director, 22 Nov 2026): she is docked in the home view (#eileen-dock) and
   shows her orb over every panel, by the shared panel's own rule (home-eileen-panel.js, dockShowing). The earlier rule
   that hid her on the home view, written when the engine's own chat was the home conversation, is removed: it hid the
   docked Eileen. Check R12 refuses it coming back. */
/* The Knowledge Library pass workspace (AMD-510-TASKS-047; Director, 22 Nov 2026): the governance workspace with what a
   pass does not include padlocked. A padlocked item opens the upgrade sheet. */
.wsf-pass { --wsf-tier: var(--tier-operational); --wsf-tier-glow: var(--tier-operational-glow); }
.wsf-tab-locked { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-sec); opacity: .78; }
.wsf-tab-locked:hover { opacity: 1; }
.wsf-lock { display: inline-flex; flex: none; color: var(--text-sec); }
body.wsf-app.wsf-pass #kl-root .kl-pass-strip { position: absolute; top: 10px; right: 56px; z-index: 6; display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) { .wsf-tab-locked { justify-content: flex-start; } body.wsf-app.wsf-pass #kl-root .kl-pass-strip { right: 52px; } }
body.wsf-app.wsf-pass #kl-root .kl-pass-upgrade-btn { background: var(--wsf-tier-glow); color: var(--text-prime); border: 1px solid var(--wsf-tier); border-radius: 999px; padding: 6px 12px; font: 600 12px var(--font-body); cursor: pointer; white-space: nowrap; }
body.wsf-app.wsf-pass #kl-root .kl-pass-upgrade-btn:focus-visible { outline: 2px solid var(--wsf-tier); outline-offset: 2px; }
