  :root {
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --primary: 240 5.9% 10%;
    --primary-foreground: 0 0% 98%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;
    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;
    --ring: 240 5.9% 10%;
    --radius: 0.5rem;
    --kbd: 0px;
  }
  .dark {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 5%;
    --card-foreground: 0 0% 98%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 15.9%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --muted: 240 3.7% 10%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 12%;
    --accent-foreground: 0 0% 98%;
    --ring: 240 4.9% 83.9%;
  }

  * { box-sizing: border-box; }
  html, body { height: 100%; height: 100dvh; margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; overscroll-behavior-x: none; }
  body { background: hsl(var(--background)); color: hsl(var(--foreground)); }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 99px; }

  /* Spinner animation */
  @keyframes spin { to { transform: rotate(360deg); } }
  .animate-spin { animation: spin 0.8s linear infinite; }

  /* Typing dots */
  @keyframes blink { 0%,80%,100%{opacity:.2;transform:translateY(0)} 40%{opacity:1;transform:translateY(-3px)} }
  .dot { display:inline-block; width:5px; height:5px; border-radius:50%; background:hsl(var(--muted-foreground)); animation:blink 1.2s ease-in-out infinite; }
  .dot:nth-child(2){animation-delay:.2s}
  .dot:nth-child(3){animation-delay:.4s}

  /* Prose in AI bubbles */
  .prose p { margin: 0 0 .6em; line-height: 1.7; }
  .prose p:last-child { margin-bottom: 0; }
  .prose h1,.prose h2,.prose h3 { font-weight: 600; margin: .9em 0 .3em; }
  .prose h1 { font-size: 1.1em; }
  .prose h2 { font-size: 1em; }
  .prose h3 { font-size: .95em; }
  .prose ul,.prose ol { margin: .4em 0 .6em 1.2em; }
  .prose li { margin-bottom:.2em; line-height:1.6; }
  .prose code { font-family:'Cascadia Code','Fira Code','Consolas',monospace; font-size:.82em; padding:1px 5px; border-radius:4px; background:hsl(var(--muted)); }
  .prose pre { margin:.5em 0; border-radius:8px; overflow:auto; }
  .prose pre code { background:transparent; padding:0; }
  .prose blockquote { border-left:3px solid hsl(var(--border)); padding-left:12px; margin:.4em 0; color:hsl(var(--muted-foreground)); }
  .prose strong { font-weight:600; }
  .prose a { text-decoration:underline; color:hsl(var(--primary)); }
  /* Tables */
  .prose table { width:100%; border-collapse:collapse; font-size:.83em; margin:.5em 0; }
  .prose th { font-weight:600; text-align:left; padding:7px 10px; background:hsl(var(--muted)); border:1px solid hsl(var(--border)); }
  .prose td { padding:6px 10px; border:1px solid hsl(var(--border)); }
  .prose tr:nth-child(even) td { background:hsl(var(--muted) / .4); }
  .prose td[align="right"], .prose th[align="right"] { text-align: right; font-variant-numeric: tabular-nums; }
  .prose .who {
    border: 1px solid hsl(var(--border)); border-radius: 12px; overflow: hidden;
    margin: .15em 0 .2em; container-type: inline-size;
  }
  .prose .who-head { padding: 14px 16px 12px; border-bottom: 1px solid hsl(var(--border)); }
  .prose .who-name { font-size: 1.05em; font-weight: 650; letter-spacing: -.01em; }
  .prose .who-status { margin-top: 3px; color: hsl(var(--muted-foreground)); font-size: .92em; line-height: 1.45; }
  .prose .who-cols { display: grid; grid-template-columns: 1fr; }
  .prose .who-col { padding: 12px 16px 14px; }
  .prose .who-col + .who-col { border-top: 1px solid hsl(var(--border)); }
  @container (min-width: 560px) {
    .prose .who-cols { grid-template-columns: 1fr 1fr; }
    .prose .who-col + .who-col { border-top: 0; border-left: 1px solid hsl(var(--border)); }
  }
  .prose .who-kicker {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: hsl(var(--muted-foreground)); margin-bottom: 6px;
  }
  .prose .who-row {
    display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 8px;
    padding: 5px 0; font-size: .92em; line-height: 1.4;
  }
  .prose .who-row > span:first-child { color: hsl(var(--muted-foreground)); }
  .prose .who-row > span:last-child { overflow-wrap: anywhere; }
  .prose .who-acct + .who-acct { margin-top: 10px; padding-top: 10px; border-top: 1px solid hsl(var(--border)); }
  .prose .who-acct-name { font-weight: 650; margin-bottom: 2px; }
  .prose .who-chip {
    display: inline-block; margin: 0 4px 4px 0; padding: 1px 7px; border-radius: 999px;
    background: hsl(var(--muted)); font-size: .86em;
  }
  .prose .who-title { display: block; }
  .prose .who-empty { color: hsl(var(--muted-foreground)); }
  .prose .who-note {
    padding: 12px 16px; border-top: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / .45); font-size: .92em; line-height: 1.5;
  }
  .prose .who-note strong {
    display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: hsl(var(--muted-foreground));
  }

  /* Sidebar: desktop rail + mobile drawer */
  #sidebar {
    width: 224px;
    overflow: hidden;
    transition: width .2s ease, transform .22s ease;
  }
  #sidebar-brand,
  #sidebar > .sidebar-account {
    flex-shrink: 0;
  }
  #sidebar > nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(0,0,0,.48);
  }
  #nav-toggle { display: none; }
  #nav-peek, #nav-edge { display: none; }
  .sidebar-close { display: none; }
  .sidebar-collapse { display: none; }
  .nav-label { min-width: 0; }
  .ask-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 36rem; text-align: left; }
  .ask-card {
    border-radius: 14px; border: 1px solid hsl(var(--border));
    padding: 14px 14px 12px; background: hsl(var(--card));
    transition: border-color .15s ease;
  }
  .ask-card:hover { border-color: hsl(var(--ring)); }
  .ask-card-green { background: rgba(16, 185, 129, .14); }
  .ask-card-rose { background: rgba(244, 63, 94, .12); }
  .ask-card-amber { background: rgba(245, 158, 11, .14); }
  .ask-card-sky { background: rgba(14, 165, 233, .14); }
  .ask-helpful {
    display: flex; align-items: center; gap: 4px;
    margin-top: 8px; font-size: 12px; color: hsl(var(--muted-foreground));
  }
  .ask-helpful-btn {
    width: 26px; height: 26px; border-radius: 8px; border: 0;
    color: inherit; background: transparent;
  }
  .ask-helpful-btn:hover, .ask-helpful-btn.is-on {
    color: hsl(var(--foreground)); background: hsl(var(--accent));
  }
  .ask-form { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; max-width: 36rem; }
  .ask-form-h { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
  .ask-form-opt {
    display: block; width: 100%; text-align: left;
    padding: 10px 12px; margin-bottom: 6px;
    border-radius: 12px; border: 1px solid hsl(var(--border));
    background: hsl(var(--card)); color: hsl(var(--foreground));
    font-size: 14px; cursor: pointer;
  }
  .ask-form-opt.is-on { border-color: hsl(var(--ring)); background: hsl(var(--accent)); }
  .ask-form-opt:disabled { cursor: default; }
  .ask-form-custom {
    display: block; width: 100%; margin: 0 0 6px;
    padding: 8px 12px; border-radius: 12px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background)); color: hsl(var(--foreground));
    font-size: 14px;
  }
  .ask-form-custom.hidden { display: none; }
  .ask-form-submit {
    align-self: flex-start;
    padding: 8px 16px; border-radius: 10px; border: 0;
    background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
    font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .ask-form-submit:disabled { opacity: .45; cursor: not-allowed; }
  @media (max-width: 640px) { .ask-cards { grid-template-columns: 1fr; } }
  a.powered-by, .powered-by a { color: inherit; text-decoration: none; }
  a.powered-by:hover, .powered-by a:hover { color: hsl(var(--foreground)); }
  a.powered-by {
    display: block;
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.3;
    color: hsl(var(--muted-foreground));
  }
  .nav-group { padding-top: 8px; }
  .nav-group + .nav-group { margin-top: 2px; }
  .nav-group-label {
    padding: 4px 10px 2px;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
  }
  .work-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .work-tab { flex-shrink: 0; }

  @media (min-width: 900px) {
    .sidebar-collapse { display: inline-flex; }
    body.nav-collapsed .sidebar-collapse { display: none; }
    body.nav-collapsed #sidebar-brand { cursor: pointer; }
    body.nav-collapsed #sidebar { width: 64px; }
    body.nav-collapsed .nav-label,
    body.nav-collapsed .brand-copy,
    body.nav-collapsed #footer-username,
    body.nav-collapsed #footer-db-label,
    body.nav-collapsed #sidebar-recents,
    body.nav-collapsed .nav-badge,
    body.nav-collapsed .nav-group-label,
    body.nav-collapsed .powered-by { display: none !important; }
    body.nav-collapsed .nav-item {
      justify-content: center;
      padding-left: 0;
      padding-right: 0;
    }
    body.nav-collapsed #sidebar-brand { justify-content: center; padding-left: 12px; padding-right: 12px; }
    body.nav-collapsed #sidebar-footer { justify-content: center; }
  }

  @media (max-width: 899px) {
    #nav-toggle { display: none !important; }
    .sidebar-close { display: inline-flex; }
    #sidebar {
      position: fixed;
      top: 0; left: 0; bottom: 0;
      z-index: 70;
      width: min(288px, 86vw);
      transform: translateX(-105%);
      padding-bottom: env(safe-area-inset-bottom);
      box-shadow: none;
      overflow: hidden;
      touch-action: pan-y;
    }
    body.nav-open #sidebar,
    body.nav-dragging #sidebar {
      box-shadow: 16px 0 40px rgba(0,0,0,.28);
    }
    body.nav-open #sidebar {
      transform: translateX(0);
    }
    body.nav-dragging #sidebar { transition: none !important; }
    #nav-backdrop {
      display: block;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease;
    }
    body.nav-open:not(.nav-dragging) #nav-backdrop {
      opacity: 1;
      pointer-events: auto;
    }
    body.nav-dragging #nav-backdrop {
      pointer-events: auto;
      transition: none;
    }
    body.nav-open, body.nav-dragging { overflow: hidden; }
    #nav-peek {
      display: flex;
      position: fixed;
      left: 0;
      top: 46%;
      z-index: 72;
      width: 22px;
      height: 72px;
      margin: 0;
      padding: 0;
      align-items: center;
      justify-content: center;
      border-radius: 0 10px 10px 0;
      background: hsl(var(--card));
      border: 1px solid hsl(var(--border));
      border-left: none;
      color: hsl(var(--muted-foreground));
      box-shadow: 4px 0 16px rgba(0,0,0,.18);
      touch-action: none;
    }
    body.nav-open #nav-peek,
    body.nav-dragging #nav-peek { display: none; }
    #nav-edge {
      display: block;
      position: fixed;
      left: 0; top: 0; bottom: 0;
      width: 16px;
      z-index: 64;
      touch-action: none;
    }
    body.nav-open #nav-edge { display: none; }
    #app-header { padding-left: 10px; padding-right: 10px; }
    #chat-title, #chat-title.ask-title { max-width: 28vw; }
    #workspace-label { max-width: 28vw !important; }
    #brief-body, #help-body, #wash-body, #club-body, #wallet-body, #bill-body, #offer-body, #journey-body, #marketing-body { padding: 16px; }
    #settings-body { padding: 16px; }
    #input-bar-wrapper { padding-bottom: max(12px, calc(env(safe-area-inset-bottom) + var(--kbd, 0px))); }
    @media (display-mode: standalone) {
      #app-header { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
    }
    #compare-panes { flex-direction: column; }
    #compare-toolbar { flex-wrap: wrap; }
    .help-table td:first-child { width: 40%; }
    .hdr-action { padding: 0 8px; }
    #chart-detail-backdrop { padding: 12px; }
    #chart-detail-box { max-width: 100%; }
    .kbd-hint { display: none; }
    #sidebar { overscroll-behavior: contain; }
    #help-btn { display: none; }
  }

  /* Rooms */
  .room { display: none; flex: 1; min-height: 0; min-width: 0; flex-direction: column; }
  body.room-brief #brief-room,
  body.room-ask #ask-room,
  body.room-work #work-room,
  body.room-wash #wash-room,
  body.room-club #club-room,
  body.room-wallet #wallet-room,
  body.room-bill #bill-room,
  body.room-offer #offer-room,
  body.room-board #board-room,
  body.room-insights #insights-room,
  body.room-marketing #marketing-room,
  body.room-churn #churn-room,
  body.room-flows #flows-room,
  body.room-workers #workers-room,
  body.room-journey #journey-room,
  body.room-settings #settings-room,
  body.room-help #help-room,
  body.room-tickets #tickets-room { display: flex; }
  .board-only { display: none !important; }
  body.room-board .board-only { display: inline-flex !important; }
  .board-fill {
    min-height: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .board-fill .board-grid { flex: 1; }
  .board-pick { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
  .board-grid {
    display: grid;
    gap: 14px;
    min-height: 260px;
    grid-template-columns: repeat(var(--board-cols, 1), minmax(0, 1fr));
    grid-auto-rows: minmax(240px, 1fr);
  }
  .board-tile {
    position: relative;
    min-width: 0;
    min-height: 240px;
    width: auto;
    height: auto;
    border-radius: 20px;
    overflow: hidden;
  }
  .board-kpi {
    font-size: clamp(2.25rem, 4.4vw, 3.5rem);
    line-height: 1;
  }
  .board-grid[data-count="1"] .board-kpi { font-size: clamp(4.5rem, 12vw, 8rem); }
  .board-grid[data-count="2"] .board-kpi { font-size: clamp(3.5rem, 8vw, 6rem); }
  .board-grid[data-count="3"] .board-kpi { font-size: clamp(2.75rem, 5.5vw, 4.75rem); }
  .board-grid[data-count="4"] .board-kpi { font-size: clamp(2.5rem, 4.5vw, 4rem); }
  @media (max-width: 639px) {
    .board-grid { gap: 10px; }
    .board-grid[data-count="1"] .board-kpi { font-size: clamp(3.5rem, 18vw, 5.5rem); }
    .board-grid[data-count="2"] .board-kpi { font-size: clamp(2.75rem, 14vw, 4rem); }
  }
  .board-tile-plot {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 44px;
    bottom: 8px;
    overflow: hidden;
    width: auto !important;
    height: auto !important;
  }
  .board-draft .board-tile-plot { bottom: 52px; }
  .board-tile-plot .js-plotly-plot,
  .board-tile-plot .plot-container,
  .board-tile-plot .svg-container,
  .board-tile-plot .main-svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
  }
  .desk-bar { height: 96px; display: flex; align-items: flex-end; gap: 6px; }
  .desk-bar i { flex: 1; display: block; border-radius: 3px 3px 0 0; background: hsl(var(--foreground) / .18); min-height: 3px; }
  .desk-bar i.today { background: hsl(var(--foreground)); }
  .desk-bar i.empty { background: hsl(var(--border)); }
  .desk-bar-sm { height: 36px; margin-top: 6px; }
  .desk-bar-sm i { background: hsl(var(--foreground) / .38); }
  .desk-bar-sm i.today { background: hsl(var(--foreground) / .82); }
  .m-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: hsl(var(--border)); }
  .m-bar i { display: block; height: 100%; background: hsl(var(--foreground) / .72); transition: width .45s ease; }
  .m-bar i.soft { background: hsl(var(--foreground) / .28); }
  .m-count { font-variant-numeric: tabular-nums; }
  @media (prefers-reduced-motion: reduce) {
    .m-bar i { transition: none; }
  }
  .m-strip { display: flex; flex-wrap: wrap; gap: 8px; }
  .m-chip {
    min-width: 7.5rem; text-align: left; padding: 8px 10px; border-radius: 12px;
    border: 1px solid transparent; background: transparent; color: inherit;
  }
  .m-chip.is-on { border-color: hsl(var(--border)); background: hsl(var(--accent)); }
  .m-chip b { display: block; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
  .m-chip span { display: block; margin-top: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .m-people { margin-top: 8px; }
  .m-person {
    display: grid; grid-template-columns: 1.2fr .9fr .9fr .9fr 1.1fr; gap: 8px; align-items: start;
    width: 100%; text-align: left; padding: 10px 2px; border: 0; border-top: 1px solid hsl(var(--border));
    background: transparent; color: inherit;
  }
  .m-person:hover { background: hsl(var(--accent)); }
  .m-person.is-muted { color: hsl(var(--muted-foreground)); }
  .m-person-more { padding: 4px 2px 12px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  @media (max-width: 720px) {
    .m-person { grid-template-columns: 1fr; gap: 2px; }
  }
  @keyframes c-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes c-scan {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
  }
  .c-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
  .c-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
  .c-meta { margin-top: 6px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .c-search { margin-top: 22px; }
  .c-search input {
    width: 100%; height: 42px; padding: 0 14px;
    border-radius: 12px; border: 1px solid hsl(var(--border));
    background: hsl(var(--background)); font-size: 14px;
  }
  .c-search input:focus { outline: none; border-color: hsl(var(--foreground) / .28); }
  .c-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
  .c-tabs { display: flex; gap: 2px; margin: 0 0 22px; border-bottom: 1px solid hsl(var(--border)); }
  .c-tab {
    height: 36px; padding: 0 14px; border: 0; background: transparent; cursor: pointer;
    color: hsl(var(--muted-foreground)); font-size: 13px; font-weight: 500;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
  }
  .c-tab.is-on { color: hsl(var(--foreground)); border-bottom-color: hsl(var(--foreground)); }
  .c-panel {
    margin-top: 14px; padding: 16px; border: 1px solid hsl(var(--border));
    border-radius: 14px; background: hsl(var(--card));
  }
  .c-panel + .c-panel { margin-top: 10px; }
  .c-panel-label {
    font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
    color: hsl(var(--muted-foreground)); margin-bottom: 8px;
  }
  .camp { display: flex; flex-direction: column; gap: 16px; }
  .camp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
  .camp-back {
    border: 0; background: transparent; padding: 0; cursor: pointer;
    color: hsl(var(--muted-foreground)); font-size: 13px;
  }
  .camp-back:hover { color: hsl(var(--foreground)); }
  .camp-kicker { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
  .camp-status {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
    border-radius: 999px; border: 1px solid hsl(var(--border));
    font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    color: hsl(var(--muted-foreground));
  }
  .camp-title { margin: 0; font-size: 1.65rem; font-weight: 560; letter-spacing: -.03em; line-height: 1.15; }
  .camp-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding-top: 28px; }
  .camp-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
    border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card));
    font-size: 12px; color: hsl(var(--foreground));
  }
  .camp-chip.is-on { background: hsl(var(--accent)); }
  .camp-chip.is-off { color: hsl(var(--muted-foreground)); }
  .camp-chip small { font-size: 11px; color: hsl(var(--muted-foreground)); }
  .camp-stage { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, .75fr); gap: 14px; align-items: start; }
  .camp-letter { padding: 22px 22px 16px; }
  .camp-subject, .camp-body {
    width: 100%; border: 0; background: transparent; color: inherit; outline: none;
  }
  .camp-subject { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.35; min-height: 1.35em; }
  .camp-body { margin-top: 10px; font-size: 15px; line-height: 1.6; min-height: 7.5rem; white-space: pre-wrap; }
  .camp-subject:empty:before, .camp-body:empty:before {
    content: attr(data-placeholder); color: hsl(var(--muted-foreground)); font-weight: 400;
  }
  .camp-token {
    display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin: 0 1px;
    border-radius: 999px; background: hsl(var(--accent)); border: 1px solid hsl(var(--border));
    font-size: 12px; font-weight: 500; letter-spacing: 0; vertical-align: 1px;
  }
  .camp-preview { margin-top: 18px; padding-top: 14px; border-top: 1px solid hsl(var(--border)); }
  .camp-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .camp-preview-subject { margin-top: 10px; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
  .camp-preview-body { margin-top: 6px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
  .camp-count { margin: 0; font-size: 2.4rem; font-weight: 560; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
  .camp-person { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid hsl(var(--border)); }
  .camp-person b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 560; }
  .camp-person .plate { font-size: 13px; font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); }
  .camp-email { grid-column: 1 / -1; font-size: 12px; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .camp-more { margin-top: 8px; }
  .camp-field {
    width: 100%; min-height: 76px; margin-top: 12px; padding: 12px 14px; resize: vertical;
    border-radius: 12px; border: 1px solid hsl(var(--border)); background: hsl(var(--background));
    color: inherit; font-size: 14px; line-height: 1.45;
  }
  .camp-field:focus { outline: none; border-color: hsl(var(--foreground) / .28); }
  .camp-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .camp-person-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px;
    border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--background));
    font-size: 13px;
  }
  .camp-person-chip button {
    width: 22px; height: 22px; border: 0; border-radius: 999px; background: transparent;
    color: hsl(var(--muted-foreground)); cursor: pointer;
  }
  .camp-person-chip button:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
  .camp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
  .camp-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; animation: k-scale-in var(--dur-base) var(--ease-out) both; }
  .camp-confirm p { margin: 0 8px 0 0; font-size: 14px; }
  .camp-card-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .camp-card-count { text-align: right; }
  .camp-card-count b { display: block; font-size: 1.6rem; font-weight: 560; letter-spacing: -.03em; line-height: 1; }
  .camp-card-count span { font-size: 12px; color: hsl(var(--muted-foreground)); }
  @media (max-width: 900px) {
    .camp-stage { grid-template-columns: 1fr; }
    .camp-head { flex-direction: column; }
    .camp-chips { justify-content: flex-start; padding-top: 0; }
  }
  .c-checks { display: flex; flex-wrap: wrap; gap: 10px 16px; }
  .c-checks label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
  .c-table-wrap { margin-top: 22px; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--card)); overflow-x: auto; }
  .c-table { width: 100%; min-width: 1120px; border-collapse: collapse; table-layout: fixed; }
  .c-table th {
    position: sticky; top: 0; z-index: 2;
    background: hsl(var(--card));
    border-bottom: 1px solid hsl(var(--border));
  }
  .c-th {
    display: flex; align-items: center; gap: 6px;
    width: 100%; height: 40px; padding: 0 14px;
    border: 0; background: transparent; color: hsl(var(--muted-foreground));
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    cursor: pointer; text-align: left; white-space: nowrap;
  }
  .c-th:hover, .c-th.is-on { color: hsl(var(--foreground)); }
  .c-caret { font-size: 10px; line-height: 1; }
  .c-table td { padding: 12px 14px; border-top: 1px solid hsl(var(--border)); font-size: 13px; vertical-align: middle; }
  .c-table col.c-col-name { width: 16%; }
  .c-table col.c-col-band { width: 9%; }
  .c-table col.c-col-feeling { width: 10%; }
  .c-table col.c-col-why { width: 20%; }
  .c-table col.c-col-status { width: 11%; }
  .c-table col.c-col-source { width: 10%; }
  .c-table col.c-col-left { width: 10%; }
  .c-tr { cursor: pointer; transition: background .16s ease; }
  .c-tr:hover, .c-tr:focus-visible { background: hsl(var(--accent)); outline: none; }
  .c-tr.is-open { background: hsl(var(--accent) / .7); }
  .c-tr.is-in { animation: c-in .32s ease both; }
  .c-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .c-chev {
    width: 6px; height: 6px; flex-shrink: 0;
    border-right: 1.5px solid hsl(var(--muted-foreground));
    border-bottom: 1.5px solid hsl(var(--muted-foreground));
    transform: rotate(-45deg); transition: transform .2s ease;
  }
  .c-tr.is-open .c-chev { transform: rotate(45deg); }
  .c-name { font-size: 13px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .c-sub { margin-top: 2px; font-size: 11px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
  .c-clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .c-muted { color: hsl(var(--muted-foreground)); }
  .c-status.is-on { color: #15803d; }
  .dark .c-status.is-on { color: #4ade80; }
  .c-detail td { padding: 0 14px 0 36px; background: hsl(var(--accent) / .35); border-top: 0; }
  .c-detail-box { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s ease; }
  .c-detail.is-open .c-detail-box { grid-template-rows: 1fr; }
  .c-detail-in { overflow: hidden; min-height: 0; }
  .c-more-pad { padding: 4px 0 14px; }
  .c-facts { display: flex; flex-wrap: wrap; gap: 14px 28px; }
  .c-fact-k { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
  .c-fact-v { margin-top: 3px; font-size: 13px; }
  .c-washes { width: 100%; margin-top: 14px; }
  .c-wash {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 8px 16px;
    align-items: baseline;
    padding: 7px 0;
    border-top: 1px solid hsl(var(--border) / .7);
    font-size: 13px;
  }
  .c-wash span:first-child { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
  .c-wash span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .c-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
  .c-save {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 14px; border: 0; border-radius: 12px;
    background: hsl(var(--foreground)); color: hsl(var(--background));
    font-size: 13px; font-weight: 600; letter-spacing: -.01em;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease;
  }
  .c-save svg { width: 14px; height: 14px; }
  .c-save:hover { transform: translateY(-1px); }
  .c-save.is-arm { background: #15803d; color: #fff; }
  .c-save:disabled { opacity: .45; transform: none; cursor: default; }
  .c-save-x {
    height: 36px; padding: 0 8px; border: 0; background: transparent;
    color: hsl(var(--muted-foreground)); font-size: 13px; cursor: pointer;
  }
  .c-empty {
    padding: 28px 8px; text-align: center;
    color: hsl(var(--muted-foreground)); font-size: 13px; line-height: 1.5;
  }
  .c-scan.is-busy { animation: c-scan 1.1s ease infinite; }
  .c-qgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
  .c-qcard {
    border: 1px solid hsl(var(--border)); background: hsl(var(--card));
    border-radius: 16px; padding: 14px 16px;
  }
  .c-qcard b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
  .c-qcard span { display: block; margin-top: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .c-form .c-seg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .c-form .c-seg-item {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: auto; height: 36px; margin: 0; padding: 0 14px;
    border-radius: 12px; border: 1px solid hsl(var(--border)); background: transparent;
    font-size: 13px; font-weight: 600; letter-spacing: -.01em; cursor: pointer;
    transition: transform .16s ease, background .16s ease, color .16s ease;
  }
  .c-form .c-seg-item:hover { transform: translateY(-1px); }
  .c-form .c-seg-item input {
    position: absolute; width: 1px; height: 1px; margin: 0; padding: 0;
    opacity: 0; pointer-events: none;
  }
  .c-form .c-seg-item:has(input:checked) {
    background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: transparent;
  }
  .c-form label.flex { display: flex; }
  .c-form label.flex input { width: auto; height: auto; margin: 0; padding: 0; }
  .c-note { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
  .c-note input {
    flex: 1; min-width: 180px; height: 36px; padding: 0 12px; border-radius: 10px;
    border: 1px solid hsl(var(--border)); background: hsl(var(--background)); font-size: 13px;
  }
  .c-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
  .c-bar-row { display: grid; grid-template-columns: 120px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
  .c-bar-track { height: 8px; border-radius: 99px; background: hsl(var(--accent)); overflow: hidden; }
  .c-bar-track i { display: block; height: 100%; background: hsl(var(--foreground)); border-radius: 99px; }
  .c-bar-row b { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
  .c-table col.c-col-driver { width: 11%; }
  .c-table col.c-col-waiting { width: 8%; }
  .c-table col.c-col-move { width: 9%; }
  .c-table col.c-col-touched { width: 8%; }
  .c-form .c-field { margin-top: 18px; }
  .c-form label { display: block; font-size: 13px; font-weight: 500; }
  .c-form input:not([type="radio"]):not([type="checkbox"]), .c-form select, .c-form textarea {
    width: 100%; margin-top: 6px; padding: 10px 12px;
    border-radius: 12px; border: 1px solid hsl(var(--border));
    background: hsl(var(--background)); font-size: 14px;
  }
  @media (max-width: 720px) {
    .c-qgrid { grid-template-columns: 1fr 1fr; }
    .c-actions { align-items: stretch; }
  }
  @media (prefers-reduced-motion: reduce) {
    .c-tr, .c-detail-box, .c-chev, .c-scan.is-busy, .c-save { animation: none; transition: none; }
  }
  .pos-nav.hidden, .nav-item.hidden { display: none; }
  body:not(.room-ask) #sidebar-recents { display: none; }
  body.room-ask #sidebar > nav {
    flex: 0 1 auto;
    max-height: 46%;
  }
  body.room-ask #sidebar-recents {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  .nav-item.active { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
  .kpi-delta.up { color: #16a34a; }
  .kpi-delta.down { color: #dc2626; }
  .kpi-delta.flat { color: hsl(var(--muted-foreground)); }
  .live-status { letter-spacing: .01em; }

  .j-search { margin-bottom: 22px; }
  .j-search input, .j-search button { height: 40px; border-radius: 12px; }
  .j-search button { padding: 0 16px; }
  .j-search .j-btn { height: 40px; padding: 0 14px; border-radius: 12px; }
  .j-stack { display: flex; flex-direction: column; gap: 22px; }
  .j-label {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 0 2px 10px;
    font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
    color: hsl(var(--muted-foreground));
  }
  .j-card {
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: 16px;
    padding: 18px 20px 6px;
  }
  .j-also { margin: 18px 2px 8px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .j-who { font-size: 16px; }
  .j-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
  .j-name { font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
  .j-plan { margin-top: 4px; font-size: 13px; color: hsl(var(--muted-foreground)); }
  .j-pill {
    flex-shrink: 0; margin-top: 2px;
    font-size: 11px; font-weight: 500; line-height: 1;
    padding: 5px 8px; border-radius: 999px;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
  }
  .j-pill.is-on { color: #15803d; background: rgba(22, 163, 74, .12); border-color: transparent; }
  .dark .j-pill.is-on { color: #4ade80; background: rgba(74, 222, 128, .14); }
  .j-pill.is-off { color: #b91c1c; background: rgba(220, 38, 38, .1); border-color: transparent; }
  .dark .j-pill.is-off { color: #fca5a5; background: rgba(248, 113, 113, .14); }
  .j-stats {
    display: flex; flex-wrap: wrap; gap: 16px 36px;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid hsl(var(--border));
  }
  .j-stat-k { font-size: 11px; color: hsl(var(--muted-foreground)); }
  .j-stat-v { margin-top: 3px; font-size: 15px; font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
  .j-contact { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.45; }
  .j-ids {
    display: flex; flex-wrap: wrap; gap: 8px 22px;
    margin-top: 14px; padding: 12px 0;
    border-top: 1px solid hsl(var(--border));
  }
  .j-id-k { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
  .j-id-v { margin-top: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
  .j-sales { margin-top: 2px; border-top: 1px solid hsl(var(--border)); }
  .j-sales-k {
    padding: 12px 0 2px;
    font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
    color: hsl(var(--muted-foreground));
  }
  .j-sale {
    display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: baseline;
    padding: 9px 0; font-size: 13px;
  }
  .j-sale + .j-sale { border-top: 1px solid hsl(var(--border) / .65); }
  .j-sale.is-two { grid-template-columns: 1fr auto; }
  .j-sale span:first-child { color: hsl(var(--muted-foreground)); }
  .j-sale span:last-child { font-variant-numeric: tabular-nums; text-align: right; }
  .j-panel {
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: 16px;
    padding: 14px 16px 12px;
  }
  .j-panel .j-label { margin-bottom: 4px; }
  .j-empty { padding: 6px 2px 4px; font-size: 13px; color: hsl(var(--muted-foreground)); }
  .j-read { display: flex; gap: 10px; align-items: flex-start; padding: 2px 2px 4px; }
  .j-dot { width: 8px; height: 8px; border-radius: 99px; margin-top: 6px; flex-shrink: 0; background: hsl(var(--muted-foreground)); }
  .j-dot.leaving { background: #ef4444; }
  .j-dot.watch { background: #f59e0b; }
  .j-dot.steady { background: #22c55e; }
  .j-read-title { font-size: 14px; font-weight: 600; }
  .j-read p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
  .j-read-sub { margin-top: 6px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .j-wash { margin-top: 16px; }
  .j-next {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: 16px;
    padding: 16px 18px;
  }
  .j-next-copy { min-width: 0; }
  .j-next-k {
    font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
    color: hsl(var(--muted-foreground));
  }
  .j-next-title { margin-top: 4px; font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
  .j-next p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: hsl(var(--muted-foreground)); }
  .j-next-actions { display: flex; flex-shrink: 0; gap: 8px; }
  .j-btn {
    height: 32px; padding: 0 12px; border-radius: 999px;
    border: 1px solid hsl(var(--border)); background: transparent;
    color: hsl(var(--foreground)); font-size: 12px; font-weight: 500;
  }
  .j-btn:hover { background: hsl(var(--accent)); }
  .j-btn:disabled { opacity: .35; }
  .j-btn.is-main { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; }
  .j-btn.is-on { border-color: hsl(var(--border)); background: hsl(var(--accent)); }
  .j-call, .j-ticket {
    width: 100%; display: block; text-align: left; color: inherit;
    padding: 10px 2px; border: 0; border-top: 1px solid hsl(var(--border));
    background: transparent;
  }
  .j-call:first-child, .j-ticket:first-child { border-top: 0; }
  .j-call:hover { background: hsl(var(--accent)); }
  .j-call.is-open { background: hsl(var(--accent) / .55); }
  .j-call-sum, .j-ticket-title { display: block; font-size: 13px; line-height: 1.4; }
  .j-call-meta { display: block; margin-top: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .j-transcript { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: hsl(var(--muted) / .45); }
  .j-page {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 8px; padding-top: 10px; border-top: 1px solid hsl(var(--border));
  }
  .j-page span { font-size: 12px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
  .j-also-row {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 10px; padding: 12px 14px; text-align: left;
    border: 1px solid hsl(var(--border)); border-radius: 14px;
    background: hsl(var(--card)); color: inherit;
  }
  .j-also-row:hover { background: hsl(var(--accent)); }
  .j-also-name { display: block; font-size: 13px; font-weight: 600; }
  .j-also-meta { display: block; margin-top: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .j-also-go { flex-shrink: 0; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .who-row {
    width: 100%; display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px; text-align: left; color: inherit;
    border: 0; border-top: 1px solid hsl(var(--border));
    background: transparent;
  }
  .who-row:first-child { border-top: 0; }
  .who-row:hover { background: hsl(var(--accent)); }
  .who-kind {
    flex-shrink: 0; min-width: 72px; margin-top: 2px;
    font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: hsl(var(--muted-foreground));
  }
  .who-title { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
  .who-meta { display: block; margin-top: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); }
  .who-empty { padding: 4px 0 2px; font-size: 13px; color: hsl(var(--muted-foreground)); }
  @media (max-width: 560px) {
    .j-card { padding: 16px 16px 4px; }
    .j-next { flex-direction: column; }
    .who-kind { min-width: 56px; }
  }

  #chat-title.ask-title {
    cursor: text;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 6px;
  }
  #chat-title.ask-title:hover { background: hsl(var(--accent)); }
  #conv-menu {
    min-width: 168px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    box-shadow: 0 10px 28px rgba(0,0,0,.22);
  }

  /* Modal backdrop */
  #modal-backdrop { backdrop-filter: blur(4px); }

  /* Library panel slide */
  #library-panel { transition: transform .25s cubic-bezier(.4,0,.2,1); visibility: hidden; pointer-events: none; }
  #library-panel.open { transform: translateX(0) !important; visibility: visible; pointer-events: auto; }
  body.room-settings #library-panel,
  body.room-settings #library-backdrop,
  body.room-brief #library-panel,
  body.room-brief #library-backdrop,
  body.room-ask #library-panel,
  body.room-ask #library-backdrop,
  body.room-help #library-panel,
  body.room-help #library-backdrop,
  body.room-insights #library-panel,
  body.room-insights #library-backdrop,
  body.room-flows #library-panel,
  body.room-flows #library-backdrop,
  body.room-journey #library-panel,
  body.room-journey #library-backdrop { display: none !important; }
  .insight-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  .insight-card { border-radius: 20px; }
  .flow-chip {
    height: 28px; padding: 0 10px;
    border: 1px solid hsl(var(--border)); border-radius: 7px;
    font-size: 12px; background: hsl(var(--background));
  }
  .flow-chip:hover, .flow-chip.is-on { background: hsl(var(--accent)); }
  .flow-chip.is-on { font-weight: 500; }
  .flow-ask {
    padding: 14px 16px;
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    background: hsl(var(--card));
  }
  .flow-you {
    padding: 12px 14px;
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    background: hsl(var(--background));
  }
  .flow-rail { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0; padding: 8px 0 18px; }
  .flow-step { width: 104px; text-align: center; opacity: .4; transition: opacity .25s, transform .25s; }
  .flow-step.is-on, .flow-step.is-done { opacity: 1; }
  .flow-step.is-on { transform: translateY(-2px); }
  .flow-dot {
    width: 16px; height: 16px; border-radius: 99px; margin: 0 auto 8px;
    border: 2px solid hsl(var(--border)); background: hsl(var(--card));
  }
  .flow-step.is-done .flow-dot { background: #10b981; border-color: #10b981; }
  .flow-step.is-on .flow-dot {
    background: hsl(var(--primary)); border-color: hsl(var(--primary));
    animation: insightPulse 1.1s ease-in-out infinite;
  }
  .flow-edge { width: 22px; height: 2px; margin-top: 7px; background: hsl(var(--border)); flex-shrink: 0; }
  .flow-edge.is-lit { background: #10b981; }
  .flow-ticket {
    border: 1px solid hsl(var(--border));
    border-radius: 16px;
    padding: 16px 18px;
    background: hsl(var(--card));
    animation: flowSlide .45s ease both;
  }
  @keyframes flowSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
  .flow-q { display: grid; gap: 8px; }
  .flow-q-row {
    display: grid; grid-template-columns: 88px 1fr auto; gap: 10px; align-items: start;
    padding: 10px 0; border-top: 1px solid hsl(var(--border));
  }
  .flow-q-row.is-wait { opacity: .55; }
  .flow-q-row.is-on { opacity: 1; }
  .flow-q-row.is-done .flow-q-t { text-decoration: line-through; color: hsl(var(--muted-foreground)); }
  .flow-q-k { font-size: 11px; color: hsl(var(--muted-foreground)); text-transform: capitalize; }
  .flow-q-t { font-size: 13px; }
  .flow-live {
    border: 1px solid hsl(var(--primary) / .35);
    background: hsl(var(--primary) / .06);
  }
  .insight-logo {
    width: 44px; height: 44px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: hsl(var(--primary) / .1); color: hsl(var(--primary));
  }
  .insight-graph {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center;
    gap: 0; padding: 12px 0 28px;
  }
  .insight-node {
    width: 128px; text-align: center; position: relative;
    opacity: .38; transition: opacity .2s, transform .2s;
  }
  .insight-node.is-ok, .insight-node.is-skipped { opacity: 1; }
  .insight-node.is-run { opacity: 1; }
  .insight-node.is-err { opacity: 1; }
  .insight-dot {
    width: 22px; height: 22px; border-radius: 999px; margin: 0 auto 8px;
    border: 2px solid hsl(var(--border)); background: hsl(var(--card));
  }
  .insight-node.is-ok .insight-dot { background: #10b981; border-color: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
  .insight-node.is-skipped .insight-dot { background: #94a3b8; border-color: #94a3b8; }
  .insight-node.is-err .insight-dot { background: #f59e0b; border-color: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
  .insight-node.is-run .insight-dot {
    border-color: hsl(var(--primary)); background: hsl(var(--primary));
    animation: insightPulse 1.1s ease-in-out infinite;
  }
  @keyframes insightPulse {
    0%, 100% { box-shadow: 0 0 0 0 hsl(var(--primary) / .45); transform: scale(1); }
    50% { box-shadow: 0 0 0 10px hsl(var(--primary) / 0); transform: scale(1.08); }
  }
  .insight-edge {
    width: 28px; height: 2px; margin-top: 10px; background: hsl(var(--border)); flex-shrink: 0;
  }
  .insight-edge.is-lit { background: #10b981; }
  .insight-kpi { border-radius: 0; }
  .insight-report-chart { height: 240px; min-height: 240px; }
  .insight-verdict {
    font-size: 11px; font-weight: 400;
    color: hsl(var(--muted-foreground));
  }
  .insight-find { border-radius: 0; }
  .insight-path {
    font-size: 12px; font-weight: 400;
    color: hsl(var(--muted-foreground));
  }
  .insight-path.is-local { color: hsl(var(--muted-foreground)); }
  .insight-path.is-peer { color: hsl(var(--muted-foreground)); }
  .insight-path.is-thin { color: hsl(var(--muted-foreground)); }
  .ops { padding-bottom: 3.5rem; }
  .ops-top {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    justify-content: space-between; gap: 12px 20px;
  }
  .ops-kicker { font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.45; }
  .ops-title {
    font-size: 1.35rem; font-weight: 600; letter-spacing: -0.03em;
    line-height: 1.25; margin-top: 2px;
  }
  .ops-tool { display: flex; gap: 8px; width: 100%; }
  @media (min-width: 640px) { .ops-tool { width: auto; min-width: 280px; } }
  .ops-tool input {
    flex: 1; min-width: 0; height: 36px; padding: 0 12px;
    border: 1px solid hsl(var(--border)); border-radius: 8px;
    background: hsl(var(--background)); font-size: 13px; outline: none;
  }
  .ops-tool input:focus { box-shadow: 0 0 0 1px hsl(var(--ring)); }
  .ops-tool button, .ops-ghost {
    height: 36px; padding: 0 12px; border: 1px solid hsl(var(--border));
    border-radius: 8px; font-size: 13px; background: transparent; color: inherit;
  }
  .ops-tool button:hover, .ops-ghost:hover { background: hsl(var(--accent)); }
  .ops-hero { margin-top: 28px; padding-bottom: 22px; border-bottom: 1px solid hsl(var(--border)); }
  .ops-hero-n {
    font-size: 2.5rem; font-weight: 600; letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums; line-height: 1;
  }
  .ops-hero-l { margin-top: 8px; font-size: 13px; color: hsl(var(--muted-foreground)); line-height: 1.45; max-width: 28rem; }
  .ops-lead {
    margin-top: 28px; font-size: 1.1rem; font-weight: 400;
    letter-spacing: -0.02em; line-height: 1.45; max-width: 34rem;
  }
  .ops-stats {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px; padding: 22px 0 2px;
  }
  @media (min-width: 720px) { .ops-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  @media (min-width: 980px) { .ops-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .ops-stat {
    display: flex; flex-direction: column;
    min-height: 108px; padding: 12px 14px 13px;
    border: 1px solid hsl(var(--border)); border-radius: 10px;
    background: hsl(var(--card));
  }
  .ops-stat.is-wide { grid-column: span 2; }
  @media (min-width: 980px) { .ops-stat.is-wide { grid-column: span 2; } }
  .ops-stat-l { font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.3; }
  .ops-stat .ops-stat-l { font-size: 11px; font-weight: 500; }
  .ops-stat-n {
    font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em; line-height: 1.2;
  }
  .ops-stat .ops-stat-n { margin-top: 8px; font-size: 1.45rem; }
  .ops-stat .ops-stat-n.is-text { font-size: 1.02rem; letter-spacing: -0.02em; line-height: 1.3; }
  .ops-stat-h { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 3px; line-height: 1.35; }
  .ops-stat .ops-stat-h {
    margin-top: auto; padding-top: 10px; font-size: 11px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ops-sec { margin-top: 14px; }
  .ops-sec-h { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
  .ops-item { padding: 12px 0; }
  .ops-item + .ops-item { border-top: 1px solid hsl(var(--border)); }
  .ops-item-t { font-size: 14px; font-weight: 500; letter-spacing: -0.015em; }
  .ops-item-d { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 4px; line-height: 1.45; }
  .ops-panel {
    margin-top: 14px;
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    background: hsl(var(--card));
    overflow: hidden;
    animation: ops-in .42s cubic-bezier(.22, 1, .36, 1) both;
    animation-delay: calc(var(--ops-i, 0) * 55ms);
  }
  @keyframes ops-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ops-panel { animation: none; }
  }
  .ops-panel-h {
    padding: 14px 16px 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  .ops-panel.is-flush .ops-panel-h {
    padding-bottom: 12px;
    border-bottom: 1px solid hsl(var(--border));
  }
  .ops-panel.is-flush .ops-panel-h + .ops-row { border-top: none; }
  .ops-panel-b { padding: 4px 16px 16px; }
  .ops-panel-b .ops-stats { padding-top: 4px; padding-bottom: 4px; }
  .ops-panel-b .ops-meter { margin-top: 2px; }
  .ops-row {
    padding: 13px 16px 14px;
    border-top: 1px solid hsl(var(--border));
  }
  .ops-row:first-child { border-top: none; }
  .ops-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 16px 16px;
  }
  @media (min-width: 720px) { .ops-cards { grid-template-columns: 1fr 1fr; } }
  .ops-card {
    display: flex; flex-direction: column;
    min-height: 108px; padding: 12px 13px 13px;
    border: 1px solid hsl(var(--border)); border-radius: 10px;
    background: hsl(var(--background));
  }
  .ops-card .ops-item-d { flex: 1; }
  .ops-quotes { display: grid; gap: 10px; padding: 0 16px 16px; }
  .ops-quote {
    padding: 12px 13px;
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    background: hsl(var(--background));
  }
  .ops-quote-m { font-size: 11px; color: hsl(var(--muted-foreground)); }
  .ops-quote p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
  .ops-mix { padding: 0; }
  .ops-meter {
    height: 8px; display: flex; overflow: hidden; border-radius: 99px;
    background: hsl(var(--border)); margin-top: 10px;
  }
  .ops-meter i { display: block; height: 100%; min-width: 2px; }
  .ops-meter .is-a, .ops-mix-dot.is-a { background: hsl(var(--foreground)); }
  .ops-meter .is-b, .ops-mix-dot.is-b { background: hsl(var(--foreground) / .48); }
  .ops-meter .is-c, .ops-mix-dot.is-c { background: hsl(var(--foreground) / .28); }
  .ops-meter .is-d, .ops-mix-dot.is-d { background: hsl(var(--foreground) / .14); }
  .ops-mix-legend {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px; margin-top: 14px;
  }
  @media (min-width: 640px) { .ops-mix-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .ops-mix-dot {
    width: 7px; height: 7px; border-radius: 99px; display: inline-block;
    margin-right: 6px; vertical-align: 1px;
  }
  .ops-hbar {
    height: 3px; background: hsl(var(--border)); border-radius: 99px;
    overflow: hidden; margin-top: 6px; max-width: 7rem;
  }
  .ops-hbar > i { display: block; height: 100%; background: hsl(var(--foreground) / .5); border-radius: inherit; }
  .ops-split { display: grid; gap: 14px; margin-top: 0; }
  @media (min-width: 768px) { .ops-split { grid-template-columns: 1fr 1fr; } }
  .ops-split > .ops-panel { margin-top: 14px; }
  .ops-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .ops-action {
    height: 28px; padding: 0 10px;
    border: 1px solid hsl(var(--border)); border-radius: 7px;
    font-size: 12px; line-height: 1;
    background: hsl(var(--background)); color: hsl(var(--foreground));
  }
  .ops-action:hover { background: hsl(var(--accent)); }
  .ops-links {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 14px; padding: 12px 16px;
    border: 1px solid hsl(var(--border)); border-radius: 12px;
    background: hsl(var(--card));
    animation: ops-in .42s cubic-bezier(.22, 1, .36, 1) both;
    animation-delay: .33s;
  }
  .ops-links button {
    height: 28px; padding: 0 10px;
    border: 1px solid hsl(var(--border)); border-radius: 7px;
    font-size: 12px; background: hsl(var(--background)); color: inherit;
  }
  .ops-links button:hover, .ops-links button.is-main { background: hsl(var(--accent)); }
  .ops-links button.is-main { font-weight: 500; }
  .rpt-page { padding-bottom: 3rem; }
  .rpt-meta { font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.4; }
  .rpt-title { font-size: 1.2rem; font-weight: 500; letter-spacing: -0.02em; margin-top: 0.2rem; line-height: 1.3; }
  .rpt-h { font-size: 13px; font-weight: 500; margin-bottom: 0.65rem; }
  .rpt-hint { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 0.2rem; line-height: 1.4; }
  .rpt-note { padding: 0.85rem 0; border-top: 1px solid hsl(var(--border)); }
  .rpt-note:first-of-type { border-top: none; padding-top: 0; }
  .rpt-do-title { font-size: 0.9rem; font-weight: 400; }
  .rpt-sub { font-size: 0.9rem; line-height: 1.65; color: hsl(var(--muted-foreground)); margin-top: 0.6rem; }
  .insight-section-label { font-size: 12px; font-weight: 400; color: hsl(var(--muted-foreground)); }
  .insight-table { width: 100%; font-size: 13px; }
  .insight-table th {
    text-align: left; font-size: 12px; font-weight: 400;
    color: hsl(var(--muted-foreground));
    padding: 8px 0;
  }
  .insight-table td { padding: 10px 0; border-top: 1px solid hsl(var(--border)); }
  .insight-table td:last-child { font-weight: 500; }
  .insight-quote {
    border-left: 1px solid hsl(var(--border));
    padding: 2px 0 2px 14px;
  }

  /* Library table preview */
  .lib-table { width:100%; border-collapse:collapse; font-size:.78em; }
  .lib-table th { position:sticky; top:0; background:hsl(var(--muted)); font-weight:600; text-align:left; padding:6px 10px; border-bottom:1px solid hsl(var(--border)); white-space:nowrap; }
  .lib-table td { padding:5px 10px; border-bottom:1px solid hsl(var(--border)/0.5); white-space:nowrap; max-width:200px; overflow:hidden; text-overflow:ellipsis; }
  .lib-table tr:nth-child(even) td { background:hsl(var(--muted)/0.3); }

  /* Login screen */
  #login-screen {
    position: fixed; inset: 0; z-index: 200;
    display: flex; background: hsl(var(--background));
  }
  .login-shell {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 100%;
  }
  .login-story { display: none; }
  @media (min-width: 860px) {
    .login-shell { grid-template-columns: minmax(300px, 1.05fr) minmax(340px, .95fr); }
    .login-story { display: flex; }
  }
  .login-mark {
    width: 40px; height: 40px; border-radius: 10px;
    object-fit: cover; display: block; flex-shrink: 0;
  }
  .login-room-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid hsl(var(--border));
  }
  .login-room-row:first-of-type { border-top: none; padding-top: 0; }

  .help-layout { display: grid; gap: 28px; }
  @media (min-width: 800px) {
    .help-layout { grid-template-columns: 168px minmax(0, 1fr); align-items: start; }
    .help-toc { position: sticky; top: 16px; }
  }
  .help-toc a { display: block; padding: 6px 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
  .help-toc a:hover { color: hsl(var(--foreground)); }
  .help-h { scroll-margin-top: 16px; }
  .help-h.help-focus {
    border-radius: 12px;
    box-shadow: 0 0 0 1px hsl(var(--border));
  }
  .help-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .help-table th { text-align: left; font-weight: 500; padding: 8px 10px; border-bottom: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  .help-table td { padding: 9px 10px; border-bottom: 1px solid hsl(var(--border)); vertical-align: top; }
  .help-table tr:last-child td { border-bottom: none; }
  .help-table td:first-child { width: 34%; font-weight: 500; }
  .chart-thumb {
    height: 176px;
    background: hsl(var(--muted) / .35);
  }
  .chart-thumb .js-plotly-plot,
  .chart-thumb .plot-container { height: 176px !important; }
  #chart-detail-box.chart-detail-max {
    max-width: 96vw;
    width: 96vw;
    height: 92vh;
    max-height: 92vh;
  }

  /* Shared conversation view - never show Brief while the Ask thread loads */
  body.share-view #sidebar,
  body.share-view #nav-toggle,
  body.share-view #nav-backdrop,
  body.share-view #nav-edge,
  body.share-view #nav-peek,
  body.share-view #brief-room,
  body.share-view #flows-room,
  body.share-view #work-room,
  body.share-view #help-room,
  body.share-view #settings-room,
  body.share-view #input-bar-wrapper,
  body.share-view #workspace-btn,
  body.share-view #corp-badge,
  body.share-view #archived-badge,
  body.share-view .ask-only,
  body.share-view #help-btn { display: none !important; }
  body.share-view #ask-room { display: flex !important; }
  body.share-view #share-view-meta { display: inline !important; }
  body.share-view #login-screen { display: none; }

  /* Comparison mode */
  #compare-panel { display:none; }
  body.compare-mode #chat-area,
  body.compare-mode #input-bar-wrapper { display:none !important; }
  body.room-ask:not(.share-view) .ask-only { display: inline-flex !important; }
  .hdr-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }
  body.compare-mode #compare-panel { display:flex !important; }
  body.compare-mode main { position:relative; }

  /* Print / PDF */
  @media print {
    #sidebar, #nav-backdrop, #nav-toggle, #library-panel, #library-backdrop, #modal-backdrop,
    #schedule-panel, #mcp-panel, #chart-detail-backdrop, #table-preview-backdrop,
    #share-modal, #input-bar-wrapper, #app-header, #nav-peek, #nav-edge, .no-print { display:none !important; }
    #messages { max-width:100%; padding:0; }
    body { background:white; color:black; overflow:visible !important; height:auto !important; }
    .prose { color:black; }
    .bg-primary { background:#1a1a1a; }
    .text-primary-foreground { color:white; }
    body.room-insights #insights-room { display:block !important; overflow:visible !important; height:auto !important; }
    .ops-hero, .ops-item, .ops-panel, .ops-card, .insight-kpi, .insight-find, .insight-quote { break-inside:avoid; }
  }
