/* UNIC MarketingOS, Web OS. Design-unified with the Marketing Intelligence dashboard
   (mcp/intelligence-worker/src/app.ts): same CSS-variable palette (light/dark via data-theme),
   same font stack, same sidebar-nav / panel / chip / table idioms, UNIC red accent (#bb1d2c).
   No build step, no external assets, no CDN. */

:root {
  --red:#bb1d2c; --ink:#1a1a1f; --muted:#6b7280; --line:#e7e7ea; --bg:#f6f6f8; --card:#fff;
  --good:#15803d; --warn:#b45309; --bad:#b91c1c; --navon-bg:#fbe9eb; --navon-fg:var(--red);
  --chip-ok-bg:#e8f5ec; --chip-partial-bg:#fef3e2; --chip-error-bg:#fdeaea;
  --shadow:rgba(0,0,0,.04); --field:#fff;
  /* Shared-header aliases (spec: --panel/--border). Map onto the existing dashboard palette so the
     top bar resolves to the exact same colours as the Intelligence dashboard header. */
  --panel:var(--card); --border:var(--line);
  /* This app's sidebar (.side) width, the shared top-bar menu is positioned at this left offset so
     its first item begins exactly at the sidebar's right edge (= the content area's left edge). */
  --sidebar-w:236px;
  /* Artifact side pane width (user-resizable, persisted). Clamp keeps chat usable on small screens. */
  --artifact-w:clamp(360px, 42vw, 680px);
}
:root[data-theme="dark"] {
  --ink:#e9eaed; --muted:#969ca8; --line:#272c36; --bg:#0e1014; --card:#171a21;
  --good:#4ade80; --warn:#fbbf24; --bad:#f87171; --navon-bg:#2c1418; --navon-fg:#f0a6ad;
  --chip-ok-bg:#12301e; --chip-partial-bg:#332811; --chip-error-bg:#3a1518;
  --shadow:rgba(0,0,0,.5); --field:#11141a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
  font-size: 14px; line-height: 1.5; transition: background .15s, color .15s;
}
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* --- Shared top bar (must match the Intelligence dashboard header exactly) ---
   Pixel spec (identical in both apps):
   - 52px bar, border-box, sticky, no vertical padding (so the logo never clips).
   - Brand cluster left (padding-left 16px). U-mark 26px, display:block, flex-centred.
   - Menu positioned absolutely at left: var(--sidebar-w) so its first item aligns with the
     content area's left edge (= sidebar right edge), regardless of brand-cluster width.
   - Menu items ALL CAPS, line-height = 52px so the 2px active underline sits on the bar's bottom. */
.topbar {
  position: sticky; top: 0; z-index: 100; box-sizing: border-box;
  height: 52px; display: flex; align-items: center;
  padding: 0; background: var(--panel); border-bottom: 1px solid var(--border);
}
.tb-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding-left: 16px; text-decoration: none; color: var(--ink); }
.tb-brand .tb-mark { height: 26px; width: auto; object-fit: contain; display: block; }
.tb-brand .tb-word { font-weight: 700; font-size: 15px; color: var(--ink); }
/* Tabs align with the main content: the menu starts at the sidebar's right edge (fixed width), so
   the first tab sits above the content, not jammed against the brand. */
.tb-menu { position: absolute; left: var(--sidebar-w); right: 150px; display: flex; align-items: center; height: 52px; overflow-x: auto; scrollbar-width: none; }
.tb-menu::-webkit-scrollbar { display: none; }
.tb-item {
  position: relative;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 12.5px; font-weight: 600;
  padding: 0 16px; line-height: 52px; color: var(--muted); text-decoration: none; cursor: pointer;
}
.tb-item:hover { color: var(--ink); }
.tb-item.on { color: var(--ink); }
/* Active underline hugs the LABEL (inset by the item padding) rather than the full padded box, so
   it doesn't run long past the text on either side. */
.tb-item.on::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; background: var(--red); }
.tb-item.disabled { pointer-events: none; opacity: .4; }
.tb-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; margin-left: auto; padding-right: 16px; }
.tb-email { font-size: 13px; color: var(--muted); }
.tb-signout {
  font-size: 13px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; font-family: inherit;
}
.tb-signout:hover { border-color: var(--red); color: var(--red); }
/* Notifications bell + unread badge (item 8) */
.tb-bell { position: relative; background: transparent; border: 0; cursor: pointer; line-height: 1; padding: 5px; border-radius: 8px; color: var(--ink); display: inline-flex; align-items: center; }
.tb-bell svg { display: block; }
.icon-btn svg { display: block; margin: 0 auto; }
.tb-bell:hover { background: var(--card); }
.tb-bell-badge { position: absolute; top: -2px; right: -3px; min-width: 15px; height: 15px; padding: 0 3px; box-sizing: border-box; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; line-height: 15px; text-align: center; border-radius: 8px; }
.notif-panel { position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px var(--shadow, rgba(0,0,0,.18)); }
.notif-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 14px 6px; }
.notif-row { padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.notif-row:hover { background: var(--bg); }
.notif-row.unread { background: color-mix(in srgb, var(--red) 7%, transparent); }
.notif-body { font-size: 13px; line-height: 1.4; margin-bottom: 2px; }
/* Hamburger (mobile drawer toggle), hidden on desktop, shown ≤900px. */
.tb-hamburger {
  display: none; width: 42px; height: 52px; padding: 0; border: 0; background: none;
  color: var(--ink); font-size: 20px; line-height: 52px; cursor: pointer; flex: 0 0 auto;
}
.nav-backdrop { display: none; position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.4); z-index: 110; }
/* On the login view only the brand-only login-topbar is shown (rendered by renderLoginView);
   the full app top bar is not present in that DOM. */
body.login-mode .topbar.login-topbar { display: flex; }

/* --- App shell: left rail + main; a third rail (Proposed Actions) shows only in chat view --- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - 52px); }
.app.with-inspector { grid-template-columns: var(--sidebar-w) 1fr 320px; }
/* The left rail is Workspace-only (Sessions). On other top tabs it's hidden and the main goes full width. */
/* The sidebar is present on every tab (its items are per-tab). Consistent width via --sidebar-w. */

/* --- Sidebar (dashboard .side pattern) --- */
.side {
  background: var(--card); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 52px; align-self: start; height: calc(100vh - 52px); overflow-y: auto;
}
.navsec { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); opacity: .65; padding: 12px 10px 3px; }
/* A group INSIDE a section (the manual's chapter groups under "User manual"): subordinate to the section
   above it, so the reader sees two levels rather than 22 equal items. Sentence case, not uppercase. */
.navsec.navsub { text-transform: none; letter-spacing: 0; font-size: 11px; opacity: .5; padding: 10px 10px 2px 10px; }
.nav {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px;
  font-size: 13px; color: var(--muted); cursor: pointer; border: 0; background: none;
  text-align: left; width: 100%; font-weight: 500; font-family: inherit;
}
.nav:hover { background: var(--bg); color: var(--ink); }
.nav.on { background: var(--navon-bg); color: var(--navon-fg); font-weight: 600; }
.nav .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; }
.nav .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; font-size: 10px; font-weight: 700; padding: 1px 6px; min-width: 18px; text-align: center; }
.side .spacer { flex: 1; }

/* --- Sub-list of specialists inside the Specialists section --- */
.subnav { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px; }
.subnav .nav { padding: 7px 10px 7px 22px; font-size: 12.5px; }
.subnav .nav .sd { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; margin-top: 1px; line-height: 1.3; }

/* --- Main --- */
/* Capped to the viewport (minus the 52px top bar) and laid out as a column so #view can flex and
   scroll internally, keeps the composer pinned in chat view and prevents the page from scrolling. */
.main { padding: 22px 26px; min-width: 0; height: calc(100vh - 52px); display: flex; flex-direction: column; overflow: hidden; }
#view { flex: 1; min-height: 0; overflow-y: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; flex: 0 0 auto; }
/* Title column takes the free width and its heading truncates with an ellipsis instead of being cut
   off by the controls on the right (#14). */
.top > div:first-child { flex: 1 1 auto; min-width: 0; }
.top h2 { margin: 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ctrls { display: flex; align-items: center; gap: 8px; }
.btn {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field);
  font-size: 12px; cursor: pointer; color: var(--ink); font-family: inherit;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; text-decoration: none; color: var(--muted); }
.btn.ghost:hover { border-color: var(--red); color: var(--red); }
.icon-btn { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; font-size: 14px; line-height: 1; }

