/* =============================================================
   ChatUWM Prototype — Stylesheet
   =============================================================
   TABLE OF CONTENTS
   -------------------------------------------------------------
   1.  FONT SETUP
   2.  COLOR PALETTE  ←  edit colors here (dark + light themes)
   3.  ADDITIONAL THEME VARIABLES (carousel/sections)
   4.  GLOBAL RESETS & BODY
   5.  USER MENU
   6.  HOME LAYOUT (left nav, collapse)
   7.  HOME SIDEBAR (logo, new chat, items, bottom area)
   8.  HEADER
   9.  SIDEBAR (history / bookmarks panel)
   10. HISTORY / BOOKMARKS LIST
   11. HERO + PROMPT AREA + SECTION WRAPPERS
   12. CAROUSELS + ACTION CARDS
   13. FOOTER
   14. TOAST
   15. AGENT STORE PAGE
   16. FEATURED CAROUSEL + BUILDER
   17. AI RESPONSE / MARKDOWN / PARAGRAPH HOVER
   18. ANIMATIONS
   19. DOC CHAT PAGE
   20. FOLDER VIEW
   =============================================================

   COLOR EDITING NOTES (for devs)
   -------------------------------------------------------------
   All colors are defined as CSS custom properties in section 2.
   To change the color palette, edit only the variables below —
   every component references them, so a single change updates
   the entire UI.

     --bg-page         page background
     --bg-surface      headers, sidebars, panels
     --bg-card         cards, inputs
     --bg-elevated     hover backgrounds, code blocks
     --border          standard border
     --border-light    subtle dividers
     --text-primary    main text
     --text-secondary  secondary text
     --text-muted      labels, hints
     --accent          PRIMARY brand color (buttons, highlights)
     --accent-dim      ~10% accent tint (hover backgrounds)
     --accent-hover    ~16% accent tint (stronger hover)
     --accent-text     accent-colored text
     --accent-dark     darker accent (button hover)
     --green-glow      very subtle accent glow

   The dark theme is the default. The light theme overrides
   the same variables under [data-theme="light"].
   ============================================================= */

/* ── 1. FONT SETUP ─────────────────────────────────────────── */
@font-face {
  font-family: "SF Pro";
  src: local(".AppleSystemUIFont"), local("SF Pro Display"), local("SF Pro Text"), local(".SFNSDisplay"), local(".SFNSText");
  font-weight: 100 900;
}

/* Phase 3 (workspace) typography — Public Sans across the entire
   prototype. Inherits everywhere since this rule lands on the root
   element and most components use `font-family: inherit`. */
html[data-phase="workspace"],
html[data-phase="workspace"] body,
html[data-phase="workspace"] button,
html[data-phase="workspace"] input,
html[data-phase="workspace"] textarea,
html[data-phase="workspace"] select {
  font-family: "Public Sans", "SF Pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ── 2. COLOR PALETTE ──────────────────────────────────────── */
/* Dark mode – cool gray surfaces + green accents */
:root, [data-theme="dark"] {
  /* Neutral cool-gray surfaces so the green accents read as the brand color
     rather than blending with the background. Surfaces stepped further apart
     for clearer visual hierarchy in dark mode. */
  --bg-page: #0e0f11;                        /* darker page so cards stand off it */
  --bg-surface: #17191c;                     /* sidebars/panels */
  --bg-card: #23262b;                        /* cards now noticeably lighter than surface */
  --bg-elevated: #2e3137;                    /* hovers + nested cards */
  --border: #3d404a;                         /* visible separator at 1px */
  --border-light: #2a2d33;                   /* subtle dividers */
  --text-primary: #f3f4f6;                   /* near-white headings */
  --text-secondary: #c4c8d0;                 /* body text — bumped for AA on bg-card */
  --text-muted: #9aa0aa;                     /* labels — passes AA (5.4:1) on bg-card */
  --accent: #2dbab2;                         /* brighter teal — readable as text on dark cards */
  --accent-dim: rgba(45, 186, 178, 0.14);    /* tint bg matches accent hue */
  --accent-hover: #5ccfc8;
  --accent-text: #5ccfc8;                    /* dedicated text-on-dark token (8.5:1 on bg-card) */
  --accent-dark: #1e8d87;                    /* pressed/CTA hover */
  --green-glow: rgba(45, 186, 178, 0.06);
}
/* Light mode – neutral complement to dark theme */
[data-theme="light"] {
  --bg-page: #ffffff;
  --bg-surface: #fafafa;
  --bg-card: #ffffff;
  --bg-elevated: #ececee;
  --border: #d1d1d6;
  --border-light: #e5e5ea;
  --text-primary: #1f1f23;
  --text-secondary: #3D3D3D;
  --text-muted: #6b7280;                     /* bumped from #a3a3a3 — now passes AA (4.8:1) on white */
  --accent: #00706D;
  --accent-dim: rgba(0, 112, 109, 0.07);     /* teal hue matching --accent */
  --accent-hover: #dbf0ef;
  --accent-text: #279b96;
  --accent-dark: #00706D;
  --green-glow: rgba(0, 112, 109, 0.04);     /* same */
}

/* ── 3. ADDITIONAL THEME VARIABLES (carousel/sections) ─────── */
/* The carousel surface now uses the same elevated panel color as the rest
   of the dashboard (Pipeline, Pick Up Where You Left Off, etc.) so the
   Underwriting Agents + Agent Marketplace containers feel like part of
   the same family rather than recessed cutouts. */
:root, [data-theme="dark"] {
  --carousel-bg: #232325; --card-face: #2c2c2e; --section-header-bg: #232325;
  --section-border: #38383a; --section-shadow: 0 2px 18px rgba(0,0,0,0.45);
  --card-shadow: 0 1px 4px rgba(0,0,0,0.4); --card-border-color: #3d404a;
}
[data-theme="light"] {
  --carousel-bg: #ffffff; --card-face: #ffffff; --section-header-bg: #ffffff;
  --section-border: #d1d1d6; --section-shadow: 0 2px 16px rgba(0,0,0,0.06);
  --card-shadow: 0 1px 6px rgba(0,0,0,0.06); --card-border-color: #55BEBC;
}

/* Small muted disclaimer below the main prompt box — shown in both
   Hybrid and Unified views, lives inside .prompt-area. */
.prompt-disclaimer {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Home "Unified" view ───────────────────────────────────
   Hides the Work and Agent carousels + footer, and vertically centers
   the hero + prompt area inside the shell. Toggled via the logo-hover
   menu in the header.

   IMPORTANT: the display mode is set by JS via inline style (block in
   Hybrid, flex in Unified, none when off-home). We DO NOT use
   `display: ... !important` here — that would override the inline
   `display:none` on the initial render (before React has chosen a page)
   and cause the home-shell to flash over the intro screen.

   #home-content-center stays as a plain block wrapper so the existing
   `.prompt-area { max-width: 720px; margin: 0 auto }` still sizes the
   prompt box identically to Hybrid. Vertical centering in Unified comes
   from auto top/bottom margins, which consume free flex-main-axis space. */
#home-shell.home-unified {
  flex-direction: column;
  min-height: 100vh;
}
#home-shell.home-unified #home-content-center {
  margin-top: auto;
  margin-bottom: auto;
  width: 100%;
}
#home-shell.home-unified #work-section,
#home-shell.home-unified #agent-section,
#home-shell.home-unified .footer {
  display: none;
}

/* Prompt-bar focus overlay — dims the page behind the main input.
   Dark mode uses a dark scrim; light mode uses a frosted white-ish scrim
   so the effect reads as lifting the input rather than dimming everything. */
/* Invisible click-outside catcher only — no dim/blur scrim on focus. */
.uw-overlay { background: transparent; }
[data-theme="light"] .uw-overlay { background: transparent; }

/* ── 4. GLOBAL RESETS & BODY ───────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "SF Pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-page);
  min-height: 100vh;
  color: var(--text-primary);
}

/* ── 5. USER MENU ──────────────────────────────────────────── */
.user-menu-wrap { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 4px 8px; border-radius: 8px; border: none; background: none;
  font-family: inherit; transition: background 0.15s;
}
.user-menu-trigger:hover { background: var(--accent-dim); }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 220px; padding: 8px 0;
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.user-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.user-menu-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px;
}
.user-menu-header .um-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.user-menu-header .um-email { font-size: 11px; color: var(--text-muted); }
.user-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; font-size: 13px; color: var(--text-secondary);
  cursor: pointer; transition: background 0.1s; border: none; background: none;
  width: 100%; font-family: inherit; text-align: left;
}
.user-menu-item:hover { background: var(--accent-dim); color: var(--text-primary); }
.theme-toggle {
  display: flex; align-items: center; width: 40px; height: 22px;
  background: #00706D; border-radius: 11px; padding: 2px;
  cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.theme-toggle.on { background: black; }
.theme-toggle .toggle-knob {
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.theme-toggle.on .toggle-knob { transform: translateX(18px); }

/* ── 6. HOME LAYOUT (left nav, collapse) ───────────────────── */
.home-layout {
  display: flex;
  min-height: 100vh;
}
.home-left-nav, #home-left-nav {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.16,1,0.3,1);
}
.home-left-nav.collapsed, #home-left-nav.collapsed {
  width: 60px;
}
.home-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}
/* Collapse toggle */
.home-nav-collapse-btn {
  position: absolute;
  top: 24px;
  right: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  z-index: 10;
  transition: all 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.home-nav-collapse-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}
/* Collapsed state overrides */
.collapsed .home-nav-logo { padding: 12px 10px 8px; justify-content: center; }
.collapsed .home-nav-logo img { width: 28px !important; height: 28px !important; }
.collapsed .home-nav-newchat { margin: 0 8px 12px; padding: 10px 0; gap: 0; border-radius: 8px; }
.collapsed .home-nav-newchat span.nav-btn-label { display: none; }
.collapsed .home-nav-section-label { font-size: 0; padding: 10px 0 4px; text-align: center; }
.collapsed .home-nav-section-label::after {
  content: ""; display: block; width: 20px; height: 1px;
  background: var(--border); margin: 0 auto;
}
.collapsed .home-nav-item { padding: 8px 0; justify-content: center; }
.collapsed .home-nav-item .nav-label { display: none; }
.collapsed .home-nav-item .nav-count { display: none; }
.collapsed .home-nav-item .nav-icon { width: auto; font-size: 17px; }
.collapsed .home-nav-show-all { display: none; }
.collapsed .home-nav-empty { display: none; }
.collapsed .home-nav-newfolder { margin: 2px 8px 0; padding: 6px 0; justify-content: center; overflow: hidden; }
.collapsed .home-nav-newfolder span { display: none; }
.collapsed .home-nav-newfolder i { margin: 0; }
.collapsed .home-nav-bottom { padding: 8px 6px 12px; }
.collapsed .home-nav-bottom .nav-admin-btn { padding: 8px 0; justify-content: center; }
.collapsed .home-nav-bottom .nav-admin-btn span:nth-child(2) { display: none; }
.collapsed .home-nav-bottom .nav-admin-badge { margin-left: 0; position: absolute; top: 2px; right: 4px; min-width: 14px; height: 14px; font-size: 8px; }
.collapsed .home-nav-bottom .nav-user-row { padding: 8px 0; justify-content: center; }
.collapsed .home-nav-bottom .nav-user-name { display: none; }
.collapsed .home-nav-bottom .nav-theme-btn { display: none; }

/* ── 7. HOME SIDEBAR (logo, new chat, items, bottom area) ──── */
.home-nav-logo {
  padding: 0;
  margin: 0 16px;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  line-height: 0;
}
.home-nav-logo img {
  display: block;
  height: auto !important;
  max-width: none;
  width: 860px;
  margin-left: -42px;
  margin-top: -18px;
  margin-bottom: -22px;
}
.home-nav-newchat {
  margin: 0 16px 16px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--bg-page);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
}
.home-nav-newchat:hover { background: var(--accent-dark); }
.home-nav-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 20px 6px;
  flex-shrink: 0;
}
.home-nav-list {
  padding: 0 8px;
  overflow-y: auto;
  flex-shrink: 0;
}
.home-nav-list.scrollable {
  overflow-y: auto;
  flex-shrink: 1;
  min-height: 0;
}
.home-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.3;
}
.home-nav-item:hover {
  background: var(--accent-dim);
  color: var(--text-primary);
}
.home-nav-item .nav-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.home-nav-item .nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-nav-item .nav-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.home-nav-show-all {
  padding: 4px 20px 8px;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 600;
  text-align: left;
  flex-shrink: 0;
}
.home-nav-show-all:hover { text-decoration: underline; }
.home-nav-empty {
  padding: 8px 20px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  flex-shrink: 0;
}
.home-nav-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 16px;
  flex-shrink: 0;
}
.home-nav-bottom {
  margin-top: auto;
  padding: 12px 12px 16px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home-nav-bottom .nav-admin-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 100%;
  text-align: left;
  transition: background 0.1s;
  position: relative;
}
.home-nav-bottom .nav-admin-btn:hover {
  background: var(--accent-dim);
  color: var(--text-primary);
}
.home-nav-bottom .nav-admin-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #CA1619;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 0 5px;
  line-height: 1;
  margin-left: auto;
}
.home-nav-bottom .nav-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
}
.home-nav-bottom .nav-user-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-nav-bottom .nav-theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.1s;
  flex-shrink: 0;
  line-height: 1;
}
.home-nav-bottom .nav-theme-btn:hover {
  background: var(--accent-dim);
}
.home-nav-newfolder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 2px 8px 0;
  border-radius: 8px;
  cursor: pointer;
  border: 1px dashed var(--border);
  background: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}
.home-nav-newfolder:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── 8. HEADER ─────────────────────────────────────────────── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
}
.header-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--text-primary); }
.header-logo .logo-icon {
  width: 34px; height: 34px; background: var(--accent-dim); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 18px;
}
.header-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-dim); border-radius: 20px; padding: 5px 14px;
}
.header-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.header-nav-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.header-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.header-nav-btn.active { background: var(--accent); color: var(--bg-page); border-color: var(--accent); }

/* Homepage top-nav buttons: History / Bookmarks / Folders / Agent Admin / Share / Archive — green like other green buttons */
#history-btn, #bookmarks-btn, #folders-btn, #agent-admin-btn, #folder-share-btn, #folder-archive-btn {
  background: var(--accent-dim);
  border-color: rgba(52,211,153,0.2);
  color: var(--accent);
}
#history-btn:hover, #bookmarks-btn:hover, #folders-btn:hover, #agent-admin-btn:hover, #folder-share-btn:hover, #folder-archive-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent);
  color: var(--accent);
}
#history-btn.active, #bookmarks-btn.active, #folders-btn.active {
  background: var(--accent); color: var(--bg-page); border-color: var(--accent);
}

/* ── 9. SIDEBAR (history / bookmarks panel) ────────────────── */
.sidebar-overlay {
  position: fixed; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 80;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }
.sidebar {
  position: fixed; left: 0; bottom: 0; width: 380px; max-width: 90vw;
  background: var(--bg-surface); z-index: 90; box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.sidebar.open { transform: translateX(0); }
.sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-header h2 { font-size: 17px; font-weight: 800; color: var(--text-primary); flex: 1; }
.sidebar-close {
  background: none; border: none; font-size: 20px; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.sidebar-close:hover { color: var(--text-primary); }
.sidebar-tabs {
  display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-tab {
  flex: 1; padding: 10px 0; font-size: 13px; font-weight: 600;
  text-align: center; cursor: pointer; border: none; background: none;
  color: var(--text-muted); font-family: inherit; border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.sidebar-tab:hover { color: var(--text-secondary); }
.sidebar-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.sidebar-search-wrap { padding: 12px 16px; flex-shrink: 0; }
.sidebar-search {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; outline: none; font-family: inherit;
  background: var(--bg-card); color: var(--text-primary);
  transition: border-color 0.15s;
}
.sidebar-search:focus { border-color: var(--accent); }
.sidebar-list { flex: 1; overflow-y: auto; padding: 0 8px 20px; }

/* ── 10. HISTORY / BOOKMARKS LIST ──────────────────────────── */
.hist-date-label {
  font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; padding: 8px 0 10px; border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px; margin-top: 20px;
}
.hist-date-label:first-child { margin-top: 0; }
.hist-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 8px;
  border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background 0.1s;
  border-radius: 8px;
}
.hist-item:hover { background: var(--bg-elevated); }
.hist-icon {
  width: 36px; height: 36px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.hist-content { flex: 1; min-width: 0; }
.hist-content h4 {
  font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hist-content p { font-size: 12px; color: var(--text-muted); }
.hist-actions { display: flex; gap: 4px; flex-shrink: 0; }
.hist-action-btn {
  background: none; border: none; cursor: pointer; font-size: 16px;
  color: var(--text-muted); padding: 4px; border-radius: 4px; transition: color 0.15s;
}
.hist-action-btn:hover { color: var(--text-secondary); }
.hist-action-btn.bookmarked { color: #f59e0b; }
.hist-action-btn.delete:hover { color: #f87171; }
.hist-empty {
  text-align: center; padding: 48px 20px; color: var(--text-muted); font-size: 14px;
}

/* ── 11. HERO + PROMPT AREA + SECTION WRAPPERS ─────────────── */
.hero { text-align: center; padding: 64px 20px 32px; }
.hero h1 { font-size: 30px; font-weight: 800; color: var(--text-primary); margin-bottom: 10px; }
.hero p { font-size: 16px; color: var(--text-secondary); line-height: 1.6; max-width: 540px; margin: 0 auto; }

.prompt-area { max-width: 720px; margin: 0 auto 40px; padding: 0 20px; }

.section { max-width: 840px; margin: 0 auto 32px; padding: 0 20px; }
.section-header {
  background: var(--section-header-bg); color: var(--text-primary); border-radius: 14px 14px 0 0;
  padding: 16px 24px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--section-border); border-bottom: 1px solid var(--section-border);
}
.section-header .sec-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.section-header .sec-icon { font-size: 18px; }
.section-header h2 { font-size: 16px; font-weight: 700; }
.section-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.see-all-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-dim); border: 1px solid rgba(52,211,153,0.2);
  color: var(--accent); font-size: 12px; font-weight: 600; font-family: inherit;
  padding: 5px 14px; border-radius: 6px; cursor: pointer;
  transition: background 0.15s; white-space: nowrap; flex-shrink: 0;
}
.see-all-btn:hover { background: var(--accent-hover); }
.section-body {
  background: var(--carousel-bg); border: 1px solid var(--section-border); border-top: none;
  border-radius: 0 0 14px 14px; padding: 24px 0 24px 20px; overflow: hidden; position: relative;
}
/* Trailing fade — sits on top of the carousel's right edge, fading the
   last visible card into the section's own background. Hints at horizontal
   overflow without competing with the cards visually. */
.section-body::after {
  content: "";
  position: absolute;
  top: 1px; bottom: 1px; right: 1px;
  width: 56px;
  background: linear-gradient(to right, transparent, var(--carousel-bg));
  pointer-events: none;
  border-radius: 0 0 14px 0;
}
.section { border-radius: 14px; }

/* ── 12. CAROUSELS + ACTION CARDS ──────────────────────────── */
.carousel {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-top: 4px; padding-bottom: 12px; padding-right: 20px; -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel { scrollbar-width: none; }

.action-card, .agent-card {
  display: flex; flex-direction: column;
  min-width: 264px; max-width: 264px; flex-shrink: 0; scroll-snap-align: start;
  padding: 18px; border: 1px solid var(--card-border-color); border-radius: 14px;
  background: var(--card-face); cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  text-align: left; position: relative;
  box-shadow: var(--card-shadow);
}
.action-card:hover, .agent-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(52,211,153,0.15), var(--card-shadow);
}
.action-card .card-top, .agent-card .card-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.action-card .card-icon, .agent-card .card-icon,
.featured-card .card-icon, .store-card .card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background-color: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--accent); flex-shrink: 0;
}
.action-card .card-icon i, .agent-card .card-icon i,
.featured-card .card-icon i, .store-card .card-icon i { font-size: 18px; }
.action-card h3, .agent-card h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; flex: 1; line-height: 1.3; }
.action-card p, .agent-card p { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.4; flex: 1; }
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.card-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  color: var(--accent); border: 1px solid rgba(52,211,153,0.3); border-radius: 10px; padding: 2px 9px;
  background: var(--accent-dim); letter-spacing: 0.01em;
}
.agent-card .tool-example {
  font-size: 11px; color: var(--text-muted); font-style: italic;
  background: var(--bg-card); border-radius: 4px; padding: 4px 8px; display: inline-block;
}

/* ── 13. FOOTER ────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 24px 20px; font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ── 14. TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--bg-page); padding: 10px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 600; z-index: 100;
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ── 15. AGENT STORE PAGE ──────────────────────────────────── */
.store-page { min-height: 100vh; background: var(--bg-page); }
.store-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 32px; background: var(--bg-surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.store-back {
  background: none; border: none; cursor: pointer; font-size: 20px;
  color: var(--accent); display: flex; align-items: center; padding: 4px 8px; border-radius: 6px;
}
.store-title { font-size: 20px; font-weight: 800; color: var(--text-primary); flex: 1; }
.store-search {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px;
  font-size: 13px; width: 260px; outline: none; font-family: inherit;
  background: var(--bg-card); color: var(--text-primary);
  transition: border-color 0.15s;
}
.store-search:focus { border-color: var(--accent); }
.store-body { max-width: 1060px; margin: 0 auto; padding: 28px 32px 60px; }
.store-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.store-cat-pill {
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
  transition: all 0.15s; font-family: inherit;
}
.store-cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.store-cat-pill.active { background: var(--accent); color: var(--bg-page); border-color: var(--accent); }
.store-section-title {
  font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 16px; margin-top: 8px;
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
}
.store-section-title:hover { color: var(--accent); }
.store-section-title .chevron {
  font-size: 14px; color: var(--text-muted); transition: transform 0.2s;
  margin-left: auto;
}
.store-section-title .chevron.closed { transform: rotate(-90deg); }
.store-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 36px;
}
.store-card {
  background: var(--card-face); border: 1px solid var(--card-border-color); border-radius: 14px;
  padding: 18px; cursor: pointer; transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column; gap: 10px; position: relative;
  box-shadow: var(--card-shadow);
}
.store-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(52,211,153,0.15), var(--card-shadow);
}
.store-card .sc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.store-card h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); flex: 1; line-height: 1.3; min-width: 0; }
.store-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.store-card .sc-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
}
.store-card .sc-uses { font-size: 11px; color: var(--text-muted); font-weight: 500; line-height: 1; white-space: nowrap; }
.sc-footer-badges { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; min-width: 0; overflow: hidden; }
.sc-footer-badges .card-badge { white-space: nowrap; padding: 2px 6px; }
.store-card .sc-best { font-size: 10px; color: var(--accent); background: var(--accent-dim); border-radius: 4px; padding: 4px 8px; font-weight: 600; display: inline-flex; align-items: center; line-height: 1; white-space: nowrap; }
.store-card .sc-open {
  font-size: 11px; font-weight: 700; color: var(--accent); opacity: 0;
  transition: opacity 0.15s; position: absolute; bottom: 14px; right: 14px;
}
.store-card:hover .sc-open { opacity: 1; }

/* ── 16. FEATURED CAROUSEL + BUILDER ───────────────────────── */
.featured-section { margin-bottom: 32px; }
.featured-title {
  font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.featured-carousel {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.featured-card {
  background: var(--card-face); border: 1px solid var(--card-border-color); border-radius: 14px;
  padding: 18px; cursor: pointer; position: relative;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--card-shadow);
}
.featured-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(52,211,153,0.15), var(--card-shadow);
}
.featured-card .fc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.featured-card h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); flex: 1; line-height: 1.3; min-width: 0; }
.featured-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.featured-card .fc-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
}
.featured-card .fc-uses { font-size: 11px; color: var(--text-muted); font-weight: 500; line-height: 1; white-space: nowrap; }
.featured-card .fc-best { font-size: 10px; color: var(--accent); background: var(--accent-dim); border-radius: 4px; padding: 4px 8px; font-weight: 600; display: inline-flex; align-items: center; line-height: 1; white-space: nowrap; }

.builder-toggle {
  display: none; padding: 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 28px;
}
.builder-toggle.open { display: block; }

