* { margin: 0; padding: 0; box-sizing: border-box; }

/* Login screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #0f1117;
}
.login-box { text-align: center; padding: 40px; }
.login-box h2 { font-size: 24px; color: #fff; margin: 12px 0 8px; }
.login-box p { font-size: 14px; color: #666; margin-bottom: 24px; }
.login-btn {
    background: #4a8fd4;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
}
.login-btn:hover { background: #5a9fe4; }
.login-error { margin-top: 16px; color: #e55; font-size: 13px; }
.user-email { font-size: 12px; color: #555; }
.header-right { display: flex; align-items: center; gap: 12px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1117;
    color: #e0e0e0;
    height: 100vh;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0 20px;
    position: relative;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* Chat wrapper fills ALL remaining space right of sidebar */
.chat-wrapper {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.main-content .chat {
    flex: 1;
    min-width: 0;
}

/* --- Thread sidebar --- */

.thread-sidebar {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid #1e2028;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.thread-search {
    position: relative;
    padding: 8px 8px 0;
    flex-shrink: 0;
}

.thread-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 28px 7px 10px;
    background: #1a1c24;
    border: 1px solid #2a2d38;
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s;
}

.thread-search input:focus {
    border-color: #4a9eff;
}

.thread-search input::placeholder {
    color: #555;
}

.thread-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-25%);
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.thread-search-clear:hover {
    color: #aaa;
}

/* Mobile drawer controls — hidden on desktop, shown in the ≤640px block
   below. The header button opens the thread list as a full-screen drawer;
   the in-drawer close button (next to the search box) closes it. */
.thread-sidebar-toggle,
.thread-sidebar-close {
    display: none;
}

.thread-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.thread-group-header {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 8px 4px;
}

.thread-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    margin-bottom: 2px;
}
.thread-item:hover {
    background: #1a1d25;
}
.thread-item.active {
    background: #1a2a3c;
    border: 1px solid #253a52;
}

.thread-title {
    font-size: 13px;
    font-weight: 500;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
}