/* --- Panels + cards (dashboard idioms) --- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-decoration: none; color: inherit; display: block; transition: border-color .12s, transform .12s; }
.rcard:hover { border-color: var(--red); transform: translateY(-1px); }
.rcard .rt { font-size: 14px; font-weight: 600; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.rcard .rd { font-size: 12px; color: var(--muted); line-height: 1.45; }
.rcard .ri { font-size: 15px; }
.rcard .go { margin-top: 10px; font-size: 11px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .04em; }

.ph { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 24px; }
.ph h3 { margin: 0 0 6px; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.ph .tag { font-size: 11px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .05em; }
.note-muted { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* --- Chips --- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.chip.ok { background: var(--chip-ok-bg); color: var(--good); }
.chip.partial { background: var(--chip-partial-bg); color: var(--warn); }
.chip.error { background: var(--chip-error-bg); color: var(--bad); }

/* --- Approval / proposed-action cards --- */
.acard { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.acard.forwarded { border-left-color: var(--good); }
.acard .ahead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.acard .aaction { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--red); }
.acard .asummary { margin: 6px 0 0; font-size: 13px; }
.acard .ameta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.acard pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 11px; overflow-x: auto; max-height: 200px; margin: 8px 0 0; }

/* --- Chat view --- */
/* Fills #view (which flexes within the viewport-capped .main); messages scroll, composer pins. */
.chat-wrap { display: flex; flex-direction: column; height: 100%; position: relative; }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 2px 16px; }
.msg { max-width: 760px; }
.msg .role { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
/* System notes (approval updates etc.), quieter than a normal turn. */
.msg.system .bubble { background: transparent; border-style: dashed; color: var(--muted); font-size: 12.5px; }
.msg.user { align-self: flex-end; }
.msg.user .bubble { background: var(--navon-bg); border-color: var(--navon-bg); }
/* #26: per-message Edit/Fork actions, revealed on hover of a user turn (mirrors the sidebar sess-tools). */
.msg.user .msg-acts { display: none; gap: 6px; margin-top: 4px; justify-content: flex-end; }
.msg.user:hover .msg-acts { display: flex; }
.msg-act { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; font-size: 11px; padding: 2px 8px; cursor: pointer; }
.msg-act:hover { border-color: var(--red); color: var(--red); }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
/* Preserve the paragraph/line breaks a user typed in their own prompt (was collapsing to one block, #11).
   Scoped to user bubbles so markdown-rendered assistant replies are unaffected. */
.msg.user .bubble p { white-space: pre-wrap; }
.bubble code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.bubble pre { background: var(--bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; border: 1px solid var(--line); }
.bubble pre code { background: none; padding: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble h1, .bubble h2, .bubble h3 { margin: 6px 0; font-size: 15px; }
.bubble a { color: var(--red); }
/* Markdown tables */
.bubble .md-table-wrap { overflow-x: auto; margin: 6px 0 10px; }
.bubble table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.bubble th { background: var(--bg); font-weight: 600; }

/* Support/manual: document-grade typography (overrides the tight chat .bubble spacing for the
   long-form User Manual so headings have hierarchy and sections breathe). Applied via .bubble.manual. */
.manual { line-height: 1.65; }
.manual > :first-child { margin-top: 0; }
.manual h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.manual h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.manual h3 { font-size: 16px; font-weight: 700; margin: 28px 0 8px; }
.manual h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 6px; }
.manual p { margin: 0 0 13px; }
.manual ul, .manual ol { margin: 8px 0 15px; padding-left: 22px; }
.manual li { margin: 5px 0; }
.manual li > ul, .manual li > ol { margin: 5px 0; }
.manual a { color: var(--red); font-weight: 500; }
.manual hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.manual blockquote { margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--red); background: var(--bg); border-radius: 0 8px 8px 0; color: var(--muted); }
.manual table { font-size: 13px; margin: 4px 0; }
.manual th, .manual td { padding: 8px 12px; vertical-align: top; }
.manual .md-table-wrap { margin: 8px 0 18px; }
.manual code { font-size: 12.5px; }
/* Fenced code block with a copy button */
.codeblock { position: relative; }
.codeblock .copy-btn {
  position: absolute; top: 6px; right: 6px; font-size: 11px; padding: 2px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer;
  opacity: 0; transition: opacity .12s; font-family: inherit;
}
.codeblock:hover .copy-btn { opacity: 1; }
.codeblock .copy-btn:hover { border-color: var(--red); color: var(--red); }
.codeblock .copy-btn.copied { color: var(--good); border-color: var(--good); }
/* Preview button sits left of Copy; always visible on artifact blocks so it's discoverable. */
.codeblock .preview-btn { right: 66px; opacity: 1; color: var(--red); border-color: var(--red); }

/* --- Artifact panel (Claude-style slide-over): sandboxed iframe preview of HTML/SVG blocks ---
   The panel is a fixed right-hand column; while it's open, `.app` reserves an equal-width gutter
   (body.artifact-open below) so the chat REFLOWS to the left instead of being covered. */
.artifact-panel {
  position: fixed; top: 52px; right: 0; bottom: 0; z-index: 130;
  width: var(--artifact-w); display: flex; flex-direction: column;
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -12px 0 40px var(--shadow);
  animation: artifact-in .16s ease;
}
@keyframes artifact-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Desktop: reserve the pane's width so the app grid shrinks and the chat is never hidden. */
@media (min-width: 901px) { body.artifact-open .app { padding-right: var(--artifact-w); } }
/* The pane covers the usage pill's corner, hide it while open to avoid the overlap. */
body.artifact-open .usage-pill { display: none; }
/* Drag handle on the pane's left edge. */
.artifact-resize { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 2; touch-action: none; }
.artifact-resize:hover { background: color-mix(in srgb, var(--red) 30%, transparent); }
.artifact-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.artifact-head .btn.active { color: var(--red); border-color: var(--red); }
/* Stage = the scrollable preview viewport; scaler = a sized box the (possibly scaled) iframe sits in
   so wide designs are scaled to fit the pane rather than cropped. */
/* Spread navigation group (multi-page designs, #6). */
.artifact-spreads { display: inline-flex; align-items: center; gap: 2px; }
.artifact-spreads .btn[disabled] { opacity: .4; cursor: default; }
/* Zoom control group in the pane head (inspect a brochure/booklet spread). */
.artifact-zoom { display: inline-flex; align-items: center; gap: 2px; }
.artifact-zoom .btn { padding: 4px 8px; }
#artifactZoomReset { min-width: 48px; text-align: center; }
/* Fullscreen: the Fullscreen API makes .artifact-panel fill the screen; drop the reserved width so
   the stage uses the whole viewport. */
.artifact-panel.artifact-full { width: 100vw; }
.artifact-stage { flex: 1; overflow: auto; background: #fff; position: relative; }
.artifact-scaler { position: relative; width: 100%; }
.artifact-frame { border: 0; width: 100%; height: 100%; background: #fff; transform-origin: top left; display: block; }
/* Edit mode: a monospace code editor above the live preview; toggled by ✎ Edit. */
.artifact-editor {
  flex: 0 0 42%; width: 100%; box-sizing: border-box; resize: none; outline: none;
  border: 0; border-bottom: 1px solid var(--line); padding: 12px 14px;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink); background: var(--bg); tab-size: 2; white-space: pre;
}
.artifact-panel.editing .artifact-stage { flex: 1 1 58%; }
#artifactVer { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
/* Chat card for a versioned artifact (from a ```artifact marker or a live event). */
.artifact-card { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); max-width: 460px; }
.artifact-card .ac-icon { font-size: 20px; line-height: 1; }
.artifact-card .ac-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.artifact-card .ac-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-card .ac-open { margin-left: auto; white-space: nowrap; }
/* A generated FILE's download card (ticket #35). Same shell as an artifact card; the action is an <a
   download> rather than a button, so it needs the button's own line-height and no underline. */
.file-card .ac-open { text-decoration: none; display: inline-flex; align-items: center; }

/* SharePoint file picker (modal) */
.sp-modal { position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 20px; }
.sp-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; width: min(560px, 96vw); max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px var(--shadow); overflow: hidden; }
.sp-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sp-list { overflow-y: auto; padding: 6px; }
.sp-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.sp-row:hover { background: var(--bg); }
.sp-row .sp-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Monthly-cap pop-up (budget limit reached) */
.budget-card { width: min(460px, 96vw); padding: 22px 24px 20px; gap: 0; }
.budget-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.budget-ico { font-size: 20px; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--navon-bg); color: var(--red); }
.budget-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.budget-sub { margin: 0 0 8px; font-size: 13.5px; color: var(--ink); }
.budget-body { margin: 0 0 18px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.budget-actions { display: flex; justify-content: flex-end; gap: 10px; }
.budget-msg { margin-top: 12px; line-height: 1.5; }
.budget-msg:empty { display: none; }
.usage-pill.over { color: var(--red); font-weight: 600; }

/* @mention autocomplete (project discussion) */
.mention-pop { position: fixed; z-index: 150; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px var(--shadow); overflow: hidden; max-height: 240px; overflow-y: auto; }
.mention-opt { padding: 8px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.mention-opt:hover { background: var(--bg); }

/* Attachment chips (history + composer staging) */
.att-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.att-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted);
}
.att-chip img { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }
.att-chip .att-x { cursor: pointer; font-weight: 700; opacity: .6; }
.att-chip .att-x:hover { opacity: 1; color: var(--red); }