.store-create-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; background: var(--accent); color: var(--bg-page); border: none;
  border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background 0.15s;
}
.store-create-btn:hover { background: var(--accent-dark); }
.builder-actions { margin-bottom: 32px; position: relative; overflow: hidden; }
.builder-actions-title {
  font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  position: relative; z-index: 2;
}
.builder-grid {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.builder-grid::-webkit-scrollbar { display: none; }
.builder-card {
  min-width: 160px; max-width: 160px; flex-shrink: 0;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px 16px; cursor: pointer; text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.builder-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(52,211,153,0.08); transform: translateY(-2px); }
.builder-card .bc-icon { font-size: 24px; margin-bottom: 10px; color: #1e7bd8; }
.builder-card h4 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.builder-card p { font-size: 11px; color: var(--text-secondary); line-height: 1.3; margin-bottom: 8px; }
.builder-chip {
  display: inline-block; font-size: 10px; font-weight: 700; border-radius: 4px;
  padding: 2px 8px; text-transform: uppercase; letter-spacing: 0.03em;
}
.builder-chip.draft { background: var(--bg-card); color: var(--text-muted); }
.builder-chip.in-review { background: rgba(202,138,4,0.15); color: #fbbf24; }
.builder-chip.approved { background: rgba(5,150,105,0.15); color: #00706d; }
.builder-chip.published { background: rgba(124,58,237,0.15); color: #a78bfa; }
.builder-chip.rejected { background: rgba(220,38,38,0.15); color: #f87171; }

/* Card transitions */
.action-card, .agent-card { transition: box-shadow 0.15s, border-color 0.15s, opacity 0.3s, transform 0.3s !important; }
.action-card.dimmed, .agent-card.dimmed { opacity: 0.35; transform: scale(0.97); }
.action-card.highlighted, .agent-card.highlighted { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(52,211,153,0.2); }
.match-badge {
  display: inline-block; font-size: 10px; font-weight: 700; color: var(--accent);
  background: var(--accent-dim); border-radius: 4px; padding: 1px 7px; margin-left: 6px;
}

/* ── 17. AI RESPONSE / MARKDOWN / PARAGRAPH HOVER ──────────── */
/* Thinking + streaming animation */
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
.thinking-dots { display: flex; gap: 5px; padding: 8px 0; }
.thinking-dots span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: dotPulse 1.4s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
.thinking-spinner {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loading block used in the Citations / Related Articles panel */
.skeleton-block {
  background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-card) 50%, var(--bg-elevated) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* AI response action row — Copy / thumbs-up / thumbs-down, trailing end of the title row */
.ai-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  font-size: 12px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ai-action-btn:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--accent); }
.ai-action-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.ai-action-btn.stamp-decision.active { color: #2563eb; border-color: #2563eb; background: rgba(37,99,235,0.12); }
.ai-action-btn.stamp-blocker.active  { color: #ea580c; border-color: #ea580c; background: rgba(234,88,12,0.12); }
.ai-action-btn.stamp-answer.active   { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

/* Same action-button chrome, tuned for the dark/accent user-bubble
   background (the "save as reusable question" bookmark). */
.ai-action-btn--user {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
}
.ai-action-btn--user:hover { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.5); }
.ai-action-btn--user.active { background: rgba(255,255,255,0.22); color: #fff; border-color: rgba(255,255,255,0.6); }

/* Stamped message — inline indicator at top of the bubble + colored left border */
.ai-md-content.has-stamp { border-left-width: 3px !important; }
.ai-md-content.stamp-decision { border-left-color: #2563eb !important; }
.ai-md-content.stamp-blocker  { border-left-color: #ea580c !important; }
.ai-md-content.stamp-answer   { border-left-color: var(--accent) !important; }
.ai-stamp-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 4px; margin-left: auto;
}
.ai-stamp-pill.decision { background: rgba(37,99,235,0.14); color: #60a5fa; }
.ai-stamp-pill.blocker  { background: rgba(234,88,12,0.14); color: #fb923c; }
.ai-stamp-pill.answer   { background: var(--accent-dim); color: var(--accent); }
[data-theme="light"] .ai-stamp-pill.decision { color: #2563eb; }
[data-theme="light"] .ai-stamp-pill.blocker  { color: #ea580c; }

/* Inline "Since you were last here" summary card */
.ai-summary-card {
  background: var(--accent-dim);
  border: 1px solid rgba(52,211,153,0.3);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
  animation: choiceSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.ai-summary-card .ai-summary-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.ai-summary-card .ai-summary-header i { font-size: 13px; }
.ai-summary-card h4 {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  margin: 0 0 10px;
}
.ai-summary-card ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.ai-summary-card li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
}
.ai-summary-card li .li-icon {
  flex-shrink: 0; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; border-radius: 4px; margin-top: 1px;
}
.ai-summary-card li.sum-decision .li-icon { background: rgba(37,99,235,0.14); color: #60a5fa; }
.ai-summary-card li.sum-blocker  .li-icon { background: rgba(234,88,12,0.14); color: #fb923c; }
.ai-summary-card li.sum-answer   .li-icon { background: var(--accent-dim); color: var(--accent); }
[data-theme="light"] .ai-summary-card li.sum-decision .li-icon { color: #2563eb; }
[data-theme="light"] .ai-summary-card li.sum-blocker  .li-icon { color: #ea580c; }
.ai-summary-card .ai-summary-dismiss {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 2px 6px;
  line-height: 1; font-family: inherit;
}
.ai-summary-card .ai-summary-dismiss:hover { color: var(--text-primary); }
/* Markdown-style rendering */
.ai-md-content h3, .ai-md-content h4 { margin: 12px 0 4px; color: var(--text-primary); font-size: 14px; font-weight: 700; }
.ai-md-content ul, .ai-md-content ol { margin: 4px 0; padding-left: 20px; }
.ai-md-content li { margin: 2px 0; }
.ai-md-content strong { color: var(--text-primary); font-weight: 700; }
.ai-md-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.ai-md-content code { background: var(--bg-elevated); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.ai-md-content table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12px; }
.ai-md-content th, .ai-md-content td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.ai-md-content th { background: var(--bg-elevated); font-weight: 700; color: var(--text-primary); }
/* Paragraph-level hover for sharing */
.ai-para {
  position: relative; padding: 4px 8px 4px 10px; margin: 0 -10px; border-radius: 6px;
  border-left: 2px solid transparent; transition: background 0.15s, border-color 0.15s;
}
.ai-para:hover {
  background: var(--accent-dim); border-left-color: var(--accent);
}
/* Paragraph action menu — vertical list popover that appears on hover.
   Used by chat AI paragraphs and document sections. Each row pairs a
   2D FontAwesome icon with its label so the action is recognizable
   even at a glance. */
.ai-para .para-share-btns,
.section-share-btns.para-share-btns {
  position: absolute; right: 6px; top: 6px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
  z-index: 5; min-width: 168px;
}
.ai-para:hover .para-share-btns,
.ai-para .para-share-btns:hover,
.section-share-btns.para-share-btns { opacity: 1; pointer-events: auto; }
.para-share-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  background: transparent; border: none; border-radius: 6px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-primary); text-align: left;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.para-share-btn i {
  font-size: 13px; color: var(--text-muted);
  width: 16px; text-align: center; flex-shrink: 0;
}
.para-share-btn:hover { background: var(--bg-elevated); color: var(--accent); }
.para-share-btn:hover i { color: var(--accent); }

/* Unified mode keeps the same vertical popover — same anchor, no override. */
.unified-home .ai-para { padding-right: 12px; }

/* ── 18. ANIMATIONS ────────────────────────────────────────── */
@keyframes textFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stream-line { animation: textFadeIn 0.3s ease both; }

@keyframes choiceSlideUp {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* KPI card hover chart animations */
@keyframes kpiLineDraw  { from { stroke-dashoffset: 300; } to { stroke-dashoffset: 0; } }
@keyframes kpiBarFill   { from { transform: scaleX(0); }  to { transform: scaleX(1); } }
@keyframes kpiDonutDraw { from { stroke-dashoffset: 170; } to { stroke-dashoffset: 97; } }
@keyframes kpiChartIn   { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kpiBarFillV  { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes kpiDonutExpand { from { stroke-dashoffset: 239; } to { stroke-dashoffset: 136; } }
@keyframes kpiPanelIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes kpiPanelOut  { to { opacity: 0; transform: translateY(-6px); } }
@keyframes kpiItemIn    { from { opacity: 0; } to { opacity: 1; } }
/* KPI hover overlay: the card shape fades in first, then each element fades into
   view in sequence from leading (stat column, top→bottom) to trailing (chart). */
.kpi-hp-stats > * { opacity: 0; animation: kpiItemIn 0.26s ease both; }
.kpi-hp-stats > *:nth-child(1) { animation-delay: 0.16s; }
.kpi-hp-stats > *:nth-child(2) { animation-delay: 0.21s; }
.kpi-hp-stats > *:nth-child(3) { animation-delay: 0.26s; }
.kpi-hp-stats > *:nth-child(4) { animation-delay: 0.31s; }
.kpi-hp-stats > *:nth-child(5) { animation-delay: 0.36s; }
.kpi-hp-chart { opacity: 0; animation: kpiItemIn 0.32s ease both; animation-delay: 0.42s; }

/* ── 19. DOC CHAT PAGE ─────────────────────────────────────── */
.doc-page { display: flex; flex-direction: column; height: 100vh; background: var(--bg-page); }
.doc-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 32px; background: var(--bg-surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
  position: relative;
}
.doc-upload-start {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px;
}
.doc-dropzone {
  width: 100%; max-width: 520px; border: 2px dashed var(--border);
  border-radius: 16px; padding: 60px 40px; text-align: center;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
  background: var(--bg-card);
}
.doc-dropzone:hover { border-color: var(--accent); background: var(--green-glow); }
.doc-dropzone .dz-icon { font-size: 48px; margin-bottom: 16px; }
.doc-dropzone h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.doc-dropzone p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.doc-dropzone .dz-btn {
  display: inline-block; padding: 10px 24px; background: var(--accent); color: var(--bg-page);
  border: none; border-radius: 8px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.doc-dropzone .dz-btn:hover { background: var(--accent-dark); }
.doc-dropzone .dz-hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.doc-split { flex: 1; display: flex; overflow: hidden; }
/* When entering DocChatPage via the prompt's "+ Doc" chip, the columns
   flip — chat takes the left, document viewer takes the right. The
   resize handler inverts its math when this class is on so the divider
   still drags naturally toward the cursor. */
.doc-split.chat-first { flex-direction: row-reverse; }
.doc-chat-pane { display: flex; flex-direction: column; overflow: hidden; }
.doc-pdf-pane {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card); border-left: 1px solid var(--border);
}
.doc-divider {
  width: 6px; cursor: col-resize; background: var(--border);
  transition: background 0.15s; flex-shrink: 0; position: relative;
}
.doc-divider:hover, .doc-divider.dragging { background: var(--accent); }
.doc-divider::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); width: 2px; height: 32px;
  background: var(--text-muted); border-radius: 1px; opacity: 0.5;
}
.doc-pdf-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.doc-pdf-body {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.doc-pdf-page {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 8px; padding: 32px 28px; font-size: 12px;
  color: var(--text-secondary); line-height: 1.8;
}
.doc-pdf-page h4 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }

/* ── 20. FOLDER VIEW ───────────────────────────────────────── */
.folder-page { min-height: 100vh; background: var(--bg-page); }
.folder-body { max-width: 900px; margin: 0 auto; padding: 28px 32px 60px; }
.folder-header-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.folder-header-row h1 { font-size: 22px; font-weight: 800; color: var(--text-primary); flex: 1; }
.folder-header-row .folder-icon { font-size: 28px; }
.folder-section { margin-bottom: 32px; }
.folder-section-title {
  font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.04em;
}
.folder-prompt-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; display: flex; align-items: center; gap: 10px;
}
.folder-prompt-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text-primary); font-family: inherit;
}
.folder-prompt-input::placeholder { color: var(--text-muted); }
.folder-prompt-btn {
  width: 36px; height: 36px; background: var(--accent); color: var(--bg-page);
  border: none; border-radius: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.folder-docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.folder-doc-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: border-color 0.15s;
}
.folder-doc-card:hover { border-color: var(--accent); }
.folder-doc-card .fdc-icon { font-size: 28px; }
.folder-doc-card .fdc-name { font-size: 12px; font-weight: 600; color: var(--text-primary); text-align: center; }
.folder-doc-card .fdc-size { font-size: 11px; color: var(--text-muted); }
.folder-empty-area {
  border: 2px dashed var(--border); border-radius: 12px; padding: 32px;
  text-align: center; color: var(--text-muted); font-size: 13px;
  cursor: pointer; transition: border-color 0.15s;
}
.folder-empty-area:hover { border-color: var(--accent); }
.folder-saved-list { display: flex; flex-direction: column; gap: 4px; }
.folder-saved-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; transition: background 0.1s;
}
.folder-saved-item:hover { background: var(--bg-elevated); }
.folder-saved-item .fsi-icon {
  width: 32px; height: 32px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.folder-saved-item .fsi-content { flex: 1; min-width: 0; }
.folder-saved-item .fsi-content h4 {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.folder-saved-item .fsi-content p { font-size: 11px; color: var(--text-muted); }
.sidebar-folder-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; transition: background 0.1s;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.sidebar-folder-item:hover { background: var(--bg-elevated); }
.sidebar-folder-item .sf-icon { font-size: 18px; flex-shrink: 0; }
.sidebar-folder-item .sf-name { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; }
.sidebar-folder-item .sf-count { font-size: 11px; color: var(--text-muted); }
.sidebar-new-folder {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 8px; border: 1px dashed var(--border); background: none;
  width: 100%; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--accent); cursor: pointer; transition: border-color 0.15s;
  margin-top: 8px;
}
.sidebar-new-folder:hover { border-color: var(--accent); }
.sidebar-new-folder-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--text-primary); font-family: inherit;
}

/* ── DARK MODE ONLY — every button with accent text uses white for legibility ─── */
/* CSS-class buttons (using !important so they beat any equal-specificity rules from earlier in the cascade) */
[data-theme="dark"] .see-all-btn,
[data-theme="dark"] .store-create-btn,
[data-theme="dark"] #history-btn,
[data-theme="dark"] #bookmarks-btn,
[data-theme="dark"] #folders-btn,
[data-theme="dark"] #agent-admin-btn,
[data-theme="dark"] #folder-share-btn,
[data-theme="dark"] #folder-archive-btn,
[data-theme="dark"] #history-btn:hover,
[data-theme="dark"] #bookmarks-btn:hover,
[data-theme="dark"] #folders-btn:hover,
[data-theme="dark"] #agent-admin-btn:hover,
[data-theme="dark"] #folder-share-btn:hover,
[data-theme="dark"] #folder-archive-btn:hover,
[data-theme="dark"] .ai-action-btn.active,
[data-theme="dark"] .sidebar-new-folder,
[data-theme="dark"] .folder-prompt-btn,
[data-theme="dark"] .doc-dropzone .dz-btn,
[data-theme="dark"] .home-nav-newchat,
[data-theme="dark"] .header-nav-btn.active {
  color: #ffffff !important;
}
/* Inline-styled buttons that set color: var(--accent) directly. The selector
   must anchor to "color:" at the start of the inline style or after a "; "
   so it doesn't accidentally match "border-color: var(--accent)". */
[data-theme="dark"] button[style^="color: var(--accent)"],
[data-theme="dark"] button[style^="color:var(--accent)"],
[data-theme="dark"] button[style*="; color: var(--accent)"],
[data-theme="dark"] button[style*=";color: var(--accent)"],
[data-theme="dark"] button[style*="; color:var(--accent)"],
[data-theme="dark"] button[style*=";color:var(--accent)"] {
  color: #ffffff !important;
}
/* Pills (non-buttons) inside marketplace cards — lighter mint, less prominent than white */
[data-theme="dark"] .featured-card .fc-best,
[data-theme="dark"] .store-card .sc-best,
[data-theme="dark"] .card-badge {
  color: #7fe9d4;
}

/* Homepage prompt box stroke — accent green; lighter mint in dark mode */
.uw-prompt-row { border-color: #00706D !important; }
[data-theme="dark"] .uw-prompt-row { border-color: #7fe9d4 !important; }

/* Inside a folder in DARK MODE only — every accent-colored icon gets the brighter mint */
[data-theme="dark"] .folder-page-root i.fa-regular,
[data-theme="dark"] .folder-page-root i.fa-solid {
  color: #7fe9d4 !important;
}
/* Chat-type tab inside a folder in dark mode — text + icon brighter mint */
[data-theme="dark"] .folder-page-root .folder-tab-chat,
[data-theme="dark"] .folder-page-root .folder-tab-chat i {
  color: #7fe9d4 !important;
}
/* Folder empty-state prompt input — mint stroke in dark mode to match homepage */
[data-theme="dark"] .folder-empty-prompt {
  border-color: #7fe9d4 !important;
}

/* ── INTRO LANDING (presentation reveal) ─────────────────────── */
/* Each card starts with the page background so it's invisible against
   the canvas, then fades up to --bg-input (the same gray our search
   fields use) when revealed. */
/* Intro page text should never be selectable — it's a passive presentation
   surface, and accidental drag-selection while clicking through cards looks
   broken. Apply with vendor prefixes so Safari/Firefox follow suit. */
.intro-page-root,
.intro-page-root * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.intro-card {
  background: #1B232C;
  border: 1px dashed var(--card-border-color);
  border-radius: 18px;
  padding: 24px 28px 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0);
  opacity: 1;
  transform: translateY(0);
  transition: background-color 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              border-style 0s 0.2s,
              border-color 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  min-height: 180px;
}
.intro-card.revealed {
  background: var(--bg-input);
  border-style: solid;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.18);
}
/* The most-recently-revealed card — color change + scale happen together as the shape transition */
.intro-card.active {
  transform: scale(1.04);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35), 0 3px 10px rgba(0, 0, 0, 0.22);
  border-color: var(--accent);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              border-style 0s 0.1s,
              border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Card content — shape animates in first (via the .intro-card transitions above),
   then ALL content (number, title, description) fades in together after the shape completes. */
.intro-card .intro-card-num,
.intro-card h3,
.intro-card p {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.5s,
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}
.intro-card .intro-card-num {
  font-size: 13px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.1em; margin-bottom: 16px;
}
.intro-card h3 {
  font-size: 24px; font-weight: 800; color: var(--text-primary);
  margin: 0 0 14px; letter-spacing: -0.01em; line-height: 1.2;
  /* Fixed 3-line height keeps all cards the same size whether the headline
     is the long storytelling sentence or the short one-liner. */
  min-height: calc(1.2em * 3);
}

/* Short-mode cards keep the same outer size (min-height: 300px) but center
   the headline + number both axes. Description is fully removed from layout
   so the centered group sits at the true visual center of the card. */
.intro-card.is-short {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  min-height: 300px;
}
.intro-card.is-short .intro-card-num { margin-bottom: 16px; }
.intro-card.is-short h3 { margin: 0; min-height: 0; }
.intro-card.is-short p { display: none; }
.intro-card p {
  font-size: 15px; color: var(--text-secondary);
  line-height: 1.6; margin: 0;
}
.intro-card.revealed .intro-card-num,
.intro-card.revealed h3,
.intro-card.revealed p {
  opacity: 1;
  transform: translateY(0);
}
/* Matches the Unified primary CTA pattern (.ags-create-btn): accent fill,
   dark text-on-accent, 1px accent border, 8px radius, opacity hover. Padding
   and font size are scaled up since this is the hero CTA. */
.intro-enter-btn {
  padding: 14px 32px;
  background: var(--accent); color: var(--bg-page);
  border: 1px solid var(--accent); border-radius: 8px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.2s,
              opacity 0.5s ease-out 0.45s;
  /* Hidden until the 6th card's content fades in — same 0.45s delay as
     .intro-feebi so the button and mascot appear together. */
  opacity: 0;
  pointer-events: none;
}
.intro-enter-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.intro-enter-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.intro-enter-btn.pulsing {
  animation: introPulse 1.8s infinite;
  /* Wait for the entrance (0.45s delay + 0.5s fade) to finish before pulsing. */
  animation-delay: 0.95s;
}
@keyframes introPulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Feebi character — hidden below the screen until card 6 (the last card) is revealed */
.intro-feebi {
  height: 56px;
  width: auto;
  flex-shrink: 0;
  transform: translateY(320px) rotate(-8deg);
  opacity: 0;
  transform-origin: center 70%;
  pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.45s,
              opacity 0.6s ease-out 0.45s;
}
.intro-feebi.visible {
  transform: translateY(0) rotate(0deg);
  opacity: 1;
}
/* Wiggle as if tickled when the Enter button is hovered (once feebi is actually visible) */
.intro-cta-wrap:has(.intro-enter-btn:hover) .intro-feebi.visible {
  animation: feebiWiggle 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes feebiWiggle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  10%      { transform: translateY(-4px) rotate(-8deg); }
  22%      { transform: translateY(-2px) rotate(7deg); }
  35%      { transform: translateY(-5px) rotate(-6deg); }
  48%      { transform: translateY(-3px) rotate(5deg); }
  62%      { transform: translateY(-4px) rotate(-4deg); }
  76%      { transform: translateY(-1px) rotate(3deg); }
  88%      { transform: translateY(-2px) rotate(-2deg); }
}
/* ─── Unified Homepage ────────────────────────────────────────
   Tokens + utility classes used only by the Unified homepage.
   Nothing existing is overwritten; these are additive. */
:root, [data-theme="light"] {
  --bg-rail:  #f6f6f4;
  --bg-hover: #efeeea;
  --bg-input: #f2f1ed;
  --bg-rail-active: #ffffff;  /* active row bg — strong contrast vs warm off-white rail */
  --radius-lg:   22px;
  --radius-pill: 999px;
}
[data-theme="dark"] {
  /* Cool blue-gray Unified palette. --bg-hover and --bg-rail-active picked
     to share the same blue undertone as the rail (#161E26) and body
     (#1B232C) — bumped a few ticks lighter so they read clearly as hover/
     selected states on either surface. */
  --bg-rail:  #161E26;
  --bg-hover: #232E3A;
  --bg-input: #1c1c1f;
  --bg-rail-active: #2A3848;  /* noticeably lighter than --bg-rail for dark-mode active state */
}
/* Unified canvas background — overrides --bg-page for the Unified view only,
   so the global page bg used elsewhere stays unchanged. */
[data-theme="dark"] .unified-home,
[data-theme="dark"] #home-shell { background: #1B232C; }
[data-theme="dark"] #home-shell { min-height: 100vh; }
/* Hybrid carousels — lift the section-body off the page in the same way
   Unified destination cards sit above the navy bg. The cards inside step
   up another level via --bg-elevated. */
[data-theme="dark"] #home-shell .section-body { background: #23262b; }
[data-theme="dark"] #home-shell .action-card,
[data-theme="dark"] #home-shell .agent-card,
[data-theme="dark"] #home-shell .featured-card,
[data-theme="dark"] #home-shell .store-card { background: #2e3137; }

/* Root shell — overlays the viewport when Unified mode is active. */
.unified-shell {
  position: fixed; inset: 0;
  display: flex;
  background: var(--bg-page);
  z-index: 20;
}
.unified-rail {
  width: 300px; flex-shrink: 0;
  background: var(--bg-rail);
  display: flex; flex-direction: column;
  padding: 14px 12px 10px;
  gap: 2px;
  overflow: hidden;
  transition: width 0.2s ease;
  position: relative;
}
.unified-rail.collapsed { width: 64px; }

/* Rail logo — !important ensures no competing CSS can shrink it. */
.unified-rail-logo-img {
  height: 32px !important;
  width: auto !important;
  max-width: 100% !important;
  display: block !important;
  cursor: pointer;
}
.unified-canvas {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 32px;
  overflow-y: auto;
}

.unified-prompt textarea {
  border: none; background: transparent; resize: none;
  font-family: inherit; font-size: 15px; color: var(--text-primary);
  outline: none; width: 100%; min-height: 32px; line-height: 1.55;
  padding: 0;
}
.unified-prompt textarea::placeholder { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════
   Unified homepage redesign (spec'd). SCOPED to .unified-home — no Hybrid
   rules below. Uses existing tokens plus the --bg-rail/--bg-hover/--bg-input
   tokens defined earlier. Font is overridden to Roboto *only* inside this
   subtree so Hybrid's SF Pro stack is unaffected.
   ═══════════════════════════════════════════════════════════════════════ */

/* Anthropic Sans — variable font, self-hosted from /fonts. Two files: upright
   + italic, both registered under the same family so font-style: italic
   resolves to the italic file automatically. */
@font-face {
  font-family: "Anthropic Sans";
  src: url("fonts/AnthropicSans-Roman.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Anthropic Sans";
  src: url("fonts/AnthropicSans-Italic.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* Unified-mode typography is driven by --unified-font, set by the font
   switcher (currently hidden — see FontSwitcher render) and persisted to
   localStorage. Defaults to Public Sans. */
:root {
  --unified-font: "Public Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.unified-home, .unified-home * {
  font-family: var(--unified-font);
}

/* Font switcher — small floating widget in the top-right of the unified
   homepage. Toggles between Satoshi and Anthropic Sans. */
.unified-home .font-switcher {
  position: absolute; top: 16px; right: 16px; z-index: 60;
}
.unified-home .font-switcher-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.unified-home .font-switcher-btn:hover { border-color: var(--accent); color: var(--accent); }
.unified-home .font-switcher-current { font-size: 11.5px; font-weight: 600; }
.unified-home .font-switcher-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 220px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,0.35);
  padding: 4px; display: flex; flex-direction: column; gap: 2px;
}
.unified-home .font-switcher-item {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 10px; border-radius: 6px;
  background: transparent; border: none; cursor: pointer;
  text-align: left; transition: background 0.12s;
}
.unified-home .font-switcher-item:hover { background: var(--bg-hover, var(--accent-dim)); }
.unified-home .font-switcher-item.is-active { background: var(--accent-dim); }
.unified-home .font-switcher-item.is-active .font-switcher-name { color: var(--accent); }
.unified-home .font-switcher-name { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.unified-home .font-switcher-sample { font-size: 13px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }

/* …but the universal selector above also overrides Font Awesome's icon font,
   turning every <i className="fa-…"> into a placeholder box. Re-assert the
   icon font (with !important) so FA glyphs render inside the Unified subtree
   — this matters when a folder (which uses FA icons) is wrapped in a Unified
   rail. */
.unified-home i[class*="fa-"],
.unified-home .fa,
.unified-home .fa-solid,
.unified-home .fa-regular,
.unified-home .fa-brands,
.unified-home .fa-light,
.unified-home .fa-thin,
.unified-home .fa-duotone {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 6 Pro" !important;
}
.unified-home .fa-regular { font-weight: 400 !important; }
.unified-home .fa-solid   { font-weight: 900 !important; }

/* Layout root */
.unified-home {
  position: fixed; inset: 0;
  display: grid;
  /* Just wide enough to clear the ChatUWM logo (~181px rendered) with a
     little breathing room. */
  grid-template-columns: 216px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-page);
  z-index: 20;
  transition: grid-template-columns 0.2s ease;
}
/* Collapsed rail — icon-only mode */
.unified-home.rail-collapsed { grid-template-columns: 64px 1fr; }
/* Hover-expand while collapsed — pushes main, keeps layout intact */
.unified-home.rail-collapsed.rail-hov { grid-template-columns: 216px 1fr; }
/* Clip rail content when narrow so it doesn't overflow into main */
.unified-home.rail-collapsed:not(.rail-hov) .rail { overflow: hidden; }
/* Animate labels via max-width so they slide in/out smoothly */
.unified-home .rail-item-label,
.unified-home .rail-user-text,
.unified-home .rail-collapse-label {
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}
.unified-home.rail-collapsed:not(.rail-hov) .rail-item-label,
.unified-home.rail-collapsed:not(.rail-hov) .rail-user-text,
.unified-home.rail-collapsed:not(.rail-hov) .rail-collapse-label {
  max-width: 0;
  opacity: 0;
}
/* Collapse/close button at rail bottom */
.unified-home .rail-collapse-wrap { padding: 6px 10px 4px; }
.unified-home .rail-collapse-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  width: 100%; text-align: left;
  transition: background 0.1s, color 0.1s;
}
.unified-home .rail-collapse-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
/* Center the icon spine when collapsed so icons sit on the rail centerline
   instead of hugging the leading edge. The logo (rail-header) is untouched. */
.unified-home.rail-collapsed:not(.rail-hov) .rail-item,
.unified-home.rail-collapsed:not(.rail-hov) .rail-collapse-btn,
.unified-home.rail-collapsed:not(.rail-hov) .rail-user {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}
/* Hide the trailing meta (badge/count/shortcut) when collapsed so it can't
   pull the icon off-center. */
.unified-home.rail-collapsed:not(.rail-hov) .rail-item-badge,
.unified-home.rail-collapsed:not(.rail-hov) .rail-item-count,
.unified-home.rail-collapsed:not(.rail-hov) .rail-item-shortcut,
/* trailing expand chevron on Agents / Notebooks items (opacity:0 but still
   occupies width, which would pull the icon off-center) */
.unified-home.rail-collapsed:not(.rail-hov) .rail-item > i {
  display: none;
}

/* Phase 1 chrome — top nav across the top, narrow icon rail under it */
.unified-home.has-top-nav {
  grid-template-columns: 56px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "topnav topnav"
    "rail   main";
}
.unified-home.has-top-nav .hybrid-topnav { grid-area: topnav; }
.unified-home.has-top-nav .hybrid-rail   { grid-area: rail; }
.unified-home.has-top-nav .main          { grid-area: main; min-height: 0; min-width: 0; }
/* `.doc-page` uses `height: 100vh` globally; inside the Phase 1 chrome the
   main grid cell is only `100vh - 56px`, and the 100vh child blows past the
   cell and ends up positioned over the top nav. Override it to fill the
   cell instead. */
.unified-home.has-top-nav .doc-page,
.unified-home.has-top-nav .doc-page.doc-page { height: 100%; min-height: 0; flex: 1 1 auto; }

/* ── Top nav ── */
.hybrid-topnav {
  display: flex; align-items: center;
  gap: 28px;
  padding: 0 24px;
  height: 56px;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
}
.hybrid-topnav-logo {
  display: flex; align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.hybrid-topnav-logo img {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}
.hybrid-topnav-links {
  display: flex; align-items: center;
  gap: 6px;
  margin-left: 20px;
}
.hybrid-topnav-link {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  color: #1D8A77;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.hybrid-topnav-link:hover { background: rgba(29, 138, 119, 0.08); }
.hybrid-topnav-link.is-active { background: rgba(29, 138, 119, 0.08); }
.hybrid-topnav-link svg { color: #1D8A77; flex-shrink: 0; }
.hybrid-topnav-spacer { flex: 1; }
.hybrid-topnav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #F3F4F6 0%, #D5D8DD 100%);
  border: 1px solid #D5D8DD;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.12s, transform 0.12s;
}
.hybrid-topnav-avatar:hover { border-color: #1D8A77; transform: scale(1.04); }

/* ── Thin icon-only rail ── */
.hybrid-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 56px;
  padding: 14px 0 14px;
  background: #DCEEEA;
  border-right: 1px solid #C6E1DC;
  overflow: visible;
  position: relative;
}
.hybrid-rail-nav {
  display: flex; flex-direction: column;
  gap: 6px;
  width: 100%;
  align-items: center;
}
.hybrid-rail-foot {
  margin-top: auto;
  display: flex; flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: center;
}
.hybrid-rail-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #1D8A77;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
.hybrid-rail-btn:hover { background: rgba(29, 138, 119, 0.12); }
.hybrid-rail-btn.is-active { background: rgba(29, 138, 119, 0.12); }
.hybrid-rail-btn svg { flex-shrink: 0; }
/* Collapse toggle — anchored to the bottom-right corner of the rail and
   shifted so half the button sits over the body (matches the screenshot). */
.hybrid-rail-collapse {
  position: absolute;
  bottom: 16px;
  right: -12px;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: #1D8A77;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  z-index: 5;
  transition: background 0.12s, transform 0.12s;
}
.hybrid-rail-collapse:hover { background: #166A5C; }

/* Show/Hide Doc toggle on each AI message header (Phase 1 doc chat). */
.dc-msg-doc-toggle {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.dc-msg-doc-toggle:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* Prompt-builder settings cog + dropdown (Phase 1 prompt box). */
.uw-settings-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.uw-settings-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.uw-settings-btn svg { flex-shrink: 0; }
.uw-settings-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.08);
  padding: 6px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.uw-settings-menu--leading { right: auto; left: 0; }
.uw-settings-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.12s;
}
.uw-settings-item:hover { background: var(--bg-elevated); }
.uw-settings-item-label { flex: 1; min-width: 0; }
.uw-settings-item-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.uw-settings-item-dot.is-on {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 138, 119, 0.18);
}

/* ─── Rail ───────────────────────────────────────────────── */
.unified-home .rail {
  background: var(--bg-rail);
  padding: 20px 10px 14px;
  display: flex;
  flex-direction: column;
  /* overflow: visible so the Notebooks hover-popover can escape the rail.
     Long rail-nav lists scroll within their own container instead. */
  overflow: visible;
  position: relative;
}

.unified-home .rail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 18px;
}
.unified-home .rail-logo { display: flex; align-items: center; gap: 8px; cursor: pointer; position: relative; }
.unified-home .rail-logo-img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}
.unified-home .rail-collapse {
  width: 28px; height: 28px; border-radius: 6px;
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.unified-home .rail-collapse:hover { background: var(--bg-hover); color: var(--text-primary); }

.unified-home .rail-nav, .unified-home .rail-secondary {
  display: flex; flex-direction: column; gap: 2px;
}
.unified-home .rail-spacer { flex: 1; }

/* Table of contents column — sections of the currently open reference
   doc/article. Lives inside that tab's own content row (a flex sibling of
   the doc body, below the tab bar), so it needs its own explicit width now
   that it's no longer a page-level CSS grid column. */
.unified-home .notebook-toc {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-light);
  padding: 24px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.unified-home .notebook-toc-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); padding: 0 10px;
}
.unified-home .notebook-toc-list { display: flex; flex-direction: column; gap: 1px; list-style: none; margin: 0; padding: 0; }
.unified-home .notebook-toc-link {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-left: 2px solid transparent;
  padding: 7px 10px; margin-left: -1px;
  font-family: inherit; font-size: 12.5px; line-height: 1.4; color: var(--text-secondary);
  cursor: pointer; border-radius: 0 6px 6px 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.unified-home .notebook-toc-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.unified-home .notebook-toc-link.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); font-weight: 600; }

.unified-home .rail-item-wrap { position: relative; }
.unified-home .rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  width: 100%; text-align: left;
  transition: background 0.1s, color 0.1s;
}
/* Hover-revealed flyout that anchors to a rail item (e.g. Notebooks → folder list).
   Shown via the .open class set by the React component on hover. */
.unified-home .rail-item-popover {
  position: absolute;
  left: calc(100% + 8px); top: -6px;
  min-width: 280px; max-width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  padding: 6px;
  z-index: 200;
  opacity: 0; pointer-events: none; transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
  max-height: 70vh; overflow-y: auto;
}
.unified-home .rail-item-popover.open { opacity: 1; pointer-events: auto; transform: translateX(0); }
.unified-home .rail-popover-head {
  padding: 8px 10px 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.unified-home .rail-popover-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; font-family: inherit;
  color: var(--text-primary); font-size: 13px; text-align: left;
  transition: background 0.12s;
}
.unified-home .rail-popover-row:hover { background: var(--bg-hover); }
.unified-home .rail-popover-row .rail-popover-icon { color: var(--accent); flex-shrink: 0; display: flex; }
.unified-home .rail-popover-row .rail-popover-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500;
}
.unified-home .rail-popover-row .rail-popover-count { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.unified-home .rail-popover-row .rail-popover-shared {
  display: inline-flex; align-items: center;
  font-size: 12px; color: var(--text-secondary); flex-shrink: 0;
}
.unified-home .rail-popover-divider { height: 1px; background: var(--border-light); margin: 4px 6px; }
.unified-home .rail-popover-footer {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 8px 10px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; font-family: inherit;
  color: var(--accent); font-size: 12px; font-weight: 600; text-align: left;
}
.unified-home .rail-popover-footer:hover { background: var(--bg-hover); }
.unified-home .rail-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.unified-home .rail-item.active {
  background: var(--bg-rail-active);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
[data-theme="dark"] .unified-home .rail-item.active { box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.unified-home .rail-item.active .rail-item-icon { color: var(--accent); }

.unified-home .rail-item-icon {
  flex-shrink: 0; color: var(--text-muted); display: flex;
  transition: color 0.1s;
}
.unified-home .rail-item:hover .rail-item-icon { color: var(--text-primary); }

.unified-home .rail-item-label {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unified-home .rail-item-shortcut {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  letter-spacing: 0.3px;
}
.unified-home .rail-item-badge {
  min-width: 18px; height: 16px; padding: 0 5px;
  background: #e3434a; color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.unified-home .rail-item-count {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.unified-home .rail-secondary .rail-item { color: var(--text-muted); }

/* User bar */
.unified-home .rail-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px 2px; margin-top: 4px;
}
.unified-home .rail-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.unified-home .rail-user-text { flex: 1; min-width: 0; }
.unified-home .rail-user-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unified-home .rail-user-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.unified-home .rail-user-more {
  width: 26px; height: 26px; border-radius: 6px;
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.unified-home .rail-user-more:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Hybrid/Unified view switcher (small popover that appears on logo hover) */
.unified-home .view-switcher {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  display: flex; flex-direction: column; gap: 2px; min-width: 168px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 100; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.unified-home .view-switcher.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.unified-home .view-switcher-btn {
  padding: 7px 12px; border-radius: 6px; text-align: left;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}
.unified-home .view-switcher-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.unified-home .view-switcher-btn.active { background: var(--accent); color: #fff; }

/* Splash/intro logo gets the same hover-flyout phase selector.
   Reuses the unified-home tokens so the popover matches the rail. */
.intro-page-root .intro-logo-wrap { position: relative; }
.intro-page-root .view-switcher {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  display: flex; gap: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 100; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.intro-page-root .view-switcher.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.intro-page-root .view-switcher-btn {
  padding: 6px 14px; border-radius: 6px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}
.intro-page-root .view-switcher-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.intro-page-root .view-switcher-btn.active { background: var(--accent); color: #fff; }

/* ─── Main canvas ──────────────────────────────────────────── */
.unified-home .main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}
/* Top-anchored (not vertically centered) so every destination's heading
   lines up with the rail's "New chat" item regardless of how much content
   is below it — a centered block would push short pages' headings down by
   a variable amount depending on content height. padding-top: 70px matches
   the rail's own top offset (20px rail padding + ~50px logo/header row). */
.unified-home .main-inner {
  width: 100%; max-width: 880px;
  margin: 0 auto;
  padding: 70px 48px 40px;
}
/* Hybrid homepage uses the wider Unified-marketplace-style canvas so the
   work + agent carousels have room to breathe. Top-anchored (not vertically
   centered) so the greeting reads at the top of the canvas. */
.hybrid-home .main-inner.hybrid-home-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 48px 80px;
  display: flex; flex-direction: column;
  gap: 24px;
}
/* Match the spacing between the prompt and Underwriting Agents
   (24px flex gap). The default .section margin-bottom would otherwise
   stack on top of the gap and create a bigger break before Agent
   Marketplace. */
.hybrid-home .section { margin-bottom: 0; }
/* Prompt wrapper — a touch narrower than the .section carousels below
   (which use max-width: 840px) so the prompt feels like a focused input,
   not a full-width banner. Centered to match the carousels. */
.hybrid-home .hybrid-home-prompt-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
/* Destinations (Saved / Notebooks) should sit at the top and use the same
   container as Agent Marketplace + Agent Admin so all unified pages share a
   consistent body width / padding. padding-top: 70px lines the heading up
   with the rail's "New chat" item (20px rail padding + ~50px logo row). */
.unified-home .main-inner:has(.destination-head) {
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px 48px 80px;
}

/* Greeting */
.unified-home .greeting { text-align: center; margin-bottom: 26px; }
.unified-home .greeting h1 {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
  color: var(--text-primary);
  margin: 0 0 10px;
}
.unified-home .greeting p {
  font-size: 14px; line-height: 1.55; color: var(--text-secondary);
  max-width: 560px; margin: 0 auto;
}
.unified-home .greeting .name { color: var(--accent); }

/* Prompt capsule */
.unified-home .prompt {
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px 18px 10px;
  transition: background 0.15s, border-color 0.15s;
}
/* Hey-Siri-style rotating ring + halo around the homepage prompt, using the
   three colors from the ChatUWM logo (lime atom, teal "Chat", navy "UWM").
   The conic gradient is rotated via a registered @property angle that
   inherits down to both pseudo-elements: ::before is the crisp 3px ring,
   ::after is a wider blurred halo behind the capsule. When the user first
   focuses the textarea, JS adds .is-quiet which fades both layers out —
   leaving just the static teal stroke. */
@property --prompt-glow-angle {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}
.unified-home .prompt {
  animation: prompt-glow-rotate 4s linear infinite;
}
.unified-home .prompt::before {
  content: "";
  position: absolute;
  /* -1px = the capsule's own border width, so the ring's outer edge and
     corner radius coincide with the border box instead of sitting 1px
     inside it with a mismatched arc. */
  inset: -1px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--prompt-glow-angle),
    #5FB041,
    #2DBAB2,
    #1F3D7A,
    #5FB041
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity 0.6s ease-out;
}
@keyframes prompt-glow-rotate {
  to { --prompt-glow-angle: 360deg; }
}
.unified-home .prompt.is-quiet::before { opacity: 0; }
/* Row of question chips above the textarea — added when the user picks a
   suggestion from the question dropdown. Mirrors the Hybrid prompt's chip row. */
.unified-home .prompt-question-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
/* Question-suggestion dropdown (Favorites + All Questions) — anchored to the
   bottom edge of the prompt capsule. */
.unified-home .prompt-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  max-height: 320px; overflow-y: auto;
  z-index: 60;
}
.unified-home .prompt-dropdown-group {
  padding: 8px 16px 4px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}
.unified-home .prompt-dropdown-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px; color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.unified-home .prompt-dropdown-item.is-highlighted { background: var(--bg-elevated); }
/* Star toggle on every dropdown row — outline by default, filled gold when
   the question is in favorites. Stops the row's mousedown from firing so
   toggling doesn't also add the question as a chip. */
.unified-home .prompt-dropdown-fav-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px;
  padding: 4px 4px 4px 12px;
  line-height: 1;
  transition: color 0.12s, transform 0.12s;
}
.unified-home .prompt-dropdown-fav-toggle:hover { color: #fbbf24; }
.unified-home .prompt-dropdown-fav-toggle.is-on { color: #f59e0b; }
.unified-home .prompt-dropdown-fav-toggle.is-on:hover { color: #d97706; }
/* Delete action for custom prompts saved via the message bookmark — these
   only exist through `favorites`, so they get an explicit trash icon
   instead of the pin toggle (unpinning them would silently delete them). */
.unified-home .prompt-dropdown-delete-toggle { color: var(--text-muted); }
.unified-home .prompt-dropdown-delete-toggle:hover { color: #ef4444; }
.unified-home .prompt:focus-within { background: #edece8; }
[data-theme="dark"] .unified-home .prompt:focus-within { background: #28282b; }

/* Attached Loan/Agent/Doc row — sits directly above the prompt capsule
   (never inside it) and slides up from behind it, like Claude's own
   usage-limit banners above the composer. Always mounted so the open/close
   toggle animates both ways off a single class. Inset from the capsule's
   edges and fully rounded on its own — the capsule below keeps its own
   corners and border untouched, so the two read as separate, stacked
   pieces rather than one merged shape. */
.unified-home .prompt-attach-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 0;
  opacity: 0;
  transform: translateY(16px);
  overflow: hidden;
  padding: 0 18px;
  margin: 0 16px;
  border: 1px solid transparent;
  border-bottom: none;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  background: var(--bg-input);
  transition: max-height 0.32s cubic-bezier(0.22,1,0.36,1), opacity 0.24s ease,
    transform 0.32s cubic-bezier(0.22,1,0.36,1), padding 0.32s cubic-bezier(0.22,1,0.36,1),
    border-color 0.2s ease;
}
.unified-home .prompt-attach-row.is-open {
  max-height: 96px;
  opacity: 1;
  transform: translateY(0);
  padding: 12px 18px 10px;
  border-color: var(--accent);
}

.unified-home .prompt textarea {
  width: 100%; border: none; background: transparent; outline: none;
  resize: none; font-family: inherit; font-size: 14.5px;
  color: var(--text-primary); line-height: 1.5;
  padding: 0; min-height: 24px;
}
.unified-home .prompt textarea::placeholder { color: var(--text-muted); }

.unified-home .prompt-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px;
}
.unified-home .prompt-left {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; min-width: 0; flex: 1;
}

/* Inactive (unselected) attachment chip — visible pill outline + muted text
   so it reads as a clickable affordance rather than disappearing into the
   prompt area. The .has-notebook modifier (set when a loan/agent/doc is
   attached) takes over the styling once selected. */
.unified-home .prompt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit; font-size: 13px; font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.unified-home .prompt-chip:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
/* Icon-only prompt chip (recent-chats clock, attach "+") — compact, no
   resting outline/circle; hover still gives a soft rounded tint for
   affordance. */
.unified-home .prompt-chip.prompt-chip--icon {
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
}
.unified-home .prompt-chip.prompt-chip--icon:hover {
  border-color: transparent;
  background: var(--bg-elevated);
}

.unified-home .prompt-chip .plus {
  font-size: 14px; line-height: 1; color: var(--text-muted);
}
.unified-home .prompt-chip.has-notebook {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid transparent;
}
/* Hover keeps the accent-dim background (preserving the accent-on-tint
   contrast that already passes WCAG AA) and signals interactivity with a
   visible accent border instead of lightening the fill — the previous
   --accent-hover bg was too close in luminance to the text. */
.unified-home .prompt-chip.has-notebook:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.unified-home .chip-swatch {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--text-muted); flex-shrink: 0;
}

.unified-home .prompt-chip .chip-close {
  background: transparent; border: none; cursor: pointer;
  color: inherit; padding: 0 0 0 4px; font-size: 13px; line-height: 1;
}

/* Attach ("+") menu. Default opens UPWARD — the loan-chat / notebook prompts
   are pinned to the bottom of a scrolling page, where a downward menu would
   fall below the fold. The homepage prompt (.ws-prompt) sits near the top of
   the page instead, so it flips DOWN to avoid covering the greeting. */
.prompt-attach-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.32);
  z-index: 61;
  padding: 6px;
}
.ws-prompt .prompt-attach-menu {
  bottom: auto;
  top: calc(100% + 10px);
}

.prompt-attach-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.prompt-attach-menu-item:hover {
  background: var(--bg-elevated);
}

.prompt-attach-menu-item i {
  width: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.unified-home .prompt-send {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--bg-elevated); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.15s, opacity 0.15s;
}
.unified-home .prompt-send:disabled { opacity: 0.55; cursor: default; }
.unified-home .prompt-send:hover:not(:disabled) { transform: translateY(-1px); }
/* When the user has typed something (button is enabled), light it up with the
   same accent green used by "Chat with My Pipeline" so the affordance reads
   as the active submit. */
.unified-home .prompt-send:not(:disabled) {
  background: var(--accent); color: var(--bg-page);
}

.prompt-voice {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--bg-elevated); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.prompt-voice:hover { color: var(--accent); transform: translateY(-1px); }

/* Notebooks section */
.unified-home .notebooks-section { margin-top: 40px; }
.unified-home .notebooks-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.unified-home .notebooks-title {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.unified-home .notebooks-action {
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: transparent; border: none; cursor: pointer;
  color: var(--text-secondary); font-family: inherit;
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.unified-home .notebooks-action:hover { background: var(--bg-hover); color: var(--text-primary); }

.unified-home .notebooks-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px 4px;
}

.unified-home .notebook-tile {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; gap: 10px;
  padding: 14px 8px 12px; border-radius: 12px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.unified-home .notebook-tile:hover { background: var(--bg-hover); }

.unified-home .notebook-tile-icon { color: var(--text-muted); transition: color 0.15s; }
.unified-home .notebook-tile:hover .notebook-tile-icon { color: var(--text-primary); }

.unified-home .notebook-tile-name {
  font-size: 12px; font-weight: 500; line-height: 1.3;
  color: var(--text-primary); text-align: center;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; text-overflow: ellipsis;
  max-height: 2.6em; word-break: break-word;
}

.unified-home .notebook-tile.is-new .notebook-tile-name { color: var(--text-muted); transition: color 0.15s; }
.unified-home .notebook-tile.is-new:hover .notebook-tile-icon,
.unified-home .notebook-tile.is-new:hover .notebook-tile-name { color: var(--accent); }

/* "Active 2h ago" / "Archived · Funded" subtitle on each tile. */
.unified-home .notebook-tile-meta {
  font-size: 10.5px; line-height: 1.3;
  color: var(--text-muted); text-align: center;
  margin-top: -2px;
}
.unified-home .notebook-tile.is-archived .notebook-tile-icon,
.unified-home .notebook-tile.is-archived .notebook-tile-name { opacity: 0.55; }
.unified-home .notebook-tile.is-archived .notebook-tile-meta {
  color: var(--accent); font-weight: 600;
}

/* ── Notebooks list view ─────────────────────────────────────
   Sectioned list (Pinned / Active loans / Topics / Shared) — the
   scalable alternative to the tile grid. Toggle now sits at the
   trailing edge of the search bar so the header stays clean. */
.unified-home .nb-search-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}

/* ── UWM Reference Library (P3) — compact dropdown menu in the page
   header, not a sectioned grid. The list view of personal notebooks
   stays the primary focus on the page. ── */
.unified-home .nb-reflib-wrap { position: relative; }
.unified-home .nb-reflib-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.unified-home .nb-reflib-btn:hover,
.unified-home .nb-reflib-btn.is-open {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.unified-home .nb-reflib-btn i { font-size: 11px; }
.unified-home .nb-reflib-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  padding: 6px;
  z-index: 50;
}
.unified-home .nb-reflib-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.unified-home .nb-reflib-menu-title {
  font-size: 12px; font-weight: 700;
  color: var(--text-primary);
}
.unified-home .nb-reflib-menu-sub {
  font-size: 10.5px; color: var(--text-muted);
  margin-top: 2px;
}
.unified-home .nb-reflib-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.unified-home .nb-reflib-item:hover { background: var(--bg-elevated); }
.unified-home .nb-reflib-item-name { font-weight: 500; }
.unified-home .nb-reflib-item-count {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Legacy two-column / card grid styles left in place but unused now —
   the menu replaces them. Keeping the variables so any older calling
   path renders gracefully. */
.unified-home .nb-managed-section { margin-bottom: 0; }
.unified-home .nb-managed-head {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 12px;
}
.unified-home .nb-managed-title {
  display: inline-flex; align-items: center;
  font-size: 15px; font-weight: 700;
  color: var(--text-primary); letter-spacing: 0.01em;
}
.unified-home .nb-managed-sub {
  font-size: 12px; color: var(--text-muted);
}
.unified-home .nb-managed-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.unified-home .nb-managed-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.unified-home .nb-managed-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
  transform: translateY(-1px);
}
.unified-home .nb-managed-card-title {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.unified-home .nb-managed-count-inline {
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
}
.unified-home .nb-managed-card-desc {
  font-size: 12px; color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.unified-home .nb-managed-card-foot {
  font-size: 11px; color: var(--text-muted);
  margin-bottom: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.unified-home .nb-managed-maintainer { font-weight: 500; }
.unified-home .nb-managed-actions {
  display: flex; gap: 6px;
}
.unified-home .nb-managed-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px; font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.unified-home .nb-managed-action:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.unified-home .nb-managed-action.is-on {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.unified-home .nb-managed-action i { font-size: 10px; }

/* Personal column header (P3). No top border — the column split is the
   divider; this is just a column label that sits next to the library. */
.unified-home .nb-personal-head {
  margin: 0 0 12px;
}
.unified-home .nb-view-toggle {
  display: inline-flex; align-items: center; gap: 0;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 2px;
  flex-shrink: 0;
}
.unified-home .nb-view-btn {
  width: 30px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 6px;
  color: var(--text-muted); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.unified-home .nb-view-btn i { font-size: 12px; }
.unified-home .nb-view-btn:hover { color: var(--text-primary); }
.unified-home .nb-view-btn.is-active {
  background: var(--card-face); color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
/* Styled hover tooltip — replaces the slow native `title` tooltip with one
   that matches the rest of the app's surface treatment. Driven by the
   `data-tooltip` attribute so we don't need a separate React component. */
.unified-home .nb-view-btn[data-tooltip] { position: relative; }
.unified-home .nb-view-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) translateY(-2px);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
  z-index: 50;
}
.unified-home .nb-view-btn[data-tooltip]:hover::after {
  opacity: 1; transform: translateX(-50%) translateY(0);
  transition-delay: 0.25s;
}

.unified-home .nb-list { display: flex; flex-direction: column; gap: 18px; }
.unified-home .nb-list-group { display: flex; flex-direction: column; gap: 2px; }
.unified-home .nb-list-group-label {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 6px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.unified-home .nb-list-group-count {
  font-weight: 600; color: var(--text-muted);
  background: var(--bg-elevated); padding: 1px 7px;
  border-radius: 999px; letter-spacing: 0;
  font-size: 10.5px;
}

.unified-home .nb-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: transparent; cursor: pointer;
  transition: background 0.12s;
}
.unified-home .nb-list-row:hover { background: var(--bg-hover); }
.unified-home .nb-list-swatch {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.unified-home .nb-list-swatch i { font-size: 13px; }
.unified-home .nb-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.unified-home .nb-list-name {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unified-home .nb-list-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-muted);
}
.unified-home .nb-list-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 999px;
  background: var(--bg-elevated); color: var(--text-secondary);
  font-size: 10.5px; font-weight: 600;
}
.unified-home .nb-list-pill i { font-size: 9px; }
.unified-home .nb-list-outcome-funded    { color: var(--accent); background: var(--accent-dim); }
.unified-home .nb-list-outcome-withdrawn { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.unified-home .nb-list-outcome-denied    { color: #f87171; background: rgba(248, 113, 113, 0.12); }
.unified-home .nb-list-stamp {
  font-size: 11.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.unified-home .nb-list-restore {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; margin-left: 10px;
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.unified-home .nb-list-restore i { font-size: 10px; }
.unified-home .nb-list-restore:hover { border-color: var(--accent); color: var(--accent); }

/* Hover-revealed action buttons (Archive, Delete) — list row variant.
   Default treatment is muted; the danger modifier turns red on hover. */
.unified-home .nb-list-action {
  position: relative;
  width: 28px; height: 28px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--text-muted); cursor: pointer;
  opacity: 0; transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
}
.unified-home .nb-list-action + .nb-list-action { margin-left: 2px; }
.unified-home .nb-list-action:first-of-type { margin-left: 4px; }
.unified-home .nb-list-action i { font-size: 12px; }
.unified-home .nb-list-row:hover .nb-list-action { opacity: 1; }
.unified-home .nb-list-action:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-primary);
}
.unified-home .nb-list-action-danger:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}
/* Pin button stays visible (opacity 1) when the notebook is pinned so the
   broker can tell at a glance which rows have been promoted. */
.unified-home .nb-list-action.is-active {
  opacity: 1;
  color: var(--accent);
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.unified-home .notebook-tile-action.is-active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent);
  opacity: 1;
}

/* Hover-revealed action buttons — grid tile variant. */
.unified-home .notebook-tile-wrap { position: relative; }
.unified-home .notebook-tile-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.unified-home .notebook-tile-wrap:hover .notebook-tile-actions { opacity: 1; }
.unified-home .notebook-tile-action {
  position: relative;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.unified-home .notebook-tile-action i { font-size: 11px; }
.unified-home .notebook-tile-action:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
}
.unified-home .notebook-tile-action-danger:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.55);
  color: #f87171;
}

/* Tooltip for the row/tile action buttons — same pattern as the view-toggle. */
.unified-home .nb-list-action[data-tooltip],
.unified-home .notebook-tile-action[data-tooltip] { position: relative; }
.unified-home .nb-list-action[data-tooltip]::after,
.unified-home .notebook-tile-action[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
  z-index: 50;
}
.unified-home .nb-list-action[data-tooltip]:hover::after,
.unified-home .notebook-tile-action[data-tooltip]:hover::after {
  opacity: 1; transform: translateX(-50%) translateY(0);
  transition-delay: 0.25s;
}

/* Notebook create / delete modal. Same overlay pattern as the memory
   modal so popovers feel consistent across the app. */
.unified-home .nb-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: memoryModalFade 0.15s ease-out;
}
.unified-home .nb-modal {
  background: var(--bg-card);
  border: 1px solid var(--card-border-color);
  border-radius: 14px;
  width: 480px; max-width: 100%;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: memoryModalSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.unified-home .nb-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.unified-home .nb-modal-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  margin: 0; letter-spacing: -0.01em;
}
.unified-home .nb-modal-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0 4px;
  transition: color 0.15s;
}
.unified-home .nb-modal-close:hover { color: var(--text-primary); }
.unified-home .nb-modal-body { padding: 18px 22px 6px; }
.unified-home .nb-modal-label {
  display: block;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.unified-home .nb-modal-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 14px; font-family: inherit; font-size: 13.5px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-primary); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.unified-home .nb-modal-input::placeholder { color: var(--text-muted); }
.unified-home .nb-modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 186, 178, 0.15);
}
.unified-home .nb-modal-swatches {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 8px; max-width: 100%;
}
.unified-home .nb-modal-swatch {
  width: 100%; aspect-ratio: 1; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.95); font-size: 11px;
  transition: transform 0.1s, border-color 0.15s;
}
.unified-home .nb-modal-swatch:hover { transform: scale(1.06); }
.unified-home .nb-modal-swatch.is-active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-card);
}
.unified-home .nb-modal-preview {
  display: flex; align-items: center; gap: 12px;
  margin-top: 18px; padding: 10px 12px;
  background: var(--bg-input); border-radius: 10px;
}
.unified-home .nb-modal-preview-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  min-width: 56px;
}
.unified-home .nb-modal-preview-name {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unified-home .nb-modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}

/* Archived section divider/toggle below the active tile grid. */
.unified-home .notebooks-archived-section { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.unified-home .notebooks-archived-toggle {
  display: inline-flex; align-items: center;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--text-muted); padding: 4px 8px; border-radius: 6px;
}
.unified-home .notebooks-archived-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.unified-home .notebook-tile-wrap { position: relative; display: flex; flex-direction: column; align-items: stretch; }
.unified-home .notebook-restore-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin: -4px 8px 0;
  padding: 4px 8px; font-size: 11px; font-weight: 600; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.unified-home .notebook-restore-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Main footer (disclaimer) */
.unified-home .main-footer {
  padding: 40px 48px 28px;
  font-size: 11.5px; color: var(--text-muted); text-align: center;
}

/* ─── Saved / Chats / Notebooks destinations ─────────────── */
.unified-home .destination-head {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 8px; margin-bottom: 24px;
}
.unified-home .destination-title {
  font-size: 26px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  display: inline-flex; align-items: center; gap: 12px;
}
.unified-home .destination-title-icon {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.unified-home .destination-subtitle {
  font-size: 14px; line-height: 1.5; color: var(--text-secondary);
  margin: 0; max-width: 720px;
}
.unified-home .destination-search {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: none; border-radius: 10px;
  font-family: inherit; font-size: 13.5px;
  color: var(--text-primary); outline: none;
  margin-bottom: 18px;
}
.unified-home .destination-search::placeholder { color: var(--text-muted); }

.unified-home .destination-list {
  display: flex; flex-direction: column; gap: 2px;
}
.unified-home .destination-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; text-align: left; width: 100%;
  transition: background 0.15s;
}
.unified-home .destination-row:hover { background: var(--bg-hover); }
.unified-home .destination-row-icon { color: var(--text-muted); flex-shrink: 0; }
.unified-home .destination-row-main { flex: 1; min-width: 0; }
.unified-home .destination-row-title {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unified-home .destination-row-meta {
  font-size: 11.5px; color: var(--text-muted); margin-top: 3px;
}
.unified-home .destination-row-star { color: #f59e0b; flex-shrink: 0; }

/* Saved — date-bucketed sections (Today / Yesterday / Previous N / by month).
   Pattern follows Slack/Linear/ChatGPT history. */
.unified-home .saved-group {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%;
}
.unified-home .saved-group + .saved-group { margin-top: 14px; }
.unified-home .saved-group-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 14px 6px;
  position: sticky; top: 0;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
/* Sticky labels need an explicit background so scrolled rows don't bleed
   through. In dark Unified mode, the page body is #1B232C — match it. */
[data-theme="dark"] .unified-home .saved-group-label { background: #1B232C; }
/* Memories sits inside the settings-panel card (#23262b), not on the page,
   so its sticky label needs to match the panel — same title-with-underline
   look as History instead of a darker contrasting band. */
.unified-home .memories-panel .saved-group-label { background: var(--card-face); }
[data-theme="dark"] .unified-home .memories-panel .saved-group-label { background: #23262b; }
.unified-home .saved-row { padding: 10px 14px; width: 100%; }
.unified-home .saved-row-stamp {
  font-size: 11.5px; color: var(--text-muted);
  flex-shrink: 0; margin-left: 8px;
  font-variant-numeric: tabular-nums;
}

/* Saved images — small thumbnail on the list row (the Images pill itself
   switches to the larger grid below; this is for images mixed into "All"). */
.unified-home .saved-row-thumb {
  width: 32px; height: 32px; border-radius: 6px;
  overflow: hidden; flex-shrink: 0;
}
.unified-home .saved-row-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Saved images grid — shown instead of the row list when the Images pill is
   active. Larger thumbnails than the list-row version, with the generating
   prompt as a caption overlay (the prompt doubles as the image's name). */
.unified-home .saved-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 4px 0 24px;
}
.unified-home .saved-image-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: default;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.unified-home .saved-image-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  border-color: var(--accent);
}
.unified-home .saved-image-tile.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.unified-home .saved-image-tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.unified-home .saved-image-tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
  display: flex; flex-direction: column; gap: 2px;
}
.unified-home .saved-image-tile-title {
  font-size: 12px; font-weight: 600; color: #fff; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.unified-home .saved-image-tile-stamp {
  font-size: 10.5px; color: rgba(255,255,255,0.7);
}
.unified-home .saved-image-tile-check {
  position: absolute; top: 8px; left: 8px;
  width: 20px; height: 20px; border-radius: 5px;
  background: rgba(0,0,0,0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; z-index: 2;
}
.unified-home .saved-image-tile-remove {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(0,0,0,0.55); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; opacity: 0; z-index: 2;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.unified-home .saved-image-tile:hover .saved-image-tile-remove { opacity: 1; }
.unified-home .saved-image-tile-remove:hover { background: rgba(0,0,0,0.8); color: var(--accent); }

/* ─── History page extras: toolbar, type icons, bookmark, selection ─── */
.unified-home .history-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.unified-home .history-toolbar .history-search {
  flex: 1; margin-bottom: 0;
}
.unified-home .history-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.unified-home .history-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 12px; border-radius: 8px;
  background: var(--bg-input); border: 1px solid transparent;
  color: var(--text-primary); cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.unified-home .history-action-btn:hover { background: var(--bg-hover); }
.unified-home .history-action-btn[disabled] {
  opacity: 0.45; cursor: not-allowed;
}
.unified-home .history-action-btn.history-action-ghost {
  background: transparent; color: var(--text-secondary);
}
.unified-home .history-action-btn.history-action-ghost:hover {
  background: var(--bg-hover); color: var(--text-primary);
}
.unified-home .history-action-btn.history-action-danger {
  color: #f87171;
}
.unified-home .history-action-btn.history-action-danger:hover:not([disabled]) {
  background: rgba(248, 113, 113, 0.12); color: #fca5a5;
}

.unified-home .history-row { position: relative; }
.unified-home .history-row:hover { background: var(--bg-hover); }
.unified-home .history-row.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.unified-home .history-checkbox {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0;
  color: var(--text-muted); font-size: 16px;
}
.unified-home .history-row.is-selected .history-checkbox { color: var(--accent); }

.unified-home .history-type-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-secondary);
}
.unified-home .history-type-icon.is-article {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.unified-home .history-type-icon.is-agent {
  background: color-mix(in srgb, #a78bfa 14%, transparent);
  color: #c4b5fd;
}

.unified-home .history-bookmark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px;
  margin-left: 4px; flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.unified-home .history-bookmark:hover {
  background: var(--bg-hover); color: var(--text-primary);
}
.unified-home .history-bookmark.is-on { color: var(--accent); }

/* Saved tabs — match the folder-page tab look (rounded top corners, accent
   glow background on the active tab) so tabs feel consistent across the app. */
.unified-home .saved-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  padding: 0 0 0 4px;
}
.unified-home .saved-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.unified-home .saved-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}
.unified-home .saved-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--green-glow);
}

/* Empty state */
.unified-home .destination-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ─── Settings destination ─────────────────────────── */
.unified-home .settings-layout {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 20px; align-items: stretch;
}
.unified-home .settings-sidenav {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px; background: var(--card-face);
  border: 1px solid var(--card-border-color); border-radius: 14px;
  box-shadow: var(--card-shadow);
  align-self: start;
}
.unified-home .settings-sidenav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-primary); text-align: left;
  transition: background 0.15s, color 0.15s;
}
.unified-home .settings-sidenav-item i { font-size: 13px; color: var(--text-muted); width: 16px; text-align: center; }
.unified-home .settings-sidenav-item:hover { background: var(--bg-hover); }
.unified-home .settings-sidenav-item.is-active {
  background: var(--accent-dim); color: var(--accent-text, var(--accent));
}
.unified-home .settings-sidenav-item.is-active i { color: var(--accent-text, var(--accent)); }
.unified-home .settings-sidenav-chev { margin-left: auto; font-size: 11px; }

.unified-home .settings-panel {
  padding: 18px 24px; background: var(--card-face);
  border: 1px solid var(--card-border-color); border-radius: 14px;
  box-shadow: var(--card-shadow);
  display: flex; flex-direction: column;
}
.unified-home .settings-row {
  display: flex; align-items: center; gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.unified-home .settings-row:last-child { border-bottom: none; }
.unified-home .settings-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.unified-home .settings-row-title {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  letter-spacing: 0.01em;
}
.unified-home .settings-row-desc {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
  max-width: 540px;
}
/* Generic on/off switch — sized to match the existing .theme-toggle
   (40×22 with an 18px knob) so all toggles in the app feel the same. */
.unified-home .settings-switch {
  width: 40px; height: 22px; flex-shrink: 0; padding: 2px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer; position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.unified-home .settings-switch.is-on {
  background: var(--accent); border-color: var(--accent);
}
.unified-home .settings-switch-knob {
  display: block; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transform: translateX(0); transition: transform 0.18s;
}
.unified-home .settings-switch.is-on .settings-switch-knob { transform: translateX(20px); }
.unified-home .settings-mode-toggle {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.unified-home .settings-mode-label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  transition: color 0.15s;
}
.unified-home .settings-mode-label.is-active { color: var(--text-primary); }
/* Download Prototype row — outline button matching .cond-btn-secondary. */
.unified-home .settings-download {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0;
}
.unified-home .settings-download-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, color 0.15s, opacity 0.15s;
}
.unified-home .settings-download-btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.unified-home .settings-download-btn[disabled] { opacity: 0.6; cursor: progress; }
.unified-home .settings-download-error {
  font-size: 12px; color: var(--danger, #e5484d); max-width: 220px; text-align: right;
}

.unified-home .settings-empty {
  padding: 56px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.unified-home .settings-empty-icon { font-size: 22px; color: var(--text-muted); }
.unified-home .settings-empty-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.unified-home .settings-empty-desc {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
  max-width: 380px;
}

/* Memories panel — reuses History's row, toolbar, search, action-button,
   and selected-state styles so multiselect/delete look identical. The
   memory-specific overrides only handle the multi-line text body. */
.unified-home .memories-panel { display: flex; flex-direction: column; }
.unified-home .memory-row { align-items: flex-start; gap: 12px; }
.unified-home .memory-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.unified-home .memory-row-text {
  font-size: 13px; line-height: 1.5; color: var(--text-primary);
  white-space: normal; overflow: visible; text-overflow: clip;
  font-weight: 500;
}
.unified-home .memory-row .saved-row-stamp { margin-top: 3px; }

/* Memory detail modal — opens when a row is clicked outside selection mode.
   Read-only view of the full memory text. */
.unified-home .memory-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: memoryModalFade 0.15s ease-out;
}
.unified-home .memory-modal {
  background: var(--bg-card);
  border: 1px solid var(--card-border-color);
  border-radius: 14px;
  width: 520px; max-width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: memoryModalSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.unified-home .memory-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.unified-home .memory-modal-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.unified-home .memory-modal-eyebrow i { color: var(--accent); font-size: 13px; }
.unified-home .memory-modal-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0 4px;
  transition: color 0.15s;
}
.unified-home .memory-modal-close:hover { color: var(--text-primary); }
.unified-home .memory-modal-body {
  padding: 22px; overflow-y: auto;
  font-size: 14.5px; line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap; word-wrap: break-word;
}
.unified-home .memory-modal-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}
@keyframes memoryModalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes memoryModalSlide {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Settings icon button at the bottom of the rail picks up an active state
   when the Settings page is open, mirroring the rail nav items above. */
.unified-home .rail-user-more.is-active {
  background: var(--accent-dim); color: var(--accent-text, var(--accent));
}

/* Notebook picker popover (for the prompt's notebook chip) */
.unified-home .nb-picker {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.22);
  padding: 6px;
  width: 280px;
  z-index: 300;
  display: flex; flex-direction: column;
  max-height: 360px; overflow-y: auto;
}
.unified-home .nb-picker-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  width: 100%; text-align: left;
  transition: background 0.12s, color 0.12s;
}
.unified-home .nb-picker-row:hover { background: var(--bg-hover); color: var(--text-primary); }
.unified-home .nb-picker-row.active { color: var(--accent); }
.unified-home .nb-picker-sep { height: 1px; background: var(--border-light); margin: 4px 10px; }

/* ─── Unified prompt inline popovers (Loan / Agent) ───────────────────
   Rendered via createPortal into document.body, so these rules must NOT be
   scoped under .unified-home. They mirror the Hybrid prompt's inline-dropdown
   pattern (the user rejected the modal versions). */
.up-pop {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.22);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 420px;
}
.up-pop--loan  { width: 360px; }
.up-pop--agent { width: 460px; }

/* Back to the root "+" menu — breadcrumb-style, matching the action board's
   .ab-back language (chevron nudges left on hover). Only rendered when the
   picker was reached from the "+" menu. */
.up-pop-back {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px;
  background: none; border: none; border-bottom: 1px solid var(--border-light);
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  color: var(--text-muted); cursor: pointer; text-align: left;
  transition: color 0.12s, background 0.12s;
}
.up-pop-back i { font-size: 11px; transition: transform 0.15s; }
.up-pop-back:hover { color: var(--text-primary); background: var(--bg-elevated); }
.up-pop-back:hover i { transform: translateX(-3px); }

.up-pop-search-wrap {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border-light);
}
.up-pop-search {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
}
.up-pop-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.up-pop-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}
.up-pop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}
.up-pop-row:hover { background: var(--bg-hover, var(--accent-dim)); color: var(--text-primary); }
/* Row wraps the agent button + a trailing heart toggle. The heart is always
   visible (not hover-only) so the user can favorite from any row directly. */
.up-pop-row-wrap {
  display: flex; align-items: stretch; gap: 4px;
  border-radius: 8px;
  transition: background 0.12s;
}
.up-pop-row-wrap:hover { background: var(--bg-hover, var(--accent-dim)); }
.up-pop-row-wrap > .up-pop-row { flex: 1; min-width: 0; background: transparent; }
.up-pop-row-wrap > .up-pop-row:hover { background: transparent; }
.up-pop-row-fav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; flex-shrink: 0;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); border-radius: 8px;
  transition: color 0.12s, background 0.12s;
}
.up-pop-row-fav-btn:hover { color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.up-pop-row-fav-btn.is-on { color: #ef4444; }
.up-pop-row-fav-btn i { font-size: 15px; }
.up-pop-section-label {
  padding: 8px 12px 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
}

.up-pop-row-body { flex: 1; min-width: 0; }
.up-pop-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}
.up-pop-row-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-pop-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.up-pop-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.up-pop-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Notebook attach popover — narrower variant with checkboxes */
.up-pop--notebook { width: 280px; }
.up-pop--notebook .up-pop-row { padding: 8px 10px; gap: 10px; }
.up-pop--notebook .nb-check {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: #fff;
  flex-shrink: 0;
}
.up-pop--notebook .nb-check.on {
  background: var(--accent);
  border-color: var(--accent);
}
.up-pop--notebook .chip-swatch {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}
.up-pop-footer {
  border-top: 1px solid var(--border-light);
  padding: 6px;
}
.up-pop-action {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px;
  border: none; background: transparent; border-radius: 8px;
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--accent);
  transition: background 0.12s;
}
.up-pop-action:hover { background: var(--accent-dim); }