.thread-preview {
    font-size: 11px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.thread-actions {
    position: absolute;
    top: 8px;
    right: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}
.thread-item:hover .thread-actions {
    opacity: 1;
}
.thread-rename, .thread-delete, .thread-share {
    background: transparent;
    border: none;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    padding: 0 3px;
    transition: color 0.15s;
}
.thread-rename:hover, .thread-share:hover { color: #4a8fd4; }
.thread-share.shared { color: #4a8fd4; }
.shared-thread-banner {
    font-size: 13px;
    color: #888;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
}
.thread-delete:hover { color: #e55; }

.thread-rename-input {
    width: 100%;
    background: #1a2030;
    border: 1px solid #4a8fd4;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 13px;
    font-family: inherit;
    padding: 2px 4px;
    outline: none;
}

.thread-empty {
    padding: 20px 12px;
    font-size: 12px;
    color: #444;
    text-align: center;
}

.thread-list::-webkit-scrollbar { width: 4px; }
.thread-list::-webkit-scrollbar-track { background: transparent; }
.thread-list::-webkit-scrollbar-thumb { background: #2a2d35; border-radius: 4px; }

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #1e2028;
    flex-shrink: 0;
}

header h1 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.subtitle {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

.new-chat-btn {
    background: transparent;
    color: #666;
    border: 1px solid #2a2d35;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.new-chat-btn:hover { color: #ccc; border-color: #4a4d55; background: #1a1d25; }

/* Primary "+ New Chat" button — green, the main CTA in the header */
.new-chat-btn.primary {
    background: #10b981;
    color: #fff;
    border: 1px solid #0e9a6c;
    font-weight: 600;
    padding: 7px 14px;
    font-size: 13px;
}
.new-chat-btn.primary:hover {
    background: #0fab73;
    border-color: #0d8e63;
    color: #fff;
}

/* Brand link — Pollux name in the header acts as a "Home" link */
.brand-link {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}
.brand-link h1 { transition: color 0.15s; margin: 0; }
.brand-link:hover h1 { color: #4a8fd4; }

/* Header overflow menu (kebab) — secondary actions: Home, What's new, Roadmap */
.header-menu { position: relative; }
.header-menu-btn {
    background: transparent;
    color: #888;
    border: 1px solid #2a2d35;
    border-radius: 6px;
    width: 32px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.header-menu-btn:hover { color: #e0e0e0; border-color: #4a4d55; background: #1a1d25; }
.header-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #161922;
    border: 1px solid #2a2d35;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    padding: 6px;
    z-index: 200;
}
.header-menu-dropdown[hidden] { display: none; }
.header-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: #ccc;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s;
}
.header-menu-item:hover { background: #1f232d; color: #fff; }
.header-menu-item .whats-new-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4a8fd4;
    box-shadow: 0 0 0 0 rgba(74,143,212,0.6);
    animation: whats-new-pulse 1.6s ease-in-out infinite;
}
.header-menu-item .whats-new-dot.seen {
    display: none;
}
@keyframes whats-new-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,143,212,0.6); }
    50%      { box-shadow: 0 0 0 6px rgba(74,143,212,0); }
}

/* Hide legacy header buttons that were moved into the kebab dropdown */
.whats-new-btn, .roadmap-btn { display: none !important; }

/* Persistent "Suggest a feature" header button — Pollux improves only when users
   tell us what's missing. Always visible, never demoted to the kebab. */
.suggest-feat-btn {
    background: transparent;
    color: #9ca3af;
    border: 1px dashed #2a2d35;
    border-radius: 6px;
    padding: 6px 11px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.suggest-feat-btn:hover {
    color: #f0f0f0;
    border-color: #4a8fd4;
    background: #1a1d25;
    border-style: solid;
}

/* Every-5-turns feedback nudge banner under an agent message */
.feedback-nudge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(74,143,212,0.08), rgba(74,143,212,0.02));
    border: 1px solid rgba(74,143,212,0.25);
    border-radius: 10px;
    font-size: 13px;
    color: #ccc;
}
.feedback-nudge-icon { font-size: 16px; flex-shrink: 0; }
.feedback-nudge-text { flex: 1; line-height: 1.45; }
.feedback-nudge-text a {
    color: #4a8fd4;
    text-decoration: none;
    font-weight: 500;
}
.feedback-nudge-text a:hover { text-decoration: underline; }
.feedback-nudge-dismiss {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.feedback-nudge-dismiss:hover { color: #ccc; }

/* Suggest-feature link inside the out-of-turns rejection overlay */
.turn-overlay-suggest {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}
.turn-overlay-suggest a {
    color: #4a8fd4;
    text-decoration: none;
    font-weight: 500;
}
.turn-overlay-suggest a:hover { text-decoration: underline; }

/* ---------- Home page (full app cover) ---------- */
.home-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    color: #ccc;
    animation: home-fadein 200ms ease;
}
@keyframes home-fadein { from { opacity: 0; } to { opacity: 1; } }

.home-hero {
    text-align: center;
    margin-bottom: 32px;
}
.home-hero-icon { font-size: 36px; margin-bottom: 6px; }
.home-hero-title {
    font-size: 26px;
    font-weight: 700;
    color: #f0f0f0;
    margin: 0 0 4px;
}
.home-hero-sub {
    font-size: 13px;
    color: #888;
    margin: 0;
}
.home-hero-sub kbd {
    background: #1a1d25;
    border: 1px solid #2a2d35;
    border-radius: 4px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 11px;
    color: #ccc;
}

.home-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.home-row {
    background: #13161f;
    border: 1px solid #2a2d35;
    border-radius: 12px;
    padding: 18px 22px;
    transition: border-color 0.15s, background 0.15s;
}
.home-row:hover {
    border-color: #3a3f48;
    background: #161a23;
}

.home-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}
.home-row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.home-row-icon { font-size: 22px; }
.home-row-title h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #f0f0f0;
}
.home-row-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1.4;
}
.home-row-badge.beta {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}
.home-row-badge.restricted {
    background: rgba(245, 158, 11, 0.10);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.home-row-enter {
    background: transparent;
    color: #4a8fd4;
    border: 1px solid #2a3548;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.home-row-enter:hover { background: #1a2538; border-color: #4a8fd4; color: #6fa9e0; }

.home-row-tagline {
    color: #9ba1aa;
    font-size: 13.5px;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* Examples are full-width, one per line, full sentences (no truncation) */
.home-row-examples {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.home-row-examples li { margin: 0; }
.home-example-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: #1a1d25;
    border: 1px solid #2a2d35;
    border-radius: 8px;
    color: #ccc;
    padding: 9px 14px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.45;
    cursor: pointer;
    transition: all 0.15s;
    white-space: normal;          /* full sentences, allow wrap */
    overflow: visible;
    text-overflow: clip;
}
.home-example-btn:hover {
    border-color: #4a8fd4;
    background: #1c2230;
    color: #f0f0f0;
}

/* Tools collapsed by default, expand inline */
.home-row-tools {
    margin-top: 6px;
    border-top: 1px solid #21242d;
    padding-top: 10px;
}
.home-row-tools > summary {
    cursor: pointer;
    color: #6b7280;
    font-size: 12px;
    list-style: none;
    user-select: none;
    padding: 4px 0;
    transition: color 0.15s;
}
.home-row-tools > summary:hover { color: #9ba1aa; }
.home-row-tools > summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.15s;
}
.home-row-tools[open] > summary::before {
    content: "▾ ";
}
.home-tools-list {
    list-style: none;
    padding: 8px 0 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.home-tool-item {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    background: #161a23;
    border: 1px solid #21242d;
    border-radius: 6px;
    align-items: flex-start;
}
.home-tool-icon { font-size: 14px; flex-shrink: 0; line-height: 1.5; }
.home-tool-body { min-width: 0; }
.home-tool-name { color: #ccc; font-size: 12.5px; font-weight: 500; }
.home-tool-desc { color: #6b7280; font-size: 11.5px; margin-top: 1px; line-height: 1.35; }

/* When in home mode, hide chat-only chrome — input area, action tray, sidebar, attachments */
/* Home is the orientation screen. It is NOT a space — it has no chat, no
   threads, no tools surface. Hide everything that belongs to "you are in a
   space" mode: input area, action tray, attachments, the thread sidebar,
   and the per-space subtitle text. Only the brand + space picker + New Chat
   + kebab stay in the header so users can choose where to go. */
body.home-mode .input-area,
body.home-mode .action-tray,
body.home-mode #attachments-container,
body.home-mode .thread-sidebar,
body.home-mode .thread-sidebar-toggle { display: none !important; }
body.home-mode .subtitle { visibility: hidden; }  /* keep height, hide text */
body.home-mode .chat-wrapper { padding: 0; }
body.home-mode .chat {
    overflow-y: auto;
    padding: 0;
    height: 100%;
}

/* Releases / Roadmap / Status full-app cover. Same shape as home-mode — kill
   the thread sidebar and composer so the page reads as its own surface, not
   as a chat message. */
body.releases-mode .input-area,
body.releases-mode .action-tray,
body.releases-mode #attachments-container,
body.releases-mode .thread-sidebar,
body.releases-mode .thread-sidebar-toggle,
body.roadmap-mode .input-area,
body.roadmap-mode .action-tray,
body.roadmap-mode #attachments-container,
body.roadmap-mode .thread-sidebar,
body.roadmap-mode .thread-sidebar-toggle,
body.status-mode .input-area,
body.status-mode .action-tray,
body.status-mode #attachments-container,
body.status-mode .thread-sidebar,
body.status-mode .thread-sidebar-toggle,
body.experts-mode .input-area,
body.experts-mode .action-tray,
body.experts-mode #attachments-container,
body.experts-mode .thread-sidebar,
body.experts-mode .thread-sidebar-toggle { display: none !important; }

.experts-page { max-width: 960px; margin: 0 auto; padding: 12px 0; color: #d0d8e8; }
.experts-page h2 { font-size: 18px; color: #fff; }
.experts-intro, .expert-meta, .expert-label { font-size: 12px; color: #8890a0; }
.expert-row { border: 1px solid #2a2d38; border-radius: 8px; padding: 12px; margin: 12px 0; }
.expert-field { margin-top: 8px; }
.expert-text { white-space: pre-wrap; font-size: 13px; }
.expert-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 13px; }
.expert-form button { align-self: flex-start; }
.expert-error { color: #e55; font-size: 12px; }
.expert-answered { margin-top: 10px; font-size: 13px; color: #9fd49f; }
.expert-draft { margin-top: 8px; }
.expert-draft-text { white-space: pre-wrap; font-size: 12px; background: #161922; padding: 8px; border-radius: 6px; user-select: all; }
body.releases-mode .subtitle,
body.roadmap-mode .subtitle,
body.status-mode .subtitle { visibility: hidden; }
body.releases-mode .chat-wrapper,
body.roadmap-mode .chat-wrapper,
body.status-mode .chat-wrapper { padding: 0; }
body.releases-mode .chat,
body.roadmap-mode .chat,
body.status-mode .chat {
    overflow-y: auto;
    padding: 32px 40px;
    height: 100%;
}

@media (max-width: 700px) {
    .home-row-head { flex-direction: column; align-items: flex-start; }
    .home-tools-list { grid-template-columns: 1fr; }
}

/* Chat area — scrollable message list, centered column */
.chat {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    scroll-behavior: smooth;
}

/* Messages fill the available width — no artificial centering constraint */

/* Welcome / empty state */
.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    gap: 12px;
}
.welcome-icon { font-size: 36px; opacity: 0.6; }
.welcome h2 { font-size: 18px; font-weight: 500; color: #ccc; }
.welcome p { font-size: 13px; color: #666; max-width: 400px; }

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
    max-width: 500px;
}
.suggestion {
    background: #1a1d25;
    color: #aaa;
    border: 1px solid #2a2d35;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.suggestion:hover { color: #fff; border-color: #4a8fd4; background: #1a2a3c; }

/* Secondary suggestions — smaller, muted */
.suggestions-secondary { margin-top: 4px; }
.suggestion-sm {
    font-size: 11px;
    padding: 6px 12px;
    color: #777;
    border-color: #222630;
}
.suggestion-sm:hover { color: #bbb; border-color: #3a3d45; }

/* Messages */
.message {
    margin-bottom: 20px;
    line-height: 1.65;
    font-size: 14px;
    position: relative;
}

.message.user {
    background: #1a2a3c;
    border: 1px solid #253a52;
    border-radius: 12px;
    padding: 10px 16px;
    margin-left: 80px;
    color: #d0dff0;
}

/* A message stored cut short (content_truncated); see addTruncatedNote. */
.msg-truncated-note {
    margin-top: 6px;
    font-size: 12px;
    font-style: italic;
    color: #8c93a6;
}

/* Copy button on agent messages (#44 — always visible so it's discoverable) */
.message.agent .msg-copy {
    position: absolute;
    top: 4px;
    right: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #667;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 5px;
    opacity: 0.55;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.message.agent:hover .msg-copy { opacity: 1; }
.message.agent .msg-copy:hover { color: #cdd; background: #1a1d25; }
.message.agent .msg-copy.copied { color: #4a9; opacity: 1; }
.msg-copy-label { font-size: 11px; letter-spacing: 0.02em; }

/* #43 — inline source attribution as a small chip, not raw "[text]" */
.source-chip {
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    margin: 0 2px;
    font-size: 0.82em;
    line-height: 1.55;
    color: #9fb4d6;
    background: rgba(120, 150, 200, 0.12);
    border: 1px solid rgba(120, 150, 200, 0.22);
    border-radius: 10px;
    /* Labels run to ~100 chars (see _SOURCE_CHIP_RE in app.js), and `nowrap`
       made a long one wider than the column: a 61-char label measured 440px
       inside a 340px phone column and pushed the answer into horizontal
       scroll. Wrapping keeps it at 336px over two lines. Short chips are
       single-line either way. */
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: baseline;
}

/* A [Policy: id, ...] chip whose id is in the register links to its source
   (linkPolicyChip in app.js). Same fill as .source-chip, a firmer outline. */
.policy-chip {
    border-color: rgba(120, 150, 200, 0.6);
    cursor: pointer;
}
.policy-chip-link:hover .policy-chip,
.policy-chip-link:focus-visible .policy-chip {
    background: rgba(120, 150, 200, 0.22);
    border-color: #9fb4d6;
}

.message.agent {
    padding: 4px 0;
}

/* Markdown content inside agent messages */
.message.agent .md-content {
    line-height: 1.7;
}
.message.agent .md-content p { margin-bottom: 10px; }
.message.agent .md-content p:last-child { margin-bottom: 0; }
.message.agent .md-content strong { color: #fff; }
.message.agent .md-content ul, .message.agent .md-content ol {
    margin: 8px 0 8px 20px;
}
.message.agent .md-content li { margin-bottom: 4px; }

/* Links in answers had no rule of their own and fell through to the UA
   default #0000EE — 2.0:1 on this background. The underline stays: the accent
   is only 2.6:1 against body text, under the 3:1 needed for a colour-only cue.
   Covered by tests/test_answer_link_contrast.py.

   The :not() pair is load-bearing, not tidiness. Data chips render their own
   anchors inside .md-content on a lighter #1a2a3c pill; this selector
   out-specifies their single-class rules below, so without the exclusion it
   repainted them #4a8fd4 (4.28:1 on the pill, under AA — their own #60a5fa is
   5.73:1) and underlined a control that is deliberately not underlined. Keep
   any future answer-link rule excluded the same way. */
.message.agent .md-content a:not(.data-chip-key):not(.data-detail-link):not(.jira-chip-key):not(.jira-detail-link),
.message.agent .md-content a:not(.data-chip-key):not(.data-detail-link):not(.jira-chip-key):not(.jira-detail-link):visited {
    color: #4a8fd4;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.message.agent .md-content a:not(.data-chip-key):not(.data-detail-link):not(.jira-chip-key):not(.jira-detail-link):hover { color: #6fa9e0; }
.message.agent .md-content code {
    background: #1a1d25;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.message.agent .md-content .code-block {
    position: relative;
}
.message.agent .md-content .code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    font-size: 12px;
    color: #c9d1d9;
    background: #1f232d;
    border: 1px solid #2d3340;
    border-radius: 6px;
    cursor: pointer;
}
.message.agent .md-content .code-copy-btn:hover { background: #2a303c; }
.message.agent .md-content pre {
    background: #12141a;
    border: 1px solid #1e2028;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    overflow-x: auto;
    font-size: 12px;
}
.message.agent .md-content pre code {
    background: none;
    padding: 0;
}
.message.agent .md-content table {
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
    width: 100%;
}
.message.agent .md-content th,
.message.agent .md-content td {
    border: 1px solid #2a2d35;
    padding: 6px 10px;
    text-align: left;
}
.message.agent .md-content th {
    background: #1a1d25;
    color: #aaa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.message.agent .md-content td { color: #ccc; }
.message.agent .md-content h1,
.message.agent .md-content h2,
.message.agent .md-content h3 {
    color: #fff;
    margin: 16px 0 8px;
    font-weight: 600;
}
.message.agent .md-content h1 { font-size: 18px; }
.message.agent .md-content h2 { font-size: 16px; }
.message.agent .md-content h3 { font-size: 14px; }
.message.agent .md-content blockquote {
    border-left: 3px solid #4a8fd4;
    padding-left: 12px;
    color: #999;
    margin: 10px 0;
}

/* --- Pollux cards (TH-inspired, dark mode) --- */

.card-intro {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #b0b8c4;
}

.pollux-card {
    background: #161920;
    border: 1px solid #252830;
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.pollux-card:hover {
    border-color: #35394a;
}

.pollux-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #1e2028;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #3b82f6;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    flex-shrink: 0;
}

.card-badge-slide {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 6px;
}

.pollux-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #e8ecf0;
}

.pollux-card-body {
    padding: 14px 20px 18px;
    font-size: 14px;
    line-height: 1.7;
    color: #b0b8c4;
}
.pollux-card-body p { margin-bottom: 8px; }
.pollux-card-body p:last-child { margin-bottom: 0; }
.pollux-card-body strong { color: #e0e6ec; }
.pollux-card-body ul, .pollux-card-body ol {
    margin: 6px 0 6px 18px;
}
.pollux-card-body li { margin-bottom: 4px; }
.pollux-card-body h3 {
    font-size: 13px;
    font-weight: 600;
    color: #d0d6de;
    margin: 12px 0 4px;
}
.pollux-card-body em {
    color: #8aa0bc;
    font-style: italic;
}

/* Slide cards — subtle purple tint */
.pollux-card-slide {
    border-color: #2a2540;
}
.pollux-card-slide:hover {
    border-color: #3d3560;
}
.pollux-card-slide .pollux-card-header {
    border-bottom-color: #252040;
}

/* Suggested Follow-Ups callout */
.card-callout {
    background: linear-gradient(135deg, #141c2a, #1a2435);
    border: 1px solid #253a52;
    border-left: 3px solid #3b82f6;
    border-radius: 12px;
    margin-top: 20px;
    overflow: hidden;
}
.card-callout-title {
    padding: 14px 18px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.card-callout-body {
    padding: 0 18px 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #8aa0bc;
}
.card-callout-body ul {
    list-style: none;
    padding: 0;
}
.card-callout-body li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}
.card-callout-body li::before {
    content: '\2192';
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: 700;
}

/* --- Contact cards (TH-inspired) --- */

.contact-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.contact-card {
    background: #12151c;
    border: 1px solid #252830;
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.2s;
}
.contact-card:hover {
    border-color: #35394a;
}

.contact-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}
.contact-avatar.has-linkedin {
    background: linear-gradient(135deg, #0077b5, #00a0dc);
    color: #fff;
}
.contact-avatar.no-linkedin {
    background: #2a2d35;
    color: #888;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 14px;
    font-weight: 600;
    color: #e8ecf0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.contact-title {
    font-size: 12px;
    color: #8aa0bc;
    margin-top: 2px;
}

.contact-email {
    font-size: 11px;
    color: #4a8fd4;
    margin-top: 3px;
}

.contact-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.contact-score {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.contact-score.score-high { background: #10b981; }
.contact-score.score-med  { background: #f59e0b; }
.contact-score.score-low  { background: #64748b; }

.contact-product-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.contact-product-badge.product-ecoa {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
}
.contact-product-badge.product-catalyst,
.contact-product-badge.product-rwe {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
}
.contact-product-badge.product-edc,
.contact-product-badge.product-essentials {
    background: #1e3a5f;
    color: #60a5fa;
}
.contact-product-badge.product-default {
    background: #1e2028;
    color: #888;
}

.contact-body {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #1e2028;
}

.contact-reason {
    font-size: 12px;
    line-height: 1.6;
    color: #8aa0bc;
}

.contact-badge-li {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    background: #0077b520;
    color: #00a0dc;
}

.contact-badge-di {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    background: #10b98120;
    color: #34d399;
}

/* Steps (tool calls) */
.steps-container {
    margin-bottom: 12px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
}
.step:hover { color: #999; }
.step.active { color: #4a8fd4; }
.step.done { color: #5a9a6a; }
.step.error { color: #c45; }

.step-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #2a2d35;
    border-top-color: #4a8fd4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.step-check { color: #5a9a6a; font-size: 14px; }

.step-label { font-weight: 500; }
.step-detail {
    color: #666;
    font-size: 12px;
    margin-left: auto;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Expandable tool detail */
.step-output {
    display: none;
    background: #12141a;
    border: 1px solid #1e2028;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 4px 0 8px 26px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #999;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.step-output.open { display: block; }

/* Rich step output (slides, images) — override monospace */
.step-output.rich {
    font-family: inherit;
    white-space: normal;
}
.step-output img {
    max-width: 280px;
    border-radius: 6px;
    border: 1px solid #2a2d35;
    margin: 6px 0;
    display: block;
}
.step-output a {
    color: #4a8fd4;
    text-decoration: none;
}
.step-output a:hover { text-decoration: underline; }
.step-output p { margin: 4px 0; }
.step-output strong { color: #ccc; }

/* Input area — centered like chat */
.input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 24px 16px;
    max-width: 808px;
    margin: 0 auto;
    width: 100%;
    border-top: 1px solid #1e2028;
    flex-shrink: 0;
    position: relative;
}
.input-hint {
    display: none;
    position: absolute;
    top: -22px;
    left: 0;
    right: 0;
    font-size: 12px;
    color: #7a8399;
    text-align: center;
    pointer-events: none;
}

/* AIS-61: the thread-busy notice carries a Stop action, so it has to opt back
   into pointer events that .input-hint disables for the container. Without this
   the button renders but cannot be clicked. */
.input-hint-action {
    pointer-events: auto;
    margin-left: 4px;
    padding: 0 6px;
    font: inherit;
    color: #4a6cf7;
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

.input-hint-action:disabled {
    color: #7a8399;
    cursor: default;
    text-decoration: none;
}

textarea {
    flex: 1;
    background: #1a1d25;
    border: 1px solid #2a2d35;
    color: #e0e0e0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 126px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.5;
    transition: border-color 0.15s, height 0.1s ease;
}
textarea:focus { border-color: #4a8fd4; }

#send {
    width: 42px;
    height: 42px;
    background: #4a8fd4;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
#send:hover { background: #5a9fe4; }
#send:disabled { background: #222; color: #444; cursor: not-allowed; }

.mic-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    color: #888;
    border: 1px solid #333;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mic-btn:hover { color: #ccc; border-color: #555; }
.mic-btn.listening {
    color: #e05555;
    border-color: #e05555;
    background: rgba(224, 85, 85, 0.1);
    animation: mic-pulse 1.2s ease-in-out infinite;
}
.mic-btn.transcribing {
    color: #10b981;
    border-color: transparent;
    background: rgba(16, 185, 129, 0.10);
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
    animation: mic-glow 1.6s ease-in-out infinite;
}
/* Running border: a conic-gradient sweep arc rotated around the button.
   The mask trick punches out the inside so only a 1px ring shows. */
.mic-btn.transcribing::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 270deg, #10b981 330deg, #6ee7b7 355deg, #10b981 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: mic-border-spin 1.1s linear infinite;
    pointer-events: none;
}
.mic-btn.mic-error {
    color: #f59e0b;
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}
@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224, 85, 85, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(224, 85, 85, 0); }
}
@keyframes mic-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
    50%      { box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.45); }
}
@keyframes mic-border-spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
.chat::-webkit-scrollbar,
.step-output::-webkit-scrollbar { width: 4px; }
.chat::-webkit-scrollbar-track,
.step-output::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb,
.step-output::-webkit-scrollbar-thumb { background: #2a2d35; border-radius: 4px; }

/* Agent status indicator (thinking / running tools / composing) */
.agent-status {
    padding: 6px 0;
}
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4a8fd4;
}
.status-label { font-weight: 500; }
.status-timer {
    color: #555;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.status-stall {
    color: #b87a3d;
    font-size: 12px;
}
.stop-btn {
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-left: 4px;
}
.stop-btn:hover {
    background: #a93226;
}

/* Thinking dots */
.thinking-dots {
    display: inline-flex;
    gap: 4px;
    padding: 8px 0;
}
.thinking-dots span {
    width: 6px;
    height: 6px;
    background: #4a8fd4;
    border-radius: 50%;
    animation: dotPulse 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Composing dots — inline indicator in message body after tools complete */
.composing-dots {
    display: inline-flex;
    gap: 5px;
    padding: 12px 0 4px;
}
.composing-dots span {
    width: 7px;
    height: 7px;
    background: #4a8fd4;
    border-radius: 50%;
    animation: dotPulse 1.2s ease-in-out infinite;
}
.composing-dots span:nth-child(2) { animation-delay: 0.2s; }
.composing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* --- Action buttons (Generate Outline / Executive Summary / Sanity Check) --- */

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #1e2028;
    flex-wrap: wrap;
}

.action-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #fff;
}

.action-btn-outline {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}
.action-btn-outline:hover {
    background: linear-gradient(135deg, #9b6cf6, #7376f1);
    transform: translateY(-1px);
}

.action-btn-summary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.action-btn-summary:hover {
    background: linear-gradient(135deg, #4b92f6, #3573fb);
    transform: translateY(-1px);
}

.action-btn-doc {
    background: linear-gradient(135deg, #10b981, #059669);
}
.action-btn-doc:hover {
    background: linear-gradient(135deg, #20c991, #06a679);
    transform: translateY(-1px);
}

.action-btn-sanity {
    background: linear-gradient(135deg, #d97706, #b45309);
}
.action-btn-sanity:hover {
    background: linear-gradient(135deg, #e98716, #c46319);
    transform: translateY(-1px);
}

.action-btn-jira {
    background: linear-gradient(135deg, #0052cc, #0747a6);
}
.action-btn-jira:hover {
    background: linear-gradient(135deg, #0065ff, #0052cc);
    transform: translateY(-1px);
}

/* --- Data chips (Jira, PMC, Meeting) --- */

.data-chip {
    margin: 4px 0;
    border-left: 2px solid transparent;
    border-radius: 3px;
    transition: border-color 0.15s, background 0.15s;
}
.data-chip.expanded {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.04);
}

.data-chip-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    flex-wrap: wrap;
}
.data-chip-header.data-chip-expandable {
    cursor: pointer;
}
.data-chip-header.data-chip-expandable:hover {
    opacity: 0.85;
}

.data-chip-chevron {
    font-size: 11px;
    color: #64748b;
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.15s;
}
.data-chip-header.data-chip-expandable:hover .data-chip-chevron {
    color: #94a3b8;
}

.data-chip-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.data-badge-jira { background: #1e3a5f; color: #60a5fa; }
.data-badge-pmc { background: #1e3520; color: #6ee7b7; }
.data-badge-meeting { background: #3b2e1e; color: #fbbf24; }

.data-chip-key {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
    background: #1a2a3c;
    border: 1px solid #253a52;
    border-radius: 3px;
    padding: 1px 5px;
    flex-shrink: 0;
}
.data-chip-key:hover {
    background: #1e3a5f;
    border-color: #3b82f6;
}

.data-chip-title {
    font-size: 13px;
    color: #c8d0d8;
    flex: 1;
    min-width: 0;
}

.data-status-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.data-status-done { background: #065f46; color: #6ee7b7; }
.data-status-inprogress { background: #1e3a5f; color: #60a5fa; }
.data-status-blocked { background: #7f1d1d; color: #fca5a5; }
.data-status-todo { background: #1e2028; color: #94a3b8; }
.data-status-default { background: #1e2028; color: #64748b; }

.data-chip-detail {
    display: none;
    padding: 6px 0 2px 28px;
    font-size: 12px;
    color: #8aa0bc;
}
.data-chip-detail.open { display: flex; flex-wrap: wrap; gap: 8px 16px; }

.data-detail-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.data-detail-label {
    font-size: 10px;
    color: #555;
    font-weight: 500;
}

.data-detail-link {
    font-size: 11px;
    color: #60a5fa;
    text-decoration: none;
}
.data-detail-link:hover { text-decoration: underline; }

/* Legacy Jira chip classes (keep for backwards compat) */

.jira-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    position: relative;
    vertical-align: baseline;
}

.jira-chip-key {
    display: inline-block;
    background: #1a2a3c;
    border: 1px solid #253a52;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #60a5fa;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.jira-chip-key:hover {
    background: #1e3a5f;
    border-color: #3b82f6;
    color: #93bbfc;
}

/* Status pills — inline color badges */
.jira-status-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.jira-status-done { background: #065f46; color: #6ee7b7; }
.jira-status-inprogress { background: #1e3a5f; color: #60a5fa; }
.jira-status-blocked { background: #7f1d1d; color: #fca5a5; }
.jira-status-todo { background: #1e2028; color: #94a3b8; }
.jira-status-default { background: #1e2028; color: #64748b; }

.jira-chip-toggle {
    background: none;
    border: none;
    color: #444;
    font-size: 9px;
    cursor: pointer;
    padding: 0 1px;
    line-height: 1;
    transition: color 0.15s;
}
.jira-chip-toggle:hover { color: #aaa; }

.jira-chip-detail {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    background: #12151c;
    border: 1px solid #252830;
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 300px;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    font-size: 12px;
    line-height: 1.5;
}

.jira-detail-title {
    font-weight: 600;
    color: #e0e6ec;
    margin-bottom: 8px;
    font-size: 13px;
}

.jira-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    color: #b0b8c4;
}

.jira-detail-label {
    font-size: 11px;
    color: #64748b;
    min-width: 60px;
    font-weight: 500;
}

.jira-detail-link {
    display: inline-block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #1e2028;
    font-size: 11px;
    color: #60a5fa;
    text-decoration: none;
}
.jira-detail-link:hover {
    text-decoration: underline;
}

.action-btn-disabled {
    background: #1e2028;
    color: #555;
    cursor: not-allowed;
    opacity: 0.5;
    border: 1px dashed #333;
}
.action-btn-disabled:hover {
    transform: none;
}

/* --- Pin button --- */

.pin-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: transparent;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 4px;
    border-radius: 4px;
    z-index: 1;
}
.message.agent {
    position: relative;
}
.message.agent:hover .pin-btn {
    opacity: 0.5;
}
.pin-btn:hover {
    opacity: 1 !important;
    background: #1a1d25;
}
.pin-btn.pinned {
    opacity: 1 !important;
    animation: pinPulse 0.3s ease;
}
@keyframes pinPulse {
    50% { transform: scale(1.3); }
}

/* --- Workspace sidebar --- */

.workspace {
    width: 300px;
    flex-shrink: 0;
    background: #12141a;
    border-left: 1px solid #1e2028;
    display: flex;
    flex-direction: column;
    transition: width 0.2s, opacity 0.2s;
    overflow: hidden;
}
.workspace.collapsed {
    width: 0;
    border-left: none;
    opacity: 0;
    pointer-events: none;
}

.workspace-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #1e2028;
    flex-shrink: 0;
}
.workspace-title {
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    flex: 1;
}
.workspace-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 0 6px;
}
.workspace-clear {
    background: transparent;
    border: none;
    color: #555;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
}
.workspace-clear:hover { color: #e55; }

.workspace-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.workspace-card {
    background: #1a1d25;
    border: 1px solid #252830;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    position: relative;
    font-size: 11px;
    line-height: 1.5;
    color: #888;
}
.workspace-card-text {
    white-space: pre-wrap;
    word-break: break-word;
}
.workspace-card-remove {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: none;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
}
.workspace-card-remove:hover { color: #e55; }

/* Workspace toggle button */
.workspace-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #1a1d25;
    border: 1px solid #2a2d35;
    border-radius: 10px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 10;
}
.workspace-toggle:hover { color: #fff; border-color: #4a8fd4; background: #1a2a3c; }

.workspace-toggle-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    background: #3b82f6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* --- Upload chip & button --- */

.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

textarea#input.expanded {
    /* Base textarea rule has `flex: 1` — that makes the parent flex column
       treat `height` as a soft preferred-size and collapses it to min-height.
       Opt out of flex sizing in expanded mode so `height: 400px` is honored
       as a hard size. */
    flex: 0 0 auto !important;
    height: 400px !important;
    max-height: 600px;
    resize: vertical;
    min-height: 126px;
}

.expand-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid #2a2d35;
    border-radius: 10px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    transition: color 0.15s, border-color 0.15s;
}
.expand-btn:hover { color: #e0e0e0; border-color: #4a5568; }
.expand-btn.active { color: #4a8fd4; border-color: #4a8fd4; }

.upload-btn {
    width: 42px;
    height: 42px;
    background: transparent;
    border: 1px solid #2a2d35;
    border-radius: 12px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.upload-btn:hover { color: #aaa; border-color: #4a4d55; background: #1a1d25; }

/* --- Attachments container (multi-file) --- */

.attachments-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.attachments-container:empty { display: none; }

.upload-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a2a3c;
    border: 1px solid #253a52;
    border-radius: 8px;
    padding: 4px 10px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #8ab4dc;
}

.image-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1a2a3c;
    border: 1px solid #253a52;
    border-radius: 8px;
    padding: 4px 10px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #8ab4dc;
}
.image-chip-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #334;
}
.image-chip-label {
    flex: 1;
}

/* Shared remove button for both chip types */
.att-remove {
    background: transparent;
    border: none;
    color: #8ab4dc;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
}
.att-remove:hover { color: #e55; }

/* --- "Short answers" switch (composer, AIS-96) --- */

.short-answers-toggle {
    align-self: flex-start;
    margin-bottom: 8px;
    background: transparent;
    border: 1px solid #253a52;
    border-radius: 8px;
    padding: 2px 10px;
    font-size: 12px;
    color: #8a9bb0;
    cursor: pointer;
}
.short-answers-toggle:hover { color: #b9d4ee; border-color: #3a6491; }
.short-answers-toggle[aria-pressed="true"] {
    background: #17324e;
    border-color: #3a6491;
    color: #bcdcf7;
    font-weight: 600;
}

/* --- Optional support-ticket chip (Support space composer) --- */

.ticket-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ticket-cap {
    font-size: 12px;
    font-weight: 600;
    color: #8a9bb0;
    letter-spacing: 0.2px;
}

.ticket-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #1a2a3c;
    border: 1px solid #253a52;
    border-radius: 8px;
    padding: 2px 4px 2px 10px;
    font-size: 12px;
    color: #8ab4dc;
}
.ticket-chip-label {
    background: transparent;
    border: none;
    color: #8ab4dc;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
}
.ticket-chip-label:hover { color: #b9d4ee; }
.ticket-chip-clear {
    background: transparent;
    border: none;
    color: #8ab4dc;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.ticket-chip-clear:hover { color: #e55; }

.ticket-chip-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #17324e;
    border: 1px solid #3a6491;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #bcdcf7;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ticket-chip-add:hover { color: #eaf4ff; border-color: #5a90c8; background: #1e3c5c; }

.ticket-input {
    background: #10151d;
    border: 1px solid #253a52;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    color: #dce7f2;
    outline: none;
    width: 220px;
    max-width: 100%;
}
.ticket-input:focus { border-color: #4a8fd4; }
.ticket-input.invalid { border-color: #e55; }

/* --- Attachments in user messages (after sending) --- */

.msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.msg-attach-thumb {
    width: 120px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #334;
    cursor: pointer;
    transition: opacity 0.15s;
}
.msg-attach-thumb:hover { opacity: 0.8; }

.msg-attach-file {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #12202e;
    border: 1px solid #253a52;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #8ab4dc;
}
.msg-attach-icon { font-size: 14px; }

/* --- Landing page tool grid --- */

.landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    gap: 20px;
}

.landing-header {
    text-align: center;
}
.landing-header .welcome-icon { font-size: 36px; opacity: 0.6; }
.landing-header h2 { font-size: 22px; font-weight: 600; color: #e8ecf0; margin: 10px 0 6px; }
.landing-header p { font-size: 13px; color: #666; }
.landing-stats { color: #4a8fd4 !important; font-weight: 500; font-size: 13px !important; letter-spacing: 0.3px; }

/* --- Prompt cards (hero action grid) --- */

.prompt-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 520px;
    width: 100%;
}

.prompt-card {
    background: #161920;
    border: 1px solid #252830;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
a.prompt-card { text-decoration: none; text-align: center; }
.prompt-card:hover {
    border-color: #4a8fd4;
    background: #1a2030;
    transform: translateY(-1px);
}

.prompt-card-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.prompt-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #e0e6ec;
}

.prompt-card-subtitle {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* --- Data sources collapsible toggle --- */

.data-sources-toggle {
    max-width: 520px;
    width: 100%;
    margin-top: 8px;
}

.data-sources-btn {
    background: transparent;
    border: none;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.15s;
    width: 100%;
    text-align: center;
}
.data-sources-btn:hover { color: #888; }

.data-sources-panel {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #1e2028;
}

.landing-tools {
    max-width: 600px;
    width: 100%;
}

.landing-category {
    margin-bottom: 16px;
}

.landing-category-title {
    font-size: 10px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 4px 6px;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.landing-card {
    background: #161920;
    border: 1px solid #252830;
    border-radius: 10px;
    padding: 12px;
    cursor: default;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.landing-card:hover {
    border-color: #35394a;
}

.landing-card-icon {
    font-size: 18px;
    margin-bottom: 4px;
}

.landing-card-label {
    font-size: 12px;
    font-weight: 600;
    color: #ccc;
}

.landing-card-desc {
    font-size: 11px;
    color: #555;
}

.landing-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 600px;
}

/* ============================================================
   Landing page v2 — per-space cards with examples + tool map
   ============================================================ */

@keyframes landing-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes landing-fadeout {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

.landing-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 40px;
    gap: 20px;
    animation: landing-fadein 0.3s ease both;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.landing-v2-fadeout {
    animation: landing-fadeout 0.28s ease both;
    pointer-events: none;
}

/* --- Hero header --- */

.landing-v2-header {
    text-align: center;
    margin-bottom: 4px;
}

.landing-v2-icon {
    font-size: 38px;
    opacity: 0.55;
    display: block;
    margin-bottom: 10px;
}

.landing-v2-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.landing-v2-sub {
    font-size: 13px;
    color: #666;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* --- Space card grid --- */

.landing-v2-spaces {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    width: 100%;
}

/* --- Individual space card --- */

.landing-space-card {
    background: #13151d;
    border: 1px solid #222530;
    border-radius: 14px;
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.landing-space-card:hover {
    border-color: #2e3248;
    box-shadow: 0 4px 24px rgba(0,0,0,0.28);
}

.landing-space-card.active {
    border-color: #2a3a56;
    background: #141820;
    box-shadow: 0 2px 16px rgba(74,143,212,0.08);
}

/* Card head row */
.lsc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.lsc-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.lsc-name {
    font-size: 14px;
    font-weight: 700;
    color: #e0e6ec;
    flex: 1;
}

.lsc-beta {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #8b5cf6;
    background: rgba(139,92,246,0.12);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 4px;
    padding: 2px 6px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Tagline */
.lsc-tagline {
    font-size: 12px;
    color: #555;
    line-height: 1.45;
    margin: 0;
}

/* Example queries */
.lsc-examples {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lsc-example {
    background: transparent;
    border: 1px solid #1e2230;
    border-radius: 8px;
    color: #8aa0bc;
    font-size: 12px;
    font-family: inherit;
    text-align: left;
    padding: 7px 10px;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lsc-example:hover {
    border-color: #4a8fd4;
    color: #c8d8e8;
    background: #181e2e;
}

.landing-space-card.active .lsc-example {
    border-color: #252e44;
    color: #7a96b8;
}

.landing-space-card.active .lsc-example:hover {
    border-color: #4a8fd4;
    color: #c8d8e8;
    background: #181e2e;
}

/* Tool chip map */
.lsc-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 6px;
    border-top: 1px solid #1a1d28;
}

.lsc-tool-chip {
    font-size: 11px;
    color: #4a5568;
    background: #12141c;
    border: 1px solid #1e2028;
    border-radius: 20px;
    padding: 3px 9px;
    white-space: nowrap;
    line-height: 1.4;
    cursor: default;
    transition: color 0.15s, border-color 0.15s;
}

.landing-space-card.active .lsc-tool-chip {
    color: #5a7090;
    border-color: #252e44;
}

.landing-space-card.active .lsc-tool-chip:hover {
    color: #8aa0bc;
    border-color: #354565;
}

/* Responsive */
@media (max-width: 700px) {
    .landing-v2 { padding: 16px 12px 32px; gap: 12px; }
    .landing-v2-spaces { grid-template-columns: 1fr; }
    .landing-v2-title { font-size: 22px; }
    .lsc-tools { display: none; }
}

/* Slide thumbnail images in agent messages */
.msg-text img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid #333;
    margin: 4px 0;
}

/* When multiple images appear consecutively, grid them */
.msg-text p:has(img) + p:has(img),
.msg-text p:has(img) {
    display: inline-block;
    width: 48%;
    vertical-align: top;
    margin-right: 2%;
}

/* Single-image paragraphs (e.g. cover slide) stay full width */
.msg-text p:has(img):only-of-type {
    display: block;
    width: 100%;
    margin-right: 0;
}

/* --- Space selector --- */

.space-selector {
    background: #1a1d25;
    border: 1px solid #2a2d35;
    border-radius: 8px;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 28px 6px 10px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.space-selector:hover { border-color: #4a4d55; }
.space-selector:focus { border-color: #4a8fd4; }
.space-selector option {
    background: #1a1d25;
    color: #ccc;
}

/* --- Action tray --- */

.action-tray {
    background: #12141a;
    padding: 0;
    flex-shrink: 0;
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}

/* Support space has no action-tray chips (triage/reply/export/sanity). */
body.support-space .action-tray { display: none !important; }

.action-tray-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 6px 0;
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s;
}

.action-tray-toggle:hover { color: #aaa; }

.action-tray-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.action-tray.collapsed .action-tray-arrow {
    transform: rotate(180deg);
}

.action-tray-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
    transition: max-height 0.2s, opacity 0.15s;
    max-height: 200px;
    opacity: 1;
}

.action-tray.collapsed .action-tray-buttons {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 12px;
}

.action-tray-btn {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid #2a2d38;
    background: #1a1d25;
    color: #b0b8c8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.action-tray-btn:hover:not(:disabled) {
    background: #252830;
    border-color: #4a8fd4;
    color: #e0e4ec;
}

.action-tray-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Action button color variants */
.action-tray-btn.color-orange { background: #3a2510; border-color: #6a4520; color: #e8a040; }
.action-tray-btn.color-orange:hover { background: #4a3015; border-color: #8a5530; }
.action-tray-btn.color-blue { background: #1a2a3c; border-color: #2a4a6c; color: #6ab4e8; }
.action-tray-btn.color-blue:hover { background: #1e3448; border-color: #3a5a7c; }
.action-tray-btn.color-green { background: #1a3020; border-color: #2a5030; color: #6ad070; }
.action-tray-btn.color-green:hover { background: #1e3a28; border-color: #3a6040; }
.action-tray-btn.color-purple { background: #2a1a3c; border-color: #4a2a6c; color: #b48ae8; }
.action-tray-btn.color-purple:hover { background: #341e48; border-color: #5a3a7c; }
.action-tray-btn.color-red { background: #3a1a1a; border-color: #6a2a2a; color: #e86a6a; }
.action-tray-btn.color-red:hover { background: #481e1e; border-color: #7a3a3a; }

.action-tray-divider {
    width: 1px;
    background: #2a2d38;
    align-self: stretch;
    margin: 2px 4px;
}

/* --- Feedback (thumbs up/down) --- */

.feedback-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #1e2028;
}

.feedback-label {
    font-size: 12px;
    color: #8890a0;
    font-weight: 500;
}

.feedback-hint {
    font-size: 11px;
    color: #555a68;
    margin-left: 4px;
}

.feedback-btn {
    background: #1a1d25;
    border: 1px solid #2a2d38;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}

.feedback-btn:hover:not(:disabled) {
    transform: scale(1.15);
}

.feedback-btn.feedback-up:hover:not(:disabled) {
    background: #1a3020;
    border-color: #2a5030;
}

.feedback-btn.feedback-down:hover:not(:disabled) {
    background: #3a1a1a;
    border-color: #6a2a2a;
}

.feedback-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.feedback-reason-form {
    width: 100%;
}

.feedback-reason-title {
    font-size: 13px;
    font-weight: 600;
    color: #d0d8e8;
    margin-bottom: 2px;
}

.feedback-reason-subtitle {
    font-size: 11px;
    color: #6a7080;
    margin-bottom: 8px;
}

.feedback-reason-input {
    width: 100%;
    background: #12141a;
    border: 1px solid #2a2d38;
    border-radius: 8px;
    color: #d0d8e8;
    font-size: 13px;
    padding: 8px 10px;
    resize: vertical;
    font-family: inherit;
    min-height: 44px;
}

.feedback-reason-input:focus {
    outline: none;
    border-color: #4a8fd4;
}

.feedback-reason-input::placeholder {
    color: #555a68;
}

.feedback-reason-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.feedback-submit-btn {
    background: #e86a6a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.feedback-submit-btn:hover:not(:disabled) {
    background: #f07a7a;
}

.feedback-submit-btn:disabled {
    opacity: 0.5;
}

.feedback-skip-btn {
    background: none;
    color: #6a7080;
    border: 1px solid #2a2d38;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.feedback-skip-btn:hover:not(:disabled) {
    color: #a0a8b8;
    border-color: #3a3d48;
}

.feedback-confirmed {
    font-size: 12px;
    color: #8890a0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feedback-confirmed span {
    font-size: 14px;
}

.feedback-submitted {
    border-top-color: transparent;
    padding-top: 6px;
    margin-top: 8px;
}

/* Reason chips above the thumbs-down textarea. Same surface, border and radius
   family as .feedback-tool-chips; the selected chip takes the Castor blue. */
.feedback-ask-sme {
    flex-basis: 100%;
    font-size: 12px;
    opacity: 0.85;
}

.feedback-reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.feedback-reason-chip {
    background: #1a1d25;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    color: #a8afc0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.feedback-reason-chip:hover {
    border-color: #4a8fd4;
}

.feedback-reason-chip.selected {
    background: #002265;
    border-color: #4a8fd4;
    color: #fff;
}

/* #143 — per-tool feedback chip card. Lives inside the thumbs-down modal
   under the comment textarea. Wraps the chip bar in the same elevated
   surface + radius as the plan-chip-bar so it visually feels like part of
   the same family (plan chips before the turn, feedback chips after). */
.feedback-tool-chips {
    margin-top: 10px;
    background: #1a1d25;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* The chip-bar lives inside the card; flatten the inner bar so we don't
   double-up backgrounds + borders. */
.feedback-tool-chips .pollux-chip-bar {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: none;
}

/* The "Which of these tools were correct?" headline gets a slightly
   stronger color than the plan-mode italic muted tone — it's a question
   asking for action, not narration. */
.feedback-tool-chips .pollux-chip-headline {
    color: #a8afc0;
    font-style: normal;
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 12px;
}

/* Ensure the chip label badge stays Castor-blue inside the card. */
.feedback-tool-chips .pollux-chip-label {
    background: #002265;
    color: #fff;
}

/* --- Mobile responsiveness --- */

@media (max-width: 768px) {
    .main-content { flex-direction: column; }
    .thread-sidebar { width: 100%; height: auto; max-height: 200px; border-right: none; border-bottom: 1px solid #1e2028; }
    .thread-list { padding: 4px; }
    .thread-item { padding: 6px 8px; }
    .thread-search input { font-size: 14px; }
    header { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
    .header-left h1 { font-size: 18px; }
    .subtitle { display: none; }
    .header-right { gap: 6px; }
    .space-selector { font-size: 12px; padding: 4px 8px; }
    .new-chat-btn { font-size: 12px; padding: 4px 8px; }
    .chat { padding: 8px; }
    .message { padding: 10px 12px; max-width: 95%; }
    .input-area { padding: 8px; gap: 6px; }
    textarea#input { font-size: 14px; }
    .workspace { display: none; }
    .workspace-toggle { display: none; }
    .landing-page { padding: 16px; }
    .prompt-cards-grid { grid-template-columns: 1fr; gap: 8px; }
    .prompt-card { padding: 12px; }
    .data-sources-toggle { display: none; }
    .action-buttons { flex-wrap: wrap; gap: 6px; }
    .action-btn { font-size: 11px; padding: 4px 8px; }
    .feedback-bar { flex-wrap: wrap; }
    .feedback-hint { display: none; }
    .pollux-card { margin: 8px 0; }
    .image-chip-thumb { width: 36px; height: 36px; }
}

@media (max-width: 480px) {
    .thread-sidebar { max-height: 150px; }
    .prompt-card-subtitle { display: none; }
    .user-email { display: none; }
    header { padding: 6px 8px; }
}

/* ---------------------------------------------------------------------------
   Turn-credit badge
   --------------------------------------------------------------------------- */

.turn-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-tertiary, #2a2a2a);
    color: var(--text-muted, #888);
    border: 1px solid var(--border, #333);
    white-space: nowrap;
    cursor: default;
    user-select: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.turn-badge-low {
    background: rgba(234, 179, 8, 0.15);
    color: #d97706;
    border-color: rgba(234, 179, 8, 0.35);
}

.turn-badge-empty {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
}

/* ---------------------------------------------------------------------------
   Turn-credit overlay (shown when turns = 0)
   --------------------------------------------------------------------------- */

/* The overlay takes the composer's place in the flow, so the input area grows
   to fit it and the chat above shrinks. Absolutely positioned, it was only as
   tall as the composer and pushed its submit button below the window.
   showTurnOverlay()/hideTurnOverlay() toggle the inline style.display, hence
   the attribute match; !important beats #send and the mic button's inline
   display. */
.input-area:has(> .turn-overlay[style*="display: flex"]) > :not(.turn-overlay):not(.input-hint) {
    display: none !important;
}

/* On a short window the form is taller than the space under the header (342px
   against ~250px at 667x375), and .chat-wrapper clips. So the input area may
   shrink below its content while the overlay shows, on one line so the
   overlay's stretched height is that bound, and the overlay scrolls inside it.
   "safe" keeps the title reachable: plain center overflows it off the top,
   where no scroll can reach. */
.input-area:has(> .turn-overlay[style*="display: flex"]) {
    flex-shrink: 1;
    min-height: 0;
    flex-wrap: nowrap;
}

.turn-overlay {
    flex: 1 1 100%;
    align-self: stretch;
    overflow-y: auto;
    background: rgba(15, 15, 15, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: safe center;
    justify-content: center;
    border-radius: 12px;
}

.turn-overlay-inner {
    text-align: center;
    padding: 20px 28px;
    max-width: 320px;
}

.turn-overlay-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.turn-overlay-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #f0f0f0);
    margin-bottom: 6px;
}

.turn-overlay-body {
    font-size: 13px;
    color: var(--text-muted, #aaa);
    line-height: 1.5;
}

.turn-overlay-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.overlay-fb-btn {
    background: #1a1d25;
    color: #e0e0e0;
    border: 1px solid #2a2d35;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.overlay-fb-btn:hover:not(:disabled) { background: #252833; border-color: #4a8fd4; }
.overlay-fb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.overlay-fb-up:hover:not(:disabled) { border-color: #10b981; }
.overlay-fb-down:hover:not(:disabled) { border-color: #f59e0b; }

.turn-overlay-reason {
    margin-top: 12px;
    width: 100%;
    max-width: 360px;
}
.overlay-fb-reason {
    width: 100%;
    background: #1a1d25;
    color: #e0e0e0;
    border: 1px solid #2a2d35;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}
.overlay-fb-reason:focus { border-color: #4a8fd4; outline: none; }
.turn-overlay-reason-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}
.overlay-fb-cancel, .overlay-fb-submit {
    background: #1a1d25;
    color: #e0e0e0;
    border: 1px solid #2a2d35;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}
.overlay-fb-submit {
    background: #4a8fd4;
    border-color: #4a8fd4;
    color: #fff;
}
.overlay-fb-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Roadmap button — header shortcut */
.roadmap-btn {
    background: transparent;
    color: #6a8fbc;
    border: 1px solid #2a3848;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.roadmap-btn:hover { color: #6ab4e8; border-color: #4a8fd4; background: #1a2a3c; }
@media (max-width: 600px) { .roadmap-btn { display: none; } }

/* ---------------------------------------------------------------------------
   What's New badge — header button with optional unread dot
   --------------------------------------------------------------------------- */

.whats-new-btn {
    position: relative;
    background: transparent;
    color: #6a8fbc;
    border: 1px solid #2a3848;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.whats-new-btn:hover { color: #6ab4e8; border-color: #4a8fd4; background: #1a2a3c; }
.whats-new-btn-unseen {
    color: #8bbfe8;
    border-color: #3a5878;
}
.whats-new-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4a9eff;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
@media (max-width: 600px) { .whats-new-btn { display: none; } }

/* ---------------------------------------------------------------------------
   Release Notes view
   --------------------------------------------------------------------------- */

.release-block {
    background: #13161f;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.release-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1e2230;
}

.release-version {
    font-size: 16px;
    font-weight: 700;
    color: #e8eaf0;
}

.release-date {
    font-size: 12px;
    color: #555;
}

.release-category {
    margin-bottom: 14px;
}

.release-category-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #4a8fd4;
    margin-bottom: 8px;
}

.release-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.release-items li {
    font-size: 13px;
    color: #b0b8cc;
    line-height: 1.55;
    padding-left: 16px;
    position: relative;
}

.release-items li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: #3a4458;
}

.release-items li strong {
    color: #d8dce8;
    font-weight: 600;
}

.release-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 7px 14px;
    background: #1a1d25;
    border: 1px solid #2a2d38;
    border-radius: 7px;
    color: #7a8aaa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.release-copy-btn:hover { color: #c0c8d8; border-color: #4a5568; background: #1e2230; }
.release-copy-btn-copied { color: #10b981 !important; border-color: #10b981 !important; }

/* ---- Structured-citation decorator spans (P2.4 / #82 / #83) ----
   Rendered by decorateStructuredResponse() in app.js into assistant
   messages. Visual vocabulary mirrors the test-run preview in
   playbook_builder.html so badges read the same in both surfaces. */
.pollux-confidence-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    margin-bottom: 4px;
    vertical-align: baseline;
}

.pollux-sources-heading {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #4a8fd4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}

.pollux-missing-data {
    display: inline-block;
    font-style: italic;
    font-size: 12px;
    color: #f59e0b;
    background: rgba(251, 191, 36, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

/* fix/legal-source-badges — typed source badge chip + compact detail line.
   Renders in front of a .pollux-citation's claim when the citation carries
   a source_type (Legal today; any space with typed citations tomorrow). */
.pollux-citation {
    margin: 6px 0;
}
.pollux-citation-type {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(74, 143, 212, 0.14);
    color: #4a8fd4;
    border: 1px solid rgba(74, 143, 212, 0.3);
    vertical-align: baseline;
}
.pollux-citation-type-clause_deviation { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.pollux-citation-type-legal_position { background: rgba(139, 92, 246, 0.12); color: #a78bfa; border-color: rgba(139, 92, 246, 0.3); }
.pollux-citation-type-insurance_policy { background: rgba(16, 185, 129, 0.12); color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.pollux-citation-type-salesforce_opportunity { background: rgba(96, 165, 250, 0.12); color: #60a5fa; border-color: rgba(96, 165, 250, 0.3); }
.pollux-citation-detail {
    font-size: 11px;
    color: #8c93a6;
    margin-top: 2px;
    margin-left: 2px;
}

/* Degraded-mode marker: a citation bound to a synthetic tool_run_id
   (no persisted record). Muted gray-amber so the user notices but
   does not read it as a hard error. */
.pollux-unrecorded-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(156, 163, 175, 0.14);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.25);
    margin-left: 4px;
    vertical-align: baseline;
    letter-spacing: 0.02em;
}

/* ----------------------------------------------------------------------
   #118 — Plan-mode chip bar (Castor brand styling)

   Castor palette used here:
     --castor-blue       #002265   primary brand blue
     --castor-blue-mid   #214893   hover / accent
     --castor-green      #3ACDA1   accent / success
     --castor-gray       #45597E   secondary text
   Dark-theme surface: #1a1d25 (matches existing .message bg).

   Layout: card → narration → tool rows → action buttons.
   Per-tool ✓/✗ controls are hidden by default; revealed when the bar has
   the .editing class (toggled by the Adjust button or feedback mode).
   When the user clicks Run, JS adds .approved which collapses everything
   into a single-line "✓ Approved N tools" pill.
   ---------------------------------------------------------------------- */

.pollux-chip-bar {
    background: #1a1d25;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 6px 0 14px 0;
    max-width: 760px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    font-size: 13px;
    color: #d6d8de;
}

.pollux-chip-headline {
    font-style: italic;
    color: #8c93a6;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.pollux-chip-empty {
    color: #8c93a6;
    font-style: italic;
    font-size: 13px;
    padding: 4px 0;
}

.pollux-chip-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.pollux-chip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 2px;
    line-height: 1.5;
    transition: opacity 0.15s ease;
}

.pollux-chip-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.pollux-chip-label {
    display: inline-block;
    background: #002265;
    color: #fff;
    font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.pollux-chip-sep {
    color: #45597E;
    margin: 0 2px;
    user-select: none;
}

.pollux-chip-why {
    color: #c0c4cf;
    font-size: 13px;
    line-height: 1.5;
}

/* Per-tool ✓/✗ row actions — hidden in default read-only preview.
   Revealed when bar enters .editing state (Adjust pressed) or in feedback mode. */
.pollux-chip-row-actions {
    display: none;
    gap: 6px;
    flex-shrink: 0;
}

.pollux-chip-bar.editing .pollux-chip-row-actions {
    display: inline-flex;
}

.pollux-chip-action {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #3a3d48;
    background: transparent;
    color: #8c93a6;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pollux-chip-keep-btn:hover {
    background: rgba(58, 205, 161, 0.15);
    border-color: #3ACDA1;
    color: #3ACDA1;
}
.pollux-chip-drop-btn:hover {
    background: rgba(229, 85, 85, 0.15);
    border-color: #e55;
    color: #e55;
}
.pollux-chip-keep-btn.pollux-chip-action-active {
    background: #3ACDA1;
    border-color: #3ACDA1;
    color: #0f1117;
}
.pollux-chip-drop-btn.pollux-chip-action-active {
    background: rgba(229, 85, 85, 0.18);
    border-color: #e55;
    color: #e55;
}

/* When a row is marked drop in editing mode, fade & strike the rationale. */
.pollux-chip-bar.editing .pollux-chip.pollux-chip-drop {
    opacity: 0.55;
}
.pollux-chip-bar.editing .pollux-chip.pollux-chip-drop .pollux-chip-why,
.pollux-chip-bar.editing .pollux-chip.pollux-chip-drop .pollux-chip-label {
    text-decoration: line-through;
    text-decoration-color: rgba(229, 85, 85, 0.65);
}

/* Action button row at the bottom of the card. */
.pollux-chip-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

.pollux-chip-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1.2;
}

.pollux-chip-btn-primary {
    background: #002265;
    color: #fff;
    border: 1px solid #002265;
}
.pollux-chip-btn-primary:hover {
    background: #214893;
    border-color: #214893;
}
.pollux-chip-btn-primary:disabled {
    opacity: 0.55;
    cursor: default;
}

.pollux-chip-btn-secondary {
    background: transparent;
    color: #6f8fd6;
    border: 1px solid #2f4a85;
}
.pollux-chip-btn-secondary:hover {
    background: rgba(33, 72, 147, 0.18);
    border-color: #214893;
    color: #b3c4ec;
}

.pollux-chip-btn-tertiary {
    background: transparent;
    color: #8c93a6;
    border: 1px solid transparent;
    padding: 8px 10px;
}
.pollux-chip-btn-tertiary:hover {
    color: #d6d8de;
    text-decoration: underline;
}

/* Approved-state pill: collapses the card to a compact inline badge. */
.pollux-chip-bar.approved {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 4px 0 10px 0;
}
.pollux-chip-bar.approved .pollux-chip-headline {
    display: none;
}
.pollux-chip-approved-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(58, 205, 161, 0.14);
    color: #6fe1bd;
    border: 1px solid rgba(58, 205, 161, 0.35);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}
.pollux-chip-approved-check {
    color: #3ACDA1;
    font-weight: 700;
}

/* Feedback-mode tweaks: the chip bar lives inside the thumbs-down modal,
   so we soften the card so it doesn't compete with the modal chrome. */
.pollux-chip-bar-feedback {
    background: transparent;
    border: 1px solid #2a2d3a;
    padding: 12px 14px;
    margin: 8px 0;
}
.pollux-chip-bar-feedback .pollux-chip-label {
    background: #214893;
}

/* ---------------------------------------------------------------------------
   Small-phone composer / chip / status fixes (~430px devices)
   --------------------------------------------------------------------------- */

@media (max-width: 640px) {
    /* #1 — composer: the textarea was squeezed into a ~200px column beside
       four buttons + the turn badge, wrapping the placeholder to 5 lines with
       its own scrollbar. Let the row wrap: the textarea (flex-basis 100%,
       pulled first via order) takes the full row, the attach/mic/expand/send
       buttons and the turn badge drop to a compact row underneath. */
    .input-area {
        flex-wrap: wrap;
        padding: 8px 12px 10px;
        gap: 6px;
    }
    .input-wrapper {
        order: -1;
        flex: 1 1 100%;
    }
    textarea#input {
        min-height: 52px;
    }
    .turn-badge {
        margin-left: auto;
    }

    /* #2 — action chips: wrap cleanly with visible edge padding instead of
       running off the panel edge. (Legal's wrong chip set is fixed in
       app.js — renderActionTray() was falling back to the "sales" bucket for
       any space it didn't special-case, including legal.) */
    .action-tray-buttons {
        padding: 0 10px 10px;
        gap: 8px;
    }

    /* #3 — the "Thinking / Stop" status row and the always-visible "Copy"
       button (absolutely positioned top-right of the agent message) sat in
       the same top-right corner. Reserve the Copy button's footprint on the
       status row so Stop never renders under it. */
    .message.agent .steps-container .status-indicator {
        padding-right: 58px;
        flex-wrap: wrap;
        row-gap: 4px;
    }

    /* #4 — the thread/conversation list sat inline above the transcript,
       pushing the answer down and, once a search box + a couple of entries
       were showing, reading as if it overlapped the top of the transcript.
       Collapse it by default and open it as a full-height drawer instead, via
       the header toggle — conversations stay reachable, but never compete
       with the transcript for space. */
    .thread-sidebar {
        display: none;
    }
    .thread-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 30px;
        background: transparent;
        color: #888;
        border: 1px solid #2a2d35;
        border-radius: 6px;
        font-size: 15px;
        cursor: pointer;
    }
    .thread-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        flex-shrink: 0;
        background: transparent;
        border: 1px solid #2a2d35;
        border-radius: 6px;
        color: #888;
        font-size: 16px;
        cursor: pointer;
        margin-right: 6px;
    }
    .thread-search {
        display: flex;
        align-items: center;
    }
    body.thread-drawer-open .thread-sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100%;
        background: #0f1117;
        z-index: 300;
    }
}

/* ── Study Risk Assessment scorecard (web/modules/study-risk.js) ──────────────
   Scoped to .sr-*; used by this card only. Tokens from the capacity
   walkthrough: ink #16181d, ink2 #4b5160, muted #8a8f99, rule #e6e8ec,
   soft #f6f7f9, blue #2a78d6. White, thin rules, inline bars, no shadows. */
.message.agent .md-content .sr-card{border:1px solid #e6e8ec;border-radius:14px;padding:22px 26px;margin:10px 0 6px;background:#fff;color:#16181d;font-size:14px;line-height:1.5}
.message.agent .md-content .sr-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}
.message.agent .md-content .sr-kicker{color:#8a8f99;font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:600}
.message.agent .md-content .sr-title{font-size:22px;font-weight:700;letter-spacing:-.015em;margin:2px 0}
.message.agent .md-content .sr-opp{color:#4b5160;font-size:13px}
.message.agent .md-content .sr-meta{display:flex;flex-wrap:wrap;gap:2px 12px;margin-top:6px;font-size:12px;color:#8a8f99}
.message.agent .md-content .sr-meta a:not(.data-chip-key):not(.data-detail-link):not(.jira-chip-key):not(.jira-detail-link){color:#2a78d6;text-decoration:none}
.message.agent .md-content .sr-badge{min-width:96px;text-align:center;border:2px solid #16181d;border-radius:12px;padding:6px 10px}
.message.agent .md-content .sr-badge-tier{font-size:34px;font-weight:700;line-height:1.05;letter-spacing:-.02em}
.message.agent .md-content .sr-badge-level{font-size:11px;color:#4b5160;text-transform:uppercase;letter-spacing:.08em;font-weight:600}
.message.agent .md-content .sr-badge.sr-none{border-color:#e6e8ec;color:#8a8f99}
.message.agent .md-content .sr-scale{margin:30px 0 4px}
.message.agent .md-content .sr-scale-bar{position:relative;display:flex;gap:2px;height:26px}
.message.agent .md-content .sr-seg{background:#f6f7f9;border-radius:4px;display:flex;align-items:center;justify-content:center}
.message.agent .md-content .sr-seg span{font-size:11px;color:#8a8f99;font-weight:600}
.message.agent .md-content .sr-seg.sr-on{background:#16181d}
.message.agent .md-content .sr-seg.sr-on span{color:#fff}
.message.agent .md-content .sr-marker{position:absolute;top:-22px;transform:translateX(-50%);font-size:11px;background:#2a78d6;color:#fff;border-radius:4px;padding:0 6px;font-weight:600}
.message.agent .md-content .sr-ticks{display:flex;justify-content:space-between;font-size:11px;color:#8a8f99;margin-top:3px}
.message.agent .md-content .sr-status{margin:14px 0 0;color:#4b5160}
.message.agent .md-content .sr-h{font-size:14px;margin:22px 0 8px;font-weight:700}
.message.agent .md-content .sr-table{width:100%;border-collapse:collapse;font-size:13px}
.message.agent .md-content .sr-table th{text-align:left;font-size:11px;color:#8a8f99;font-weight:600;border-bottom:1px solid #e6e8ec;padding:5px 8px}
.message.agent .md-content .sr-table td{border-bottom:1px solid #e6e8ec;padding:7px 8px;vertical-align:top;white-space:pre-line}
.message.agent .md-content .sr-table td:first-child{color:#8a8f99;white-space:nowrap}
.message.agent .md-content .sr-table .sr-num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.message.agent .md-content .sr-bar{display:inline-block;height:8px;background:#2a78d6;border-radius:2px;margin-right:8px;vertical-align:1px;opacity:.85}
.message.agent .md-content .sr-effort{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid #e6e8ec;border-radius:10px;margin-bottom:10px}
.message.agent .md-content .sr-kpi{padding:10px 12px;border-left:1px solid #e6e8ec}
.message.agent .md-content .sr-kpi:first-child{border-left:0}
.message.agent .md-content .sr-kpi-v{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}
.message.agent .md-content .sr-kpi-v small{font-size:12px;color:#8a8f99;font-weight:500}
.message.agent .md-content .sr-kpi-k{font-size:11px;color:#4b5160}
.message.agent .md-content .sr-note{margin-top:8px;font-size:12px;color:#8a8f99}
.message.agent .md-content .sr-flags{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
.message.agent .md-content .sr-flags span{font-size:11px;border-radius:999px;padding:2px 9px;border:1px solid #e6e8ec}
.message.agent .md-content .sr-flag-on{border-color:#16181d !important;font-weight:600}
.message.agent .md-content .sr-flag-off{color:#8a8f99}
.message.agent .md-content .sr-prov{margin-top:16px;font-size:11px;color:#8a8f99;border-top:1px solid #e6e8ec;padding-top:8px}
@media (max-width:640px){.message.agent .md-content .sr-effort{grid-template-columns:repeat(2,1fr)}.message.agent .md-content .sr-head{flex-direction:column}}
.message.agent .md-content .sr-card .sr-table th,.message.agent .md-content .sr-card .sr-table td{border:0;border-bottom:1px solid #e6e8ec;background:none;text-transform:none;letter-spacing:0}
.message.agent .md-content .sr-card .sr-table th{color:#8a8f99;font-size:11px}
.message.agent .md-content .sr-card .sr-table td{color:#16181d}
.message.agent .md-content .sr-card .sr-table td:first-child{color:#8a8f99}
.message.agent .md-content .sr-card p,.message.agent .md-content .sr-card h4{color:#16181d}


/* ── Study Pulse floor pack card (web/modules/floor-pack.js) ───────────────────
   Scoped to .floorpack*; one generic renderer for the five delivery-floor
   playbooks. Same tokens as the Study Risk card: ink #16181d, ink2 #4b5160,
   muted #8a8f99, rule #e6e8ec, soft #f6f7f9, blue #2a78d6. White, thin rules. */
.message.agent .md-content .floorpack{border:1px solid #e6e8ec;border-radius:14px;padding:22px 26px;margin:10px 0 6px;background:#fff;color:#16181d;font-size:14px;line-height:1.5}
.message.agent .md-content .floorpack-kicker{color:#8a8f99;font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:600}
.message.agent .md-content .floorpack-title{font-size:22px;font-weight:700;letter-spacing:-.015em;margin:2px 0}
.message.agent .md-content .floorpack-meta{display:flex;flex-wrap:wrap;gap:2px 12px;margin-top:6px;font-size:12px;color:#8a8f99}
.message.agent .md-content .floorpack-section{margin-top:18px}
.message.agent .md-content .floorpack-h{font-size:14px;margin:0 0 6px;font-weight:700;color:#16181d}
.message.agent .md-content .floorpack-lines{list-style:none;margin:0;padding:0}
.message.agent .md-content .floorpack-lines li{border-bottom:1px solid #e6e8ec;padding:5px 0;font-size:13px;color:#16181d;font-variant-numeric:tabular-nums}
.message.agent .md-content .floorpack-lines li:last-child{border-bottom:0}
.message.agent .md-content .floorpack-lines li.floorpack-l1{padding-left:18px;color:#4b5160}
.message.agent .md-content .floorpack-lines li.floorpack-l2{padding-left:36px;color:#2a78d6;font-size:12px;border-bottom:0;padding-top:0}
.message.agent .md-content .floorpack-lines li.floorpack-none{color:#8a8f99;font-style:italic}
.message.agent .md-content .floorpack-decisions{background:#f6f7f9;border-radius:10px;padding:12px 14px}
.message.agent .md-content .floorpack-decisions .floorpack-lines li{border-bottom:0;padding:3px 0}
.message.agent .md-content .floorpack-notes{margin-top:14px;font-size:12px;color:#8a8f99}
.message.agent .md-content .floorpack-foot{margin-top:12px;font-size:11px;color:#8a8f99;border-top:1px solid #e6e8ec;padding-top:8px}
@media (max-width:640px){.message.agent .md-content .floorpack{padding:16px 14px}}


/* --- Installed app / phone (2026-10-22) ---------------------------------- */
/* Respect the notch and home indicator when running as a PWA, and use the
   dynamic viewport so the composer isn't hidden behind the mobile URL bar. */
@supports (height: 100dvh) {
    .login-screen, .container { height: 100dvh; }
}
@media (max-width: 700px) {
    .header { padding-top: calc(10px + env(safe-area-inset-top)); }
    .input-area { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .header-menu-item, .login-btn { min-height: 44px; }
}
@media (display-mode: standalone) {
    body { overscroll-behavior-y: none; -webkit-user-select: none; user-select: text; }
}