/* Typing / waiting indicator */
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .5; animation: typing-b 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-b { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: .9; } }

/* Composer: staging row (attachments) above the input row, both inside a bordered container. */
.composer { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); position: relative; }
.composer.dragover { outline: 2px dashed var(--red); outline-offset: 4px; border-radius: 10px; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.input {
  flex: 1; resize: none; background: var(--field); border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); padding: 10px 12px; font-family: inherit; font-size: 14px; max-height: 160px; outline: none;
}
.input:focus { border-color: var(--red); }
.input:disabled { opacity: .5; }
.clip-btn {
  flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--field); color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1;
}
.clip-btn:hover { border-color: var(--red); color: var(--red); }
.btn.stop { background: var(--card); border-color: var(--bad); color: var(--bad); }
.btn.stop:hover { background: var(--chip-error-bg); }

/* Scroll-to-bottom pill (shown when unpinned) */
.scroll-pill {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 5;
  font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; box-shadow: 0 2px 8px var(--shadow);
}

/* Error toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--bad); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 420px;
}

.emptystate { color: var(--muted); font-size: 13px; padding: 40px 8px; text-align: center; }
.emptystate .big { font-size: 15px; color: var(--ink); margin-bottom: 6px; }

/* --- Welcome page: hero + specialist launch cards --- */
.hero { max-width: 760px; margin: 0 auto 28px; text-align: center; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 14px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); font-size: 14.5px; line-height: 1.7; margin: 0; }
.spec-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; max-width: 1240px; margin: 0 auto 40px; }
.spec-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 18px;
  display: flex; flex-direction: column; gap: 8px; transition: border-color .12s, transform .12s;
}
.spec-card:hover { border-color: var(--red); transform: translateY(-2px); }
.spec-card .sc-icon { font-size: 28px; line-height: 1; }
.spec-card .sc-name { font-size: 15px; font-weight: 700; }
.spec-card .sc-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.55; flex: 1; }
.spec-card .sc-launch { margin-top: 12px; align-self: flex-start; }