/* ─── Pipeline list (Unified homepage) ─────────────────────────────────
   Vertical list of "loans needing attention right now." Each row = one
   loan + one trigger (condition due, lock expiring, etc.). Rows are flat
   by default; actions appear on hover. */
.unified-home .pipeline-section {
  margin-top: 32px;
}
.unified-home .pipeline-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.unified-home .pipeline-title {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.unified-home .pipeline-action {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none;
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  transition: background 0.12s;
}
.unified-home .pipeline-action:hover { background: var(--accent-dim); }

.unified-home .pipeline-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border-light);
}

.unified-home .pipeline-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  position: relative;
  transition: background 0.12s;
}
.unified-home .pipeline-row:hover {
  background: var(--bg-hover, var(--accent-dim));
}

/* (Severity icons removed — rows are text-only. Severity color still available
   on .pipeline-row-reason via the sev-* class if we want to re-surface it later.) */

.unified-home .pipeline-row-text {
  flex: 1; min-width: 0;
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unified-home .pipeline-row-borrower { font-weight: 600; }
.unified-home .pipeline-row-sep {
  margin: 0 6px;
  color: var(--text-muted);
  font-weight: 400;
}
.unified-home .pipeline-row-reason { color: var(--text-secondary); font-weight: 400; }

.unified-home .pipeline-row-due {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
  transition: opacity 0.12s;
}

.unified-home .pipeline-row-actions {
  display: flex; align-items: center; gap: 2px;
  flex-shrink: 0;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.12s;
  position: relative;
}
.unified-home .pipeline-row:hover .pipeline-row-actions { opacity: 1; }
.unified-home .pipeline-row:hover .pipeline-row-due { opacity: 0.6; }

/* Notebook-exists indicator — sits between the due/timestamp and the
   action buttons. Flat, no pill, accent icon + muted count. */
.unified-home .pipeline-row-notebook {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent;
  border: 0;
  padding: 0 2px;
  margin-left: 12px;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: opacity 0.12s;
}
.unified-home .pipeline-row-notebook:hover { opacity: 0.75; }
.unified-home .pipeline-row-notebook-count {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.unified-home .pipeline-act {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent; border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.unified-home .pipeline-act:hover {
  background: var(--accent-dim);
  color: var(--accent);
}
.unified-home .pipeline-act.is-on { color: var(--accent); }

/* Small dropdown menu for ••• */
.unified-home .pipeline-menu {
  position: absolute;
  top: calc(100% + 4px); right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  padding: 4px; min-width: 180px;
  z-index: 250;
  display: flex; flex-direction: column;
}
.unified-home .pipeline-menu-item {
  text-align: left;
  padding: 8px 10px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  background: transparent; border: none; border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.unified-home .pipeline-menu-item:hover {
  background: var(--bg-hover, var(--accent-dim));
  color: var(--text-primary);
}

/* Caught-up empty state */
.unified-home .pipeline-empty {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 10px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 13.5px;
}
.unified-home .pipeline-empty svg { color: #059669; }
[data-theme="dark"] .unified-home .pipeline-empty svg { color: #34d399; }

/* ─── Unified Agent Marketplace ─────────────────────────────────────── */
/* padding-top matches .main-inner's — keeps the Agent Marketplace heading
   in line with the rail's "New chat" item, same as every other destination. */
.unified-home .ags-inner {
  max-width: 1180px;
  padding: 70px 48px 80px;
  margin: 0 auto;
  width: 100%;
}

/* Header — kept in sync with .destination-head so all Unified destination
   pages (Saved, History, Notebooks, Agent Marketplace, Agent Admin) share
   the same title size, subtitle size, color, and vertical rhythm. */
.unified-home .ags-head { margin-bottom: 24px; }
.unified-home .ags-head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.unified-home .ags-title {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  display: inline-flex; align-items: center; gap: 12px;
}
.unified-home .ags-subtitle {
  font-size: 14px; line-height: 1.5;
  color: var(--text-secondary);
  margin: 0; max-width: 720px;
}
/* Primary accent CTA — same dark-text-on-accent treatment used by the
   Agent Admin "+ Create agent" button and the active prompt submit, so
   filled accent buttons read consistently across the app. */
.unified-home .ags-create-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  background: var(--accent); color: var(--bg-page);
  border: 1px solid var(--accent); border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.unified-home .ags-create-btn:hover { opacity: 0.85; }

/* Search */
.unified-home .ags-search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.unified-home .ags-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}
.unified-home .ags-search {
  width: 100%;
  padding: 11px 14px 11px 40px;
  font-family: inherit; font-size: 14px;
  background: var(--bg-input, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.unified-home .ags-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
/* When the unified Agents-style search lives inside the History/Saved toolbar
   (Search + selection actions on one row), let it grow to fill the row and
   drop the wrap's default bottom margin. */
.unified-home .history-toolbar .ags-search-wrap {
  flex: 1; margin-bottom: 0;
}
/* P3 modifier: cap the search bar at 50% of the toolbar width so the
   Select button sits immediately after it rather than being pushed to
   the trailing edge of the row. */
.unified-home .history-toolbar.is-workspace .ags-search-wrap {
  flex: 0 0 50%;
  max-width: 50%;
}
.unified-home .history-toolbar.is-workspace {
  justify-content: flex-start;
}

/* Category chips */
.unified-home .ags-cats {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 32px;
}
.unified-home .ags-cat {
  padding: 7px 14px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.unified-home .ags-cat:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.unified-home .ags-cat.active {
  background: var(--accent);
  color: var(--bg-page);
  border-color: var(--accent);
}

/* Section */
.unified-home .ags-section { margin-bottom: 36px; }
.unified-home .ags-section-head {
  display: flex; align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.unified-home .ags-section-title {
  font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.unified-home .ags-section-count {
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
}

/* Agent grid */
.unified-home .ags-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Agent card */
.unified-home .ags-card {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 16px 16px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.12s, border-color 0.12s;
  cursor: pointer;
}
.unified-home .ags-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated, var(--bg-card));
}

.unified-home .ags-card-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.unified-home .ags-card-body { flex: 1; min-width: 0; }
.unified-home .ags-card-title {
  font-size: 14.5px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  padding-right: 24px;  /* room for fav */
}
.unified-home .ags-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.unified-home .ags-card-meta {
  display: flex; align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.unified-home .ags-card-badges {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.unified-home .ags-badge {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
}
.unified-home .ags-uses { font-weight: 500; }
.unified-home .ags-cat-tag {
  color: var(--text-muted);
  padding-left: 6px;
  margin-left: auto;
  border-left: 1px solid var(--border-light);
}

.unified-home .ags-fav {
  position: absolute;
  top: 10px; right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
  z-index: 1;
}
.unified-home .ags-fav.on { color: #f59e0b; }
.unified-home .ags-fav:hover { color: #f59e0b; }

/* Empty state */
.unified-home .ags-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.unified-home .ags-empty svg {
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: 12px;
}
.unified-home .ags-empty-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.unified-home .ags-empty-body {
  font-size: 13px;
  line-height: 1.6;
}
.unified-home .ags-empty-link {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.unified-home .ags-empty-link:hover { text-decoration: underline; }


/* ─────────────────────────────────────────────────────────────────────
   Condition Resolution Assistant page styles
   ───────────────────────────────────────────────────────────────────── */
.unified-home .conditions-page {
  flex: 1; overflow-y: auto; padding: 24px 32px 40px;
  display: flex; flex-direction: column; gap: 18px;
}

/* Loan context card */
.unified-home .cond-loan-card {
  background: var(--bg-card); border: 1px solid var(--card-border-color);
  border-radius: 14px; padding: 16px 20px;
  box-shadow: var(--card-shadow);
}
.unified-home .cond-loan-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.unified-home .cond-loan-borrower {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.01em; margin-right: 4px;
}
.unified-home .cond-loan-pill {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  letter-spacing: 0.02em; white-space: nowrap;
}
.unified-home .cond-loan-num {
  margin-top: 6px;
  font-size: 12.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Summary bar */
.unified-home .cond-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--card-border-color);
  border-radius: 14px; box-shadow: var(--card-shadow);
}
.unified-home .cond-summary-pills {
  display: flex; gap: 10px; flex: 1; flex-wrap: wrap;
}
.unified-home .cond-count-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  background: var(--bg-input); border: 1px solid var(--border);
}
.unified-home .cond-count-num {
  font-size: 18px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.unified-home .cond-count-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.unified-home .cond-count-need .cond-count-num     { color: #dc2626; }
.unified-home .cond-count-wait .cond-count-num     { color: #ca8a04; }
.unified-home .cond-count-submit .cond-count-num   { color: #2563eb; }
.unified-home .cond-count-cleared .cond-count-num  { color: #059669; }
.unified-home .cond-count-need    { border-color: rgba(220,38,38,0.30);  background: rgba(220,38,38,0.07); }
.unified-home .cond-count-wait    { border-color: rgba(202,138,4,0.30);  background: rgba(202,138,4,0.07); }
.unified-home .cond-count-submit  { border-color: rgba(37,99,235,0.30);  background: rgba(37,99,235,0.07); }
.unified-home .cond-count-cleared { border-color: rgba(5,150,105,0.30);  background: rgba(5,150,105,0.07); }

.unified-home .cond-draft-all-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; flex-shrink: 0;
  font-family: inherit; font-size: 13px; font-weight: 700;
  background: var(--accent); color: var(--bg-page);
  border: 1px solid var(--accent); border-radius: 8px;
  cursor: pointer; transition: opacity 0.15s, background 0.15s;
}
.unified-home .cond-draft-all-btn:hover { opacity: 0.85; }
.unified-home .cond-draft-all-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Conditions list */
.unified-home .conditions-list { display: flex; flex-direction: column; gap: 10px; }
.unified-home .cond-row {
  background: var(--bg-card); border: 1px solid var(--card-border-color);
  border-left: 4px solid var(--border); border-radius: 10px;
  overflow: hidden; transition: box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--card-shadow);
}
.unified-home .cond-row.is-cleared { opacity: 0.55; }
.unified-home .cond-row.is-open { box-shadow: 0 6px 20px rgba(0,0,0,0.18), var(--card-shadow); }

.unified-home .cond-row-summary {
  display: flex; align-items: flex-start; gap: 16px;
  width: 100%; padding: 14px 18px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; text-align: left;
}
.unified-home .cond-row-summary:hover { background: var(--bg-hover); }
.unified-home .cond-row-text {
  flex: 1; min-width: 0;
  font-size: 13.5px; line-height: 1.5; color: var(--text-primary);
  font-weight: 500;
}
.unified-home .cond-row-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  flex-shrink: 0;
}
.unified-home .cond-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  letter-spacing: 0.02em;
}
.unified-home .cond-pill-category { background: var(--bg-elevated); color: var(--text-secondary); }
.unified-home .cond-pill-ptc      { background: var(--accent-dim); color: var(--accent); }
.unified-home .cond-pill-deadline { background: var(--bg-elevated); color: var(--text-muted); }
.unified-home .cond-pill-deadline.is-urgent { background: rgba(220,38,38,0.15); color: #dc2626; }
.unified-home .cond-pill-status   { font-weight: 700; }
.unified-home .cond-chev          { font-size: 11px; color: var(--text-muted); margin-left: 4px; }

.unified-home .cond-row-body {
  padding: 4px 18px 16px;
  display: flex; flex-direction: column; gap: 14px;
  border-top: 1px solid var(--border-light);
  margin-top: 0;
}
.unified-home .cond-block { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; }
.unified-home .cond-block-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.unified-home .cond-block-text {
  font-size: 13px; line-height: 1.55; color: var(--text-secondary);
}
.unified-home .cond-checklist { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.unified-home .cond-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-primary); cursor: pointer;
  padding: 4px 0; line-height: 1.5;
}
.unified-home .cond-check input { margin-top: 3px; flex-shrink: 0; cursor: pointer; }

.unified-home .cond-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 4px;
}
.unified-home .cond-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.unified-home .cond-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.unified-home .cond-btn-primary {
  background: var(--accent); color: var(--bg-page); border: 1px solid var(--accent); font-weight: 700;
}
.unified-home .cond-btn-primary:hover:not([disabled]) { opacity: 0.85; }
.unified-home .cond-btn-secondary {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.unified-home .cond-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.unified-home .cond-sent-stamp {
  font-size: 11.5px; color: var(--text-muted);
  margin-right: auto;
}
.unified-home .cond-pending {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-muted); margin-right: auto;
}
.unified-home .cond-cleared-stamp {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: #059669;
}
.unified-home .cond-pulse {
  animation: condPulse 1.5s ease-in-out infinite;
}
@keyframes condPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* Condition email modal — same overlay/card pattern as the memory + notebook modals. */
.unified-home .cond-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: memoryModalFade 0.15s ease-out;
}
.unified-home .cond-modal {
  background: var(--bg-card); border: 1px solid var(--card-border-color);
  border-radius: 14px;
  width: 640px; max-width: 100%; max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: memoryModalSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.unified-home .cond-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
}
.unified-home .cond-modal-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  margin: 0; letter-spacing: -0.01em;
}
.unified-home .cond-modal-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0 4px; transition: color 0.15s;
}
.unified-home .cond-modal-close:hover { color: var(--text-primary); }
.unified-home .cond-modal-body {
  padding: 18px 22px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.unified-home .cond-modal-label {
  display: block; margin-bottom: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.unified-home .cond-modal-input {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px; font-family: inherit; font-size: 13px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-primary); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.unified-home .cond-modal-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 186, 178, 0.15);
}
.unified-home .cond-modal-textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  padding: 12px 14px; font-family: inherit; font-size: 13px; line-height: 1.55;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-primary); outline: none; min-height: 220px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.unified-home .cond-modal-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 186, 178, 0.15);
}
.unified-home .cond-modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 22px 18px; border-top: 1px solid var(--border);
}


/* ─────────────────────────────────────────────────────────────────────
   Broker Drive promotion — Files tab inside a notebook
   ───────────────────────────────────────────────────────────────────── */
.unified-home .bd-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--card-border-color);
  border-radius: 12px; box-shadow: var(--card-shadow);
}

/* P3 — square pending card in the trailing corner of the Docs head row.
   Replaces the wide banner with a compact glanceable count. */
.unified-home .docs-pending-card {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 120px; height: 120px;
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.unified-home .docs-pending-card:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.unified-home .docs-pending-card:disabled {
  cursor: default;
}
.unified-home .docs-pending-count {
  display: flex; align-items: baseline; gap: 4px;
  line-height: 1;
}
.unified-home .docs-pending-pending {
  font-size: 30px; font-weight: 700;
  color: var(--accent);
}
.unified-home .docs-pending-card:disabled .docs-pending-pending {
  color: #10b981;
}
.unified-home .docs-pending-of {
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
}
.unified-home .docs-pending-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}
.unified-home .docs-pending-cta {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px;
  padding: 3px 8px;
  background: var(--accent);
  color: var(--bg-page);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
}

/* P3 — Docs table layout (replaces the row-list rendering). */
.unified-home .docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.unified-home .docs-table thead th {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.unified-home .docs-table .docs-th-check { width: 32px; cursor: pointer; }
.unified-home .docs-table .docs-th-name { width: 38%; }
.unified-home .docs-table .docs-th-notebook { width: 22%; }
.unified-home .docs-table .docs-th-status { width: 110px; }
.unified-home .docs-table .docs-th-size { width: 80px; text-align: right; }
.unified-home .docs-table .docs-th-modified { width: 100px; }
.unified-home .docs-table .docs-th-actions { width: 110px; }
.unified-home .docs-table .docs-tr {
  border-bottom: 1px solid var(--border-light);
  cursor: default;
  transition: background 0.1s;
}
.unified-home .docs-table .docs-tr:hover { background: var(--bg-elevated); }
.unified-home .docs-table .docs-tr.is-selected { background: var(--accent-dim); }
.unified-home .docs-table td {
  padding: 10px 12px;
  vertical-align: middle;
  color: var(--text-secondary);
}
.unified-home .docs-table .docs-td-name {
  color: var(--text-primary);
  font-weight: 500;
  min-width: 0;
}
.unified-home .docs-table .docs-td-name-inner {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.unified-home .docs-table .docs-td-icon {
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.unified-home .docs-table .docs-td-fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.unified-home .docs-table .docs-td-size { text-align: right; font-variant-numeric: tabular-nums; }
.unified-home .docs-table .docs-td-modified { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.unified-home .docs-table .docs-td-actions {
  text-align: right;
  white-space: nowrap;
}
.unified-home .docs-table .docs-td-actions .bd-file-send,
.unified-home .docs-table .docs-td-actions .bd-file-delete,
.unified-home .docs-table .docs-td-actions .bd-file-chat {
  opacity: 0;
  transition: opacity 0.12s;
  margin-left: 6px;
}
.unified-home .docs-table .docs-td-actions .bd-file-chat:first-child {
  margin-left: 0;
}
.unified-home .docs-table .docs-tr:hover .docs-td-actions .bd-file-send,
.unified-home .docs-table .docs-tr:hover .docs-td-actions .bd-file-delete,
.unified-home .docs-table .docs-tr:hover .docs-td-actions .bd-file-chat {
  opacity: 1;
}
.unified-home .bd-file-chat {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 7px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.unified-home .bd-file-chat:hover {
  border-color: var(--accent); background: var(--accent-dim); color: var(--accent);
}
.unified-home .bd-banner-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--accent-dim); color: var(--accent);
}
.unified-home .bd-banner-text { flex: 1; min-width: 0; }
.unified-home .bd-banner-title {
  font-size: 13.5px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.01em;
}
.unified-home .bd-banner-sub {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
  margin-top: 2px;
}
.unified-home .bd-banner-btn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 8px 14px; border-radius: 8px;
  background: var(--accent); color: var(--bg-page);
  border: 1px solid var(--accent);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s;
}
.unified-home .bd-banner-btn:hover { opacity: 0.85; }

.unified-home .bd-file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s, border-color 0.1s;
}
.unified-home .bd-file-row:hover {
  background: var(--bg-elevated); border-color: var(--accent);
}
.unified-home .bd-file-row.is-on-drive { opacity: 0.78; }
.unified-home .bd-file-icon {
  font-size: 16px; color: var(--accent); width: 18px; text-align: center;
  flex-shrink: 0;
}
.unified-home .bd-file-name {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.unified-home .bd-file-size {
  font-size: 12px; color: var(--text-muted);
  flex-shrink: 0;
}
.unified-home .bd-file-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--bg-elevated); color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap; flex-shrink: 0;
  letter-spacing: 0.01em;
}
.unified-home .bd-file-pill.is-on-drive {
  background: var(--accent-dim); color: var(--accent);
  border-color: rgba(45, 186, 178, 0.35);
}
.unified-home .bd-file-send {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 7px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: inherit; font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.unified-home .bd-file-send:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
}


/* Files-destination row — same pattern as the in-notebook bd-file-row but
   with extra meta (notebook name) and a per-row delete button. */
.unified-home .bd-file-row .bd-file-meta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.unified-home .bd-file-row .bd-file-dot { opacity: 0.55; }
.unified-home .bd-file-row.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.unified-home .bd-file-actions {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.unified-home .bd-file-delete {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: transparent; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-muted); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.unified-home .bd-file-delete i { font-size: 12px; }
.unified-home .bd-file-delete:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}

/* List row enter/exit animations — Saved / History / Docs. Whenever a
   filter chip narrows the visible set or a row is removed (unsaved /
   deleted), the row is kept mounted for one animation cycle via a
   `row-leaving`/`row-entering` class (see useAnimatedRows) instead of the
   list just snapping to its new shape. */
@keyframes rowSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rowCollapseOut {
  from { opacity: 1; max-height: 72px; padding-top: 10px; padding-bottom: 10px; }
  to   { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
}
.unified-home .destination-list .row-entering,
.unified-home .bd-file-row.row-entering {
  animation: rowSlideIn 220ms ease both;
}
.unified-home .destination-list .row-leaving,
.unified-home .bd-file-row.row-leaving {
  animation: rowCollapseOut 240ms ease forwards;
  overflow: hidden;
  pointer-events: none;
}
/* Image grid tiles reflow via CSS Grid when one drops out, so they get a
   fade + scale instead of a height collapse. */
@keyframes tileFadeScaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes tileFadeScaleOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.9); }
}
.unified-home .saved-image-tile.row-entering { animation: tileFadeScaleIn 220ms ease both; }
.unified-home .saved-image-tile.row-leaving {
  animation: tileFadeScaleOut 200ms ease forwards;
  pointer-events: none;
}
/* Docs table rows: a `<tr>` ignores its own padding and doesn't animate
   `transform` reliably across browsers, so the collapse plays on each
   cell's padding instead — the row's rendered height shrinks right along
   with it, since a table row's height is the max of its cells'. */
@keyframes docsRowFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes docsCellCollapseOut {
  from { opacity: 1; padding-top: 10px; padding-bottom: 10px; }
  to   { opacity: 0; padding-top: 0; padding-bottom: 0; }
}
.unified-home .docs-table .docs-tr.row-entering { animation: docsRowFadeIn 200ms ease both; }
.unified-home .docs-table .docs-tr.row-leaving { pointer-events: none; }
.unified-home .docs-table .docs-tr.row-leaving td {
  animation: docsCellCollapseOut 240ms ease forwards;
}
.unified-home .bd-file-send[data-tooltip],
.unified-home .bd-file-delete[data-tooltip] { position: relative; }
.unified-home .bd-file-send[data-tooltip]::after,
.unified-home .bd-file-delete[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: var(--bg-surface); color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
  z-index: 50;
}
.unified-home .bd-file-send[data-tooltip]:hover::after,
.unified-home .bd-file-delete[data-tooltip]:hover::after {
  opacity: 1; transform: translateX(-50%) translateY(0);
  transition-delay: 0.25s;
}


/* ─────────────────────────────────────────────────────────────────────
   Condition card — custom AI message used during the conditions
   walkthrough. Splits "the condition / why UW is asking / what
   satisfies it" into visually distinct sections so the issue and
   resolution stop blurring together.
   ───────────────────────────────────────────────────────────────────── */