/* BETA tag on the brand (header, login marks, welcome hero) */
.beta-tag { display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: .08em; vertical-align: middle; padding: 1px 5px; border-radius: 5px; background: var(--red); color: #fff; margin-left: 6px; position: relative; top: -1px; }
.hero h1 .beta-tag { font-size: 12px; top: -6px; }
.login-mark .beta-tag { display: inline-block; width: auto; font-size: 8.5px; margin-left: 5px; color: #fff; }

/* Specialist "good for / when to use someone else" scope, welcome cards + specialist landing */
.hero-pick { margin-top: 14px; font-size: 13.5px; line-height: 1.7; }
.sc-good { margin-top: 4px; text-align: left; }
.sc-good ul { margin: 4px 0 0; padding-left: 18px; }
.sc-good li { font-size: 12px; color: var(--ink); margin: 2px 0; line-height: 1.4; }
.sc-lbl { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sc-cross { margin-top: 10px; text-align: left; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.sc-cross .sc-lbl { color: var(--red); margin-right: 4px; }
.spec-scope { max-width: 600px; margin: 26px auto 0; text-align: left; border-top: 1px solid var(--line); padding-top: 18px; }
.spec-scope .sc-good ul { columns: 1; }

/* Capabilities explainer (welcome screen): what the tools can do + the approval model */
.capabilities { max-width: 1180px; margin: 8px auto 48px; }
.capabilities > h2 { font-size: 17px; margin: 0 0 4px; }
.capabilities > .cap-intro { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.cap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* Specialist grid = 4 up, explainer = 3 up, on desktop; both step down on narrower screens. */
@media (max-width: 1180px) { .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .spec-grid, .cap-grid { grid-template-columns: 1fr; } }
.cap-group { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.cap-group.gated { border-left: 3px solid var(--warn); }
.cap-group.free { border-left: 3px solid var(--good); }
.cap-group h3 { margin: 0 0 4px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.cap-group .cap-sub { color: var(--muted); font-size: 11.5px; margin: 0 0 10px; }
.cap-group ul { margin: 0; padding-left: 18px; }
.cap-group li { font-size: 12.5px; line-height: 1.5; margin: 4px 0; color: var(--ink); }
.cap-group li b { font-weight: 600; }

/* --- Specialist landing: Claude-style centered prompt --- */
.spec-hero { max-width: 680px; margin: 12vh auto 0; text-align: center; }
.spec-hero .sh-icon { font-size: 44px; margin-bottom: 14px; }
.spec-hero .sh-headline { font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 10px; letter-spacing: -0.02em; }
.spec-hero .sh-sub { color: var(--muted); font-size: 14.5px; line-height: 1.65; margin: 0 0 26px; }
/* The hero composer stacks: staging row (attachments), then clip + textarea + Send, then the
   Model / Effort picks (FL-06, AI-01). The row keeps the old side-by-side layout. */
.hero-composer { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.hero-composer .hero-row { display: flex; gap: 10px; align-items: flex-end; }
.hero-composer .hero-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-composer .hero-opts select.btn { font-size: 12px; padding: 6px 10px; }
.hero-composer.dragover { outline: 2px dashed var(--red); outline-offset: 6px; border-radius: 14px; }
.hero-composer .clip-btn { height: 44px; width: 44px; border-radius: 12px; }
.hero-composer textarea {
  flex: 1; resize: none; background: var(--field); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); padding: 14px 16px; font-family: inherit; font-size: 15px; outline: none; min-height: 84px;
  box-shadow: 0 4px 18px var(--shadow);
}
.hero-composer textarea:focus { border-color: var(--red); }
.hero-composer .hero-row .btn { padding: 12px 20px; font-size: 14px; border-radius: 12px; }
/* FL-07: a shared chat opened by a colleague has a banner where the composer would be. */
.shared-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 13.5px; }
.sessitem.shared .sm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* FL-05: the project's MarkOS chats, one line under the project header. */
.pms-chats { margin: 4px 0 12px; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.pms-chats a { text-decoration: none; border-bottom: 1px dotted var(--line); }
.pms-chats a:hover { border-bottom-color: var(--red); }
/* Unified MarkOS home: no icon, larger wordmark + BETA sticker, pronounced prompt, compact tags.
   Vertically centered in the content area (fills #view, centers its own column). */
.markos-hero { max-width: 800px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.markos-hero .mk-headline { font-size: clamp(30px, 3.8vw, 38px); margin-bottom: 12px; }
.markos-hero .mk-headline .beta-tag { font-size: 12px; top: -8px; }
.markos-hero .sh-sub { margin-bottom: 16px; }
/* "What are you working on?": pronounced call to action above the intent tags. */
.mk-prompt { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin: 0 0 14px; }
/* Intent tags (unified MarkOS home): compact + light-weight. Only the first 6 show; "More…" reveals the rest. */
.mk-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 0 0 22px; }
.mk-chip {
  background: transparent; border: 1px solid var(--line); border-radius: 999px; color: var(--ink);
  padding: 5px 11px; font-family: inherit; font-size: 12px; cursor: pointer; transition: border-color .12s, background .12s;
}
.mk-chip:hover { border-color: var(--red); background: var(--panel); }
.mk-chip--extra { display: none; }
.mk-chips.show-all .mk-chip--extra { display: inline-block; }
.mk-more { background: transparent; border: none; color: var(--muted); font-family: inherit; font-size: 12px; cursor: pointer; padding: 5px 8px; text-decoration: underline; text-underline-offset: 2px; }
.mk-more:hover { color: var(--red); }

/* --- Sidebar specialist icons + header avatar --- */
.nav .sicon { font-size: 15px; line-height: 1; flex: 0 0 auto; }
.tb-avatar {
  /* Solid red + white to MATCH the presence "me" avatar (.tb-presence-av.me), so when presence loads
     and swaps this chip for the stack there is no visible flash (same colour, same initials). */
  width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; letter-spacing: .03em; cursor: default; user-select: none;
}

/* --- Support sidebar footer: the running app version --- */
.side-version { padding: 14px 10px 8px; border-top: 1px solid var(--line); margin-top: 16px; }

/* --- Presence stack (who is using the OS right now; hover a circle for the name infobox) --- */
.tb-presence { display: inline-flex; align-items: center; }
.tb-presence-av {
  position: relative;
  width: 26px; height: 26px; border-radius: 50%; background: var(--navon-bg); color: var(--navon-fg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; letter-spacing: .02em; cursor: default; user-select: none;
  border: 2px solid var(--panel); margin-left: -7px;
}
.tb-presence-av:first-child { margin-left: 0; }
.tb-presence-av.me { background: var(--red); color: #fff; }
.tb-presence-av.more { background: var(--card); color: var(--muted); }
/* Styled hover infobox (native title tooltips are slow/subtle). data-name carries the person's
   full name; right-aligned under the circle so it never clips off the viewport's right edge. */
.tb-presence-av::after {
  content: attr(data-name);
  position: absolute; top: calc(100% + 8px); right: -4px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
  box-shadow: 0 6px 20px var(--shadow); opacity: 0; transform: translateY(-3px);
  transition: opacity .12s ease, transform .12s ease; pointer-events: none; z-index: 200;
}
.tb-presence-av:hover::after { opacity: 1; transform: translateY(0); }
/* On hover, lift the circle above its overlapping neighbours so the infobox isn't covered. */
.tb-presence-av:hover { z-index: 201; }

/* --- Right inspector rail: "What MarkOS can do" --- */
/* Collapsible (owner, 2026-08-11). Collapsed = a 34px strip with a vertical label; the grid column
   shrinks with it so the chat gets the width back. The artifact pane HIDING the rail is a separate,
   older mechanism (openArtifact): this class is the USER'S choice and survives pane open/close. */
#railHead { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#railHead #railToggle { font-size: 13px; line-height: 1; padding: 2px 7px; opacity: .7; }
#railHead #railToggle:hover { opacity: 1; }
#railStrip { display: none; }
.app.with-inspector.rail-collapsed { grid-template-columns: var(--sidebar-w) 1fr 34px; }
.inspector.rail-collapsed { padding: 10px 4px; }
.inspector.rail-collapsed #railHead, .inspector.rail-collapsed #railBody { display: none; }
.inspector.rail-collapsed #railStrip {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: 100%; padding: 8px 0; font: inherit; font-size: 12px; color: var(--text);
  background: none; border: 0; cursor: pointer; opacity: .65;
}
.inspector.rail-collapsed #railStrip:hover { opacity: 1; }
.inspector.rail-collapsed #railStrip span { writing-mode: vertical-rl; letter-spacing: .04em; }
#capSearchWrap { padding: 0 4px 8px; }
#capSearch { width: 100%; box-sizing: border-box; padding: 7px 9px; font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
#capSearch:focus { outline: none; border-color: var(--accent, #c8102e); }
.capsum { padding: 0 4px 10px; }
.capgroup { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; overflow: hidden; background: var(--bg); }
.capgroup > summary { cursor: pointer; padding: 9px 11px; font-size: 13px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
.capgroup > summary::-webkit-details-marker { display: none; }
.capgroup > summary::before { content: "▸"; font-size: 10px; opacity: .6; transition: transform .12s ease; }
.capgroup[open] > summary::before { transform: rotate(90deg); }
.capgroup > summary:hover { background: var(--card); }
.capgroup .capcount { margin-left: auto; font-weight: 400; font-size: 11px; opacity: .6; }
.capbody { padding: 2px 11px 10px; border-top: 1px solid var(--line); }
.capgsum { font-size: 12px; opacity: .75; margin: 8px 0; line-height: 1.45; }
.capitem { padding: 6px 0; border-top: 1px dashed var(--line); font-size: 12px; line-height: 1.45; }
.capitem:first-of-type { border-top: 0; }
.capitem .capwhat { display: block; }
.capitem .captool { display: block; margin-top: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; opacity: .5; }
.capbadge { display: inline-block; font-size: 9.5px; letter-spacing: .03em; text-transform: uppercase; padding: 1px 5px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; white-space: nowrap; }
.capbadge.read { background: rgba(80,160,110,.16); color: #4fae7c; }
.capbadge.gated { background: rgba(200,140,40,.16); color: #d09a3c; }
.capbadge.blocked { background: rgba(200,60,60,.16); color: #d46a6a; }
.capblocked { font-size: 11.5px; opacity: .8; margin-top: 3px; padding-left: 2px; border-left: 2px solid rgba(200,60,60,.4); padding: 2px 0 2px 7px; }
.capempty { font-size: 12px; opacity: .7; padding: 6px 4px; }

/* --- "What am I approving?" preview blocks on an approval card --- */
.pvwrap { margin: 8px 0 2px; }
.pvblock { margin: 8px 0; }
.pvlabel { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; margin-bottom: 4px; cursor: default; }
details.pvblock > summary.pvlabel { cursor: pointer; list-style: none; }
details.pvblock > summary.pvlabel::-webkit-details-marker { display: none; }
details.pvblock > summary.pvlabel::after { content: " ▸"; font-size: 9px; }
details.pvblock[open] > summary.pvlabel::after { content: " ▾"; }
.pvlist { margin: 2px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; }
.pvlist li { margin: 0; }
.pvframe { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 4px 0; }
.pvimg { max-width: 280px; max-height: 280px; border-radius: 8px; display: block; margin: 0 0 8px; border: 1px solid var(--line); }
.pvpost { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 6px 0; }
.pvkind { margin-bottom: 6px; }
.pvconseq { margin: 8px 0 2px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; border-left: 3px solid; }
.pvconseq.ok { background: rgba(80,160,110,.10); border-color: #4fae7c; }
.pvconseq.warn { background: rgba(200,140,40,.10); border-color: #d09a3c; }
.pvconseq.danger { background: rgba(200,60,60,.12); border-color: #d46a6a; }

/* --- Right inspector rail (legacy proposed-actions styles, kept for the Approvals cards) --- */
.inspector { background: var(--card); border-left: 1px solid var(--line); padding: 18px 14px; overflow-y: auto; height: calc(100vh - 52px); position: sticky; top: 52px; }
.inspector .navsec { padding-left: 4px; }

/* --- Sessions list within Specialists section --- */
.sesslist { display: flex; flex-direction: column; gap: 2px; }
.sessitem { padding: 7px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; font-size: 12.5px; }
.sessitem:hover { background: var(--bg); }
.sessitem.on { background: var(--navon-bg); border-color: transparent; color: var(--navon-fg); font-weight: 600; }
.sessitem .sm { font-size: 10.5px; color: var(--muted); }
/* Session title never hard-cuts: one line, ellipsis; padding keeps it clear of the hover tools (#12). */
.sessitem .st-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }

.foot { margin-top: 18px; font-size: 11px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* --- Chat turn context: thought process (collapsible), tool activity, live status, turn stats --- */
.turn-think { margin: 0 0 10px; border-left: 2px solid var(--line); padding-left: 10px; }
.turn-think summary { cursor: pointer; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); user-select: none; }
.turn-think .tt { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.55; max-height: 280px; overflow-y: auto; }
.turn-think .tt p { margin: 0 0 8px; } .turn-think .tt p:last-child { margin-bottom: 0; }
/* Working notes: the model's interim narration between tool calls, collapsed by default so only the
   final answer shows. Expands to the running commentary. Mirrors the Activity strip's chrome. */
.turn-narr { margin: 0 0 10px; }
.turn-narr > summary { cursor: pointer; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); user-select: none; list-style: none; }
.turn-narr > summary::-webkit-details-marker { display: none; }
.turn-narr > summary::before { content: "▸ "; }
.turn-narr[open] > summary::before { content: "▾ "; }
.turn-narr .nn { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.55; border-left: 2px solid var(--line); padding-left: 10px; max-height: 280px; overflow-y: auto; }
.turn-narr .nn .narr-block + .narr-block { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.turn-narr .nn p { margin: 0 0 8px; } .turn-narr .nn p:last-child { margin-bottom: 0; }
/* Activity log: a collapsed one-liner (step count) that expands to the full step-by-step tool
   trace. The live narration lives in the status row; this keeps the chat from crowding with 🔧 lines. */
.turn-acts { margin: 0 0 10px; }
.turn-acts > .acts-sum { cursor: pointer; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); user-select: none; list-style: none; }
.turn-acts > .acts-sum::-webkit-details-marker { display: none; }
.turn-acts > .acts-sum::before { content: "▸ "; }
.turn-acts[open] > .acts-sum::before { content: "▾ "; }
.turn-acts .acts-body { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; border-left: 2px solid var(--line); padding-left: 10px; max-height: 260px; overflow-y: auto; }
.turn-acts .act-line { font-size: 12px; color: var(--muted); }
.turn-status { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.turn-status .ts-label { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.turn-meta { font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
/* The token figure carries the cost composition (fresh / cache read / cache write) as a title. */
.turn-meta .tok { cursor: help; border-bottom: 1px dotted currentColor; }

/* --- Personal usage meter (bottom-right). Clearly labeled; translucent so it never hides content. --- */
.usage-pill {
  position: fixed; right: 14px; bottom: 12px; z-index: 95;
  font-size: 11px; color: var(--muted); background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  box-shadow: 0 2px 10px var(--shadow); backdrop-filter: blur(4px); cursor: default;
  font-variant-numeric: tabular-nums;
}
.usage-pill .ul { font-weight: 700; letter-spacing: .05em; font-size: 9.5px; color: var(--red); margin-right: 4px; }

/* --- Session list hover tools (rename / delete) --- */
.sessitem { position: relative; }
.sessitem .sess-tools { position: absolute; right: 6px; top: 6px; display: none; gap: 4px; }
.sessitem:hover .sess-tools { display: inline-flex; }
.sessitem .sbtn { font-size: 11px; opacity: .65; cursor: pointer; }
.sessitem .sbtn:hover { opacity: 1; }

/* --- Approvals: decide row + readable payload rows --- */
.adecide { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.adecide input { flex: 1; min-width: 160px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 12px; font-family: inherit; }
.btn.approve { background: var(--good); border-color: var(--good); color: #fff; font-weight: 600; }
.btn.reject { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
/* Approvals, "Show all approvals": a row you may not decide keeps its buttons visible but inert, with the
   reason beside them (feedback AP-01). */
.btn.approve:disabled, .btn.reject:disabled { opacity: .45; cursor: not-allowed; }
.adecide input:disabled { opacity: .5; }
.adecide-why { font-size: 12px; color: var(--muted); margin-top: 6px; }
.appr-toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: auto; cursor: pointer; }
.appr-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.appr-head h3 { margin: 0; }
.prows { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.prow { display: flex; gap: 10px; font-size: 12.5px; }
.prow .pk { flex: 0 0 130px; color: var(--muted); }
.prow .pv { min-width: 0; overflow-wrap: anywhere; }
.pjson { margin-top: 6px; }
.pjson summary { cursor: pointer; }

/* --- Mobile (≤900px): the sidebar becomes a slide-in drawer behind a hamburger; the top-bar menu
   sits in normal flow (its absolute var(--sidebar-w) offset only makes sense next to a visible
   sidebar); chat bubbles go full width. Same pattern as the Intelligence dashboard. --- */
@media (max-width: 900px) {
  .tb-hamburger { display: block; }
  .tb-brand { padding-left: 2px; }
  .tb-menu { position: static; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .tb-menu::-webkit-scrollbar { display: none; }
  .tb-item { padding: 0 10px; white-space: nowrap; }
  .tb-email { display: none; }
  .tb-right { padding-right: 10px; }
  .app, .app.with-inspector { grid-template-columns: 1fr; }
  .side {
    position: fixed; top: 52px; left: 0; bottom: 0; width: min(280px, 82vw); height: auto;
    z-index: 120; transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    /* The drawer itself scrolls; the page behind must not steal the touch scroll. */
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  body.nav-open .side { transform: none; }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open { overflow: hidden; }
  .main { padding: 14px; height: calc(100dvh - 52px); }
  .msg { max-width: 100%; }
  /* Lift the usage meter above the pinned chat composer on small screens. */
  .usage-pill { bottom: 82px; right: 8px; }
  .panel { overflow-x: auto; }
  .inspector { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
  /* No room to split on a phone, the artifact pane is a near-full overlay (chat is not reserved). */
  .artifact-panel { width: min(760px, 96vw); }
  .artifact-resize { display: none; }
}
@media (max-width: 640px) { .tb-brand .tb-word { display: none; } }

/* In-page login (split-origin mode). Mirrors the server-rendered login page (src/login.ts) so the
   two surfaces look identical; used only when the static UI runs on a different origin than the API. */
body.login-mode { background: var(--bg); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: min(380px, 100%); box-shadow: 0 1px 3px var(--shadow); }
.login-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.login-mark .m { background: var(--red); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .5px; padding: 5px 8px; border-radius: 6px; }
.login-mark b { font-size: 14px; display: block; } .login-mark span { font-size: 11px; color: var(--muted); display: block; }
.login-h1 { font-size: 18px; margin: 0 0 4px; }
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.login-label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.login-input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; outline: none; background: var(--field); color: var(--ink); font-family: inherit; }
.login-input:focus { border-color: var(--red); }
.login-btn { width: 100%; margin-top: 18px; padding: 11px; border: 0; border-radius: 9px; background: var(--red); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-err { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; }
.login-note { margin-top: 16px; font-size: 11px; color: var(--muted); line-height: 1.5; }

/* --- UNIC U-mark on the in-page (split-origin) login card. Matches the dashboard login mark. --- */
.login-mark .mimg { width: 32px; height: 32px; object-fit: contain; display: block; }

/* --- Intelligence embed (in-shell iframe replacing the old link grid). --- */
.embed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.reports-dd { font-size: 12px; }
.reports-dd > summary { cursor: pointer; color: var(--muted); list-style: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; display: inline-block; }
.reports-dd > summary::-webkit-details-marker { display: none; }
.reports-dd[open] > summary { border-color: var(--red); color: var(--red); }
.qlinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.qlink { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; font-size: 12px; font-weight: 600; }
.qlink:hover { border-color: var(--red); }
.qlink .ri { font-size: 14px; }
.embed-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.intel-frame { width: 100%; height: calc(100vh - 170px); min-height: 480px; border: 0; display: block; }

/* ============================ Projects (PMS) pane ============================ */
.pms { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pms-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.pms-tab { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.pms-tab.on { background: var(--red); color: #fff; border-color: var(--red); }
.pms-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pms-toolbar select, .pms-toolbar input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13px; }
.pms-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.pms-toolbar .pms-check input { width: auto; padding: 0; }
/* Board — horizontal scroller. min-width:0 lets it shrink inside the flex column (.pms) so its own
   overflow-x scroll engages instead of the columns overflowing off-screen on a narrow window. The
   scrollbar is forced visible (not the macOS overlay one) so a narrow window clearly scrolls to the
   stages on the right instead of looking like they vanished. */
.pms-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; min-width: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.pms-board::-webkit-scrollbar { height: 10px; }
.pms-board::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.pms-board::-webkit-scrollbar-track { background: transparent; }
/* Responsive columns: share the width and shrink to a sensible min so all stages stay visible as the
   window narrows; the board's overflow-x:auto only kicks in once even the min no longer fits. */
.pms-col { flex: 1 1 170px; min-width: 160px; background: var(--panel, var(--bg)); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.pms-col-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.pms-card { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 2px var(--shadow, rgba(0,0,0,.04)); }
.pms-card:hover { border-color: var(--red); }
.pms-card-code { font-size: 11px; font-weight: 700; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.pms-card-name { font-size: 13px; font-weight: 600; margin: 2px 0; }
.pms-card-meta { font-size: 11px; color: var(--muted); }
/* Calendar view (item 4) */
.pms-cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pms-cal-nav { display: flex; align-items: center; gap: 6px; }
.pms-cal-label { font-size: 15px; margin-left: 6px; }
.pms-cal-views { display: flex; gap: 4px; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.cal-head > div { padding: 0 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid.week .cal-cell { min-height: 220px; }
.cal-cell { min-height: 96px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; overflow: hidden; }
.cal-cell.out { background: var(--bg); opacity: .55; }
.cal-cell.today { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.cal-daynum { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal-cell.today .cal-daynum { color: var(--red); }
.cal-item { font-size: 11px; line-height: 1.3; padding: 2px 5px; border-radius: 5px; margin-bottom: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--muted); background: var(--bg); }
.cal-item.project { border-left-color: var(--red); }
.cal-item.task { border-left-color: var(--good, #2e9e5b); }
.cal-item.event { border-left-color: var(--warn, #c98a00); }
.cal-item:hover { background: var(--navon-bg, var(--line)); }
.cal-more { font-size: 10px; color: var(--muted); padding: 1px 4px; }
.cal-year { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cal-ymonth { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; text-align: center; }
.cal-ymonth:hover { border-color: var(--red); }
.cal-ymonth-h { font-weight: 700; font-size: 13px; }
.cal-ymonth-n { font-size: 12px; color: var(--muted); margin-top: 4px; }
.cal-upcoming { display: flex; flex-direction: column; gap: 2px; }
.cal-up-row { display: flex; gap: 12px; align-items: baseline; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.cal-up-row:hover { background: var(--card); }
.cal-up-date { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; min-width: 84px; }
/* Table */
.pms-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pms-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.pms-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.pms-table tbody tr { cursor: pointer; }
.pms-table tbody tr:hover { background: var(--panel, var(--bg)); }
/* Detail */
.pms-detail { display: flex; flex-direction: column; gap: 10px; }
.pms-detail-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pms-detail-head h2 { margin: 0; font-size: 18px; }
.pms-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pms-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; background: var(--panel, var(--bg)); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.pms-detail-grid select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); }
.pms-brief { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 10px; font-size: 13px; white-space: pre-wrap; }
.pms-task { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--card); }
.pms-task-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pms-task-title { font-weight: 600; font-size: 13px; }
.pms-task-desc { line-height: 1.4; }
/* Intake brief / request full view: key-value grid + per-scope blocks */
.pms-intake { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 6px 0; }
.pms-intake-block { margin-bottom: 6px; }
.pms-kvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 14px; }
.pms-kv { font-size: 13px; }
.pms-kv > .muted { display: block; }
/* Intake field values are free text from a textarea; preserve the requester's line + paragraph
   breaks instead of collapsing them to one line (matches the .pms-brief treatment). */
.pms-kv > div { white-space: pre-wrap; overflow-wrap: anywhere; }
.pms-req-full { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.pms-req-toggle { background: none; border: 0; color: var(--red, #bb1d2c); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 4px 0; }
.pms-task select, .pms-addtask select, .pms-addtask input { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); font-size: 12px; }
.pms-addtask { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.pms-addtask input[type=text] { flex: 1; min-width: 160px; }
.pms-activity { display: flex; flex-direction: column; gap: 4px; }
.pms-act { font-size: 12px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
/* Per-project files + discussion (item 5) */
.pms-files { display: flex; flex-direction: column; gap: 3px; }
.pms-file { font-size: 13px; display: flex; align-items: center; gap: 8px; padding: 3px 0; flex-wrap: wrap; }
.pms-file.archived { opacity: .7; }
.pms-file-state { margin-left: auto; font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); }
.pms-archived { margin-top: 4px; }
.pms-archived summary { cursor: pointer; padding: 3px 0; }
.pms-series { margin-bottom: 12px; }
.pms-addfile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 16px; }
.pms-addfile input[type=url], .pms-addfile input[type=text] { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13px; }
.pms-addfile input[type=url] { min-width: 200px; flex: 1; }
.pms-comments { display: flex; flex-direction: column; gap: 8px; }
.pms-cmt { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; }
.pms-cmt-body { font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; line-height: 1.5; }
.pms-addcmt { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 16px; }
.pms-addcmt textarea { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13.5px; font-family: inherit; resize: vertical; }
/* Project watchers (ticket #41): people following a project for visibility only. Sized to sit inside a
   detail-grid cell, so the row reads as one more fact about the project rather than a panel. */
.pms-watchers { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pms-watcher { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; padding: 1px 4px 1px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.pms-watcher.is-me { border-color: var(--accent, var(--line)); font-weight: 600; }
.pms-watch-rm { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.pms-watch-rm:hover { color: var(--ink); }
.pms-watch-add { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 5px; }
.pms-watch-add select { max-width: 170px; font-size: 12.5px; }
.pms-watchers-cell { grid-column: span 2; }

/* Requests + forms */
.pms-reqs { display: flex; flex-direction: column; gap: 10px; }
.pms-req { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--card); color: var(--ink); }
/* Flex header so the status chip is pushed to the right edge; the title takes the remaining width.
   In the LIST the title truncates to one line; in the detail view it may wrap. (#A2) */
.pms-req-h { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 2px; }
.pms-req-h > b { flex: 1; min-width: 0; }
.pms-req-list .pms-req-h > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pms-req-h .chip { flex: none; }
/* "or add this work to an existing project" (2026-08-04): the second, quieter way to deal with a
   reviewed request. Separated from the primary actions above it so "Open project" stays the obvious
   default and this reads as the alternative, not a competing button. */
.pms-req-attach { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pms-req-attach-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.pms-req-attach-row select { min-width: 220px; max-width: 100%; }
/* A later round of intake on a project that already existed. */
.pms-round { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; background: var(--card); }
.pms-round > summary { cursor: pointer; font-size: 13px; }
.pms-round-head { font-size: 11px; font-weight: 600; color: var(--muted); opacity: .8; padding: 10px 2px 4px; }
.tk-files a { display: inline-block; margin-right: 8px; }
/* Ticket list filter bar (#8). */
.tk-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tk-filters .btn { padding: 6px 8px; font-size: 12.5px; }
.tk-hideclosed { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.pms-req-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.pms-req-actions .rTitle { flex: 1; min-width: 160px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); }
.pms-req-actions select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); }
.pms-form { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
/* The full New Project form carries more fields + a predefined-task list, so give it more room. */
.pms-form.pms-newproj { max-width: 720px; }
.np-task-row { margin: 0; }
.pms-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; }
.pms-form input, .pms-form select, .pms-form textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13px; }
.pms-form .row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
/* Checkbox label: keep the box beside its text instead of stacking (overrides the column default). */
.pms-form label.pms-check { flex-direction: row; align-items: center; gap: 6px; flex: 0 0 auto; }
.pms-form label.pms-check input { width: auto; }
/* An in-place task editor takes the full row width instead of the compact flex task layout. */
.pms-task-edit { display: block; }
.pms-task-edit .pms-form { max-width: none; width: 100%; }
.pms-stat { font-size: 15px; margin-bottom: 8px; }

/* --- Assets pane (SharePoint _Library browser) --- */
.as-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-bottom: 6px; }
.as-crumbs .btn { padding: 3px 8px; }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.as-folder { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.as-folder:hover { border-color: var(--accent, var(--good)); }
.as-fname { font-weight: 600; word-break: break-word; }
.as-folder .btn { align-self: flex-start; padding: 3px 8px; }

/* ---- Marketing Wizard intake form (non-marketing staff) ---- */
.wiz { max-width: 720px; }
.wiz-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 14px; margin: 4px 0 6px; }
.wiz-check, .wiz-radio { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink); cursor: pointer; }
.wiz-check input, .wiz-radio input { width: auto; }
.wiz-radio { margin-right: 18px; }
.wiz-svc { border-left: 2px solid var(--red); padding-left: 12px; margin: 8px 0; }
.wiz-hint { color: var(--muted); font-size: 11.5px; }
.wsvc-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin: 8px 0; }
.wsvc-lbl { font-size: 12px; color: var(--muted); }
.wiz-svc .wiz-checks { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.wiz-svc .wiz-check { align-items: flex-start; }
.wiz-uploads { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.wiz-file { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.wiz-file input[type=file] { font-size: 13px; color: var(--ink); }
.wiz-upload-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.wiz-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--ink); }
.wiz-chip-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.wiz-chip-x:hover { color: var(--red, #bb1d2c); }
/* Stepped intake (deck slide 21): the form asks one step at a time. Only classes toggle; see wizStepsInit. */
.wiz-progress { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wiz-step { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.wiz-step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.wiz-step.is-locked .wiz-step-head { color: var(--muted); cursor: default; opacity: .7; }
.wiz-step-state { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.wiz-step-desc { display: none; padding: 0 14px 6px; font-size: 12.5px; color: var(--muted); }
.wiz-step-body { display: none; flex-direction: column; gap: 10px; padding: 4px 14px 14px; }
.wiz-step.is-open .wiz-step-desc { display: block; }
.wiz-step.is-open .wiz-step-body { display: flex; }
.wiz-step-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.wiz-summary { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 12.5px; }
.wiz-sum-lead { font-weight: 600; margin-bottom: 2px; }
.wiz-sum-row { display: flex; gap: 8px; }
.wiz-sum-k { color: var(--muted); flex: 0 0 90px; }
.wiz-sum-v { color: var(--ink); }
.wiz-sum-v.is-empty { color: var(--muted); font-style: italic; }
a.pms-dl { color: var(--red, #bb1d2c); text-decoration: none; font-weight: 600; }
a.pms-dl:hover { text-decoration: underline; }

/* --- Admin console (RBAC Phase 3) --- */
.ad-addrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ad-addrow input, .ad-addrow select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-family: inherit; font-size: 13px; }
.ad-addrow input[type=email] { min-width: 260px; }
.btn.small { padding: 4px 8px; font-size: 11.5px; }
.btn.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.ad-tablewrap { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ad-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-table td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ad-table select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); font-family: inherit; font-size: 12.5px; }
.ad-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-detail code { font-size: 11.5px; color: var(--muted); word-break: break-word; }
.ad-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.ad-field { display: flex; flex-direction: column; gap: 6px; }
.ad-field > label { font-size: 12px; color: var(--muted); font-weight: 600; }
.ad-field select, .ad-form input:not([type=checkbox]) { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); font-family: inherit; font-size: 13px; }
.ad-subhead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; }
.ad-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.ad-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink); }
.ad-chk input { margin: 0; }
.ad-role-panel h3 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }

/* --- Admin: one person's activity profile (last seen, logins, usage) ------------------------ */
/* Uses the existing panel/pms-table furniture; only the stat row and the day bars are new. */
.statrow { display: flex; gap: 10px; flex-wrap: wrap; }
.statcard { flex: 1 1 150px; min-width: 150px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2, transparent); }
.statbig { font-size: 20px; font-weight: 650; margin: 2px 0; }
/* A bare bar chart. Deliberately not a charting library: the question is "is this account used at all",
   which 30 bars answer at a glance, and the exact numbers live in each bar's title. */
.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 64px; padding-top: 4px; }
.spark-bar { flex: 1 1 0; min-width: 3px; background: var(--accent, #b91c1c); border-radius: 2px 2px 0 0; opacity: .85; }
.spark-bar:hover { opacity: 1; }

/* Live M365 people picker (Admin > Users, and the recipient rows on Admin > Reports).
   Anchored to the input's wrapper, which is why .ad-addrow is position:relative. */
.ad-addrow { position: relative; }
.people-pick {
  position: absolute; z-index: 40; top: 100%; left: 0; margin-top: 4px;
  min-width: 320px; max-width: 520px; max-height: 280px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.people-pick-row { padding: 7px 10px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.people-pick-row:hover, .people-pick-row.on { background: var(--field); }
.people-pick-row .pp-name { font-weight: 600; font-size: 13px; }
.people-pick-row .pp-mail { color: var(--muted); font-size: 12px; }
.people-pick-row .pp-title { color: var(--muted); font-size: 11px; width: 100%; }

/* Release history: one collapsible entry per release (owner request 2026-08-03). 103 entries and 150KB as a
   single document meant scrolling past every previous release to reach the current one. <details> rather than
   scripted toggling, so keyboard and screen-reader behaviour comes for free. */
.rel__bar { display: flex; align-items: center; gap: 12px; justify-content: space-between;
  margin: 18px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line, #e5e5e5); }
details.rel { border-bottom: 1px solid var(--line, #e5e5e5); }
details.rel > summary.rel__sum { cursor: pointer; padding: 11px 4px 11px 22px; position: relative;
  font-weight: 600; list-style: none; }
details.rel > summary.rel__sum::-webkit-details-marker { display: none; }
/* The disclosure triangle, drawn rather than inherited so it rotates predictably in both themes. */
details.rel > summary.rel__sum::before { content: "›"; position: absolute; left: 6px; top: 10px;
  font-size: 15px; line-height: 1.2; opacity: .55; transition: transform .12s ease; display: inline-block; }
details.rel[open] > summary.rel__sum::before { transform: rotate(90deg); }
details.rel > summary.rel__sum:hover { background: var(--hover, rgba(127,127,127,.07)); }
details.rel > summary.rel__sum:focus-visible { outline: 2px solid var(--accent, #b3161d); outline-offset: -2px; }
.rel__now { margin-left: 8px; vertical-align: 1px; }
.rel__body { padding: 2px 4px 18px 22px; }
/* An entry's own h2 is redundant: the summary already carries it. */
.rel__body > h2:first-child { display: none; }
/* The ritual block reads as chrome, not as a release, so it is quieter than the version entries. */
details.rel--meta > summary.rel__sum { font-weight: 500; opacity: .75; font-size: .93em; }

/* --- Approval cards: what am I actually approving (2026-09-02) --------------------------------- */
.actx { margin: 6px 0 4px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; line-height: 1.5; }
.actx q { font-style: italic; }
.pvquote { margin: 6px 0 0; padding: 4px 10px; border-left: 3px solid var(--line); color: var(--muted); font-style: italic; }
.prow.prow-block { display: block; }
.prow.prow-block > .pk { display: block; margin-bottom: 2px; }
.prows.nested { margin-left: 12px; border-left: 2px solid var(--line); padding-left: 8px; }
.pvlong > summary { cursor: pointer; }
.pvtext { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 4px; max-height: 360px; overflow: auto; }
.pvdiff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
@media (max-width: 900px) { .pvdiff { grid-template-columns: 1fr; } }
.pvside.old .pvtext { border-left: 3px solid var(--warn); }
.pvside.new .pvtext, .pvedit { border-left: 3px solid var(--good); }
.pvedit { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; line-height: 1.5; padding: 8px 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: inherit; resize: vertical; }
.btn.small { font-size: 12px; padding: 4px 10px; }

/* ---------------- Projects vNext (v0.110.0): tickets, portfolios, inline editing ---------------- */
/* Toast kinds: the default is the error red; "ok" confirms an inline save, "info" is neutral. */
.toast.ok { background: var(--good); }
.toast.info { background: var(--ink); color: var(--bg); }
/* A chip with no tone: still carries a word. */
.chip.neutral { background: var(--panel, var(--bg)); color: var(--muted); border: 1px solid var(--line); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.bad { color: var(--bad); }
/* Row links: the row text is a real anchor (middle-click / right-click open a tab) styled as text. */
a.pms-rowlink { color: inherit; text-decoration: none; }
a.pms-rowlink:hover { color: var(--red); text-decoration: underline; }
.pms-table.pms-projects th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.pms-table.pms-projects th[data-sort]:hover, .pms-table.pms-projects th.sorted { color: var(--ink); }
.pms-table-wrap { overflow-x: auto; min-width: 0; }
.pms-table .pms-inline, .pms-detail-grid .pms-inline { padding: 4px 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); font-size: 12.5px; max-width: 170px; }
.pms-table .pms-inline:hover, .pms-detail-grid .pms-inline:hover, .pms-table .pms-inline:focus, .pms-detail-grid .pms-inline:focus { border-color: var(--line); background: var(--field); }
.pms-table .pms-inline[type=date] { max-width: 140px; }
.pms-td-code { white-space: nowrap; }
.pms-td-name { min-width: 180px; }
.pms-count { padding: 0 2px 6px; }
.pms-filters input[type=search] { flex: 1; }
.pms-saveview { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin: 0 0 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--card); }
.pms-saveview input[type=text], .pms-saveview select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13px; }
.pms-saveview input[type=text] { min-width: 240px; }
/* Progress: done/total, a thin bar, the overdue chip. */
.pms-prog { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pms-prog-txt { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 34px; }
.pms-prog-bar { display: inline-block; width: 64px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pms-prog-bar i { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.pms-card .pms-prog { margin-top: 6px; }
/* Assignee initials. */
.pms-avatars { display: inline-flex; gap: 3px; }
.pms-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navon-bg); color: var(--navon-fg); font-size: 10px; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--line); }
.pms-avatar.more { background: var(--panel, var(--bg)); color: var(--muted); }
/* The Portfolios tree in the rail. */
.pms-tree { margin: 0 0 4px; }
.pms-tree .nav.pms-tree-item { padding-left: 26px; font-size: 12.5px; }
.pms-tree-tg { margin-left: auto; padding: 0 4px; color: var(--muted); font-size: 12px; }
.pms-tree-tg:hover { color: var(--ink); }
.pms-tree-tag { margin-left: 6px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); }
/* Detail header: breadcrumb + sub-tabs. */
.pms-detail-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pms-crumbs { font-size: 13px; color: var(--muted); }
.pms-crumbs a { color: var(--muted); text-decoration: none; }
.pms-crumbs a:hover { color: var(--red); text-decoration: underline; }
.pms-crumbs b { color: var(--ink); }
.pms-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 6px; }
.pms-subtab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.pms-subtab.on { color: var(--ink); border-bottom-color: var(--red); }
.pms-subtab .badge { background: var(--line); color: var(--ink); border-radius: 10px; font-size: 10px; padding: 1px 6px; }
/* Tickets on a project, and the Tickets view rows. */
.pms-tickets { display: flex; flex-direction: column; gap: 10px; }
.pms-ticket { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel, var(--bg)); }
.pms-ticket.loose { border-style: dashed; }
.pms-ticket-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.pms-ticket-h label { display: inline-flex; align-items: center; gap: 4px; }
.pms-ticket-h select, .pms-ticket-wait input, .pms-ticket-wait select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); font-size: 12px; max-width: 180px; }
.pms-ticket-wait { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; }
.pms-ticket-wait input[type=text] { min-width: 240px; flex: 1; }
.pms-ticket-sub { margin: 4px 0 8px; }
.pms-ticket .pms-task { background: var(--card); }
.pms-req.focus, .pms-task.focus, .pms-ticket.focus { outline: 2px solid var(--red); outline-offset: 2px; }
.pms-req-actions label { display: inline-flex; align-items: center; gap: 4px; }
/* Task rows: inline controls + expander. */
.pms-task { flex-direction: column; align-items: stretch; gap: 0; }
.pms-task.done .pms-task-title { color: var(--muted); text-decoration: line-through; }
.pms-task-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pms-task-row .pms-task-main { flex: 1 1 240px; }
.pms-task-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pms-task-toggle { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; width: 22px; }
.pms-task-toggle:hover { color: var(--ink); }
.pms-task-ctl { padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); font-size: 12px; }
.pms-task-ctl[type=date] { max-width: 135px; }
.pms-task-more { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.pms-task-more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.pms-task-wait { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pms-task-wait input[type=text], .pms-task-wait select, .pms-ck-add input { padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); font-size: 12px; }
.pms-task-wait input[type=text] { min-width: 180px; flex: 1; }
.pms-checklist { display: flex; flex-direction: column; gap: 3px; }
.pms-checklist .pms-check { white-space: normal; }
.pms-ck-rm { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.pms-ck-rm:hover { color: var(--bad); }
.pms-ck-add { display: flex; gap: 6px; margin-top: 4px; }
.pms-ck-add input { flex: 1; }
.pms-task-comments { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.pms-addcmt.small textarea { font-size: 12.5px; }
/* The team-scoped assignee picker (type-ahead). */
.pms-picker { position: relative; display: inline-block; }
.pms-picker-in { width: 150px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--ink); font-size: 12px; }
.pms-picker-in::placeholder { color: var(--muted); font-style: italic; }
.pms-picker-pop { position: absolute; z-index: 120; top: 100%; left: 0; min-width: 220px; max-height: 260px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px var(--shadow); margin-top: 3px; }
.pms-picker-grp { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 7px 10px 2px; }
.pms-picker-opt { padding: 6px 10px; font-size: 13px; cursor: pointer; }
.pms-picker-opt:hover { background: var(--bg); }
.pms-picker-opt.cur { font-weight: 600; color: var(--red); }
.pms-picker-opt.unassign { color: var(--muted); font-style: italic; }
/* Global search in the top bar. */
.pms-search { position: relative; display: inline-block; }
.pms-search input { width: min(380px, 40vw); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13px; }
.pms-search-pop { position: absolute; z-index: 130; top: 100%; right: 0; width: min(520px, 90vw); max-height: 60vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px var(--shadow); margin-top: 6px; }
.pms-search-row { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 13px; color: var(--ink); text-decoration: none; }
.pms-search-row span:first-of-type { flex: 1; min-width: 0; }
a.pms-search-row:hover { background: var(--bg); }
/* My Work counters. */
.pms-counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 8px; }
.pms-counter { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.pms-counter b { font-size: 24px; line-height: 1.1; }
.pms-counter span { font-size: 12px; color: var(--muted); }
.pms-counter.bad b { color: var(--bad); }
/* Tiles: portfolios and collections. */
.pms-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 8px; }
.pms-tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: inherit; text-decoration: none; }
a.pms-tile:hover { border-color: var(--red); }
.pms-tile-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; margin-bottom: 4px; }
.pms-tile-meta { margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pms-collats { display: flex; flex-direction: column; gap: 6px; }
.pms-collat { font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pms-collat > div { flex-basis: 100%; }
/* Board drag and drop. */
.pms-card[draggable=true] { cursor: grab; }
.pms-card.dragging { opacity: .5; }
.pms-col.dropover { border-color: var(--red); background: var(--navon-bg); }

/* Message timestamps in MarkOS chat (register AI-02): quiet, beside the role label. */
.msg .role time.msg-time { font-weight: 400; opacity: .6; margin-left: 6px; font-size: 11px; letter-spacing: 0; text-transform: none; }
.pms-detail-grid input.pms-inline-text { width: 100%; max-width: 320px; font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--line, #ccc); border-radius: 4px; background: transparent; color: inherit; }
/* UX-10: the three dates (Requested, Due, Event) share one cell and sit side by side. */
.pms-dates-cell { grid-column: span 2; }
.pms-dates { display: flex; gap: 18px; flex-wrap: wrap; }
.pms-dates > div { min-width: 110px; }
@media (max-width: 640px) { .pms-dates-cell { grid-column: auto; } }
/* Links on a collection tile (SharePoint folder, Figma project): the link, and the owner's paste field. */
.pms-col-links { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.pms-col-link { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.pms-col-link input.pms-inline-text { flex: 1; min-width: 140px; font: inherit; font-size: 12px; padding: 2px 6px; border: 1px solid var(--line, #ccc); border-radius: 4px; background: transparent; color: inherit; }
.pms-pref { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.pms-ticket-row.standalone .pms-standalone-tasks { margin-top: 6px; border-top: 1px dashed var(--line, #ccc); padding-top: 6px; }
.wiz-suggest { display: block; margin-top: 4px; font-size: 12.5px; }
.wiz-suggest .wiz-use { font: inherit; font-size: 12px; margin: 2px 6px 2px 0; padding: 2px 8px; border: 1px solid var(--line, #ccc); border-radius: 4px; background: transparent; color: inherit; cursor: pointer; }

/* The Marketing Officer home (My Work for someone who coordinates open tickets). Numbers are quiet:
   a zero is never painted as an alarm, and the bars are proportion, not warning. */
a.pms-oh-stat { color: inherit; text-decoration: none; cursor: pointer; }
a.pms-oh-stat:hover { border-color: var(--muted); }
.pms-oh-empty { padding: 4px 10px 10px; }
.pms-oh-act { text-align: right; white-space: nowrap; }
.pms-oh-group { margin-bottom: 4px; }
.pms-oh-wo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; padding: 4px 10px 8px; }
.pms-oh-wo-group { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pms-oh-wo-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pms-oh-bar { height: 6px; background: var(--line); border-radius: 3px; margin: 6px 0 8px; overflow: hidden; }
.pms-oh-bar i { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.pms-oh-wo-list { list-style: none; margin: 0; padding: 0; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.pms-oh-fu { list-style: none; margin: 0; padding: 4px 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.pms-oh-fu li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; }

/* The unit head's team view (Home, under the officer home or the task buckets). The six weekly cells per
   person are counts of open tasks due that week, not hours: we hold no estimates and no capacity. Only a
   non-zero overdue or blocked is coloured. */
.pms-tv { margin-top: 14px; }
.pms-tv-scroll { overflow-x: auto; }
.pms-tv .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pms-tv-total td { border-top: 2px solid var(--line); font-weight: 600; }
.pms-tv-weeks { display: inline-grid; grid-template-columns: repeat(6, 26px); gap: 3px; vertical-align: middle; }
.pms-tv-wk { position: relative; display: block; height: 14px; background: var(--line); border-radius: 3px; overflow: hidden; }
.pms-tv-wk i { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.pms-tv-wk b { position: absolute; inset: 0; font-size: 10px; line-height: 14px; text-align: center; font-weight: 600; color: var(--ink); }
.pms-tv-legend { font-size: 11px; color: var(--muted); padding: 4px 10px 8px; }
.pms-tv-unassigned-table select { max-width: 200px; }