.unified-home .cond-card { display: flex; flex-direction: column; gap: 14px; }
.unified-home .cond-card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.unified-home .cond-card-step {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.unified-home .cond-card-status {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  background: var(--bg-elevated); color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.unified-home .cond-card-status.cond-card-status-not-started        { background: rgba(220,38,38,0.12); color: #f87171; }
.unified-home .cond-card-status.cond-card-status-borrower-contacted { background: rgba(202,138,4,0.14); color: #facc15; }
.unified-home .cond-card-status.cond-card-status-docs-received      { background: rgba(8,145,178,0.14); color: #38bdf8; }
.unified-home .cond-card-status.cond-card-status-submitted-to-uw    { background: rgba(37,99,235,0.14); color: #60a5fa; }
.unified-home .cond-card-status.cond-card-status-cleared            { background: rgba(5,150,105,0.14); color: #34d399; }
.unified-home .cond-card-deadline {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-muted);
  margin-left: auto;
}
.unified-home .cond-card-deadline i { font-size: 10px; }
.unified-home .cond-card-deadline.is-urgent { color: #f87171; }

.unified-home .cond-card { gap: 16px; }
.unified-home .cond-card-section {
  display: flex; flex-direction: column; gap: 5px;
}
/* "What satisfies it" is the action surface — distinguish it with a soft
   accent-tinted block instead of a side stripe. Issue and why sections
   sit directly on the card's own background, separated by spacing alone. */
.unified-home .cond-card-fix {
  background: var(--accent-dim);
  border-radius: 10px;
  padding: 12px 14px;
}

.unified-home .cond-card-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.unified-home .cond-card-fix .cond-card-label { color: var(--accent); }
.unified-home .cond-card-fix .cond-card-label i { color: var(--accent); font-size: 10px; }
.unified-home .cond-card-fix .cond-card-text { color: var(--text-primary); }
.unified-home .cond-card-text {
  font-size: 13.5px; line-height: 1.55; color: var(--text-primary);
}
.unified-home .cond-card-jargon {
  color: var(--text-secondary);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
}
.unified-home .cond-card-prompt {
  margin-top: 4px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
}


/* Sent-to-Broker-Drive confirmation modal. Reuses the .nb-modal-overlay
   for backdrop/animation; this card is wider with a scrolling body so
   long batches stay readable. */
.unified-home .bd-confirm-modal {
  background: var(--bg-card);
  border: 1px solid var(--card-border-color);
  border-radius: 14px;
  width: 780px; max-width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: memoryModalSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.unified-home .bd-confirm-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent);
  font-size: 13px;
}
.unified-home .bd-confirm-body {
  padding: 18px 22px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.unified-home .bd-confirm-sub {
  font-size: 13px; line-height: 1.55; color: var(--text-secondary);
}
.unified-home .bd-confirm-group { display: flex; flex-direction: column; gap: 6px; }
.unified-home .bd-confirm-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-size: 12px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.01em;
}
.unified-home .bd-confirm-group-head i { color: var(--accent); font-size: 12px; }
.unified-home .bd-confirm-count {
  margin-left: auto;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-elevated); padding: 2px 8px; border-radius: 999px;
}
.unified-home .bd-confirm-group-list { display: flex; flex-direction: column; gap: 4px; }
.unified-home .bd-confirm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  background: var(--bg-input);
}
.unified-home .bd-confirm-row-icon { font-size: 14px; color: var(--accent); width: 16px; text-align: center; flex-shrink: 0; }
.unified-home .bd-confirm-row-name {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unified-home .bd-confirm-row-size {
  font-size: 11.5px; color: var(--text-muted);
  flex-shrink: 0;
}

/* Searchable "send to which loan" combobox inside the Broker Drive send
   modals — replaces a plain <select> so brokers can type to find a loan
   instead of scrolling a long list. Picking a result sets the field to
   that loan's label, like a fixed custom tag, until reopened. */
.unified-home .bd-dest { position: relative; width: 240px; flex-shrink: 0; }
.unified-home .bd-dest-input {
  width: 100%; font-family: inherit; font-size: 11.5px;
  padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-secondary);
  outline: none; cursor: text;
  transition: border-color 0.12s;
}
.unified-home .bd-dest-input::placeholder { color: var(--text-muted); }
.unified-home .bd-dest-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  max-height: 220px; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 4px;
}
.unified-home .bd-dest-empty {
  padding: 8px 10px; font-size: 12px; color: var(--text-muted);
}
.unified-home .bd-dest-opt {
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 9px; border-radius: 6px; cursor: pointer;
}
.unified-home .bd-dest-opt:hover { background: var(--bg-hover); }
.unified-home .bd-dest-opt.is-selected { background: var(--accent-dim); }
.unified-home .bd-dest-opt-label { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.unified-home .bd-dest-opt-sub { font-size: 10.5px; color: var(--text-muted); }


/* Conditions overview — clickable list rendered inside the AI message
   bubble. Lets the broker pick where to start instead of being forced
   into "begin from the top". */
.unified-home .cond-overview-list { display: flex; flex-direction: column; gap: 14px; }
.unified-home .cond-overview-intro {
  font-size: 13.5px; line-height: 1.55; color: var(--text-primary);
}
.unified-home .cond-overview-rows { display: flex; flex-direction: column; gap: 6px; }
.unified-home .cond-overview-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-input); border: 1px solid transparent;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.unified-home .cond-overview-row:hover {
  background: var(--bg-elevated); border-color: var(--accent);
  transform: translateY(-1px);
}
.unified-home .cond-overview-num {
  width: 26px; height: 26px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: var(--bg-card); color: var(--text-muted);
  font-size: 12px; font-weight: 700;
}
.unified-home .cond-overview-row:hover .cond-overview-num {
  background: var(--accent); color: var(--bg-page);
}
.unified-home .cond-overview-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.unified-home .cond-overview-summary {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  line-height: 1.4;
}
.unified-home .cond-overview-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
}
.unified-home .cond-overview-status {
  font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-elevated); color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.unified-home .cond-overview-status-not-started        { background: rgba(220,38,38,0.12); color: #f87171; }
.unified-home .cond-overview-status-borrower-contacted { background: rgba(202,138,4,0.14); color: #facc15; }
.unified-home .cond-overview-status-docs-received      { background: rgba(8,145,178,0.14); color: #38bdf8; }
.unified-home .cond-overview-status-submitted-to-uw    { background: rgba(37,99,235,0.14); color: #60a5fa; }
.unified-home .cond-overview-status-cleared            { background: rgba(5,150,105,0.14); color: #34d399; }
.unified-home .cond-overview-deadline {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-muted);
}
.unified-home .cond-overview-deadline i { font-size: 9px; }
.unified-home .cond-overview-deadline.is-urgent { color: #f87171; }
.unified-home .cond-overview-cta {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 11px; font-weight: 700; color: var(--accent);
  opacity: 0; transform: translateX(-4px);
  transition: opacity 0.12s, transform 0.12s;
}
.unified-home .cond-overview-cta i { font-size: 9px; }
.unified-home .cond-overview-row:hover .cond-overview-cta {
  opacity: 1; transform: translateX(0);
}


/* Overview "Show N more / Show fewer" toggle — cap conditions at 4 in
   the chat overview, expand inline for full list. */
.unified-home .cond-overview-more {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  margin-top: 2px; padding: 7px 12px;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.unified-home .cond-overview-more i { font-size: 9px; }
.unified-home .cond-overview-more:hover {
  border-color: var(--accent); color: var(--accent);
}


/* Citations fallback — appears below the 5 capped citation cards.
   "Cantfindwhatyoure looking for?" + secondary-styled Browse All
   Articles button (accent outline, transparent fill). */
.unified-home .citations-fallback {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-top: 14px; padding: 4px 0 0;
  text-align: center;
}
.unified-home .citations-fallback-prompt {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
}
.unified-home .citations-browse-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.unified-home .citations-browse-btn:hover {
  background: var(--accent-dim);
}

/* ─── Workspace homepage ────────────────────────────────────────
   Alternate Unified-mode home. Dark-only — uses the same canvas
   navy (#1B232C) as Unified plus --bg-rail for the topbar so the
   palette reads as the same product, not a different surface. */
.workspace-home {
  position: fixed; inset: 0;
  /* Override .unified-home's grid columns? No — keep them. The dual-class
     wrapper inherits .unified-home's grid layout (216px rail + 1fr main).
     Workspace-specific main styling (.ws-main, .ws-grid, etc.) lives below. */
  background: #1B232C;
  color: var(--text-primary);
  overflow: hidden;
  /* Public Sans is the primary typeface for the Workspace mode. Falls back
     through the platform UI stack if Google Fonts is blocked. */
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  z-index: 50;
  /* P3 token overrides — shift card and border colors to match the blue-tinted
     canvas (#1B232C) and rail (#161E26). The global --bg-card (#23262b) and
     --border (#3d404a) read warm-neutral against this cooler stage; these
     overrides bring them into the same chromatic family. */
  --bg-card:    #212a35;
  --bg-elevated: #29333f;
  --border:     #2e3a48;
  --border-light: #243040;
}
/* Make sure form controls inside the Workspace inherit Public Sans —
   inputs/buttons/textareas don't pick up font-family by default. */
.workspace-home input,
.workspace-home textarea,
.workspace-home button,
.workspace-home select { font-family: inherit; }
/* Workspace's main column scrolls independently (rail stays fixed). */
.workspace-home .ws-main { overflow-y: auto; }
/* Hide ws-topbar leftovers in case any markup still references it. */
.workspace-home .ws-topbar { display: none; }
.workspace-home .rail-logo { position: relative; display: inline-block; }
.workspace-home .rail-logo-img { height: 32px; display: block; cursor: pointer; }
.workspace-home .view-switcher {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  display: flex; flex-direction: column; gap: 2px; min-width: 168px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 100; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.workspace-home .view-switcher.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.workspace-home .view-switcher-btn {
  padding: 7px 12px; border-radius: 6px; text-align: left;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}
.workspace-home .view-switcher-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.workspace-home .view-switcher-btn.active { background: var(--accent); color: var(--bg-page); }

.workspace-home .ws-topbar-actions { display: flex; align-items: center; gap: 8px; }
.workspace-home .ws-icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  color: var(--text-secondary); font-size: 14px; cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.workspace-home .ws-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.workspace-home .ws-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg-page);
  font-size: 12px; font-weight: 700; cursor: pointer;
  margin-left: 4px;
}

.workspace-home .ws-main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  justify-self: stretch;
  /* Top padding pushes the greeting headline down so its baseline lands
     near the first rail nav item (Dashboard) rather than floating above
     the logo. The rail's logo + header padding occupies ~66px before the
     first nav row starts; matching that puts greeting and Dashboard on
     the same horizontal line. */
  padding: 64px 32px 64px;
  display: flex; flex-direction: column; gap: 28px;
  box-sizing: border-box;
}
/* Hero — text block on the left, Tools waffle launcher on the right.
   The two are aligned to the top so the launcher sits flush with the
   greeting headline. */
.workspace-home .ws-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  /* Match the prompt-box width so the header (greeting + subtitle + Tools
     launcher) sits in the same column as the prompt below it. */
  width: 100%;
  max-width: 944px;
  margin: 0 auto;
}
.workspace-home .ws-hero-text { flex: 1; min-width: 0; }
.workspace-home .ws-greeting {
  font-size: 32px; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.02em; margin: 0 0 8px;
  color: var(--text-primary);
}
.workspace-home .ws-subtitle {
  /* Reads as a natural sentence: "You have 15 active loans: 7 with
     conditions, 4 locks expiring, and 3 are clear to close." Stat phrases
     are inline-flex buttons embedded in the prose, so the comma + "and"
     punctuation flows correctly between them. */
  font-size: 14.5px; line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}
.workspace-home .ws-active-count { color: var(--text-secondary); font-weight: 500; }

/* Inline PRO line styles removed — the ranking now lives in the PRO
   launcher (trophy button) next to the Tools launcher in the hero.
   The launcher + popover CSS is below alongside the Tools launcher. */

/* Stat link — colored by tone, embedded inline in the subtitle sentence.
   The color alone signals "different from surrounding text"; an underline
   appears on hover/focus to confirm tappability without cluttering the
   default state. */
.workspace-home .ws-stat-link {
  background: transparent; border: none; padding: 0;
  font: inherit; font-weight: 600; cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: filter 0.12s, opacity 0.12s, text-decoration-color 0.12s;
  white-space: nowrap;
}
.workspace-home .ws-stat-link:hover {
  filter: brightness(1.18);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.workspace-home .ws-stat-link:active { opacity: 0.85; }
.workspace-home .ws-stat-link:focus-visible {
  outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px;
}
/* Single link color — uses the prototype's green accent so the inline
   stat phrases match every other link in the app (e.g. "Chat with my
   pipeline", "All history"). The `--warn / --info / --ok` modifier
   classes still ship in the JSX so we can re-introduce per-tone color
   later without touching markup, but today they all resolve to the
   same green so the page doesn't go rainbow. */
.workspace-home .ws-stat-link,
.workspace-home .ws-stat-link--warn,
.workspace-home .ws-stat-link--info,
.workspace-home .ws-stat-link--ok {
  color: var(--accent-text);
}

/* ── Action-KPI cards (P3 Desktop — Action KPIs variant) ─────────
   The KPI row repurposed to show the greeting stat-link categories.
   Each card sets --tone inline (amber/blue/green per category); hover
   and the open-board state light the border in that tone. */
.workspace-home .ws-kpi-action-card:hover,
.workspace-home .ws-kpi-action-card.is-active {
  border-color: var(--tone) !important;
}
.workspace-home .ws-kpi-action-card:focus-visible {
  outline: 2px solid var(--tone);
  outline-offset: 2px;
}

/* ── Stepper homepage variant (P3 Desktop — Stepper) ─────────────
   One action per step in the KPI row's real estate. The embedded
   WSActionCard goes flat (no inner card chrome) and its headline
   scales up to read as the step title; the footer carries numbered
   dots, the "View all steps" link, and the Next button. */
.ws-stepper .ab-card { border: none; background: transparent; padding: 2px 0 0; }
.ws-stepper .ab-card--done {
  border: 1px solid rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.05);
  padding: 14px 16px;
}
.ws-stepper .ab-headline { font-size: 19px; font-weight: 700; line-height: 1.3; margin-top: 2px; }
.ws-stepper-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid transparent;
  color: var(--text-muted); font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; flex-shrink: 0;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
button.ws-stepper-dot:hover { border-color: var(--accent); color: var(--text-primary); }
.ws-stepper-dot.is-current { background: var(--accent); color: #08121a; }
.ws-stepper-dot.is-done { color: var(--accent); }
.ws-stepper-link {
  background: none; border: none; color: var(--text-secondary);
  font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  padding: 4px 6px; margin-left: 6px;
}
.ws-stepper-link:hover { color: var(--text-primary); }
.ws-stepper-next {
  margin-left: auto; background: #fff; color: #10151c;
  border: none; border-radius: 10px; padding: 9px 24px;
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: transform 0.12s, filter 0.12s;
}
.ws-stepper-next:hover { filter: brightness(0.9); transform: translateY(-1px); }
.ws-stepper-row:hover { background: var(--bg-elevated); }
/* Stepper variant hero — the subtitle is hidden there, so center the
   greeting against the Tools launcher and pull the prompt up; without
   this the 62px launcher hangs below the text and the hero reads as a
   band of empty space. */
.workspace-home .ws-main.is-stepper { gap: 16px; }
.workspace-home .ws-main.is-stepper .ws-hero { align-items: center; }
.workspace-home .ws-main.is-stepper .ws-greeting { margin-bottom: 0; }
.workspace-home .ws-main.is-stepper .ws-launchers { margin-top: 0; }

/* ── Concierge email composer (rate-lock message steps) ──────────
   To / editable Subject / editable body / Copy — styled after the
   Claude composer widget, minus the A/B variant toggles. */
.ws-composer {
  margin-top: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  animation: abExtraIn 0.18s ease both;
}
.ws-composer-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.ws-composer-label { color: var(--text-muted); flex-shrink: 0; }
.ws-composer-value { color: var(--text-secondary); }
.ws-composer-row input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: var(--text-primary); font: inherit; font-weight: 600; padding: 0;
}
.ws-composer textarea {
  display: block; width: 100%; box-sizing: border-box;
  background: none; border: none; outline: none; resize: vertical;
  min-height: 96px; padding: 10px 12px;
  font-size: 13px; line-height: 1.55; color: var(--text-primary); font-family: inherit;
}
.ws-composer-foot {
  display: flex; justify-content: flex-end;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--border-light);
}
.ws-composer-copy {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-secondary); font-size: 12px; font-weight: 600;
  padding: 5px 10px; cursor: pointer; font-family: inherit;
  transition: color 0.12s, border-color 0.12s;
}
.ws-composer-copy:hover { color: var(--text-primary); border-color: var(--accent); }
.ws-composer-copy.is-copied { color: var(--accent); border-color: var(--accent); }

/* Daily Brief panel reveal — the category panel unfolds beneath the
   greeting sentence and pushes the prompt down smoothly (animated
   grid-template-rows), with a margin offset so the flex gap doesn't
   jump when the wrapper first mounts. Runs once on open; switching
   categories inside the open panel doesn't re-run it. */
.ws-brief-panel-reveal {
  display: grid;
  animation: briefPanelExpand 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ws-brief-panel-clip { overflow: hidden; min-height: 0; }
@keyframes briefPanelExpand {
  from { grid-template-rows: 0fr; margin-bottom: -28px; opacity: 0.3; }
  to   { grid-template-rows: 1fr; margin-bottom: 0; opacity: 1; }
}
/* Exit — the reverse fold, played while the panel is flagged closing
   (the X, Esc, or re-clicking the active greeting link). */
.ws-brief-panel-reveal.is-closing {
  animation: briefPanelCollapse 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
  pointer-events: none;
}
@keyframes briefPanelCollapse {
  from { grid-template-rows: 1fr; margin-bottom: 0; opacity: 1; }
  to   { grid-template-rows: 0fr; margin-bottom: -28px; opacity: 0; }
}

/* Concierge panel header, trailing end: "History" text link, then the
   close X on a dark circle (same 30px disc as the prompt's voice/send
   buttons). The 16px gap + the shape contrast keep the two from reading
   as one control. */
.ws-panel-history {
  margin-left: auto;
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  /* Same green as every other text link in the app (stat links, loan
     numbers, "View details") — never a one-off color. */
  color: var(--accent-text);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  transition: text-decoration-color 0.12s, opacity 0.12s;
}
.ws-panel-history:hover { text-decoration-color: currentColor; }
.ws-panel-history.is-on { text-decoration-color: currentColor; }
.ws-panel-close {
  margin-left: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: none; padding: 0; cursor: pointer;
  color: var(--text-muted); font-size: 14px; font-family: inherit; flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.ws-panel-close:hover { color: var(--text-primary); transform: translateY(-1px); }

/* ── Chat Rotator greeting ───────────────────────────────────────
   "Chat" stays the heading's off-white; the rotating suffix takes the
   app's accent. The caret only shows on hover/open; the menu is a large
   type-scale dropdown of the same phrases. */
.ws-chat-wrap { position: relative; display: inline-block; }
.ws-chat-rotator {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit;
  color: var(--accent-text);
  display: inline-flex; align-items: baseline; gap: 12px;
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.ws-chat-rotator.is-fading { opacity: 0; transform: translateY(8px); }
.ws-chat-caret {
  font-size: 0.45em; opacity: 0; transform: translateY(-0.15em);
  transition: opacity 0.15s;
}
.ws-chat-wrap:hover .ws-chat-caret,
.ws-chat-wrap.is-open .ws-chat-caret { opacity: 1; }
.ws-chat-menu {
  position: absolute; top: calc(100% + 10px); left: -14px; z-index: 140;
  min-width: 420px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 18px 56px rgba(0,0,0,0.5);
  padding: 10px; display: flex; flex-direction: column; gap: 2px;
  animation: kpiPanelIn 0.15s ease both;
}
.ws-chat-menu-item {
  background: none; border: none; text-align: left; cursor: pointer; font-family: inherit;
  font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--accent-text);
  padding: 13px 16px; border-radius: 11px;
  transition: background 0.12s;
}
.ws-chat-menu-item:hover { background: var(--bg-elevated); }
.ws-chat-menu-lead { color: var(--text-primary); }

/* Concierge loan-number links — open the EASE placeholder modal. */
.ws-loan-link {
  background: none; border: none; padding: 0; font-family: inherit;
  font-size: 12px; color: var(--accent-text); cursor: pointer;
  font-variant-numeric: tabular-nums;
  text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.12s;
}
.ws-loan-link:hover { text-decoration-color: currentColor; }

/* ── Greeting launchers row ─────────────────────────────────
   PRO ranking + Tools waffle, side by side on the right edge of the
   hero block. Both buttons share size/shape so they read as a paired
   set; their colors signal different roles (gold for PRO status,
   accent green for Tools). */
.workspace-home .ws-launchers {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  margin-top: 2px;
}
.workspace-home .ws-tools-launcher-wrap,
.workspace-home .ws-pro-launcher-wrap {
  position: relative;
}

/* ── Tools waffle launcher ─────────────────────────────────
   Square button. Click opens a 3-column popover list containing
   every broker tool. The launcher's surface uses the accent-dim
   tint to read as "interactive" without becoming a full CTA. */
.workspace-home .ws-tools-launcher {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  width: 62px; height: 62px;
  /* Accent-tinted surface so the launcher reads clearly as "interactive
     thing" without being a full CTA. Border, icon, and label all pull
     from the accent palette to match other green affordances on the page
     (stat links, "Chat with my pipeline", "All history"). */
  background: var(--accent-dim);
  border: 1px solid rgba(52,211,153,0.35);
  border-radius: 12px;
  color: var(--accent-text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.workspace-home .ws-tools-launcher:hover,
.workspace-home .ws-tools-launcher.is-open {
  background: rgba(52,211,153,0.18);
  border-color: var(--accent);
  color: var(--accent-text);
}
.workspace-home .ws-tools-launcher:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.workspace-home .ws-tools-launcher-icon { color: inherit; }
.workspace-home .ws-tools-launcher-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Tools popover — opens anchored under the launcher, right-aligned.
   3-column grid of icon+label tiles. Same dark surface as the
   "Needs attention" and "Pick up where you left off" panels. */
.workspace-home .ws-tools-popover {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  /* Narrower than the old tile grid — a list reads better in a tighter
     column, and the popover stops competing with the canvas width. */
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  padding: 6px;
  z-index: 120;
  /* Subtle enter animation — fade + slide-down + slight scale from the
     top-right corner so the popover feels like it springs from the
     waffle launcher rather than appearing abruptly. */
  transform-origin: top right;
  animation: ws-tools-popover-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ws-tools-popover-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* Tool section — small uppercase title sits above each list of items.
   Subsequent sections get a thin top divider so the eye sees the groups
   as bands rather than one continuous wall. */
.workspace-home .ws-tools-popover-section + .ws-tools-popover-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}
.workspace-home .ws-tools-popover-section-title {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 4px;
}
/* List layout — vertical rows, every item the same height regardless of
   label length. Mirrors the pattern used by the Loan/Agent picker
   popovers and most command-palette menus. */
.workspace-home .ws-tools-popover-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.workspace-home .ws-tools-popover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: background 0.12s, color 0.12s;
}
.workspace-home .ws-tools-popover-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.workspace-home .ws-tools-popover-item:hover .ws-tools-popover-icon {
  color: var(--accent-text);
}
.workspace-home .ws-tools-popover-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.12s;
}
.workspace-home .ws-tools-popover-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  flex: 1; min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-home .ws-tools-popover-item:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.workspace-home .ws-tools-popover-icon { font-size: 18px; line-height: 1; }
.workspace-home .ws-tools-popover-label {
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}

/* ── PRO ranking launcher ──────────────────────────────────
   Mirror shape of the Tools launcher — same 62×62 square, same
   icon+label vertical stack — but tinted gold so the launcher
   reads as "your status" rather than "your toolkit." */
.workspace-home .ws-pro-launcher {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  /* min-width keeps the launcher at least square so it doesn't shrink
     when the label is short. Horizontal padding gives the "PRO Basic"
     label some breathing room from the rounded corners — it was hitting
     the edges at the old fixed 62×62 size. */
  min-width: 62px; height: 62px;
  padding: 0 14px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 12px;
  color: #f59e0b;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.workspace-home .ws-pro-launcher:hover,
.workspace-home .ws-pro-launcher.is-open {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
}
.workspace-home .ws-pro-launcher:focus-visible {
  outline: 2px solid #f59e0b; outline-offset: 2px;
}
.workspace-home .ws-pro-launcher-icon {
  font-size: 18px; line-height: 1;
}
.workspace-home .ws-pro-launcher-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* PRO popover — anchored top-right under the launcher. Shows the
   three data points that used to live in the inline PRO line. Each
   row is icon + label/value, with the last two clickable (chevron). */
.workspace-home .ws-pro-popover {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  padding: 6px;
  z-index: 120;
  transform-origin: top right;
  animation: ws-tools-popover-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.workspace-home .ws-pro-popover-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.workspace-home .ws-pro-popover-item + .ws-pro-popover-item {
  margin-top: 4px;
}
.workspace-home .ws-pro-popover-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.workspace-home .ws-pro-popover-item:hover .ws-pro-popover-item-icon {
  color: var(--accent-text);
}
/* Static (informational) row — keep the cursor neutral and skip the
   green-border hover since there's nothing to click. */
.workspace-home .ws-pro-popover-item--static {
  cursor: default;
}
.workspace-home .ws-pro-popover-item--static:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
}
.workspace-home .ws-pro-popover-item--static:hover .ws-pro-popover-item-icon {
  color: #f59e0b;
}
.workspace-home .ws-pro-popover-item-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  font-size: 13px;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}
.workspace-home .ws-pro-popover-item-body {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 0;
}
.workspace-home .ws-pro-popover-item-title {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.workspace-home .ws-pro-popover-item-value {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.workspace-home .ws-pro-popover-item-chev {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.12s;
}
.workspace-home .ws-pro-popover-item:hover .ws-pro-popover-item-chev {
  color: var(--accent-text);
}

/* Outer .ws-prompt is now just a transparent positioning shell. The inner
   .prompt block (same markup as UnifiedHomepage) provides the border,
   background, padding, glow ring, dropdown anchoring, and chip row. This
   keeps the +Loan/+Agent dropdowns and the favorite/suggested-question
   dropdown visually identical between Workspace and Unified modes. */
.workspace-home .ws-prompt {
  background: transparent;
  border: none;
  padding: 0;
  /* Prompt width — sized to the previous pipeline width so the box reads
     more prominent against the (now narrower) pipeline card below it. */
  width: 100%;
  max-width: 944px;
  margin: 0 auto;
}
/* Phase 3 prompt textarea — mirror Phase 1's multi-line behavior:
   no scrollbar while the auto-grow useEffect handles height. */
.workspace-home .prompt textarea {
  overflow: hidden;
  line-height: 1.45;
}

/* The Workspace's prompt section now hosts the EXACT same .prompt /
   .prompt-chip / .prompt-dropdown / .prompt-question-chips markup as
   UnifiedHomepage. Those classes are styled by the .unified-home rules
   above (the wrapper carries both `workspace-home` and `unified-home`
   classes), so we don't redeclare them here. The .ws-prompt outer block
   keeps width/padding consistent with the rest of the Workspace canvas. */
.workspace-home .ws-disclaimer {
  font-size: 12px; color: var(--text-muted);
  margin: -16px auto 0;
  max-width: 944px;
  width: 100%;
}
/* Override the shared `.prompt-disclaimer-row` max-width on Phase 3 so the
   row spans the wider prompt. */
.workspace-home .prompt-disclaimer-row { max-width: 944px; }
/* Pipeline card width — 20% narrower than the prompt above so the prompt
   reads as the primary action and the pipeline as the secondary scan. */
.workspace-home .ws-grid {
  max-width: 755px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Shared disclaimer + character-counter row (Phase 1 and Phase 3 homepages).
   Left-aligned with the prompt, counter trails to the right edge. */
.prompt-disclaimer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 760px;
  margin: 12px auto 0;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  box-sizing: border-box;
}
.prompt-disclaimer-row .prompt-disclaimer-text {
  text-align: left;
}
.prompt-disclaimer-row .prompt-disclaimer-count {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 500;
}

.workspace-home .ws-grid {
  display: grid;
  /* Single column while "Pick up where you left off" is hidden — restore
     `1fr 1fr` if/when that section comes back. */
  grid-template-columns: 1fr;
  gap: 20px;
  /* `stretch` (default for grid) so the two columns share the height of
     the taller column. Combined with `.ws-card { flex: 1 }` below, both
     panels render at equal heights regardless of internal content. */
  align-items: stretch;
}
.workspace-home .ws-col {
  display: flex; flex-direction: column; gap: 20px;
}
/* The single card in each column grows to fill the column, so both
   panels match the taller one's height. */
.workspace-home .ws-col > .ws-card { flex: 1; }

.workspace-home .ws-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  /* Tightened top padding so the header sits flush with the divider line.
     Card body keeps the original 18px breathing room. */
  padding: 0 20px 18px;
  /* Flex column so the body content (grid or list) can flex: 1 to claim
     all remaining vertical space inside the panel. Without this, the card
     would size to its content and any "fill the container" rules on the
     children would have nothing to fill against. */
  display: flex; flex-direction: column;
}
/* Card header — the title was getting lost against the body content. Lift
   it visually with a heavier title, a tinted strip behind the row, and a
   divider separating header from body. */
.workspace-home .ws-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  /* Negative side-margin pulls the strip out to the card's edges so it
     reads as a section header, not just a row inside the card. */
  margin: 0 -20px 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-radius: 12px 12px 0 0;
}
.workspace-home .ws-card-title {
  font-size: 15px; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 8px;
}
.workspace-home .ws-card-link {
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--accent-text);
  display: inline-flex; align-items: center;
  transition: color 0.12s;
}
.workspace-home .ws-card-link:hover { color: var(--accent-hover); }

/* Inline pipeline-chat input — replaces the Pipeline card's header
   row contents (title + "Chat with my pipeline" CTA) with a single-
   line input + submit + cancel when the broker triggers the CTA. */
.workspace-home .ws-pipeline-input-wrap {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
}
.workspace-home .ws-pipeline-input {
  flex: 1; min-width: 0;
  height: 32px;
  padding: 0 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.workspace-home .ws-pipeline-input::placeholder { color: var(--text-muted); }
.workspace-home .ws-pipeline-input:focus {
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}
.workspace-home .ws-pipeline-input-submit,
.workspace-home .ws-pipeline-input-cancel {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.workspace-home .ws-pipeline-input-submit {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-page);
}
.workspace-home .ws-pipeline-input-submit:hover {
  background: var(--accent-dark, var(--accent));
  border-color: var(--accent-dark, var(--accent));
}
.workspace-home .ws-pipeline-input-cancel:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.workspace-home .ws-attention-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.workspace-home .ws-attention-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
  /* Left rail-style severity stripe — adds shape redundancy on top of color
     so colorblind users still get a per-row severity cue at a glance. */
  border-left: 3px solid transparent;
  border-radius: 0;
}
.workspace-home .ws-attention-row:last-child { border-bottom: none; }
.workspace-home .ws-attention-row:hover { background: var(--bg-hover); }
/* No per-row tinting — every row uses the same flat neutral surface. */
.workspace-home .ws-attention-row--danger,
.workspace-home .ws-attention-row--warn,
.workspace-home .ws-attention-row--ok,
.workspace-home .ws-attention-row--pro {
  border-left-color: transparent;
  background: transparent;
}
.workspace-home .ws-attention-row--pro:hover { background: var(--bg-hover); }

/* Status indicator — distinct icon shape per severity, paired with the
   color. Sized so the row keeps the same vertical rhythm as before. */
.workspace-home .ws-attention-status {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0;
  font-size: 14px;
}
/* All status icons render in the same muted gray — the icon SHAPE
   carries the semantic difference (triangle / circle / check / trophy),
   so color isn't doing redundant work. */
.workspace-home .ws-attention-status--danger,
.workspace-home .ws-attention-status--warn,
.workspace-home .ws-attention-status--ok,
.workspace-home .ws-attention-status--pro {
  color: var(--text-muted);
}

/* Legacy dot kept for the card title's red bullet. Removed here from the
   row since the status icon now occupies that role. */
.workspace-home .ws-attention-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; flex-shrink: 0;
}
.workspace-home .ws-attention-name {
  font-weight: 600; color: var(--text-primary);
  white-space: nowrap;
}
.workspace-home .ws-attention-sep { color: var(--text-muted); }
.workspace-home .ws-attention-detail {
  color: var(--text-secondary);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.workspace-home .ws-attention-due {
  font-size: 12px; color: var(--text-muted); white-space: nowrap;
}
/* All due dates render in the same neutral muted gray. */
/* "+N pts" on the PRO row — neutral muted gray to match the rest of
   the list. Kept slightly heavier-weight so it still reads as the
   numeric payoff. */
.workspace-home .ws-attention-due--pro {
  font-weight: 700;
}

/* Visually hidden text for screen readers — kept inside the row so
   assistive tech reads "Critical. James Mitchell — Condition due tomorrow"
   while sighted users only see the icon + name. */
.workspace-home .sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.workspace-home .ws-attention-icon {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px 6px;
  font-size: 12px;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}
.workspace-home .ws-attention-icon:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* ─── Dashboard active-pipeline row hover actions (Chat + Broker Drive) ─── */
.ws-dash-loan-actions {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 6px; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.12s ease;
  background: var(--bg-elevated); padding-left: 14px;
}
.ws-dash-loan-row:hover .ws-dash-loan-actions { opacity: 1; pointer-events: auto; }
.ws-dash-loan-act {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; font-family: inherit; white-space: nowrap;
  color: var(--text-secondary); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 7px; padding: 4px 9px; cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.ws-dash-loan-act:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Broker Drive in-chat file chooser (selectable rows in the AI message) ─── */
.bd-pick-intro { font-size: 15px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 12px; }
.bd-pick-rows { display: flex; flex-direction: column; gap: 6px; }
.bd-pick-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; cursor: pointer; font-family: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.bd-pick-row:hover { border-color: var(--accent); }
.bd-pick-row.is-sel { border-color: var(--accent); background: var(--accent-dim); }
.bd-pick-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-pick-size { font-size: 11px; color: var(--text-muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
/* Leading-edge checkbox — same placement/style as the History bulk-select. */
.bd-pick-check { font-size: 15px; color: var(--text-muted); flex-shrink: 0; width: 18px; text-align: center; }
.bd-pick-row.is-sel .bd-pick-check { color: var(--accent); }

/* Broker Drive "pulling files" loader (two-phase chat open). */
.bd-loading { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 14px; }
.bd-loading-dots { display: inline-flex; gap: 4px; }
.bd-loading-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.4; animation: bdDot 1s infinite ease-in-out; }
.bd-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.bd-loading-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes bdDot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.bd-pick-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.bd-pick-hint { font-size: 12px; color: var(--text-muted); }
.bd-pick-go {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: var(--bg-page); border: none; border-radius: 9px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.bd-pick-go:disabled { opacity: 0.4; cursor: default; }

/* Right-rail Docs panel file rows (Broker Drive + uploaded). */
.bd-rail-doc { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; margin-bottom: 6px; cursor: pointer; font-family: inherit; transition: border-color 0.12s; }
.bd-rail-doc:hover { border-color: var(--accent); }
.bd-rail-doc-ic { font-size: 15px; flex-shrink: 0; }
.bd-rail-doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bd-rail-doc-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-rail-doc-meta { font-size: 10.5px; color: var(--text-muted); }
.bd-rail-doc-tag { flex-shrink: 0; font-size: 9px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--bg-elevated); color: var(--text-muted); }
.bd-rail-doc-tag.on { background: var(--accent-dim); color: var(--accent); }
/* The folder-wide mint icon rule (#7fe9d4) would tint this arrow, leaving it
   low-contrast on the teal fill. On the accent button, match the dark on-accent
   color used across the rest of the P3 UI. */
[data-theme="dark"] .folder-page-root .bd-pick-go i.fa-solid { color: var(--bg-page) !important; }

/* Loan Tools modal — tool tile inside the categorized grid (now unused
   on the dashboard since Loan Tools moved to the row of small cards
   below the prompt; keeping the styles in case the modal is reused
   elsewhere — e.g., a future "All tools" launcher). */
.loan-tool-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.loan-tool-card:hover { background: var(--bg-hover, var(--bg-elevated)); border-color: var(--accent); }
.loan-tool-card-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.loan-tool-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.loan-tool-card-name {
  font-size: 13.5px; font-weight: 700; color: var(--text-primary);
}
.loan-tool-card-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.4;
}

/* Row overflow menu — anchored under the ••• button on a "Needs attention"
   row. Stops at the viewport edge if there's no room. Standard menu list
   with a header showing the loan it's scoped to. */
.row-actions-menu {
  position: fixed;
  width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  padding: 4px 0;
  z-index: 250;
  font-family: inherit;
}
.row-actions-menu-head {
  padding: 10px 14px 8px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.row-actions-menu-divider {
  height: 1px; background: var(--border-light); margin: 4px 0;
}
.row-actions-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 14px;
  background: transparent; border: none;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  cursor: pointer; text-align: left;
  transition: background 0.1s;
}
.row-actions-menu-item:hover { background: var(--bg-hover, var(--bg-elevated)); }
.row-actions-menu-item.is-danger { color: #ef4444; }
.row-actions-menu-item.is-danger:hover { background: rgba(239,68,68,0.10); }
.row-actions-menu-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; flex-shrink: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.row-actions-menu-item.is-danger .row-actions-menu-icon { color: #ef4444; }
.workspace-home .ws-quick-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.workspace-home .ws-quick-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.workspace-home .ws-quick-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--bg-rail-active); }
.workspace-home .ws-quick-btn i { font-size: 12px; color: var(--text-muted); }
.workspace-home .ws-quick-btn:hover i { color: var(--text-primary); }

.workspace-home .ws-recents-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  /* Claim all leftover vertical space inside the card; grid-auto-rows: 1fr
     splits that space evenly across all rows so each card cell gets an
     equal share. Cards then fill their cells via stretch (grid default). */
  flex: 1;
  grid-auto-rows: 1fr;
  min-height: 0;
}
.workspace-home .ws-recent-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  display: flex; flex-direction: column; gap: 10px;
  /* Push the icon/pill row to the top and the title/meta toward the
     bottom so when the card expands, content distributes top-to-bottom
     instead of clumping at the top. */
  justify-content: space-between;
}
.workspace-home .ws-recent-card:hover { background: var(--bg-hover); border-color: var(--accent); }
.workspace-home .ws-recent-head {
  display: flex; align-items: center; justify-content: space-between;
}
.workspace-home .ws-recent-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
/* Chat / Notebook / Doc colors mirror Unified's history-type-icon palette:
   chat = neutral, notebook = soft purple (matches the Agent badge there),
   doc = accent teal (matches the Article badge). */
.workspace-home .ws-recent-icon--chat     { background: var(--bg-input); color: var(--text-secondary); }
.workspace-home .ws-recent-icon--notebook { background: color-mix(in srgb, #a78bfa 14%, transparent); color: #c4b5fd; }
.workspace-home .ws-recent-icon--doc      { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.workspace-home .ws-recent-pill {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
}
.workspace-home .ws-recent-pill--chat     { background: var(--bg-input); color: var(--text-secondary); }
.workspace-home .ws-recent-pill--notebook { background: color-mix(in srgb, #a78bfa 14%, transparent); color: #c4b5fd; }
.workspace-home .ws-recent-pill--doc      { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.workspace-home .ws-recent-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.workspace-home .ws-recent-meta {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center;
}

.workspace-home .ws-saved-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.workspace-home .ws-saved-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.workspace-home .ws-saved-row:hover { background: var(--bg-hover); }
.workspace-home .ws-saved-title {
  flex: 1; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.workspace-home .ws-saved-when { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── Trending Now ─────────────────────────────────────────────
   Two-pane content feed: a featured video on the left, a list of
   other titles on the right. Lower visual priority than the pipeline
   panels above — muted category eyebrows with small color-coded dots
   (no urgency-coded reds or ambers; those belong to pipeline alerts). */
.workspace-home .ws-trending {
  display: flex; flex-direction: column;
  gap: 14px;
}
.workspace-home .ws-trending-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.workspace-home .ws-trending-title {
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0;
}
.workspace-home .ws-trending-more {
  background: transparent; border: none; padding: 4px 0;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--accent-text);
  cursor: pointer;
  display: inline-flex; align-items: center;
  transition: filter 0.12s, text-decoration-color 0.12s;
}
.workspace-home .ws-trending-more:hover {
  filter: brightness(1.18);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.workspace-home .ws-trending-more:focus-visible {
  outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px;
}
/* Two columns: featured card (left) at 1.1fr and the title list (right) at 1fr.
   The featured side gets a touch more space because it carries an image. */
.workspace-home .ws-trending-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}

/* Featured video card — hero image with play overlay + body text. */
.workspace-home .ws-trending-featured {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.workspace-home .ws-trending-featured-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  overflow: hidden;
}
.workspace-home .ws-trending-featured-media img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Play button overlay — circular accent badge centered on the thumbnail
   so the broker reads it as a video at a glance. */
.workspace-home .ws-trending-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  pointer-events: none;
}
.workspace-home .ws-trending-play i { transform: translateX(1.5px); /* visual center of the play triangle */ }
.workspace-home .ws-trending-duration {
  position: absolute;
  right: 8px; bottom: 8px;
  font-size: 11px; font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.65);
  padding: 2px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.workspace-home .ws-trending-featured-body {
  padding: 12px 16px 16px;
  display: flex; flex-direction: column;
  gap: 6px;
}

/* Category eyebrow — used in both the featured card and the list rows. */
.workspace-home .ws-trending-category {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.workspace-home .ws-trending-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.workspace-home .ws-trending-category--video    .ws-trending-dot { background: var(--accent); }
.workspace-home .ws-trending-category--rate     .ws-trending-dot { background: #34d399; }
.workspace-home .ws-trending-category--program  .ws-trending-dot { background: #60a5fa; }
.workspace-home .ws-trending-category--tool     .ws-trending-dot { background: #a78bfa; }
.workspace-home .ws-trending-category--training .ws-trending-dot { background: #fbbf24; }
.workspace-home .ws-trending-category--promo    .ws-trending-dot { background: #f472b6; }
.workspace-home .ws-trending-category--policy   .ws-trending-dot { background: #94a3b8; }
.workspace-home .ws-trending-card-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.workspace-home .ws-trending-card-desc {
  font-size: 13px; line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}

/* Right-side title list — compact rows: small eyebrow, title, date meta.
   No images. Whole row reads as scannable text. The panel stretches to
   match the featured card's height (grid-default `align-items: stretch`
   plus an explicit `height: 100%`), and each row claims an equal share
   of that height so the list never leaves empty space at the bottom. */
.workspace-home .ws-trending-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.workspace-home .ws-trending-list-item {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  align-content: center;
}
.workspace-home .ws-trending-list-item:last-child { border-bottom: none; }
.workspace-home .ws-trending-list-item .ws-trending-category {
  grid-column: 1 / 2;
}
.workspace-home .ws-trending-list-title {
  grid-column: 1 / 2;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}
.workspace-home .ws-trending-list-meta {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 880px) {
  .workspace-home .ws-grid { grid-template-columns: 1fr; }
  .workspace-home .ws-recents-grid { grid-template-columns: 1fr; }
  .workspace-home .ws-hero { flex-direction: column; }
  .workspace-home .ws-stats { width: 100%; }
  .workspace-home .ws-trending-layout { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────────────────────────
   PDF viewer (Doc Chat page)
   Simulated PDF viewer that lives on the right side of the Doc Chat
   split. Top toolbar has page nav + zoom controls + filename. Below
   it is a scrollable viewport that hosts a single white "page" frame
   sized to US Letter (612×792 @ 72dpi) and scaled via CSS transform.
   ──────────────────────────────────────────────────────────────── */
.pdf-viewer-pane {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  background: #1a1a1c;
  border-left: 1px solid var(--border);
  /* Smooth open/close: animate width AND max-width together with an
     easeInOutCubic curve so the close feels gentle on both ends. */
  transition: width 0.9s cubic-bezier(0.65, 0, 0.35, 1),
              max-width 0.9s cubic-bezier(0.65, 0, 0.35, 1),
              border-left-color 0.3s linear;
}
.pdf-viewer-pane.collapsed {
  max-width: 0 !important;
  border-left-color: transparent;
}
.doc-chat-pane {
  min-width: 0;
  max-width: 100%;
  transition: width 0.9s cubic-bezier(0.65, 0, 0.35, 1),
              max-width 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
/* While the user drags the divider, snap to cursor — no transition lag. */
.doc-split.is-dragging .pdf-viewer-pane,
.doc-split.is-dragging .doc-chat-pane {
  transition: none;
}
.doc-divider {
  transition: width 0.9s cubic-bezier(0.65, 0, 0.35, 1),
              opacity 0.45s cubic-bezier(0.65, 0, 0.35, 1),
              background 0.15s;
}
.doc-divider.collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
}
.doc-split.is-dragging .doc-divider {
  transition: none;
}
.pdf-toolbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  height: 44px;
}
/* Brand-styled PDF toolbar — dark teal bar with white page/zoom inputs
   and white icon buttons. Matches the reference UI in Phase 1 doc viewer. */
.pdf-toolbar.pdf-toolbar--brand {
  background: #00706D;
  border-bottom: 0;
  height: 56px;
  padding: 0 16px;
  color: #fff;
}
.pdf-toolbar--brand .pdf-tb-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 0;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.12s, opacity 0.12s;
}
.pdf-toolbar--brand .pdf-tb-icon:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.pdf-toolbar--brand .pdf-tb-icon:disabled { opacity: 0.4; cursor: default; }
.pdf-toolbar--brand .pdf-tb-icon.active { background: rgba(255,255,255,0.22); }
.pdf-toolbar--brand .pdf-tb-spacer { flex: 1; min-width: 0; }
.pdf-toolbar--brand .pdf-tb-center {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.pdf-toolbar--brand .pdf-tb-pageinput,
.pdf-toolbar--brand .pdf-tb-zoominput {
  width: 60px;
  height: 32px;
  background: #fff;
  color: #1a1a1a;
  border: 0;
  border-radius: 4px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  outline: none;
  box-sizing: border-box;
}
.pdf-toolbar--brand .pdf-tb-pageinput { width: 52px; }
.pdf-toolbar--brand .pdf-tb-pageinput:focus,
.pdf-toolbar--brand .pdf-tb-zoominput:focus {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.pdf-toolbar--brand .pdf-tb-label {
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
}

/* Light-mode document framing — light gray surround, soft drop shadow on
   the page. Matches the Phase 1 reference. Dark mode keeps its existing
   dark frame so the contrast still reads. */
[data-theme="light"] .pdf-viewer-pane { background: #F2F3F5; }
[data-theme="light"] .pdf-viewport { background: #F2F3F5; }
[data-theme="light"] .pdf-thumbnails {
  background: #FFFFFF;
  border-right: 1px solid #E5E7EB;
}
[data-theme="light"] .pdf-page {
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 6px 18px rgba(0,0,0,0.10);
}
.pdf-tb-group { display: flex; align-items: center; gap: 6px; }
.pdf-tb-group button {
  width: 28px; height: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; line-height: 1;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pdf-tb-group button:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.pdf-tb-group button:disabled { opacity: 0.35; cursor: default; }
.pdf-page-counter, .pdf-zoom-level {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  min-width: 92px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.pdf-zoom-level { min-width: 48px; }
.pdf-tb-divider {
  width: 1px; height: 22px;
  background: var(--border);
  flex-shrink: 0;
}
.pdf-tb-filename {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-muted);
  max-width: 260px;
  overflow: hidden;
}
.pdf-tb-filename span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pdf-body {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
}
.pdf-thumbnails {
  flex-shrink: 0;
  width: 128px;
  background: #161618;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.pdf-thumbnails::-webkit-scrollbar { width: 8px; }
.pdf-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}
.pdf-thumbnails::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}
.pdf-thumb {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  outline: none;
}
.pdf-thumb-frame {
  /* 612 * 0.157 ≈ 96 ; 792 * 0.157 ≈ 124 */
  width: 96px;
  height: 124px;
  background: #ffffff;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.pdf-thumb-page {
  position: absolute;
  top: 0; left: 0;
  width: 612px;
  height: 792px;
  background: #ffffff;
  color: #1a1a1a;
  padding: 56px 64px;
  font-family: "Times New Roman", Georgia, "Liberation Serif", serif;
  font-size: 11px;
  line-height: 1.55;
  transform: scale(0.157);
  transform-origin: top left;
  overflow: hidden;
  pointer-events: none;
}
.pdf-thumb-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  transition: color 0.12s;
}
.pdf-thumb:hover .pdf-thumb-frame {
  outline-color: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}
.pdf-thumb:hover .pdf-thumb-label { color: var(--text-secondary); }
.pdf-thumb:focus-visible .pdf-thumb-frame { outline-color: var(--accent); }
.pdf-thumb.active .pdf-thumb-frame {
  outline-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.6), 0 0 0 1px var(--accent), 0 0 12px var(--green-glow, rgba(80,200,120,0.35));
}
.pdf-thumb.active .pdf-thumb-label {
  color: var(--accent);
}
.pdf-viewport {
  flex: 1;
  overflow: auto;
  background: #1a1a1c;
  padding: 12px 6px;
  min-width: 0;
  /* Using block + text-align centers the inline-block frame and lets
     overflow scroll cleanly when the zoomed page is wider than the pane. */
  text-align: center;
}
.pdf-page-frame {
  display: inline-block;
  position: relative;
  text-align: left;
  transition: width 0.18s, height 0.18s;
}
.pdf-page {
  position: absolute; top: 0; left: 0;
  width: 612px; height: 792px;
  background: #ffffff;
  color: #1a1a1a;
  padding: 56px 64px;
  font-family: "Times New Roman", Georgia, "Liberation Serif", serif;
  font-size: 11px;
  line-height: 1.55;
  box-shadow: 0 6px 32px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.4);
  transform-origin: top left;
  overflow: hidden;
  transition: transform 0.18s;
}
.pdf-page .pdf-form-id {
  font-size: 9px;
  color: #555;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.pdf-page .pdf-doc-title {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: #000;
}
.pdf-page .pdf-doc-meta {
  text-align: center;
  font-size: 9.5px;
  color: #555;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1a1a1a;
}
.pdf-page h2.pdf-section {
  font-size: 11px;
  font-weight: 800;
  color: #000;
  background: #d8d8d8;
  padding: 4px 10px;
  margin-top: 14px;
  margin-bottom: 8px;
  border-left: 3px solid #1a1a1a;
  letter-spacing: 0.03em;
}
.pdf-page .pdf-grid p {
  margin: 0 0 4px 0;
  color: #1a1a1a;
}
.pdf-page strong { font-weight: 700; color: #000; }
.pdf-page p { margin: 0 0 4px 0; color: #1a1a1a; }
.pdf-page .pdf-comp-block {
  margin: 10px 0;
  padding: 8px 10px;
  background: #f5f5f5;
  border-left: 2px solid #aaa;
}
.pdf-page .pdf-comp-block p { margin: 0 0 2px 0; }
.pdf-page .pdf-signature {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #999;
}
.pdf-page .pdf-page-footer {
  position: absolute;
  bottom: 24px; left: 64px; right: 64px;
  font-size: 9px;
  color: #888;
  text-align: center;
  border-top: 1px solid #ddd;
  padding-top: 6px;
  letter-spacing: 0.06em;
}

/* The .doc-chat-pane (conversation column) and .doc-divider stay as-is
   from the earlier rules — they continue to host the chat panel in
   the visually-left position thanks to the row-reverse flip. */

/* ────────────────────────────────────────────────────────────────
   Doc Chat — chat-pane toolbar with the document-panel toggle.
   The toolbar sits at the top of the conversation column and stays
   visible whether the doc viewer is open or collapsed.
   ──────────────────────────────────────────────────────────────── */
.doc-chat-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 10px 14px 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.doc-chat-toolbar-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.doc-panel-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 7px;
  padding: 5px 10px;
  margin-bottom: 8px; /* align with the bottom edge of tabs */
  font-size: 11.5px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.doc-panel-toggle:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.doc-panel-toggle svg { flex-shrink: 0; }
.doc-panel-toggle--icon {
  padding: 6px;
  width: 30px;
  height: 30px;
  justify-content: center;
}

/* Right-panel section header — Sources / Related Articles / Images all get
   one of these at the top now, matching the icon + title + meta pattern
   used for reference documents, instead of jumping straight into a list. */
.rp-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 0 2px; }
.rp-section-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.rp-section-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rp-section-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* ────────────────────────────────────────────────────────────────
   Doc Chat — Citations / Related Articles cards
   ──────────────────────────────────────────────────────────────── */
.dc-cite-list {
  display: flex; flex-direction: column; gap: 10px;
}
.dc-cite-card {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.dc-cite-card:hover {
  border-color: var(--accent);
}
.dc-cite-num {
  flex-shrink: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--border);
}
.dc-cite-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dc-cite-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.dc-cite-title {
  flex: 1;
  min-width: 0;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}
.dc-cite-bookmark {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  padding: 2px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.dc-cite-bookmark:hover { color: var(--accent); background: var(--accent-dim); }
.dc-cite-bookmark.active { color: var(--accent); }
.dc-cite-desc {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dc-cite-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  font-size: 10.5px;
}
.dc-cite-date {
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.dc-cite-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 7px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.dc-cite-pill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ────────────────────────────────────────────────────────────────
   Doc Chat — Recent Activity dropdown (replaces Hide doc when in sources mode)
   ──────────────────────────────────────────────────────────────── */
.dc-recent-wrap { position: relative; margin-bottom: 8px; }
.dc-recent-wrap .doc-panel-toggle { margin-bottom: 0; }
.dc-recent-trigger.open {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.dc-recent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
}
.dc-recent-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dc-recent-menu-head {
  padding: 8px 10px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dc-recent-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s;
}
.dc-recent-item:hover { background: var(--bg-elevated); }
.dc-recent-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.dc-recent-item-meta {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ────────────────────────────────────────────────────────────────
   Doc Chat — Multi-turn extras
   - Inline bar chart for the "infographic" turn
   - Sources panel (replaces PDF viewer when the answer comes from the web)
   - Loading / "Searching the web…" shimmer used during panel transitions
   ──────────────────────────────────────────────────────────────── */

/* Bar chart inside an AI message bubble */
.dc-chart {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
}
.dc-chart-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.dc-chart-sub   { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; }
.dc-chart-row   { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.dc-chart-label {
  width: 130px; font-size: 11px; color: var(--text-secondary);
  flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-chart-bar-wrap {
  flex: 1; height: 20px;
  background: var(--bg-card);
  border-radius: 4px; overflow: hidden;
  position: relative;
}
.dc-chart-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 4px;
  transform-origin: left;
  transform: scaleX(0);
  animation: dc-bar-grow 0.7s cubic-bezier(0.16,1,0.3,1) forwards;
}
.dc-chart-bar.subject {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}
@keyframes dc-bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.dc-chart-val {
  width: 64px; flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Sources panel — replaces the PDF viewport when in sources mode */
.pdf-viewer-pane.sources-mode { background: var(--bg-card); }
.dc-sources-header {
  flex-shrink: 0;
  display: flex; align-items: center;
  gap: 8px;
  padding: 8px 12px;
  height: 44px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.dc-sources-title {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
}
.dc-sources-close {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  width: 26px; height: 26px;
  padding: 0;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.dc-sources-close:hover {
  background: var(--bg-elevated);
  color: var(--accent);
}
.dc-recent-wrap--header { margin-left: auto; margin-bottom: 0; }
.dc-recent-wrap--header .doc-panel-toggle { margin-bottom: 0; }
.dc-sources-show-doc {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.dc-sources-show-doc:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.dc-sources-scroll {
  flex: 1; overflow-y: auto;
  padding: 16px 18px 24px;
}
.dc-sources-list { display: flex; flex-direction: column; gap: 10px; }
.dc-sources-heading {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.dc-source-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.dc-source-item:hover { border-color: var(--accent); background: var(--accent-dim); }
.dc-source-row1 {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px;
}
.dc-source-num {
  width: 18px; height: 18px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10px; font-weight: 800;
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dc-source-name {
  flex: 1; min-width: 0;
  font-size: 12px; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-source-host {
  font-size: 10px; color: var(--text-muted);
  flex-shrink: 0;
}
.dc-source-excerpt {
  font-size: 11.5px; color: var(--text-secondary);
  line-height: 1.5; font-style: italic;
}

/* Right-panel shimmer used during panel mode transitions */
.dc-right-shimmer {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  color: var(--text-muted);
  background: var(--bg-card);
}
.dc-right-shimmer .dc-shimmer-dots { display: flex; gap: 5px; }
.dc-right-shimmer .dc-shimmer-dots span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: dc-shimmer-pulse 1.2s ease-in-out infinite;
}
.dc-right-shimmer .dc-shimmer-dots span:nth-child(2) { animation-delay: 0.15s; }
.dc-right-shimmer .dc-shimmer-dots span:nth-child(3) { animation-delay: 0.30s; }
.dc-shimmer-text { font-size: 12px; font-weight: 500; }
@keyframes dc-shimmer-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40%           { opacity: 1;   transform: scale(1); }
}

/* ────────────────────────────────────────────────────────────────
   Doc Chat — top tab bar + article reader for source tabs
   ──────────────────────────────────────────────────────────────── */
.doc-chat-toolbar .dc-tabs {
  display: flex; align-items: flex-end; gap: 2px;
  flex: 1; min-width: 0; overflow-x: auto;
  scrollbar-width: thin;
}
.doc-chat-toolbar .dc-tabs::-webkit-scrollbar { height: 6px; }
.dc-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0; max-width: 220px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.dc-tab:hover:not(.active) {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}
.dc-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(52,211,153,0.35);
}
.dc-tab .dc-tab-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.dc-tab-close {
  background: none; border: none;
  color: inherit;
  cursor: pointer;
  padding: 0 0 0 4px;
  font-size: 14px; font-weight: 700; line-height: 1;
  opacity: 0.6;
}
.dc-tab-close:hover { opacity: 1; }

/* Article reader (source tabs) */
.dc-article-scroll {
  flex: 1; overflow-y: auto;
  background: var(--bg-elevated);
  padding: 20px 18px 32px;
}
.dc-article {
  max-width: 720px; margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 36px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.dc-article-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text-muted);
  margin-bottom: 10px;
}
.dc-article-source {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 3px 9px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.dc-article-title {
  font-size: 22px; font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.dc-article-section {
  margin-bottom: 22px;
}
.dc-article-section h2 {
  font-size: 14.5px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-light);
}
.dc-article-section p {
  font-size: 13.5px; color: var(--text-secondary);
  line-height: 1.65;
}

/* ────────────────────────────────────────────────────────────────
   PDF loading bar — shown for ~1.4s before the doc renders.
   ──────────────────────────────────────────────────────────────── */
.pdf-loading {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  background: #1a1a1c;
  padding: 24px;
}
.pdf-loading-bar {
  width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.pdf-loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 2px;
  animation: pdf-loading-fill 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes pdf-loading-fill {
  0%   { width: 0%;   }
  60%  { width: 70%;  }
  100% { width: 100%; }
}
.pdf-loading-text {
  font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  max-width: 320px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ────────────────────────────────────────────────────────────────
   Doc Chat — demo suggestion chips above the prompt input.
   Disappear once clicked so the demo progresses in order.
   ──────────────────────────────────────────────────────────────── */
.dc-suggestion-row {
  flex-shrink: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 16px 8px;
  max-width: 720px; margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}
.dc-suggestion-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  font-family: inherit;
  padding: 7px 12px;
  border-radius: 18px;
  cursor: pointer;
  max-width: 100%;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.dc-suggestion-chip:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.dc-suggestion-chip span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* + Doc button (Phase 1 homepage prompt) — hover/focus states */
.uw-doc-btn:hover {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.uw-doc-btn:hover span { color: var(--accent) !important; }
.uw-doc-btn:active { transform: translateY(1px); }

/* ─── Citations ↔ Spine toggle (P1 topnav + P3 chat topbar) ─── */
.topnav-panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  margin-right: 12px;
}
.topnav-panel-toggle-btn {
  width: 30px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.topnav-panel-toggle-btn:hover { color: var(--accent); background: var(--accent-dim); }
.topnav-panel-toggle-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ─── P1 chat: floating right panel (alternate to Citations column) ───
   Two-piece floating object: panel body (left, rounded-left) + tab spine
   (right, rounded-right). The assembly reserves its own column so the
   conversation body stays visible — it doesn't overlay chat content.
   Light-mode surface to match the P1 chat page. */
.floating-panel-assembly {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  margin: 12px 12px 12px 0;
  /* Single soft shadow on the whole assembly — keeps the body↔spine seam
     clean (no dark band between the two pieces). */
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.12));
}
/* When the body is hidden, the spine should only be as tall as its icon
   stack — don't let the parent flex stretch it to full height. */
.floating-panel-assembly.collapsed {
  align-self: flex-start;
}
/* Expand the body when a PDF is open inside the Documents tab so the
   toolbar, page thumbnails, and viewport all fit comfortably. */
.floating-panel-assembly.pdf-open .floating-panel-body {
  width: 720px;
  padding: 0;
  overflow: hidden;
}
/* The Spine reads from theme tokens (--bg-card, --bg-surface, --border,
   --text-*, --accent*) so it follows light/dark automatically. The body
   is one step darker than the spine so the seam is intentional. */
.floating-panel-body {
  width: 320px;
  min-height: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-right: none;
  border-radius: 16px 0 0 16px;
  padding: 20px;
  overflow-y: auto;
  color: var(--text-primary);
}
.floating-panel-spine {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-left: none;
  border-radius: 0 14px 14px 0;
}
/* When collapsed, round all four corners of the spine so it reads as a
   stand-alone vertical icon stack. */
.floating-panel-assembly.collapsed .floating-panel-spine {
  border-left: 1px solid var(--border-light);
  border-radius: 14px;
}
.fp-tab {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  transition: color 0.12s, background 0.12s;
}
.fp-tab:hover { color: var(--text-primary); background: var(--bg-elevated); }
.fp-tab.active {
  color: var(--text-primary);
  background: var(--accent-dim);
}
.fp-tab.active::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--accent);
  border-radius: 1px;
}
.fp-tab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-surface);
  line-height: 1;
}

/* ─── Floating panel content views ─── */
.fp-view { display: flex; flex-direction: column; gap: 14px; }
.fp-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.fp-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Pipeline list */
.fp-list { display: flex; flex-direction: column; gap: 1px; }
.fp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-light);
}
.fp-row:last-child { border-bottom: none; }
.fp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fp-row-text { flex: 1; min-width: 0; }
.fp-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-row-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-row-due {
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Overview stats */
.fp-stat-row { display: flex; gap: 8px; }
.fp-stat {
  flex: 1;
  padding: 12px 10px;
  background: var(--bg-elevated);
  border-radius: 10px;
  text-align: center;
}
.fp-stat-num {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.fp-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fp-summary { display: flex; flex-direction: column; gap: 8px; }
.fp-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.fp-summary-row:last-child { border-bottom: none; }
.fp-summary-val { color: var(--text-primary); font-weight: 600; }

/* Notes */
.fp-notes { display: flex; flex-direction: column; gap: 8px; }
.fp-note {
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 10px;
}
.fp-note-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.fp-note-body {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.fp-note-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Tools */
.fp-tools { display: flex; flex-direction: column; gap: 2px; }
.fp-tool {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.fp-tool i { width: 18px; font-size: 14px; color: var(--text-muted); }
.fp-tool:hover { background: var(--bg-elevated); color: var(--text-primary); }
.fp-tool:hover i { color: var(--text-primary); }

/* Documents */
.fp-doc-list { display: flex; flex-direction: column; gap: 2px; }
.fp-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}
.fp-doc:hover { background: var(--bg-elevated); }
.fp-doc > i {
  width: 18px;
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.fp-doc-text { flex: 1; min-width: 0; }
.fp-doc-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-doc-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-doc-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Citations */
.fp-cite-list { display: flex; flex-direction: column; gap: 8px; }
.fp-cite {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--bg-elevated);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}
.fp-cite:hover { background: var(--accent-dim); }
.fp-cite-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fp-cite-body { flex: 1; min-width: 0; }
.fp-cite-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.fp-cite-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}
.fp-cite-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
}
.fp-cite-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: rgba(234, 88, 12, 0.14);
  color: #ea580c;
  border-radius: 4px;
  font-weight: 600;
}

/* Articles */
.fp-article-list { display: flex; flex-direction: column; gap: 6px; }
.fp-article {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.fp-article:hover { background: var(--bg-elevated); }
.fp-article-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.fp-article-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}
.fp-article-date {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* PDF viewer embedded inside the floating panel body */
.fp-pdf-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.fp-pdf-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fp-pdf-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.fp-pdf-back:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--text-muted); }
.fp-pdf-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.fp-pdf-pane {
  flex: 1;
  min-height: 0;
  border-left: none;
}

/* Images */
.fp-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fp-image {
  position: relative;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elevated);
  aspect-ratio: 4 / 3;
}
.fp-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.fp-image:hover img { transform: scale(1.04); }
.fp-image-cap {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE PREVIEW — iPhone 16 Pro device frame + mobile P3 app styling.
   Followed the document theme tokens so the phone matches dark/light.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Backdrop overlay ── */
.mobile-preview-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(8, 9, 11, 0.74);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  animation: mOverlayIn 0.25s ease;
}
@keyframes mOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.mobile-preview-exit {
  position: absolute; top: 22px; right: 26px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: "Public Sans", -apple-system, system-ui, sans-serif;
}
.mobile-preview-exit:hover { background: rgba(255, 255, 255, 0.16); }
.mobile-device-scaler { transform-origin: center center; }

/* ── iPhone 16 Pro frame ── */
.iphone16 { position: relative; width: 421px; height: 880px; }
.iphone16-frame {
  width: 100%; height: 100%;
  border-radius: 66px; padding: 12px;
  background: linear-gradient(135deg, #e3e3e6 0%, #a9a9ad 22%, #f0f0f2 38%, #8d8d92 58%, #cfcfd3 76%, #9b9b9f 100%);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 2px 4px rgba(255, 255, 255, 0.3) inset;
}
.iphone16-screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 53px; overflow: hidden;
  background: var(--bg-page);
  box-shadow: 0 0 0 3px #060608;
}
.iphone16-island {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 122px; height: 35px; background: #000; border-radius: 19px;
  z-index: 95; pointer-events: auto; cursor: pointer;
}
.iphone16-home {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 138px; height: 5px; border-radius: 3px;
  background: var(--text-primary); opacity: 0.45;
  z-index: 95; pointer-events: none;
}
.ip-btn { position: absolute; border-radius: 2px;
  background: linear-gradient(180deg, #c6c6c9, #8d8d91); }
.ip-action { left: -2px; top: 152px; width: 4px; height: 30px; }
.ip-volup  { left: -2px; top: 200px; width: 4px; height: 56px; }
.ip-voldn  { left: -2px; top: 268px; width: 4px; height: 56px; }
.ip-power  { right: -2px; top: 214px; width: 4px; height: 92px; }

/* ── App shell inside the screen ── */
.m-app {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--bg-page); color: var(--text-primary);
  font-family: var(--unified-font, "Public Sans"), -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
/* Match the desktop P3 workspace "stage": the cool navy canvas (#1B232C) plus
   the same card/border token retint the desktop applies on .workspace-home so
   surfaces stay in the same chromatic family. Dark-only, like the desktop. */
[data-theme="dark"] .m-app,
[data-theme="dark"] .iphone16-screen {
  background: #1B232C;
}
/* ── iOS-style navigation stage: full-screen push/pop between views ── */
.m-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.m-page { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg-page); }
[data-theme="dark"] .m-page { background: #1B232C; }
.m-page--push-in  { z-index: 2; animation: mPgPushIn 0.34s cubic-bezier(0.32,0.72,0,1) both; box-shadow: -12px 0 28px rgba(0,0,0,0.32); }
.m-page--push-out { z-index: 1; animation: mPgPushOut 0.34s cubic-bezier(0.32,0.72,0,1) both; }
.m-page--pop-in   { z-index: 1; animation: mPgPopIn 0.34s cubic-bezier(0.32,0.72,0,1) both; }
.m-page--pop-out  { z-index: 2; animation: mPgPopOut 0.34s cubic-bezier(0.32,0.72,0,1) both; box-shadow: -12px 0 28px rgba(0,0,0,0.32); }
@keyframes mPgPushIn  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes mPgPushOut { from { transform: translateX(0); } to { transform: translateX(-26%); } }
@keyframes mPgPopIn   { from { transform: translateX(-26%); } to { transform: translateX(0); } }
@keyframes mPgPopOut  { from { transform: translateX(0); } to { transform: translateX(100%); } }
[data-theme="dark"] .m-app {
  --bg-card: #212a35;
  --bg-elevated: #29333f;
  --border: #2e3a48;
  --border-light: #243040;
}
.m-statusbar {
  height: 54px; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 30px 5px; font-size: 15px; font-weight: 600;
}
.m-status-time { letter-spacing: 0.3px; }
.m-status-icons { display: flex; gap: 7px; align-items: center; font-size: 14px; }
.m-topbar {
  flex-shrink: 0; height: 48px; display: flex; align-items: center; gap: 8px;
  padding: 0 8px; border-bottom: 1px solid var(--border-light);
}
.m-topbar-title { flex: 1; text-align: center; font-size: 17px; font-weight: 700; }
.m-icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text-primary);
  font-size: 17px; border-radius: 10px; cursor: pointer;
}
.m-icon-btn:active { background: var(--bg-elevated); }
.m-icon-btn--ghost { visibility: hidden; }
.m-screen { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 18px 40px; }
.m-screen::-webkit-scrollbar { width: 0; }

/* ── Home: hero + prompt + chips ── */
.m-hero { padding: 14px 2px 12px; }
.m-greeting { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.m-subline { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.m-subline strong { color: var(--text-primary); }
/* .m-prompt is a static positioning wrapper so the prompt pickers/sheets
   (absolute, inset:0) keep anchoring to .m-app, not the box. The visible
   capsule + rotating glow ring live on .m-prompt-box. */
.m-prompt { margin-top: 6px; position: relative; }
.m-prompt-box {
  position: relative;
  background: var(--bg-card); border: 1px solid var(--accent); border-radius: 20px;
  padding: 12px 14px 10px; box-shadow: var(--card-shadow);
  animation: prompt-glow-rotate 4s linear infinite;
}
/* Rotating conic-gradient ring — same three ChatUWM logo colors + the shared
   @property --prompt-glow-angle and prompt-glow-rotate keyframes as the
   desktop .unified-home .prompt. Fades out (.is-quiet) once the broker taps in. */
.m-prompt-box::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2px;
  background: conic-gradient(from var(--prompt-glow-angle), #5FB041, #2DBAB2, #1F3D7A, #5FB041);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity 0.6s ease-out;
}
.m-prompt-box.is-quiet::before { opacity: 0; }
.m-prompt-input {
  width: 100%; border: none; background: transparent; resize: none;
  color: var(--text-primary); font-family: inherit; font-size: 15px; outline: none;
  line-height: 1.4; max-height: 120px;
}
.m-prompt-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.m-prompt-tools { display: flex; gap: 6px; }
/* Right cluster — Voice paired with Send, mirroring the desktop P3 prompt
   where the soundwave sits immediately left of the submit button. */
.m-prompt-submit { display: flex; align-items: center; gap: 6px; }
.m-prompt-tool {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px;
}
/* All prompt tools are borderless icon buttons (matches the desktop P3
   prompt row) — no resting circle outline; tap/hover gives a soft round tint. */
.m-prompt-tool--plain { border-color: transparent; background: transparent; }
.m-prompt-tool--plain:active,
.m-prompt-tool--plain:hover { background: var(--bg-elevated); }
.m-prompt-send {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; font-size: 14px; cursor: pointer;
}
.m-chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.m-chip-row::-webkit-scrollbar { display: none; }
.m-chip-row--center { flex-wrap: wrap; justify-content: center; overflow: visible; }
.m-chip {
  flex-shrink: 0; white-space: nowrap; font-size: 12.5px; padding: 8px 13px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-secondary); cursor: pointer; font-family: inherit;
}

/* ── Prompt composer extras: logo title, clickable stats, attach chips, Tools, pickers ── */
.m-brand--sm { font-size: 17px; font-weight: 800; }
.m-brand-btn { background: none; border: none; cursor: pointer; padding: 4px 6px; font-family: inherit; }
/* Mobile uses the real ChatUWM logo image, matching the desktop rail. */
.m-brand-img-btn { display: inline-flex; align-items: center; }
.m-brand-img { height: 24px; width: auto; max-width: none; display: block; }
.m-stat-link { background: none; border: none; padding: 0; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.m-prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.m-pchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 12.5px; font-family: inherit; cursor: pointer; }
.m-pchip i { font-size: 11px; }
.m-pchip.is-on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-text); }
.m-pchip-plus { font-weight: 800; color: var(--accent); }
.m-pchip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; margin-left: 1px; }
.m-prompt-tool--wide { width: auto; height: 32px; border-radius: 16px; padding: 0 12px; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }

.m-sheet-wrap { position: absolute; inset: 0; z-index: 80; display: flex; align-items: flex-end; background: rgba(0,0,0,0.45); animation: mFade 0.2s ease; }
@keyframes mFade { from { opacity: 0; } to { opacity: 1; } }
.m-sheet { width: 100%; max-height: 80%; background: var(--bg-surface); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; padding-bottom: 18px; animation: mSheetUp 0.3s cubic-bezier(0.16,1,0.3,1); }
.m-sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 8px auto 2px; }
.m-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 8px 18px; border-bottom: 1px solid var(--border-light); }
.m-sheet-title { font-size: 15px; font-weight: 700; }
.m-sheet-body { overflow-y: auto; padding: 4px 14px; scrollbar-width: none; }
.m-sheet-body::-webkit-scrollbar { display: none; }
.m-sheet-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 4px; border: none; background: transparent; border-bottom: 1px solid var(--border-light); text-align: left; cursor: pointer; font-family: inherit; color: var(--text-primary); }
.m-sheet-row:last-child { border-bottom: none; }
.m-sheet-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.m-sheet-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.m-sheet-row-title { font-size: 14px; font-weight: 600; }
.m-sheet-row-sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ── Anchored popover menu (••• and + actions) ── */
.m-menu { position: absolute; z-index: 120; min-width: 208px; max-width: 86%; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 6px; box-shadow: 0 14px 40px rgba(0,0,0,0.45); transform-origin: top right; animation: mMenuIn 0.14s cubic-bezier(0.22,1,0.36,1); }
@keyframes mMenuIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
.m-menu--topbar { top: 44px; right: 8px; }
.m-menu--prompt { top: calc(100% + 8px); left: 4px; transform-origin: top left; }
.m-menu-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 10px; background: transparent; border: none; cursor: pointer; font-family: inherit; text-align: left; color: var(--text-primary); }
.m-menu-item:active { background: var(--accent-dim); }
.m-menu-item > i { width: 17px; text-align: center; font-size: 14px; color: var(--text-secondary); flex-shrink: 0; }
.m-menu-item.is-danger > i, .m-menu-item.is-danger .m-menu-item-label { color: #f87171; }
.m-menu-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.m-menu-item-label { font-size: 14px; font-weight: 600; }
.m-menu-item-sub { font-size: 11.5px; color: var(--text-muted); }
/* ── Tools slide-out panel (right) — same drawer pattern as the hamburger ── */
.m-tools-cat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 14px 12px 6px; }
.m-tools-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 50; }
.m-tools-scrim.open { opacity: 1; pointer-events: auto; }
.m-tools-panel { position: absolute; top: 0; bottom: 0; right: 0; width: 84%; max-width: 320px; background: var(--bg-surface); z-index: 60; transform: translateX(102%); transition: transform 0.28s cubic-bezier(0.16,1,0.3,1); display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,0.3); }
.m-tools-panel.open { transform: translateX(0); }
.m-tools-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 56px 8px 10px 18px; border-bottom: 1px solid var(--border-light); }
.m-tools-panel-title { font-size: 18px; font-weight: 800; }
.m-tools-panel-body { flex: 1; overflow-y: auto; padding: 2px 8px 16px; scrollbar-width: none; }
.m-tools-panel-body::-webkit-scrollbar { display: none; }
.m-tool-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 10px; border-radius: 10px; border: none; background: transparent; color: var(--text-primary); font-size: 14px; cursor: pointer; font-family: inherit; text-align: left; }
.m-tool-row:active { background: var(--bg-elevated); }
.m-tool-row-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.m-prompt-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 4px; border-bottom: 1px solid var(--border-light); text-align: left; cursor: pointer; color: var(--text-primary); }
.m-prompt-row:last-child { border-bottom: none; }
.m-prompt-row-ic { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.m-prompt-row-text { flex: 1; font-size: 13.5px; line-height: 1.35; }
.m-prompt-pin { background: none; border: none; color: var(--border); cursor: pointer; font-size: 13px; flex-shrink: 0; padding: 4px; transform: rotate(40deg); }
.m-prompt-pin.on { color: var(--accent); transform: rotate(0deg); }

/* ── Chat markdown + citations + sources sheet ── */
.m-bubble .m-md-ul { margin: 6px 0 0; padding-left: 18px; }
.m-bubble .m-md-ul li { margin: 3px 0; }
.m-bubble .m-md-sp { height: 8px; }
.m-cite { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; margin: 0 1px; border-radius: 5px; border: none; background: var(--accent-dim); color: var(--accent-text); font-size: 10px; font-weight: 700; font-family: inherit; cursor: pointer; vertical-align: middle; }
.m-sources-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--accent-text); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.m-seg--sheet { margin: 6px 0 10px; }
.m-ctx-banner { display: flex; align-items: center; gap: 9px; padding: 9px 14px; background: var(--accent-dim); border-bottom: 1px solid var(--border-light); font-size: 12.5px; color: var(--text-secondary); flex-shrink: 0; }
.m-ctx-banner > i { color: var(--accent); font-size: 13px; flex-shrink: 0; }
.m-ctx-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-ctx-text b { color: var(--text-primary); font-weight: 700; }
.m-ctx-clear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; flex-shrink: 0; }
.m-src-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; padding: 12px 13px; margin-bottom: 10px; }
.m-src-head { display: flex; align-items: center; gap: 8px; }
.m-src-num { width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px; background: var(--accent-dim); color: var(--accent-text); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.m-src-name { font-size: 13.5px; font-weight: 700; flex: 1; }
.m-src-bm { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; flex-shrink: 0; }
.m-src-bm.on { color: var(--accent); }
.m-src-ex { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; margin-top: 6px; }
.m-src-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── List search, filter chips, favorites, empty ── */
.m-listsearch { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 9px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; color: var(--text-muted); }
.m-listsearch input { flex: 1; border: none; background: transparent; outline: none; color: var(--text-primary); font-size: 14px; font-family: inherit; }
.m-listsearch-clear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; }
.m-filterchips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.m-filterchips::-webkit-scrollbar { display: none; }
.m-fchip { flex-shrink: 0; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; font-family: inherit; }
.m-fchip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.m-fav { background: none; border: none; color: var(--border); cursor: pointer; font-size: 15px; flex-shrink: 0; }
.m-fav.on { color: #f59e0b; }
.m-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 30px 16px; }

/* ── Conditions screen ── */
.m-cond-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 2px 0 8px; }
.m-cond-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 4px; text-align: center; }
.m-cond-num { font-size: 20px; font-weight: 800; line-height: 1; }
.m-cond-lbl { font-size: 9.5px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }
.m-cond-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.m-cond-head { display: flex; align-items: flex-start; gap: 9px; width: 100%; background: none; border: none; text-align: left; cursor: pointer; font-family: inherit; color: var(--text-primary); padding: 0; }
.m-cond-bar { width: 4px; align-self: stretch; min-height: 30px; border-radius: 2px; flex-shrink: 0; }
.m-cond-text { flex: 1; font-size: 13px; line-height: 1.4; font-weight: 500; }
.m-cond-chev { color: var(--text-muted); font-size: 11px; margin-top: 3px; flex-shrink: 0; }
.m-cond-meta { display: flex; align-items: center; gap: 8px; margin: 8px 0 0 13px; font-size: 11px; }
.m-cond-tag { background: var(--bg-elevated); color: var(--text-muted); font-weight: 700; padding: 1px 6px; border-radius: 4px; font-size: 10px; }
.m-cond-due { color: var(--text-muted); }
.m-cond-body { margin: 10px 0 2px 13px; }
.m-cond-block { margin-bottom: 10px; }
.m-cond-block b { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.m-cond-block p { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); margin: 4px 0 0; }
.m-cond-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Agent admin cards ── */
.m-admin-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 13px; margin-bottom: 10px; }
.m-admin-head { display: flex; align-items: center; gap: 12px; }
.m-admin-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--border-light); }
.m-admin-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.m-admin-dot { width: 7px; height: 7px; border-radius: 50%; }
.m-admin-acts { display: flex; gap: 7px; }

/* ── Inline bar chart + doc pager ── */
.m-barchart { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.m-bar-row { display: flex; align-items: center; gap: 8px; }
.m-bar-label { font-size: 11px; color: var(--text-muted); width: 70px; flex-shrink: 0; }
.m-bar-track { flex: 1; height: 16px; background: var(--bg-elevated); border-radius: 4px; overflow: hidden; }
.m-bar-fill { display: block; height: 100%; border-radius: 4px; }
.m-bar-val { font-size: 11px; font-weight: 700; width: 56px; text-align: right; flex-shrink: 0; color: var(--text-primary); }
.m-doc-page .m-bar-label { color: #666; }
.m-doc-page .m-bar-track { background: #eee; }
.m-doc-page .m-bar-val { color: #1a1a1a; }
.m-doc-pager { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px; border-top: 1px solid var(--border-light); flex-shrink: 0; }
.m-pager-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); cursor: pointer; }
.m-pager-btn:disabled { opacity: 0.4; cursor: default; }
.m-pager-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }

/* ── Chat actions: toast + share fields ── */
.m-toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 90; background: var(--text-primary); color: var(--bg-page); font-size: 13px; font-weight: 600; padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); animation: mFade 0.2s ease; white-space: nowrap; }
.m-share-field { margin-bottom: 12px; }
.m-share-field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 5px; }
.m-share-field input, .m-share-field textarea { width: 100%; border: 1px solid var(--border); background: var(--bg-card); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--text-primary); font-family: inherit; outline: none; resize: none; }
.m-drive-status { display: flex; align-items: center; gap: 9px; padding: 11px 12px; margin: 2px 0 10px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 10px; font-size: 12.5px; color: var(--text-secondary); }
.m-drive-status > i { color: var(--accent); font-size: 14px; flex-shrink: 0; }
.m-drive-status b { color: var(--text-primary); }

/* ── Simulated iOS keyboard ── */
.m-kb {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 85;
  background: #2c2c30;
  padding: 8px 3px 26px;
  display: flex; flex-direction: column; gap: 10px;
  transform: translateY(105%);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.m-kb.open { transform: translateY(0); }
.m-kb-row { display: flex; gap: 6px; justify-content: center; padding: 0 4px; }
.m-kb-row--mid { padding: 0 22px; }
.m-kb-key {
  flex: 1 1 0; min-width: 0; height: 44px; border: none; border-radius: 6px;
  background: #6d6d72; color: #fff; font-size: 18px; font-weight: 400;
  font-family: var(--unified-font, "Public Sans"), -apple-system, system-ui, sans-serif;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.m-kb-key:active { background: #8a8a90; }
.m-kb-key--mod { background: #47474c; flex: 1.3 1 0; font-size: 15px; }
.m-kb-key--mod.is-on { background: #e6e6ea; color: #1a1a1a; }
.m-kb-key--fn { font-size: 14px; }
.m-kb-key--space { flex: 5 1 0; font-size: 15px; }
.m-kb-key--return { flex: 2.2 1 0; font-size: 15px; }
[data-theme="light"] .m-kb { background: #d2d5db; }
[data-theme="light"] .m-kb-key { background: #fff; color: #1a1a1a; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }
[data-theme="light"] .m-kb-key:active { background: #e8e8ea; }
[data-theme="light"] .m-kb-key--mod { background: #abb1bb; }
[data-theme="light"] .m-kb-key--mod.is-on { background: #fff; }
/* When the keyboard is up, shrink the app's content box so bottom-anchored
   inputs (e.g. the chat bar) sit just above it, like a real device. */
.m-app.kb-open { padding-bottom: 240px; }

/* ── Cards ── */
.m-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  margin-top: 18px; overflow: hidden; box-shadow: var(--card-shadow);
}
.m-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border-light);
}
.m-card-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.m-card-title i { color: var(--text-muted); font-size: 13px; }
.m-card-title--label {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.m-card-link {
  font-size: 12.5px; color: var(--accent); background: transparent; border: none;
  cursor: pointer; display: flex; align-items: center; gap: 5px; font-weight: 600; font-family: inherit;
}

/* ── Pipeline "needs attention" rows ── */
.m-attn-row {
  display: grid; grid-template-columns: 20px 1fr auto auto; column-gap: 11px; align-items: center;
  width: 100%; text-align: left; padding: 12px 16px; background: transparent; border: none;
  border-bottom: 1px solid var(--border-light); cursor: pointer; color: var(--text-primary); font-family: inherit;
}
.m-attn-row:last-child { border-bottom: none; }
.m-attn-row--pro { background: var(--green-glow); }
/* Status icon + due date render in the same muted gray as desktop — the
   icon SHAPE carries the tone, not color. */
.m-attn-dot { grid-column: 1; grid-row: 1 / 3; font-size: 15px; text-align: center; color: var(--text-muted); }
/* Colored status dot (matches the insights ACTIVE PIPELINE list) */
.m-attn-dot--tone { width: 9px; height: 9px; border-radius: 50%; align-self: center; justify-self: center; }
.m-attn-name { grid-column: 2; grid-row: 1; font-size: 13.5px; font-weight: 700; }
.m-attn-detail { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--text-secondary); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-attn-due { grid-column: 3; grid-row: 1 / 3; font-size: 11.5px; font-weight: 500; color: var(--text-muted); text-align: right; white-space: nowrap; }
.m-attn-row--pro .m-attn-due { font-weight: 700; }
.m-attn-act { grid-column: 4; grid-row: 1 / 3; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 4px 0 4px 8px; }
.m-sheet-sub { font-size: 12.5px; color: var(--text-muted); padding: 2px 4px 8px; }

/* ── Insights: KPI grid, TRAC, mini rows ── */
.m-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
/* iOS-style horizontal KPI row — full-bleed to the screen edges so cards run
   past the trailing edge, signalling there's more to scroll. */
.m-kpi-row { margin: 14px -18px 0; padding: 0 18px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; }
.m-kpi-row::-webkit-scrollbar { display: none; }
.m-kpi-track { display: flex; gap: 12px; width: max-content; will-change: transform; }
.m-kpi-track .m-kpi { width: 152px; flex-shrink: 0; }
.m-kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 13px; box-shadow: var(--card-shadow); display: block; width: 100%; text-align: left; font-family: inherit; cursor: pointer; }
.m-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
.m-kpi-label { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.m-kpi-value { font-size: 22px; font-weight: 800; margin: 5px 0 3px; color: var(--text-primary); }
.m-kpi-delta { font-size: 12px; font-weight: 600; }
.m-branch-grid { display: grid; grid-template-columns: 1fr 1fr; }
.m-branch-cell { padding: 11px 14px; border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.m-branch-cell:nth-child(2n) { border-right: none; }
.m-branch-cell:nth-last-child(-n+2) { border-bottom: none; }
.m-branch-lbl { font-size: 11px; color: var(--text-muted); }
.m-branch-val { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-top: 3px; }
.m-kpi-detail { padding: 6px 2px 4px; }
.m-kpi-detail-value { font-size: 30px; font-weight: 800; line-height: 1; }
.m-kpi-detail-delta { font-size: 14px; font-weight: 700; margin: 6px 0 2px; }
.m-kpi-detail-sub { font-size: 12.5px; color: var(--text-muted); }
.m-spark { width: 100%; height: 90px; margin-top: 12px; display: block; }
.m-kpi-detail-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }

/* Full-screen KPI detail pager (MKpiCarousel) — covers the whole phone like an
   iOS modal; horizontal scroll-snap pages, dots, chevrons, drag-down dismiss. */
/* Frosted scrim — the Insights home stays visible but blurred behind the pager,
   rather than being fully painted over. */
.m-kpic { position: absolute; inset: 0; z-index: 88; display: flex; flex-direction: column;
  background: rgba(18, 24, 31, 0.55); -webkit-backdrop-filter: blur(22px) saturate(125%);
  backdrop-filter: blur(22px) saturate(125%); animation: mFade 0.2s ease;
  transition: transform 0.18s ease, opacity 0.18s ease; }
[data-theme="dark"] .m-kpic { background: rgba(15, 20, 26, 0.55); }
.m-kpic-head { display: flex; align-items: center; gap: 10px; padding: 64px 14px 18px; flex: none; touch-action: none; }
.m-kpic-done { display: block; margin: auto; padding: 11px 40px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 12px; color: var(--text-primary); font-size: 14px;
  font-weight: 600; font-family: inherit; cursor: pointer; }
.m-kpic-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px; }
.m-kpic-dots { display: flex; gap: 5px; justify-content: center; padding: 16px 0 6px; flex: none; }
.m-kpic-dot { width: 6px; height: 6px; padding: 0; border: none; border-radius: 50%; background: var(--border);
  cursor: pointer; transition: width 0.2s ease, background 0.2s ease; }
.m-kpic-dot.on { width: 18px; border-radius: 999px; background: var(--accent); }
/* flex: 0 0 auto (not 1) so the track's height collapses to its content; with
   align-items: stretch every card then equalizes to the TALLEST card's content
   height instead of stretching to fill the whole screen. */
.m-kpic-track { flex: 0 0 auto; display: flex; align-items: stretch; gap: 14px; margin-top: 4px;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.m-kpic-track::-webkit-scrollbar { display: none; }
/* Pages are narrower than the viewport so the previous/next cards peek at the
   leading/trailing edges, signalling there's more to swipe. */
.m-kpic-page { flex: 0 0 calc(100% - 72px); scroll-snap-align: center; scroll-snap-stop: always;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 18px 18px 24px; }
.m-kpic-page:first-child { margin-left: 16px; }
.m-kpic-page:last-child { margin-right: 16px; }
.m-kpic-bigrow { display: flex; align-items: baseline; gap: 10px; }
.m-kpic-big { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; color: var(--text-primary); }
.m-kpic-delta { font-size: 14px; font-weight: 600; }
.m-kpic-sub { font-size: 12.5px; color: var(--text-muted); margin: 8px 0 4px; }
.m-kpic .m-spark { height: 116px; margin-top: 10px; }
.m-kpic-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin: 4px 0 14px; }
.m-kpic-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0;
  border-top: 1px solid var(--border-light); font-size: 13px; }
.m-kpic-row:first-child { border-top: none; }
.m-kpic-row-k { color: var(--text-secondary); }
.m-kpic-row-v { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.m-kpic-actions { display: flex; gap: 8px; margin-top: 18px; }
.m-kpic-ask { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: var(--bg-page); border: none; border-radius: 12px; padding: 12px;
  font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; }
.m-kpic-drill { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 15px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; }
.m-kpic-about { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border-light);
  font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }

.m-trac { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; margin-top: 12px; box-shadow: var(--card-shadow); }
.m-trac-text { flex: 1; font-size: 13px; font-weight: 700; }
.m-trac-pts { font-size: 14px; font-weight: 800; color: var(--accent); }
.m-pro { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; font-family: inherit; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-top: 10px; box-shadow: var(--card-shadow); }
.m-pro-ic { flex-shrink: 0; font-size: 18px; color: #f59e0b; }
.m-pro-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-pro-tier { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.m-pro-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.m-pro-prog { font-size: 12px; color: var(--text-muted); }
.m-pro-prog strong { color: var(--accent); font-weight: 700; }
.m-pro-cta { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.m-pro-cta i { font-size: 10px; }
.m-mini-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.m-mini-row:last-child { border-bottom: none; }
.m-mini-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.m-mini-name { font-weight: 600; }
.m-mini-note { color: var(--text-muted); font-size: 12px; margin-left: auto; }
.m-rank { width: 16px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.m-mini-vol { font-weight: 800; margin-left: 10px; }
.m-mini-row--tap { cursor: pointer; }
.m-mini-row--tap:active { background: var(--accent-dim); }

/* ── Loan workspace (mobile twin of the desktop FolderPage briefing) ── */
/* Fills the area under the top bar; content scrolls, the prompt docks at bottom. */
.m-loan { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.m-loan-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 18px 16px; display: flex; flex-direction: column; gap: 18px; }
.m-loan-scroll::-webkit-scrollbar { width: 0; }
/* keep children at natural height so the stat grid (overflow:hidden) isn't
   flex-shrunk to zero and clipped */
.m-loan-scroll > * { flex-shrink: 0; }
/* Docked prompt footer at the bottom of the screen */
.m-loan-foot { flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 18px 16px; }
/* Borderless chrome on the loan workspace — no header hairline, no prompt-area line */
.m-app--loan .m-topbar { border-bottom: none; }
.m-loan-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding-top: 6px; }
.m-loan-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 5px; }
.m-loan-title { font-size: 20px; font-weight: 800; color: var(--text-primary); margin: 0; line-height: 1.2; }
.m-loan-num { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.02em; }
.m-loan-sub { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.m-loan-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.m-loan-stat { background: var(--bg-card); padding: 13px 10px; text-align: center; }
.m-loan-stat-val { font-size: 17px; font-weight: 800; color: var(--text-primary); line-height: 1.15; }
.m-loan-stat-lbl { font-size: 9.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 5px; }
/* Collapsed Client Requests — one tappable summary row that opens a detail sheet */
.m-loan-crs-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-family: inherit; }
.m-loan-crs-btn:active { background: var(--bg-elevated); }
.m-loan-crs-btn-ic { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.m-loan-crs-btn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-loan-crs-btn-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.m-loan-crs-btn-sub { font-size: 11.5px; color: var(--text-muted); }
.m-loan-crs-count { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-dim); color: var(--accent); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.m-loan-crs-chev { flex-shrink: 0; font-size: 11px; color: var(--text-muted); }
.m-loan-cr-pill { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.m-loan-cr-dot { width: 6px; height: 6px; border-radius: 50%; }
/* Detail-sheet rows */
.m-loan-cr-full { padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.m-loan-cr-full:last-of-type { border-bottom: none; }
.m-loan-cr-full-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.m-loan-cr-full-ts { font-size: 11px; color: var(--text-muted); }
.m-loan-cr-full-subj { font-size: 13.5px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.m-loan-crs-ask { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 12px; background: var(--accent-dim); color: var(--accent); border: none; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.m-loan-crs-ask:active { background: var(--accent); color: #fff; }
.m-loan-brief { font-size: 13.5px; color: var(--text-secondary); text-align: center; line-height: 1.6; margin: 0; }
.m-loan-bar { display: flex; align-items: center; gap: 8px; }
.m-loan-input { flex: 1; height: 44px; border-radius: 22px; border: 1px solid var(--border); background: var(--bg-card); padding: 0 16px; font-size: 14px; color: var(--text-primary); font-family: inherit; outline: none; }
.m-loan-input:focus { border-color: var(--accent); }
.m-loan-send { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; flex-shrink: 0; }
.m-loan-send:disabled { opacity: 0.45; }
.m-loan-disc { font-size: 11px; color: var(--text-muted); text-align: center; line-height: 1.4; }

/* ── Chat ── */
.m-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.m-chat-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: none; }
.m-chat-msgs::-webkit-scrollbar { display: none; }
.m-bubble { max-width: 84%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.m-bubble p { margin: 0; }
.m-bubble p + p { margin-top: 8px; }
.m-bubble--user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.m-bubble--ai { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-primary); border-bottom-left-radius: 5px; }
.m-chat-empty { margin: auto; text-align: center; color: var(--text-muted); padding: 16px; }
.m-chat-empty-logo { font-size: 26px; font-weight: 800; display: block; margin-bottom: 10px; }
.m-chat-empty p { font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.m-chat-bar { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 8px 12px 14px; border-top: 1px solid var(--border-light); }
.m-chat-input { flex: 1; height: 42px; border-radius: 21px; border: 1px solid var(--border); background: var(--bg-card); padding: 0 16px; font-size: 14px; color: var(--text-primary); font-family: inherit; outline: none; }
.m-chat-voice { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-muted); font-size: 15px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: color 0.15s, border-color 0.15s; }
.m-chat-voice:active { color: var(--accent); border-color: var(--accent); }
.m-chat-send { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; flex-shrink: 0; }
.m-chat-send:disabled { opacity: 0.5; }
.m-thinking { display: inline-flex; gap: 4px; align-items: center; padding: 3px 2px; }
.m-thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: mDot 1.2s infinite ease-in-out; }
.m-thinking span:nth-child(2) { animation-delay: 0.15s; }
.m-thinking span:nth-child(3) { animation-delay: 0.30s; }
@keyframes mDot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ── Doc chat ── */
.m-doc { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.m-doc-card { display: flex; align-items: center; gap: 12px; margin: 12px 14px 0; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; text-align: left; width: calc(100% - 28px); font-family: inherit; }
.m-doc-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(124,58,237,0.15); color: #a78bfa; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.m-doc-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.m-doc-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.m-doc-sub { font-size: 12px; color: var(--text-muted); }
.m-doc-chat { flex: 1; display: flex; min-height: 0; }
.m-doc-chat .m-chat { flex: 1; }
.m-doc-sheet { position: absolute; inset: 0; background: var(--bg-page); z-index: 30; display: flex; flex-direction: column; animation: mSheetUp 0.3s cubic-bezier(0.16,1,0.3,1); }
@keyframes mSheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.m-doc-sheet-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 14px; font-weight: 700; }
.m-doc-sheet-body { flex: 1; overflow-y: auto; padding: 16px; }
.m-doc-page { background: #fff; color: #1a1a1a; border-radius: 8px; padding: 18px 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.m-doc-page-h { font-size: 12px; font-weight: 800; text-align: center; letter-spacing: 0.04em; border-bottom: 2px solid #1a1a1a; padding-bottom: 8px; margin-bottom: 12px; }
.m-doc-page-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid #eee; }
.m-doc-page-row span { color: #666; }
.m-doc-page-sec { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin: 14px 0 6px; color: #333; }

/* ── List screens (notebooks, history, saved, docs, agents, settings) ── */
.m-list { padding-top: 4px; }
.m-list-sec { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 14px 4px 6px; }
.m-list-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border-light); }
.m-list-swatch { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; color: #fff; }
.m-list-main { flex: 1; min-width: 0; }
.m-list-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.m-list-title--clamp { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m-list-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.m-list-chev { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.m-pill-btn { font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); background: transparent; cursor: pointer; flex-shrink: 0; font-family: inherit; }
.m-switch { width: 46px; height: 28px; border-radius: 999px; background: var(--border); border: none; position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.2s; }
.m-switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.m-switch.on { background: var(--accent); }
.m-switch.on span { transform: translateX(18px); }
.m-fullbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 20px; padding: 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.m-fullbtn i { color: var(--accent); }
.m-fullbtn:disabled { opacity: 0.5; cursor: default; }

/* Mobile "Send to Broker Drive" picker — checklist of pending docs with a
   per-doc destination pill; tapping the pill opens a search sheet on top
   (mirrors the desktop DestPicker combobox as a mobile sheet-over-sheet). */
.m-push-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 4px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.m-push-row:last-child { border-bottom: none; }
.m-push-check { flex-shrink: 0; margin-top: 2px; font-size: 17px; color: var(--text-muted); }
.m-push-check.is-checked { color: var(--accent); }
.m-push-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.m-push-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-push-meta { font-size: 11.5px; color: var(--text-muted); margin-top: -3px; }
.m-dest-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; align-self: flex-start; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 11.5px; font-weight: 600; font-family: inherit; cursor: pointer; }
.m-dest-pill.is-changed { border-color: var(--accent); color: var(--accent); }
.m-dest-pill-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Slideout drawer ── */
.m-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 50; }
.m-scrim.open { opacity: 1; pointer-events: auto; }
.m-drawer {
  position: absolute; top: 0; bottom: 0; left: 0; width: 82%; max-width: 312px;
  background: var(--bg-surface); z-index: 60; transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}
.m-drawer.open { transform: translateX(0); }
.m-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 56px 12px 10px 18px; }
.m-brand { font-size: 19px; font-weight: 800; }
.m-brand-chat { color: var(--text-primary); }
.m-brand-uwm { color: var(--accent); }
.m-drawer-search { display: flex; align-items: center; gap: 8px; margin: 4px 14px 10px; padding: 9px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; color: var(--text-muted); }
.m-drawer-search input { border: none; background: transparent; outline: none; color: var(--text-primary); font-size: 14px; font-family: inherit; width: 100%; }
.m-drawer-new { display: flex; align-items: center; gap: 10px; margin: 0 14px 8px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.m-drawer-new i { color: var(--accent); }
.m-drawer-scroll { flex: 1; overflow-y: auto; padding: 4px 8px; scrollbar-width: none; }
.m-drawer-scroll::-webkit-scrollbar { display: none; }
.m-drawer-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 10px; border: none; background: transparent; color: var(--text-primary); font-size: 14.5px; cursor: pointer; font-family: inherit; text-align: left; }
.m-drawer-item i { width: 18px; text-align: center; color: var(--text-muted); font-size: 15px; }
.m-drawer-item:active { background: var(--bg-elevated); }
.m-drawer-sec { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 14px 12px 6px; }
.m-drawer-recent { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: none; background: transparent; color: var(--text-secondary); font-size: 13px; cursor: pointer; font-family: inherit; text-align: left; }
.m-drawer-recent i { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.m-drawer-recent span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-drawer-foot { border-top: 1px solid var(--border-light); padding: 10px 14px 16px; }
.m-seg { display: flex; gap: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.m-seg-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 9px; border: none; background: transparent; color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.m-seg-btn.active { background: var(--accent); color: #fff; }
.m-drawer-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.m-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.m-drawer-user-text { flex: 1; }
.m-drawer-user-name { font-size: 14px; font-weight: 700; }
.m-drawer-user-role { font-size: 12px; color: var(--text-muted); }
.m-drawer-desktop { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.m-drawer-desktop i { color: var(--accent); }

/* ===== Mobile voice conversation (orb of swirling light) ===== */
.m-voice {
  position: absolute; inset: 0; z-index: 130;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 64px 26px 36px;
  background:
    radial-gradient(120% 70% at 50% 22%, rgba(45,186,178,0.12), transparent 62%),
    radial-gradient(110% 60% at 50% 92%, rgba(59,130,246,0.12), transparent 62%),
    var(--bg-page);
  /* ── Entrance choreography ──────────────────────────────────────
     1. The overlay blooms out of the tapped soundwave button via an
        expanding clip-path circle (--vx/--vy are set inline from the
        tap; the default reads as "rising from the prompt bar").
     2. The orb ignites: born as a tiny over-bright spark, springs past
        full size, settles into its breathing loop (.m-voice-stage).
     3. Chrome staggers in: logo and Type/Done pills drop from the top,
        the transcript rises from below.
     All fills are `backwards` so nothing (clip, filter, transform)
     lingers after the entrance — the steady state is untouched. */
  --vx: 50%;
  --vy: 78%;
  animation: mVoiceBloom calc(0.55s * var(--m-voice-speed, 1)) cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
@keyframes mVoiceBloom {
  from { clip-path: circle(14px at var(--vx) var(--vy)); opacity: 0.55; }
  30%  { opacity: 1; }
  to   { clip-path: circle(150% at var(--vx) var(--vy)); opacity: 1; }
}
/* Kept for reuse (voice suggestion pills animate in with this). */
@keyframes mVoiceIn { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.m-voice.is-closing { animation: mVoiceOut calc(0.32s * var(--m-voice-speed, 1)) ease forwards; pointer-events: none; }
@keyframes mVoiceOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.985); } }
/* Orb ignition — composes with .m-voice-stage's own translateY(-50%). */
.m-voice-stage { animation: mOrbIgnite calc(0.9s * var(--m-voice-speed, 1)) cubic-bezier(0.3, 1.2, 0.4, 1) calc(0.1s * var(--m-voice-speed, 1)) backwards; }
@keyframes mOrbIgnite {
  0%   { opacity: 0; transform: translateY(-50%) scale(0.22); filter: brightness(2.4) saturate(1.5); }
  45%  { opacity: 1; }
  70%  { transform: translateY(-50%) scale(1.06); filter: brightness(1.35) saturate(1.15); }
  100% { opacity: 1; transform: translateY(-50%) scale(1); filter: brightness(1) saturate(1); }
}
.m-voice-close { animation: mChromeDrop calc(0.45s * var(--m-voice-speed, 1)) ease calc(0.44s * var(--m-voice-speed, 1)) backwards; }
@keyframes mChromeDrop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.m-voice-logo { animation: mLogoDrop calc(0.45s * var(--m-voice-speed, 1)) ease calc(0.38s * var(--m-voice-speed, 1)) backwards; }
@keyframes mLogoDrop { from { opacity: 0; transform: translateX(-50%) translateY(-12px); } to { opacity: 1; transform: translateX(-50%); } }
.m-voice-transcript { animation: mTranscriptRise calc(0.5s * var(--m-voice-speed, 1)) cubic-bezier(0.22, 1, 0.36, 1) calc(0.3s * var(--m-voice-speed, 1)) backwards; }
@keyframes mTranscriptRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .m-voice { animation: mVoiceIn 0.32s ease backwards; }
  .m-voice-stage, .m-voice-close, .m-voice-logo, .m-voice-transcript { animation: none; }
}
/* Top-bar control — a labeled "Done" pill on mobile so the exit reads as an
   action, not a mystery icon. The desk variant hides the label and keeps its
   original circular icon button. */
.m-voice-close {
  position: absolute; top: 22px; right: 22px;
  height: 34px; padding: 0 13px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.m-voice-brand {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin-top: 4px;
}
.m-voice-logo { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); height: 22px; width: auto; z-index: 2; }
.m-voice-btn-label { font-size: 12px; font-weight: 700; letter-spacing: 0.01em; }
.m-voice-stage { position: absolute; top: 33%; left: 0; right: 0; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; z-index: 0; pointer-events: none; }
.m-voice-orb {
  position: relative; width: 230px; height: 230px;
  display: flex; align-items: center; justify-content: center;
  animation: mOrbBreathe calc(5s * var(--m-voice-speed, 1)) ease-in-out infinite;
}
.m-voice-orb.is-thinking { animation-duration: 2.6s; }
.m-voice-orb.is-speaking { animation-duration: 1.5s; }
@keyframes mOrbBreathe { 0%,100% { transform: scale(0.98); } 50% { transform: scale(1.07); } }
.m-voice-orb::after {
  content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%;
  box-shadow: 0 0 70px 16px rgba(45,186,178,0.30);
  animation: mOrbHalo calc(5s * var(--m-voice-speed, 1)) ease-in-out infinite;
}
@keyframes mOrbHalo { 0%,100% { opacity: 0.45; } 50% { opacity: 0.85; } }
.m-voice-blob {
  position: absolute; top: 50%; left: 50%; border-radius: 50%;
  filter: blur(26px); mix-blend-mode: screen; will-change: transform;
}
.m-voice-blob.b1 { width: 132px; height: 132px; background: radial-gradient(circle, #2dbab2 0%, rgba(45,186,178,0) 70%); animation: mOrbit1 calc(6.5s * var(--m-voice-speed, 1)) linear infinite; }
.m-voice-blob.b2 { width: 120px; height: 120px; background: radial-gradient(circle, #34d399 0%, rgba(52,211,153,0) 70%); animation: mOrbit2 calc(9.5s * var(--m-voice-speed, 1)) linear infinite; }
.m-voice-blob.b3 { width: 112px; height: 112px; background: radial-gradient(circle, #22d3ee 0%, rgba(34,211,238,0) 70%); animation: mOrbit3 calc(7.8s * var(--m-voice-speed, 1)) linear infinite; }
.m-voice-blob.b4 { width: 142px; height: 142px; background: radial-gradient(circle, #3b82f6 0%, rgba(59,130,246,0) 72%); animation: mOrbit4 calc(11s * var(--m-voice-speed, 1)) linear infinite; }
.m-voice-orb.is-speaking .m-voice-blob { animation-duration: 3.4s; }
@keyframes mOrbit1 { from { transform: translate(-50%,-50%) rotate(0deg) translateX(34px); } to { transform: translate(-50%,-50%) rotate(360deg) translateX(34px); } }
@keyframes mOrbit2 { from { transform: translate(-50%,-50%) rotate(120deg) translateX(46px); } to { transform: translate(-50%,-50%) rotate(-240deg) translateX(46px); } }
@keyframes mOrbit3 { from { transform: translate(-50%,-50%) rotate(240deg) translateX(40px); } to { transform: translate(-50%,-50%) rotate(600deg) translateX(40px); } }
@keyframes mOrbit4 { from { transform: translate(-50%,-50%) rotate(60deg) translateX(26px); } to { transform: translate(-50%,-50%) rotate(-300deg) translateX(26px); } }
.m-voice-core {
  position: absolute; top: 50%; left: 50%; width: 84px; height: 84px; border-radius: 50%;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(94,234,212,0.3) 45%, rgba(255,255,255,0) 70%);
  filter: blur(7px); mix-blend-mode: screen;
}
.m-voice-status { font-size: 14px; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.02em; margin-bottom: 10px; }
.m-voice-transcript { position: relative; z-index: 1; min-height: 92px; display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; }
.m-voice-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.m-voice-msg--user { align-self: flex-end; }
.m-voice-msg--ai { align-self: flex-start; }
.m-voice-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; }
.m-voice-avatar--user { display: flex; align-items: center; justify-content: center; background: var(--accent-dark, #1c8f88); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.02em; }
.m-voice-avatar--ai { overflow: hidden; background: var(--bg-elevated); }
.m-voice-avatar--ai img { height: 26px; width: auto; max-width: none; display: block; }
.m-voice-user {
  background: rgba(30,141,135,0.72);
  background: color-mix(in srgb, var(--accent-dark, #1c8f88) 72%, transparent);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  color: #fff;
  border-radius: 18px 18px 5px 18px;
  padding: 9px 14px; font-size: 14px; font-weight: 500; line-height: 1.4; text-align: left;
}
.m-voice-ai {
  background: rgba(41,51,63,0.7);
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  color: var(--text-primary);
  border-radius: 18px 18px 18px 5px;
  padding: 10px 14px; font-size: 14px; line-height: 1.5; text-align: left;
}
.m-voice-cursor { display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 2px; vertical-align: -2px; border-radius: 1px; animation: mCursorBlink 0.9s steps(1) infinite; }
.m-voice-typing { display: inline-flex; align-items: center; gap: 5px; padding: 3px 1px; }
.m-voice-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: mTyping 1.2s infinite ease-in-out; }
.m-voice-typing span:nth-child(2) { animation-delay: 0.18s; }
.m-voice-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes mTyping { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes mCursorBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.m-voice-newchar { animation: mCharIn 0.22s ease both; }
@keyframes mCharIn { from { opacity: 0.12; } to { opacity: 1; } }
/* AI reply streams word-by-word (spoken cadence) — each newest word fades in
   as a unit, in step with the orb pulse fired when it was emitted. */
.m-voice-newword { display: inline-block; animation: mWordIn 0.18s ease both; }
@keyframes mWordIn { from { opacity: 0.15; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
/* Word-pulse wrapper — JS scales this once per spoken word (fast attack, soft
   decay via inline transitions). A separate element so the pulse composes with
   the orb's own mOrbBreathe transform animation instead of overriding it. */
.m-voice-orb-pulse { will-change: transform; }
/* Claude-style generation status ("Thinking…", "Cooking…") — muted text with a
   soft highlight shimmering across it while the reply is being prepared. */
.m-voice-thinking {
  color: transparent;
  background: linear-gradient(90deg, var(--text-muted) 0%, var(--text-muted) 38%, var(--text-primary) 50%, var(--text-muted) 62%, var(--text-muted) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: mThinkShimmer 1.5s linear infinite;
}
@keyframes mThinkShimmer { from { background-position: 200% 0; } to { background-position: -120% 0; } }
.m-voice-controls { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 24px; flex-shrink: 0; }
.m-voice-btn {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 18px; cursor: pointer;
}
.m-voice-btn.is-on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.m-voice-end {
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #ef4444; color: #fff; font-size: 22px;
  box-shadow: 0 10px 28px rgba(239,68,68,0.42);
}
/* Attached-document thumbnail inside the prompt (desktop + mobile) — a small
   doc tile with the filename underneath, expanding the prompt's height. */
.doc-attach { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.doc-attach-card { position: relative; width: 92px; display: flex; flex-direction: column; gap: 6px; }
.doc-attach-thumb {
  position: relative; width: 92px; height: 104px; border-radius: 10px;
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.doc-attach-thumb > i { font-size: 30px; color: var(--text-muted); }
.doc-attach-ext {
  position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em;
  color: var(--accent); background: var(--accent-dim); border-radius: 4px; padding: 2px 6px;
}
.doc-attach-name {
  font-size: 11px; color: var(--text-secondary); line-height: 1.3; width: 92px;
  word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.doc-attach-x {
  position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-page); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 2; padding: 0;
}

/* Voice follow-up suggestion bubbles (replace the controls once the AI answers) */
.m-voice-suggestions { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 24px; flex-shrink: 0; }
.m-voice-suggestion {
  width: 100%; padding: 13px 16px; border-radius: 16px;
  background: rgba(33,42,53,0.72);
  background: color-mix(in srgb, var(--bg-card) 72%, transparent);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  border: 1px solid var(--border);
  color: var(--text-primary); font-size: 14px; font-weight: 500; font-family: inherit;
  text-align: left; line-height: 1.35; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  animation: mVoiceIn 0.3s ease;
}
.m-voice-suggestion:hover, .m-voice-suggestion:active { border-color: var(--accent); background: var(--accent-dim); }
.m-voice-hint { margin-top: 14px; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }

/* ── Desktop voice mode (.m-voice--desk) ────────────────────────────
   Same component, script, and animations as the mobile voice overlay,
   scaled to the full viewport: fixed above every in-app layer, a larger
   orb with its own orbit radii (the blob offsets live in keyframes, so
   the desk size needs desk orbits to keep proportions), and a centered
   ~680px conversation column so bubbles and suggestion pills don't
   stretch across the monitor. */
.m-voice--desk {
  position: fixed;
  z-index: 8000; /* above all app chrome (≤300); below the 9000 mobile-preview overlay */
  padding: 84px clamp(24px, 8vw, 140px) 56px;
}
.m-voice--desk .m-voice-logo { top: 34px; height: 26px; }
.m-voice--desk .m-voice-close { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 16px; transition: border-color 0.15s, color 0.15s; }
.m-voice--desk .m-voice-btn-label { display: none; } /* label is mobile-only */
.m-voice--desk .m-voice-close { top: 28px; right: 32px; }
.m-voice--desk .m-voice-close:hover { border-color: var(--accent); color: var(--accent); }
.m-voice--desk .m-voice-stage { top: 36%; }
.m-voice--desk .m-voice-orb { width: 320px; height: 320px; }
.m-voice--desk .m-voice-orb::after { width: 210px; height: 210px; box-shadow: 0 0 96px 22px rgba(45,186,178,0.30); }
.m-voice--desk .m-voice-blob { filter: blur(34px); }
.m-voice--desk .m-voice-blob.b1 { width: 184px; height: 184px; animation-name: dOrbit1; }
.m-voice--desk .m-voice-blob.b2 { width: 168px; height: 168px; animation-name: dOrbit2; }
.m-voice--desk .m-voice-blob.b3 { width: 156px; height: 156px; animation-name: dOrbit3; }
.m-voice--desk .m-voice-blob.b4 { width: 198px; height: 198px; animation-name: dOrbit4; }
.m-voice--desk .m-voice-core { width: 118px; height: 118px; filter: blur(10px); }
@keyframes dOrbit1 { from { transform: translate(-50%,-50%) rotate(0deg) translateX(48px); } to { transform: translate(-50%,-50%) rotate(360deg) translateX(48px); } }
@keyframes dOrbit2 { from { transform: translate(-50%,-50%) rotate(120deg) translateX(64px); } to { transform: translate(-50%,-50%) rotate(-240deg) translateX(64px); } }
@keyframes dOrbit3 { from { transform: translate(-50%,-50%) rotate(240deg) translateX(56px); } to { transform: translate(-50%,-50%) rotate(600deg) translateX(56px); } }
@keyframes dOrbit4 { from { transform: translate(-50%,-50%) rotate(60deg) translateX(36px); } to { transform: translate(-50%,-50%) rotate(-300deg) translateX(36px); } }
.m-voice--desk .m-voice-transcript { max-width: 680px; margin: 0 auto; gap: 14px; }
.m-voice--desk .m-voice-msg { max-width: 86%; gap: 10px; }
.m-voice--desk .m-voice-avatar { width: 30px; height: 30px; }
.m-voice--desk .m-voice-avatar--ai img { height: 30px; }
.m-voice--desk .m-voice-user { font-size: 15px; padding: 10px 16px; }
.m-voice--desk .m-voice-ai { font-size: 15px; padding: 12px 16px; }
.m-voice--desk .m-voice-suggestions {
  max-width: 680px; margin-left: auto; margin-right: auto;
  flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.m-voice--desk .m-voice-suggestion { width: auto; padding: 12px 20px; border-radius: 999px; font-size: 14px; }
.m-voice--desk .m-voice-hint { margin-top: 18px; }

/* ═══════════════════════════════════════════════════════════════════════
   WORKSPACE ACTION BOARD — stat-link in-place takeover on the P3 home.
   The greeting sentence stays; .ws-below (everything under it) fades out
   and the board fades in. Sections FLIP-reorder when the links retab.
   ═══════════════════════════════════════════════════════════════════════ */
.workspace-home .ws-below {
  /* Mirror .ws-main's flex column (28px gap) — this wrapper swallowed the
     prompt / disclaimer / grid into one flex child, so it must recreate the
     spacing .ws-main's gap used to put between them. */
  display: flex; flex-direction: column; gap: 28px;
}
/* Transition lives on a transient class (applied only while the board fade
   choreography runs) — a STANDING transform/opacity transition on this
   ancestor makes Safari freeze the prompt's @property glow animation. */
.workspace-home .ws-below.is-anim { transition: opacity 0.22s ease, transform 0.22s ease; }
.workspace-home .ws-below.is-faded { opacity: 0; transform: translateY(10px); pointer-events: none; }
/* Stat links double as board tabs: active = underline, handled = accent. */
.workspace-home .ws-stat-link.is-active {
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.workspace-home .ws-stat-link.is-handled { color: var(--accent); }

.workspace-home .ws-action-board {
  /* Match .ws-hero / .ws-prompt (944px) so the board owns the same column
     as the greeting sentence that opened it — not the narrower pipeline grid. */
  max-width: 944px; margin: 0 auto; width: 100%;
  padding: 6px 0 60px;
  animation: abIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.workspace-home .ws-action-board.is-closing { animation: abOut 0.2s ease both; pointer-events: none; }
@keyframes abIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes abOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px); } }

/* Exit affordance — breadcrumb-style back link, not a modal X. */
.ab-back {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; padding: 0; margin-bottom: 12px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; font-family: inherit;
  transition: color 0.12s;
}
.ab-back i { font-size: 11px; transition: transform 0.15s; }
.ab-back:hover { color: var(--text-primary); }
.ab-back:hover i { transform: translateX(-3px); }
.ab-back-kbd {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-muted); background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px 2px;
}
.ab-lead { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.ab-lead-text { flex: 1; font-size: 14px; line-height: 1.5; color: var(--text-secondary); margin: 0; }

/* ── Shortcuts board on mobile (P3 Mobile) ─────────────────────────
   Reuses the desktop WorkspaceActionBoard verbatim inside a phone
   screen. The board's own breadcrumb-back is hidden (the top bar owns
   Back), and each card stacks vertically so the primary + Chat buttons
   sit full-width under the copy instead of crowding a narrow row. */
.m-shortcuts { padding: 14px 16px 40px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.m-shortcuts .ws-action-board { width: 100%; animation: abIn 0.3s cubic-bezier(0.16,1,0.3,1) both; }
.m-shortcuts .ab-back { display: none; }
.m-shortcuts .ab-lead { margin-bottom: 14px; }
.m-shortcuts .ab-lead-text { font-size: 13px; }
.m-shortcuts .ab-section-head { padding: 13px 15px; }
.m-shortcuts .ab-section-title { font-size: 14px; }
.m-shortcuts .ab-card { flex-direction: column; align-items: stretch; gap: 12px; }
.m-shortcuts .ab-card-side { flex-direction: row; align-items: stretch; }
.m-shortcuts .ab-card-side .ab-approve { flex: 1; white-space: normal; justify-content: center; text-align: center; }

.ab-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; margin-bottom: 12px; overflow: hidden;
}
.ab-section-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 18px; background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: left; transition: background 0.12s;
}
.ab-section-head:hover { background: var(--bg-elevated); }
.ab-section-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.ab-section-icon--warn { background: rgba(245,158,11,0.14); color: #f59e0b; }
.ab-section-icon--info { background: rgba(59,130,246,0.14); color: #60a5fa; }
.ab-section-icon--ok   { background: rgba(16,185,129,0.14); color: #10b981; }
.ab-section-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.ab-section-meta {
  flex: 1; font-size: 12.5px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ab-section-meta .fa-check { color: var(--accent); margin-right: 5px; }
.ab-section-chev { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; }
.ab-section-chev.is-open { transform: rotate(180deg); }
.ab-section-body { padding: 2px 14px 14px; display: flex; flex-direction: column; gap: 10px; }

.ab-card {
  background: var(--bg-page); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  /* Two columns: content on the left, the primary Approve docked to the
     right (vertically centered) so the consent action never sinks below
     long copy. Secondaries stay in the content column's action row. */
  display: flex; align-items: stretch; gap: 18px;
}
.ab-card-main { flex: 1; min-width: 0; }
.ab-card-side {
  /* Horizontal pair: Approve primary with Chat trailing it, centered as a
     unit against the card content. */
  display: flex; flex-direction: row; justify-content: center;
  align-items: center; gap: 8px; flex-shrink: 0;
}
.ab-card-side .ab-approve { justify-content: center; }
.ab-card-side .ab-chat { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.ab-card--done { border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.05); display: block; }
.ab-card-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ab-card-borrower { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.ab-card-loan { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ab-card-tag { font-size: 12px; color: var(--text-muted); }
.ab-headline { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.ab-sub { margin-top: 5px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.ab-checklist { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ab-checklist li { font-size: 13px; color: var(--text-secondary); display: flex; align-items: baseline; gap: 8px; }
.ab-checklist li i { font-size: 11px; color: var(--text-muted); }

.ab-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ab-approve {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: var(--bg-page);
  border: none; border-radius: 9px; padding: 9px 16px;
  font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, filter 0.12s;
}
.ab-approve:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ab-secondary {
  background: none; border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 12px; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); font-family: inherit; cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.ab-secondary:hover, .ab-secondary.is-open { border-color: var(--accent); color: var(--accent); }

.ab-extra {
  margin-top: 10px; border: 1px solid var(--border-light); border-radius: 10px;
  padding: 10px; background: var(--bg-elevated);
  display: flex; flex-direction: column; gap: 6px;
  animation: abExtraIn 0.18s ease both;
}
@keyframes abExtraIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.ab-extra-text, .ab-draft { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.ab-draft { font-style: italic; }
.ab-option {
  display: grid; grid-template-columns: 14px 56px auto 1fr; align-items: center; gap: 10px;
  text-align: left; background: var(--bg-page); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 12px; cursor: pointer; font-family: inherit;
  transition: border-color 0.12s;
}
.ab-option:hover { border-color: var(--accent); }
.ab-option.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ab-option-radio { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); }
.ab-option.is-selected .ab-option-radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2.5px var(--bg-page); }
.ab-option-label { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.ab-option-cost { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.ab-option-note { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-mini-send {
  align-self: flex-start; background: none; border: 1px solid var(--accent);
  color: var(--accent); border-radius: 8px; padding: 6px 11px;
  font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.ab-mini-send:hover { background: var(--accent-dim); }
.ab-mini-done { font-size: 12px; font-weight: 600; color: var(--accent); }

/* Compose — editable draft before a message-type action sends. Same slide-
   down entrance as .ab-extra so opening it reads as part of the same
   "card reveals its next step" language. */
.ab-compose {
  margin-top: 12px; display: flex; flex-direction: column; gap: 9px;
  animation: abExtraIn 0.18s ease both;
}
.ab-compose textarea {
  width: 100%; min-height: 88px; resize: vertical; box-sizing: border-box;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; line-height: 1.55; color: var(--text-primary);
  font-family: inherit; outline: none; transition: border-color 0.12s;
}
.ab-compose textarea:focus { border-color: var(--accent); }
.ab-compose-actions { display: flex; align-items: center; gap: 8px; }

/* Confirm — one-line consent check before an internal/system action fires
   (lock-desk submission, booking a closing, wiring instructions). */
.ab-confirm {
  margin-top: 12px; padding: 12px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px;
  animation: abExtraIn 0.18s ease both;
}
.ab-confirm-text { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; line-height: 1.4; }
.ab-confirm-actions { display: flex; align-items: center; gap: 8px; }

/* Loading — the "slight moment" between committing and the receipt. Reuses
   the app's existing spin keyframe. */
.ab-loading { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 6px 2px; }
.ab-loading--mini { margin-top: 0; padding: 0; }
.ab-spinner {
  width: 15px; height: 15px; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.ab-loading-text { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }

.ab-receipt-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.ab-receipt-title i { color: #10b981; font-size: 15px; }
.ab-receipt-line { margin-top: 5px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; padding-left: 23px; }

/* Post-approval badge on pipeline rows — proof the action landed. */
.ws-attention-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px;
  font-size: 10.5px; font-weight: 700; color: #10b981;
  background: rgba(16,185,129,0.12); border-radius: 999px; padding: 2px 8px;
  white-space: nowrap; flex-shrink: 0;
}
