:root {
  --navy: #0e3472; --navy-ink: #16336e; --accent: #2360cf; --accent-soft: #eaf1fd; --accent-softer: #f4f8fe; --ring: rgb(35 96 207 / .18);
  --fg: #18181b; --body: #3f3f46; --muted: #676772; --faint: #9a9aa3; --line: #e5e7eb; --line-soft: #f0f1f4;
  --mist: #f3f5f8; --sky: #cfe4fb; --bg: #f6f7f9; --panel: #fff;
  --note: #fff8e1; --note-line: #f3df9b; --note-ink: #6b4f00; --note-tab: #fcebb0;
  /* Ask: the team's chat with Robin, a grey-green teal so it never reads as the conversation. */
  --ask: #3e8079; --ask-ink: #24534e; --ask-soft: #e2efec; --ask-softer: #f2f7f6; --ask-line: #bfd8d3; --ask-ring: rgb(62 128 121 / .18);
  --customer: #f0f2f5; --team: #e7effc;
  --red: #d92d20; --amber: #f79009; --green: #12b76a; --slate: #8794ab;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / .05);
  --shadow-lg: 0 12px 32px rgb(16 24 40 / .14), 0 2px 6px rgb(16 24 40 / .06);
  --serif: Lora, Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --nav-w: 220px; --list-w: 340px; --side-w: 300px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.55 Lato, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
kbd { font: 700 10.5px/1 var(--mono); color: var(--muted); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; }
.boot { padding: 48px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: #b42318; }
.ic { flex: none; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn { height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; font-size: 13.5px; color: var(--navy-ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--mist); }
.btn.primary { background: var(--navy-ink); border-color: var(--navy-ink); color: #fff; }
.btn.primary:hover { background: var(--navy); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 44px; font-size: 15px; }
.btn:disabled { opacity: .55; }
a.btn { text-decoration: none; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; }
.icon-btn:hover { background: var(--mist); color: var(--fg); }
.link-btn { border: 0; background: transparent; color: var(--accent); font-size: 12.5px; font-weight: 700; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--accent-soft); }
.pill-btn { height: 32px; padding: 0 10px 0 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700; color: var(--body); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; max-width: 100%; }
.pill-btn > span:not(.av):not(.status-dot) { overflow: hidden; text-overflow: ellipsis; }
.pill-btn:hover, .pill-btn[aria-expanded="true"] { background: var(--mist); border-color: #d6d9df; }
.pill-btn .ic:last-child { color: var(--faint); }
.pill-btn > .ic:first-child { margin-left: 4px; color: var(--accent); }

/* ─── Chips and dots ──────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; line-height: 18px; border-radius: 999px; padding: 0 8px; background: #f1f1f3; color: var(--body); white-space: nowrap; }
.chip .ic { width: 11px; height: 11px; }
.silent-chip { background: var(--note); color: var(--note-ink); border: 1px solid var(--note-line); }
.marker.not-sent { color: var(--note-ink); }
.chip.blocking { background: #fef0ef; color: #b42318; }
.chip.broken { background: #fff6e0; color: #93370d; }
.chip.ai { background: var(--accent-soft); color: #17468f; }
.chip.verified { background: #e9f9f0; color: #067647; }
.chip.cost { background: var(--line-soft); color: var(--muted); font-family: var(--mono); font-weight: 600; cursor: default; }
.chip.cost .ic { color: var(--faint); }
.chip.status-open { background: #fff4e5; color: #93370d; }
.chip.status-waiting { background: #eef1f6; color: #3d4a63; }
.chip.status-resolved { background: #e9f9f0; color: #067647; }
.chip.outcome { margin-left: 6px; background: #f1f1f3; color: var(--body); }
.chip.outcome.clarify { background: #eef1f6; color: #3d4a63; }
.chip.outcome.answer { background: #e9f9f0; color: #067647; }
.chip.outcome.hand_off { background: #fff4e5; color: #93370d; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--slate); }
.status-dot.open { background: var(--amber); }
.status-dot.waiting { background: var(--amber); }
.status-dot.resolved { background: var(--green); }

/* ─── Avatars ─────────────────────────────────────────────────────────── */
.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; font-weight: 700; overflow: hidden; user-select: none; letter-spacing: .02em; line-height: 1; background: var(--mist); color: var(--body); }
.av-xs { width: 20px; height: 20px; font-size: 8.5px; }
.av-sm { width: 26px; height: 26px; font-size: 10.5px; }
.av-md { width: 34px; height: 34px; font-size: 12.5px; }
.av-lg { width: 60px; height: 60px; font-size: 21px; }
.av-staff { background: var(--navy-ink); color: #fff; }
.av-robin { background: var(--sky); }
.av-robin svg, .av-robin img { width: 100%; height: 100%; display: block; object-fit: cover; }
.av-agent { background: #fcebb0; color: #7a5600; }
.av-empty { background: #fff; color: var(--faint); border: 1px dashed #c9cdd5; }
.av-empty svg { width: 60%; height: 60%; }

/* ─── Sign-in ─────────────────────────────────────────────────────────── */
.signin { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, #e8effb, var(--bg)); }
.signin-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); }
.signin-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; color: var(--navy-ink); letter-spacing: .02em; }
.signin-card h1 { margin: 0; font: 600 24px/1.2 var(--serif); color: var(--navy-ink); }
.signin-card p { margin: 0; color: var(--muted); }
.signin-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--body); }
.signin-card input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-weight: 400; }
.signin-card input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.warn { background: var(--note); border: 1px solid var(--note-line); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--note-ink); }
.brand-tile { width: 30px; height: 30px; border-radius: 8px; background: var(--navy); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-tile .gem { width: 19px; height: auto; }

/* ─── Layout ──────────────────────────────────────────────────────────── */
.app { height: 100%; display: grid; grid-template-columns: var(--nav-w) var(--list-w) minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr); grid-template-areas: 'top top top' 'side list main'; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; background: #fff; border-bottom: 1px solid var(--line); min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; border-radius: 10px; padding: 4px; }
.brand-name { font: 600 16px/1 var(--serif); color: var(--navy-ink); white-space: nowrap; }
.topbar-gap { flex: 1; }
/* The customer sidebar's toggle: only while a conversation (and so a sidebar) is showing. */
.app:not(:has(#sidebar)) .sidebar-toggle { display: none; }
.sidebar-toggle[aria-expanded="true"] { background: var(--mist); color: var(--fg); }
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--line-strong, #d4d4d8); flex: none; transition: background .3s; }
.live-dot.on { background: #12b76a; box-shadow: 0 0 0 3px rgb(18 183 106 / .15); }
.alerts-btn .ic { flex: none; }
@media (max-width: 720px) { .alerts-btn span { display: none; } .alerts-btn { padding: 0 9px; } }
.me { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--body); min-width: 0; }
.me-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Left nav */
.side { grid-area: side; background: var(--bg); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; min-height: 0; }
.nav { display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-heading { margin: 0 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.side-foot { margin: auto 10px 2px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.4; color: var(--muted); }
.side-foot b { color: var(--body); }
.me-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: 999px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--body); cursor: pointer; min-width: 0; }
.me-btn:hover, .me-btn[aria-expanded="true"] { background: var(--mist); border-color: var(--line); }
.me-btn .ic { color: var(--muted); width: 12px; height: 12px; }
.me-wrap .pop { left: auto; right: 0; min-width: 240px; padding: 6px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.me-card > span { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.me-email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.me-pop [role="menuitemradio"] { text-decoration: none; color: var(--fg); }
.me-pop [role="menuitemradio"] .ic { color: var(--muted); }
.me-rule { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.av-photo { background: var(--line-soft); }
.av-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--body); text-decoration: none; font-size: 13.5px; font-weight: 700; }
.nav-item:hover { background: #eceef2; }
.nav-item[aria-current="page"] { background: #fff; color: var(--navy-ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.nav-ic { display: inline-flex; color: var(--muted); }
.nav-item[aria-current="page"] .nav-ic { color: var(--accent); }
.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #e9ebef; }
.count.hot { color: #fff; background: var(--red); }
.stats { display: flex; flex-direction: column; gap: 8px; }
.stats h2 { margin: 0 4px 2px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; box-shadow: var(--shadow-sm); }
.stat-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.stat .value { font-size: 18px; font-weight: 900; color: var(--navy-ink); line-height: 1.1; }
.stat .label { font-size: 12px; color: var(--body); font-weight: 700; line-height: 1.25; }
.stat .sub { font-size: 11px; color: var(--muted); line-height: 1.3; }
.meter { height: 4px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #4e8bed); }

/* Conversation list */
.list { grid-area: list; background: #fafafb; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.list-search { padding: 12px 12px 6px; }
.search { position: relative; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); transition: border-color .12s, background .12s, box-shadow .12s; }
.search:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--ring); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font-size: 13.5px; color: var(--fg); height: 100%; }
.search input::placeholder { color: var(--faint); }
.search:focus-within .search-key, .search.has-value .search-key { display: none; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 18px 6px; min-height: 36px; }
.list-head h2 { margin: 0; font-size: 13px; font-weight: 900; color: var(--fg); letter-spacing: .01em; }
.list-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.list-body { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.list-foot { margin: 10px 18px; font-size: 11.5px; color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0 8px; display: flex; flex-direction: column; }
.row-item { position: relative; }
/* A hairline between rows, hidden around the hovered or picked one. */
.row-item + .row-item::before { content: ''; position: absolute; top: 0; left: 14px; right: 14px; border-top: 1px solid var(--line-soft); }
.row-item:hover::before, .row-item:hover + .row-item::before, .row-item:has(.row[aria-current="true"])::before, .row-item:has(.row[aria-current="true"]) + .row-item::before { border-color: transparent; }
.row { display: flex; gap: 11px; padding: 11px 12px 11px 10px; border: 1px solid transparent; border-radius: 12px; text-decoration: none; color: inherit; position: relative; transition: background .1s, box-shadow .1s, border-color .1s; }
.row-item:hover .row { background: #fff; border-color: var(--line); box-shadow: 0 1px 3px rgb(16 24 40 / .07), 0 1px 2px rgb(16 24 40 / .04); }
.row[aria-current="true"], .row-item:hover .row[aria-current="true"] { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.row[aria-current="true"]::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.row:focus-visible { outline-offset: -2px; }
.row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.row-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-name { font-size: 13.5px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { margin-left: auto; padding-left: 6px; font-size: 11.5px; color: var(--faint); flex: none; transition: margin-right .1s; }
.row-subject { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-snippet { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-who { font-weight: 700; color: var(--body); }
.row.unread .row-name { font-weight: 900; color: var(--fg); }
.row.unread .row-subject { color: var(--fg); font-weight: 700; }
.row.unread .row-snippet { color: var(--body); }
.row.unread .row-time { color: var(--accent); font-weight: 700; }
.row-prio { display: inline-flex; flex: none; margin-left: auto; }
.row-prio + .row-time { margin-left: 0; padding-left: 4px; }
.row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.row-tags { display: flex; align-items: center; gap: 6px; margin-top: 5px; min-width: 0; flex-wrap: wrap; }
.row-owner { display: inline-flex; flex: none; }
/* Close on hover: the time steps left to make room. */
.row-close { position: absolute; top: 7px; right: 7px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .1s; }
.row-close:hover { background: var(--mist); color: var(--fg); }
.row-item:hover .row-close, .row-close:focus-visible { opacity: 1; pointer-events: auto; }
.row-item:hover .row-time, .row-item:focus-within .row-time { margin-right: 26px; }
.row-item.leaving { opacity: .4; pointer-events: none; transition: opacity .15s; }
.typing-text { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; }
.empty { padding: 48px 28px; color: var(--muted); text-align: center; font-size: 13px; }
.empty p { margin: 0 0 4px; }
.empty-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-softer); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.empty-ic svg { width: 22px; height: 22px; }
.empty-title { font-size: 14px; font-weight: 700; color: var(--fg); }

/* ─── Detail: conversation + sidebar ─────────────────────────────────── */
.detail { grid-area: main; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); min-height: 0; min-width: 0; background: #fff; overflow: hidden; }
.detail:not(:has(> .sidebar)) { display: block; overflow-y: auto; }
.detail.sidebar-closed { grid-template-columns: minmax(0, 1fr) 0; }
.detail.sidebar-closed > .sidebar { display: none; }
.sidebar-scrim { display: none; }
.detail-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); text-align: center; padding: 24px; background: linear-gradient(180deg, #fff, var(--accent-softer)); }
.detail-empty p { margin: 0; }
.empty-gem { width: 56px; height: 56px; border-radius: 16px; background: var(--navy); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; box-shadow: 0 8px 24px rgb(14 52 114 / .18); }
.empty-gem .gem { width: 34px; height: auto; }

.convo { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.convo-head { flex: none; padding: 14px 20px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.head-top { display: flex; align-items: flex-start; gap: 8px; }
.head-top > .btn { margin-top: 1px; }
.head-top .back { display: none; margin: -2px 0 0 -8px; }
.head-title { flex: 1; min-width: 0; }
.head-title h2 { margin: 0; font: 600 18px/1.3 var(--serif); color: var(--navy-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.head-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ref { display: inline-flex; align-items: center; gap: 5px; border: 0; background: var(--line-soft); border-radius: 6px; padding: 1px 7px; font: 700 11.5px/18px var(--mono); color: var(--body); }
.ref:hover { background: var(--line); }
.ref .ic { color: var(--faint); }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.head-gap { flex: 1; }

/* Popovers */
.pop-wrap { position: relative; min-width: 0; }
.pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 230px; max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.pop [role="menuitemradio"] { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; border: 0; background: transparent; text-align: left; width: 100%; font-size: 13px; color: var(--fg); }
.pop [role="menuitemradio"]:hover, .pop [role="menuitemradio"]:focus-visible { background: var(--mist); outline: 0; }
.pop [role="menuitemradio"][aria-checked="true"] { font-weight: 700; }
.pop-check { margin-left: auto; color: var(--accent); display: inline-flex; }
.pop-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.pop-foot .small { line-height: 1.35; }

/* Thread */
.thread-scroll { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: auto; }
.thread { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 14px; max-width: 900px; margin: 0 auto; }
.day { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 6px 0 -2px; }
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.msg-row { display: flex; gap: 10px; align-items: flex-start; }
.msg-row.right { flex-direction: row-reverse; }
.msg-row.grouped { margin-top: -8px; }
.msg-av { width: 34px; flex: none; display: flex; padding-top: 20px; }
.grouped .msg-av { padding-top: 0; }
.msg { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; max-width: min(80%, 640px); }
.right .msg { align-items: flex-end; }
.msg:has(.collapsible) { max-width: min(88%, 700px); }
.msg-meta { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 4px; flex-wrap: wrap; }
.right .msg-meta { justify-content: flex-end; }
.msg-meta .who { font-weight: 700; color: var(--fg); }
.msg-meta .role { color: var(--note-ink); font-weight: 700; }
.msg-meta .chip { line-height: 16px; padding: 0 6px; font-size: 10px; }
.msg-meta time, .msg-foot time { color: var(--muted); }
.bubble { border-radius: 16px; padding: 10px 14px; font-size: 14px; line-height: 1.55; color: var(--fg); min-width: 0; max-width: 100%; border: 1px solid transparent; }
.bubble.customer { background: var(--customer); border-top-left-radius: 5px; }
.bubble.team { background: var(--team); border-top-right-radius: 5px; }
.bubble.robin { background: #fff; border-color: var(--line); border-top-right-radius: 5px; box-shadow: var(--shadow-sm); }
.bubble.note, .bubble.robin-note, .bubble.agent { background: var(--note); border-color: var(--note-line); border-top-right-radius: 5px; color: #3b3200; }
.text.plain { white-space: pre-wrap; overflow-wrap: anywhere; }
.text.md { overflow-wrap: anywhere; }
.text.md p { margin: 0 0 8px; }
.text.md > :last-child { margin-bottom: 0; }
.text.md ol, .text.md ul { margin: 0 0 8px; padding-left: 20px; }
.text.md li { margin: 2px 0; }
.text.md li::marker { color: var(--muted); }
.text.md a { color: var(--accent); }
.text.md h4 { margin: 10px 0 4px; font-size: 13px; font-weight: 900; color: inherit; }
.text.md h4:first-child { margin-top: 0; }
/* Robin's help-center screenshots under its steps (widget/src/markdown.ts .shot): within the message, never full size */
.text.md .shot { display: block; width: fit-content; max-width: min(100%, 420px); margin: 8px 0; border-radius: 10px; }
.text.md .shot img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.text code { font: 11.5px/1.5 var(--mono); background: rgb(24 24 27 / .06); border-radius: 4px; padding: 1px 4px; overflow-wrap: anywhere; word-break: break-word; }
.text pre { margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: rgb(24 24 27 / .05); font: 11.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.text pre code { background: none; padding: 0; }
.staff-md { font-size: 13.5px; }
.bubble.note code, .bubble.robin-note code, .bubble.agent code, .bubble.note pre, .bubble.robin-note pre, .bubble.agent pre { background: rgb(107 79 0 / .08); }
.bubble.clamped .text { max-height: calc(1.55em * 4); overflow: hidden; -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent); }
.more { display: inline-flex; margin-top: 6px; border: 0; background: transparent; padding: 2px 0; font-size: 12px; font-weight: 900; color: var(--note-ink); border-radius: 4px; }
.more:hover { text-decoration: underline; }
.msg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 0 4px; font-size: 11px; color: var(--muted); }
.marker { display: inline-flex; align-items: center; gap: 4px; }
.marker.staff-only { color: var(--note-ink); font-weight: 700; }
.msg-activity { margin: 6px 0 0; max-width: 100%; font-size: 12px; color: var(--muted, #6c6c75); }
.msg-activity summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.msg-activity summary::-webkit-details-marker { display: none; }
.msg-activity summary span { font-weight: 700; }
.msg-activity.has-bad summary { color: #b42318; }
.msg-activity table { width: 100%; margin-top: 6px; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.msg-activity th, .msg-activity td { padding: 3px 6px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.msg-activity td.url { white-space: normal; word-break: break-all; }
.msg-activity td.url .err { margin-top: 2px; font-family: inherit; font-weight: 700; word-break: normal; }
.msg-activity tr.bad td { color: #b42318; background: #fef3f2; }
.msg-activity ul { margin: 6px 0 0; padding-left: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.msg-activity li.lv-error { color: #b42318; }
.msg-activity li span { color: var(--muted, #6c6c75); }
.msg-activity-note { margin: 6px 0 0; font-size: 11px; }
.msg-page { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 4px 0 0; font-size: 12px; color: var(--muted, #6c6c75); }
.msg-page svg { flex: none; }
.msg-page span { flex: none; font-weight: 700; }
.msg-page a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent, #2360cf); text-decoration: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.msg-page a:hover { text-decoration: underline; }
.asked { margin: 6px 0 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 13px; }
.asked-h { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--muted, #6c6c75); margin-bottom: 6px; }
.asked ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.asked-q { font-weight: 700; }
.asked-k { font-size: 11px; font-weight: 700; color: var(--accent, #2360cf); }
.asked-a { display: block; color: var(--muted, #6c6c75); }
.sources { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sources a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--accent); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sources a:hover { border-color: var(--accent); }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.right .files { justify-content: flex-end; }
.file-pill.checking, .file-pill.removed { opacity: .7; cursor: default; }
.files-dropped { font-size: 12px; color: #b45309; margin: 4px 0; }
.page-render { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.page-render-label { font-size: 11px; color: var(--muted, #71717a); }
.right .page-render { align-items: flex-end; }
.right .files-dropped { text-align: right; }
.thumb { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--mist); }
.thumb img { display: block; width: 120px; height: 88px; object-fit: cover; }
.thumb:hover { border-color: var(--accent); }
.file-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; color: var(--fg); font-size: 12.5px; }
.file-pill:hover { border-color: var(--accent); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.file-size { color: var(--muted); flex: none; }
.event { align-self: center; display: inline-flex; align-items: center; gap: 8px; max-width: 92%; padding: 6px 14px; border: 1px dashed var(--note-line); border-radius: 14px; background: #fffcf0; color: var(--note-ink); font-size: 12.5px; }
.event > span { min-width: 0; overflow-wrap: anywhere; }
.event time { color: var(--muted); flex: none; font-size: 11.5px; }
/* "How Robin got here": staff-only, so it uses the note tones. */
.review { align-self: flex-end; max-width: 100%; margin-top: 4px; font-size: 12px; color: var(--muted); }
.review[open] { align-self: stretch; }
.review summary { display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; cursor: pointer; list-style: none; border: 1px dashed var(--line); border-radius: 999px; padding: 3px 10px 3px 8px; line-height: 18px; }
.review summary::-webkit-details-marker { display: none; }
.review summary:hover { border-style: solid; background: var(--line-soft); }
.review summary .ic { width: 13px; height: 13px; color: #067647; }
.review.stopped summary { border-color: #f4b4ae; color: #b42318; }
.review.stopped summary .ic { color: #b42318; }
.rv-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rv-mood { flex: 0 3 auto; color: var(--faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.review summary .chip { flex: none; }
.rv-body { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px; display: grid; gap: 8px; }
.rv-row b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin-bottom: 2px; }
.rv-row ul { margin: 0; padding-left: 16px; color: var(--body); }
.rv-row p { margin: 0; color: var(--body); }
.rv-row pre { margin: 0; white-space: pre-wrap; font: 12.5px/1.5 var(--sans, inherit); color: var(--body); background: var(--line-soft); border-radius: 8px; padding: 8px 10px; }
.trace { align-self: flex-end; max-width: 100%; display: flex; flex-direction: column; align-items: flex-end; }
.msg:has(> .trace.open) { width: min(100%, 720px); max-width: min(92%, 720px); }
.trace.open { align-self: stretch; align-items: stretch; }
.trace-toggle { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px dashed var(--note-line); border-radius: 999px; background: #fffcf0; color: var(--note-ink); padding: 3px 10px 3px 8px; font-size: 12px; line-height: 18px; text-align: left; }
.trace-toggle:hover { background: var(--note); border-style: solid; }
.trace-toggle .ic { flex: none; width: 13px; height: 13px; }
.trace-toggle .ic:last-child { color: var(--note-ink); opacity: .7; transition: transform .15s; }
.trace.open .trace-toggle { align-self: flex-end; background: var(--note); border-style: solid; }
.trace.open .trace-toggle .ic:last-child { transform: rotate(180deg); }
.trace-title { font-weight: 900; white-space: nowrap; }
.trace-stats { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7d6418; }
.trace-body { margin-top: 6px; border: 1px solid var(--note-line); border-radius: 14px; background: #fffdf6; padding: 12px 14px 10px; color: var(--fg); }
.trace-msg { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trace-msg.error { color: #b42318; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 12px; top: 6px; bottom: 6px; width: 1px; background: var(--note-line); }
.tl-step { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 0 0 14px; }
.tl-step:last-child { padding-bottom: 4px; }
.tl-icon { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--note-line); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.tl-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 3px; }
.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-name { font-weight: 700; font-size: 13px; color: var(--fg); }
.tl-time { margin-left: auto; font: 11px/1.4 var(--mono); color: var(--muted); white-space: nowrap; }
.tl-badge { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: #b42318; background: #fef0ef; border-radius: 999px; padding: 0 7px; line-height: 16px; }
.tl-input { margin: 0; font-size: 13px; color: var(--body); overflow-wrap: anywhere; }
.tl-input q { quotes: '“' '”'; }
.tl-error { margin: 0; font-size: 12.5px; color: #b42318; background: #fef3f2; border: 1px solid #fecdca; border-radius: 8px; padding: 6px 9px; overflow-wrap: anywhere; }
.tl-step.fail .tl-icon { border-color: #fda29b; background: #fef3f2; }
.tl-step.fail .tl-name { color: #b42318; }
.tl-hits { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.tl-hits li { overflow-wrap: anywhere; }
.tl-hits li::marker { color: var(--faint); font-size: 11px; }
.tl-hits a { font-weight: 700; text-decoration: none; }
.tl-hits a:hover { text-decoration: underline; }
.tl-sec { color: var(--muted); margin-left: 6px; }
.tl-sec::before { content: '· '; }
.tl-score { margin-left: 6px; font: 10.5px/1 var(--mono); color: var(--muted); background: var(--line-soft); border-radius: 4px; padding: 2px 4px; }
.tl-block { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.tl-label { font-size: 10.5px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--note-ink); margin-bottom: 3px; }
.tl-cut { font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--muted); }
.tl-pre { align-self: stretch; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 11.5px/1.5 var(--mono); color: var(--body); white-space: pre-wrap; overflow-wrap: anywhere; max-height: calc(1.5em * 12 + 16px); overflow: hidden; }
.tl-pre.clamped { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.tl-pre.open { max-height: min(60vh, 520px); overflow: auto; -webkit-mask-image: none; mask-image: none; }
.tl-more { margin-top: 2px; }
.tl-foot { margin: 6px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--note-line); display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px 14px; font-size: 12px; }
.tl-foot > div { min-width: 0; }
.tl-foot .wide { grid-column: 1 / -1; }
.tl-foot dt { font-size: 10.5px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--note-ink); }
.tl-foot dd { margin: 0; color: var(--body); overflow-wrap: anywhere; }
.bubble.typing { display: inline-flex; align-items: center; gap: 10px; background: #fff; border-color: var(--line); color: var(--muted); font-size: 13px; border-top-right-radius: 5px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .3; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.typing-row .msg-av { padding-top: 0; }

details.chatlog { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 13px; }
details.chatlog summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 14px; cursor: pointer; color: var(--body); font-weight: 700; border-radius: 12px; }
details.chatlog summary::-webkit-details-marker { display: none; }
details.chatlog summary > span { flex: 1; }
details.chatlog summary .muted { font-weight: 400; }
details.chatlog summary .ic:last-child { color: var(--faint); transition: transform .15s; }
details.chatlog[open] summary .ic:last-child { transform: rotate(180deg); }
.chatlog-turns { display: flex; flex-direction: column; gap: 8px; padding: 2px 14px 12px; }
.turn { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--body); }
.turn b { color: var(--navy-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Composer */
.composer { flex: none; padding: 4px 20px 14px; max-width: 900px; width: 100%; margin: 0 auto; container-type: inline-size; }
@container (max-width: 560px) { .kbd-hint { display: none; } }
.composer-box { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgb(16 24 40 / .05); transition: border-color .12s, box-shadow .12s, background .12s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.composer.is-note .composer-box { background: var(--note); border-color: var(--note-line); }
.composer.is-note .composer-box:focus-within { border-color: #e2c45a; box-shadow: 0 0 0 3px rgb(247 144 9 / .16); }
.tabs { display: flex; gap: 2px; padding: 6px 8px 0; }
.tabs [role="tab"] { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tabs [role="tab"]:hover { color: var(--fg); background: var(--mist); }
.tabs [role="tab"][aria-selected="true"] { color: var(--navy-ink); background: var(--accent-soft); }
.composer.is-note .tabs [role="tab"]:hover { background: rgb(107 79 0 / .06); }
.composer.is-note .tabs [data-tab="note"][aria-selected="true"] { color: var(--note-ink); background: var(--note-tab); }
.composer .editor { display: block; width: 100%; outline: 0; padding: 6px 14px 2px; font-size: 14px; line-height: 1.5; min-height: 76px; max-height: 300px; overflow-y: auto; overflow-wrap: anywhere; cursor: text; }
.composer .editor:empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; }
.composer .editor ol, .composer .editor ul { margin: 2px 0; padding-left: 22px; }
.composer .editor code { font: 12.5px/1.5 var(--mono); background: rgb(24 24 27 / .06); border-radius: 4px; padding: 1px 4px; }
.composer.is-note .editor:empty::before { color: #a08a4a; }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px 12px; }
.composer-bar .btn { flex: none; }
.composer-gap { flex: 1; }
.kbd-hint { font-size: 11px; color: var(--faint); font-weight: 700; margin-right: 4px; white-space: nowrap; }
.composer.is-note .btn.primary { background: #7a5600; border-color: #7a5600; }
.composer.is-note .btn.primary:hover { background: #654700; }
.composer-hint { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: #93370d; }
.composer-hint > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-hint .ic { flex: none; }
.composer-hint[hidden] { display: none; }

/* Customer sidebar */
.sidebar { overflow-y: auto; border-left: 1px solid var(--line); background: #fff; padding: 20px 18px 28px; display: flex; flex-direction: column; gap: 22px; font-size: 13px; min-height: 0; }
.sidebar > div { display: flex; flex-direction: column; gap: 22px; }
.customer-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 6px 0 2px; }
.cc-name { margin-top: 10px; font-size: 15px; font-weight: 900; color: var(--fg); overflow-wrap: anywhere; }
.cc-email { font-size: 12.5px; color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.cc-email:hover { text-decoration: underline; }
.side-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.facts { margin: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--bg); border-radius: 12px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); flex: none; }
.facts dd { margin: 0; color: var(--fg); text-align: right; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.facts a { text-decoration: none; }
.side-section { display: flex; flex-direction: column; gap: 8px; }
.side-section h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.side-count { font-size: 10.5px; letter-spacing: 0; background: var(--line-soft); color: var(--body); border-radius: 999px; padding: 0 6px; line-height: 16px; }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.side-list li { display: flex; gap: 8px; align-items: flex-start; }
.side-ic { color: var(--faint); display: inline-flex; padding-top: 3px; }
.side-warn .side-ic { color: var(--red); }
.side-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.side-list a { color: var(--accent); text-decoration: none; }
.side-list a:hover { text-decoration: underline; }
.side-path { font: 11.5px/1.4 var(--mono); color: var(--body); overflow-wrap: anywhere; }
.side-meta { font-size: 11px; color: var(--muted); }
.side-note { margin: 0; font-size: 12px; color: var(--muted); }
.side-convos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.side-convos a { display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; text-decoration: none; color: var(--fg); }
.side-convos a:hover { background: var(--mist); border-color: var(--line); }
.side-convos .status-dot { grid-row: span 2; }
.sc-subject { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-meta { font-size: 11px; color: var(--muted); }
/* Activity: one compact row per page visit; details on hover (.act-popover) */
.act-list { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-direction: column; }
.act-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 8px; align-items: start; padding: 6px 8px; border-radius: 8px; color: var(--fg); text-decoration: none; cursor: default; }
a.act-row { cursor: pointer; }
.act-row:hover, .act-row:focus-visible { background: var(--mist); }
.act-ic { color: var(--faint); display: inline-flex; padding-top: 2px; }
.act-ic svg { width: 14px; height: 14px; }
.act-row.warn .act-ic { color: var(--red); }
.act-main { display: flex; flex-direction: column; min-width: 0; }
.act-title { font-size: 13px; font-weight: 700; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-sum { display: block; font-size: 11.5px; line-height: 1.45; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-sum .act-dot { color: var(--faint); }
.act-sum .act-warn { color: var(--red); }
.act-time { font-size: 11px; color: var(--faint); white-space: nowrap; padding-top: 2px; }
.act-older { margin-top: 2px; }
.act-older summary { list-style: none; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--accent); padding: 4px 0; }
.act-older summary::-webkit-details-marker { display: none; }
.act-older[open] summary { color: var(--muted); }
.act-popover { position: fixed; z-index: 60; width: 300px; max-height: min(420px, calc(100vh - 16px)); overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 12.5px; }
.act-popover[hidden] { display: none; }
.pop-title { font-weight: 700; font-size: 13.5px; margin-bottom: 2px; }
.pop-url { display: block; font: 11px/1.45 var(--mono); color: var(--accent); overflow-wrap: anywhere; margin-bottom: 8px; text-decoration: none; }
a.pop-url:hover { text-decoration: underline; }
.pop-facts { margin: 0 0 8px; display: grid; gap: 2px; }
.pop-facts > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.pop-facts dt { color: var(--muted); }
.pop-facts dd { margin: 0; }
.pop-events { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 3px; }
.pop-events li { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 6px; }
.pop-events time { color: var(--faint); font-size: 11.5px; }
.pop-events span { overflow-wrap: anywhere; }
.pop-events .act-warn span { color: var(--red); }
.pop-more { color: var(--muted); font-style: italic; }
.pop-hint { margin-top: 8px; font-size: 11px; color: var(--muted); }

.side-skeleton { display: flex; flex-direction: column; gap: 10px; }
.side-skeleton span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line-soft), #f8f9fb, var(--line-soft)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.side-skeleton span:nth-child(2) { width: 80%; }
.side-skeleton span:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Sent email */
.playbook-page { padding: 22px 28px 48px; max-width: 860px; }
.playbook-intro { max-width: 560px; padding-top: 24px; color: var(--body); font-size: 14px; line-height: 1.6; }
.playbook-intro p { margin: 0 0 12px; }
.playbook-intro .btn { margin-top: 6px; }
.playbook-form { display: flex; flex-direction: column; gap: 18px; }
.pb-head { display: flex; align-items: center; gap: 8px; }
.pb-head .outbox-title { margin: 0; }
.pb-field { display: flex; flex-direction: column; gap: 4px; }
.pb-field label, .pb-check b { font-size: 13px; font-weight: 700; color: var(--fg); }
.pb-hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pb-field input, .pb-field textarea { margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 14px; line-height: 1.5; background: #fff; color: var(--fg); width: 100%; }
.pb-field textarea { resize: vertical; }
.pb-field textarea.mono { font: 12.5px/1.55 var(--mono); }
.pb-field input:focus, .pb-field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.pb-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.pb-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.pb-check > span { display: flex; flex-direction: column; gap: 2px; }
.pb-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fef0ef; color: #b42318; font-size: 13px; }
.pb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to bottom, transparent, var(--panel) 30%); }
.pb-gap { flex: 1; }
.pb-meta { font-size: 12px; color: var(--muted); }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { background: #fef0ef; }
.link-btn.with-ic { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.playbook-row.off .row-name { color: var(--muted); }
.outbox { padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.outbox-title { margin: 0 0 4px; font: 600 18px/1.3 var(--serif); color: var(--navy-ink); }
.mail { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.mail-head { display: flex; align-items: center; gap: 10px; }
.mail-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-softer); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mail-subject { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-head time { font-size: 12px; color: var(--muted); flex: none; }
.mail-meta { margin: 4px 0 0 38px; font-size: 12px; color: var(--muted); }
.mail pre { margin: 10px 0 0 38px; white-space: pre-wrap; font: 12px/1.55 var(--mono); color: var(--body); max-height: 220px; overflow: auto; }

/* Toasts */
.toasts { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--navy-ink); color: #fff; font-size: 13px; font-weight: 700; padding: 9px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); transition: opacity .3s, transform .3s; max-width: min(90vw, 480px); }
.toast.error { background: #b42318; }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1439px) {
  :root { --nav-w: 204px; --list-w: 312px; --side-w: 280px; }
  .thread { padding: 16px 18px 22px; }
  .composer { padding: 4px 16px 12px; }
  .convo-head { padding: 12px 16px 10px; }
}
/* The sidebar becomes a drawer over the conversation. */
@media (max-width: 1199px) {
  .detail, .detail.sidebar-closed { grid-template-columns: minmax(0, 1fr); }
  .detail > .sidebar, .detail.sidebar-closed > .sidebar { display: flex; position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 90%); z-index: 50; box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .2s ease; visibility: hidden; }
  .detail.sidebar-open > .sidebar { transform: none; visibility: visible; }
  .detail.sidebar-open > .sidebar-scrim { display: block; position: absolute; inset: 0; z-index: 45; background: rgb(16 24 40 / .18); }
}
/* The nav becomes an icon rail. */
@media (max-width: 1023px) {
  :root { --nav-w: 64px; --list-w: 300px; }
  .side { padding: 12px 8px; align-items: center; }
  .nav-item { width: 44px; height: 40px; padding: 0; justify-content: center; }
  .nav-label, .stats, .brand-name, .me-name, .nav-heading, .side-foot { display: none; }
  .nav { gap: 10px; }
  .nav-item .count { position: absolute; top: 1px; right: -3px; min-width: 18px; height: 16px; font-size: 10px; padding: 0 4px; }
}
/* One pane at a time. */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 52px auto minmax(0, 1fr); grid-template-areas: 'top' 'side' 'main'; }
  .side { flex-direction: row; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-group { flex-direction: row; gap: 4px; }
  .list, .detail { grid-area: main; border-right: 0; }
  .app[data-pane="detail"] .list, .app[data-pane="detail"] .side { display: none; }
  .app[data-pane="detail"], .app[data-pane="page"] { grid-template-rows: 52px minmax(0, 1fr); grid-template-areas: 'top' 'main'; }
  .app[data-pane="list"] .detail { display: none; }
  .head-top .back { display: inline-flex; }
  .msg { max-width: 88%; }
  .msg:has(.collapsible) { max-width: 92%; }
  .kbd-hint { display: none; }
  .msg:has(> .trace.open) { width: 100%; max-width: 100%; }
  .trace-body { padding: 10px 10px 8px; }
  .tl-time { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .dots i { opacity: .7; }
}

/* Priority and snooze */
.chip.snoozed .ic { width: 11px; height: 11px; }
.chip.snoozed { background: #eef0ff; color: #3e4ab8; }
/* A conversation a teammate started while impersonating the customer. */
.chip.staff-test { background: #fff1d6; color: #8a5300; }
.marker.staff-test { color: #8a5300; font-weight: 600; }
/* The tap-to-answer badges Robin offered in a chat. */
.marker.quick-offered { color: var(--accent, #2360cf); }
.marker.vote.down { color: #b42318; font-weight: 600; }
.marker.vote.up { color: #067647; font-weight: 600; }
.pop-snooze { min-width: 260px; }
.pop-snooze [role="menuitemradio"] { justify-content: space-between; }
.snooze-custom { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 4px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
.snooze-custom > div { display: flex; gap: 6px; }
.snooze-custom input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; height: 32px; font-size: 13px; }
.pop-foot-note { margin: 4px 8px 2px; line-height: 1.4; }
.head-customer { color: inherit; text-decoration: none; font-weight: 700; }
.head-customer:hover { color: var(--accent); text-decoration: underline; }
a.cc-name { text-decoration: none; }
a.cc-name:hover { color: var(--accent); text-decoration: underline; }

/* Customer notes */
.cnotes { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cnote { background: var(--note); border: 1px solid var(--note-line); border-radius: 10px; padding: 8px 10px; }
.cnote-body { font-size: 13px; line-height: 1.45; color: var(--fg); overflow-wrap: anywhere; }
.cnote-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--note-ink); }
.cnote-meta .link-btn { padding: 2px 4px; display: inline-flex; }
.cnote-add { display: flex; flex-direction: column; gap: 6px; }
.people .person { justify-content: space-between; }
.person-email { font-size: 13px; color: var(--fg); overflow-wrap: anywhere; }
.person .btn { align-self: flex-start; margin-top: 4px; }
.person-add { display: flex; gap: 6px; }
.person-add input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; background: #fff; }
.person-add input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.cnote-add textarea { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; resize: vertical; min-height: 40px; background: #fff; }
.cnote-add textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.cnote-actions { display: flex; justify-content: flex-end; gap: 6px; }
.cnote-actions[hidden] { display: none; }

/* Customer profile page */
.customer-page { padding: 22px 28px 48px; max-width: 980px; }
.customer-page .pb-head { margin-bottom: 18px; }
.customer-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.customer-card-page { gap: 10px; }
.customer-card-page .facts { width: 100%; text-align: left; }
.customer-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.customer-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.customer-side > div { display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 760px) {
  .customer-page { padding: 16px 16px 40px; }
  .customer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Draft with Robin */
.composer { position: relative; }
.composer-ai { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.composer-ai[hidden] { display: none; }
@media (max-width: 700px) {
  .composer-bar { flex-wrap: wrap; row-gap: 6px; }
  .kbd-hint { display: none; }
  .composer-ai { flex: 1 1 100%; }
}

/* ─── Robin's actions: cards in the thread, and their settings ───────────── */
.ac-row { display: flex; justify-content: center; margin: 10px 0 14px; }
.ac-card { width: 100%; max-width: 640px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); }
.ac-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ac-titles { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ac-card h3 { margin: 0; font-size: 16px; font-weight: 900; color: var(--navy-ink); line-height: 1.3; }
.ac-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.ac-chip { flex: none; background: #fff4e5; color: #93370d; line-height: 22px; padding: 0 10px; font-size: 12px; }
.ac-chip.editing { background: var(--accent-soft); color: var(--accent); }
.ac-reason { margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg); }
.ac-reason a { color: var(--accent); font-weight: 700; }
.ac-checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--body); }
.ac-checks li { display: flex; align-items: center; gap: 8px; }
.ac-checks li.ok .ic { color: #067647; }
.ac-checks li.flag { color: #93370d; }
.ac-checks li.flag .ic { color: var(--amber); width: 15px; height: 15px; }
/* What a card changes: one row per record, the record's name above "now → becomes". */
.ac-changes { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg); padding: 12px 14px; }
.ac-changes h4 { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ac-changes dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ac-changes dl > div { display: flex; flex-direction: column; gap: 2px; }
.ac-changes dt { font-size: 12.5px; color: var(--muted); }
.ac-changes dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; font-size: 14px; line-height: 1.45; }
.ac-changes .before { color: var(--muted); }
.ac-changes .arrow { color: var(--faint); }
.ac-changes .after { color: var(--fg); font-weight: 700; }
.ac-checks { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.ac-after { flex: none; display: flex; align-items: center; gap: 8px; }
.ac-result { display: block; margin-top: 2px; color: var(--body); }
.composer-attach { padding: 0 12px 8px; }
.composer-attach:not([hidden]) { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.composer-attach .attach-chip { padding-right: 10px; }
.composer-attach .icon-btn { width: 24px; height: 24px; border-radius: 999px; }
.ac-docs { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.ac-docs legend { padding: 0; margin-bottom: 6px; }
.ac-docs .ac-check { font-weight: 400; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 12.5px; color: var(--body); }
.attach-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.ac-gap { flex: 1; }
.ac-foot .btn { height: 40px; padding: 0 16px; font-size: 14px; }
.ac-approve { background: var(--accent); border-color: var(--accent); color: #fff; padding-left: 14px !important; }
.ac-approve:hover { background: #1d52b3; }
.ac-approve .ic { width: 16px; height: 16px; }
.ac-reject-btn { background: #fef6f5; border-color: #fcd9d6; color: #b42318; }
.ac-reject-btn:hover { background: #fdecea; }
.ac-fields { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-start; }
.ac-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--body); }
.ac-field.grow { flex: 1 1 240px; }
.ac-field input, .ac-field textarea, .ac-field select { font: inherit; font-weight: 400; font-size: 14px; color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; }
.ac-field textarea { resize: vertical; line-height: 1.5; }
.ac-field input:focus, .ac-field textarea:focus, .ac-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.ac-money { display: flex; align-items: center; width: 150px; border: 1px solid var(--line); border-radius: 10px; padding: 0 0 0 12px; font-weight: 400; color: var(--muted); }
.ac-money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.ac-money input { border: 0; box-shadow: none !important; padding-left: 4px; width: 100%; }
.ac-hint { font-weight: 400; color: var(--muted); }
.ac-reject { display: flex; flex-direction: column; gap: 12px; }
.ac-card.compact { flex-direction: row; align-items: center; gap: 12px; padding: 14px 18px; }
.ac-card.compact .ac-ic { flex: none; display: inline-flex; }
.ac-card.compact .ac-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ac-card.compact h3 { font-size: 15px; }
.ac-card.done .ac-ic { color: #067647; }
.ac-card.stopped .ac-ic, .ac-card.warn .ac-ic { color: #93370d; }
.ac-card.failed .ac-ic { color: #b42318; }
.ac-card.rejected { background: var(--bg); box-shadow: none; }
.ac-card.rejected h3 { color: var(--muted); font-weight: 700; }
.ac-card.rejected .ac-ic { color: var(--faint); }
.ac-warning { color: #93370d; }
.ac-link { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 8px 4px; }
.ac-link:hover { color: var(--navy-ink); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .ac-card { padding: 14px; }
  .ac-foot { flex-wrap: wrap; }
  .ac-foot .ac-approve { flex: 1 1 100%; order: 3; }
  .ac-card.compact { flex-wrap: wrap; }
  .ac-after { width: 100%; justify-content: flex-end; }
}

.ac-options { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg); }
.ac-opt { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--fg); cursor: pointer; }
.ac-opt input, .ac-check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.ac-opt > span { display: flex; flex-direction: column; gap: 2px; }
.ac-opt-sub { font-size: 12.5px; color: var(--muted); }
.ac-limits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; padding: 4px 0 0 26px; }
.ac-limits .ac-field input { width: 100%; box-sizing: border-box; padding: 7px 10px; }
.ac-limits .ac-hint { font-size: 11.5px; }
.ac-checks-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ac-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--body); cursor: pointer; }
.ac-check input { margin: 0; }
.ac-steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ac-steps li { display: flex; align-items: flex-start; gap: 6px; color: var(--body); }
.ac-steps li .ic { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.ac-steps li.ok .ic { color: #067647; }
.ac-steps li.flag { color: #93370d; }
.ac-steps li.flag .ic { color: var(--amber); }
@media (max-width: 700px) { .ac-limits { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 0; } }
.ac-checks li.muted { color: var(--muted); }
.ac-checks li.muted .ic { color: var(--faint); width: 15px; height: 15px; }
.ac-sub { margin: 12px 0 0; font-weight: 700; color: var(--body); }

.bl-company { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.bl-company:last-of-type { border-bottom: 0; padding-bottom: 0; }
.bl-name { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.bl-flag, .bl-ok { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; line-height: 1.45; }
.bl-flag { color: #93370d; }
.bl-flag .ic { flex: none; color: var(--amber); margin-top: 1px; }
.bl-ok { color: #067647; }
.bl-suggest s { color: var(--faint); }

.actions-page { padding: 22px 28px 48px; max-width: 860px; display: flex; flex-direction: column; gap: 18px; }
.ap-head h2 { margin: 0 0 4px; }
.ap-intro { margin: 0; font-size: 14px; color: var(--muted); }
.ap-list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.ap-row:last-child { border-bottom: 0; }
.ap-name { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; }
.ap-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-name b { font-size: 15px; font-weight: 900; color: var(--fg); }
.muted-row .ap-name b { color: var(--body); }
.ap-sub { font-size: 13px; color: var(--muted); }
.ap-person { font-size: 13.5px; font-weight: 700; color: #b42318; }
.segs { display: flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; background: var(--bg); }
.seg { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg:hover:not(:disabled):not(.on) { color: var(--navy-ink); }
.seg.on { background: #fff; color: var(--navy-ink); box-shadow: 0 0 0 1px var(--line); }
.seg.on.auto { background: var(--navy-ink); color: #fff; box-shadow: none; }
.seg:disabled { opacity: .45; cursor: not-allowed; }
.ap-foot { margin: 0; font-size: 13px; color: var(--muted); }

/* ─── Settings ─────────────────────────────────────────────────────────── */
/* Settings is a page of its own: no nav or list, just the top bar. */
.app[data-pane="page"] { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'top' 'main'; }
.app[data-pane="page"] .side, .app[data-pane="page"] .list { display: none; }
.app[data-pane="page"] .detail { background: var(--bg); }
.settings-page { padding: 28px 28px 64px; max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.st-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-left: -6px; padding: 4px 8px 4px 4px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.st-back:hover { background: var(--mist); color: var(--fg); }
.st-head h2 { margin: 0 0 4px; }
.st-sub { margin: 0; font-size: 14px; color: var(--muted); }
.st-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.st-card h3 { margin: 0; font-size: 15px; font-weight: 900; color: var(--fg); }
.st-photo { display: flex; align-items: center; gap: 16px; }
.st-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.st-photo-actions .st-hint { flex-basis: 100%; }
.st-upload { cursor: pointer; }
.st-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--body); }
.st-field input, .st-field textarea { font: inherit; font-weight: 400; font-size: 14px; color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; }
.st-field textarea { resize: vertical; line-height: 1.5; }
.st-field input:focus, .st-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.st-hint { font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.45; margin: 0; }
.st-actions { display: flex; gap: 8px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-value { font-size: 14px; color: var(--fg); overflow-wrap: anywhere; }
.st-inline { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 760px) { .settings-page { padding: 16px; } }

/* Priority bars, and the label under icon-only buttons. */
.prio-btn > .bars { margin-left: 4px; }
.pop [data-value] .bars { flex: none; }
.tip { position: fixed; z-index: 1000; max-width: 260px; padding: 4px 8px; border-radius: 6px; background: #18181b; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.4; pointer-events: none; box-shadow: 0 4px 12px rgb(16 24 40 / .18); }

/* ─── Ask: the team's chat with Robin ─────────────────────────────────── */
.convo.asking .thread, .convo:not(.asking) .ask-chat { display: none; }
.convo.asking .thread-scroll { background: var(--ask-softer); }
.ask-chat { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 16px; max-width: 900px; margin: 0 auto; }
.ask-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 24px; color: var(--muted); font-size: 13.5px; max-width: 460px; margin: 0 auto; }
.ask-empty p { margin: 0; }
.ask-empty-ic { margin-bottom: 4px; }
.ask-turn { display: flex; flex-direction: column; gap: 4px; max-width: 82%; }
.ask-staff { align-self: flex-end; align-items: flex-end; }
.ask-robin { align-self: flex-start; }
.ask-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ask-meta b { color: var(--fg); font-weight: 700; }
.ask-bubble { border-radius: 14px; padding: 10px 14px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.ask-staff .ask-bubble { background: var(--ask); color: #fff; white-space: pre-wrap; border-bottom-right-radius: 4px; }
.ask-robin .ask-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.ask-robin.failed .ask-bubble { border-color: #f5c2bd; background: #fef6f5; color: #912018; }
.ask-bubble .text p { margin: 0 0 8px; }
.ask-bubble .text p:last-child { margin-bottom: 0; }
.ask-bubble .text pre, .ask-bubble .text code { font-family: var(--mono); font-size: 12.5px; }
.ask-working { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; }
.ask-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.ask-steps li { display: flex; align-items: center; gap: 6px; }
.ask-steps .ic { width: 12px; height: 12px; color: var(--ask); }
.ask-steps li.failed .ic { color: var(--red); }
.ask-steps-done { margin: 0 0 8px; }
.ask-steps-done summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.ask-steps-done .ask-steps { margin: 4px 0 2px; }
/* The draft: a well with Copy and Move to reply. */
.ask-draft { border: 1px solid var(--ask-line); border-radius: 12px; background: #fff; overflow: hidden; }
.ask-draft-head { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.ask-draft-head > span:first-child { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ask-draft > .text { padding: 12px 14px; font-size: 14px; line-height: 1.55; white-space: pre-line; }
.ask-draft > .text p { margin: 0 0 8px; }
.ask-draft > .text p:last-child { margin-bottom: 0; }
.ask-proposed { margin: 2px 0 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--body); }
.ask-proposed .ic { width: 13px; height: 13px; color: var(--ask); }
/* Dots on the Ask tab while Robin works. */
.tab-count { display: inline-flex; align-items: center; }
.tab-count .dots i { width: 4px; height: 4px; }
.composer.is-ask .composer-box { background: var(--ask-softer); border-color: var(--ask-line); }
.composer.is-ask .composer-box:focus-within { border-color: var(--ask); box-shadow: 0 0 0 3px var(--ask-ring); }
.composer.is-ask .tabs [role="tab"]:hover { background: rgb(62 128 121 / .08); }
.composer.is-ask .tabs [data-tab="ask"][aria-selected="true"] { color: var(--ask-ink); background: var(--ask-soft); }
.composer.is-ask .editor:empty::before { color: #7fa19c; }
.composer.is-ask .btn.primary { background: var(--ask); border-color: var(--ask); }
.composer.is-ask .btn.primary:hover { background: var(--ask-ink); border-color: var(--ask-ink); }
.tabs [data-tab="ask"] .ic { color: var(--ask); }
.ask-draft-head { background: var(--ask-softer); border-bottom-color: var(--ask-line); }
.ask-draft-head > span:first-child { color: var(--ask-ink); }
.ask-draft .btn.primary { background: var(--ask); border-color: var(--ask); }
.ask-draft .btn.primary:hover { background: var(--ask-ink); border-color: var(--ask-ink); }
.ask-robin .ask-bubble { border-color: var(--ask-line); }
.ask-chat .dots i, .tab-count .dots i { background: var(--ask); }

@media (max-width: 700px) { .ask-chat { padding: 14px; } .ask-turn { max-width: 94%; } }

/* The team or Robin wrote last. */
.av-replied { background: var(--mist); color: var(--body); }
.av-replied .ic { width: 16px; height: 16px; }
.close-after { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.close-after input { margin: 0; width: 13px; height: 13px; accent-color: var(--navy-ink); }
.close-after:has(input:checked) { color: var(--body); }

/* Reply and Ask as a switch; Note on its own at the top right. */
.tabs { align-items: center; padding: 8px 8px 0; }
.tab-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--mist); }
.tab-switch [role="tab"] { padding: 4px 12px; border-radius: 8px; }
.tab-switch [role="tab"]:hover { background: rgb(255 255 255 / .6); }
.tab-switch [role="tab"][aria-selected="true"], .composer.is-ask .tab-switch [data-tab="ask"][aria-selected="true"] { background: #fff; box-shadow: 0 1px 2px rgb(16 24 40 / .1), 0 0 0 1px rgb(16 24 40 / .04); }
.tab-switch [data-tab="reply"][aria-selected="true"] { color: var(--navy-ink); }
.composer.is-ask .tab-switch { background: var(--ask-soft); }
.composer.is-ask .tab-switch [data-tab="ask"][aria-selected="true"] { color: var(--ask-ink); }
.composer.is-note .tab-switch { background: rgb(107 79 0 / .07); }
.tab-note { margin-left: auto; }
.tabs .tab-note[aria-selected="true"] { color: var(--note-ink); background: var(--note-tab); }

/* What's next after Robin's answer: ways to reply as chips, and a quieter Dig deeper menu. */
/* Ways to reply, stacked. */
.ask-dirs { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 4px; min-width: 0; }
.ask-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 11px 5px 9px; border: 1px solid var(--ask-line); border-radius: 999px; background: #fff; color: var(--ask-ink); font-size: 12.5px; font-weight: 700; text-align: left; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s; }
.ask-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-chip .ic { flex: none; width: 12px; height: 12px; color: var(--ask); }
.ask-chip:hover { background: var(--ask-soft); border-color: var(--ask); }
/* Dig deeper: a tab hanging from the bottom right of the card above it. */
.ask-hang { align-self: flex-end; display: flex; gap: 6px; margin: -5px 14px 0 0; position: relative; z-index: 1; }
.ask-dig { position: relative; }
.ask-dig summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 4px; border: 1px solid var(--ask-line); border-top: 0; border-radius: 0 0 9px 9px; background: #fff; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; user-select: none; }
.ask-dig summary::-webkit-details-marker { display: none; }
.ask-dig summary:hover, .ask-dig[open] summary { color: var(--ask-ink); background: var(--ask-softer); }
.ask-dig summary .ic { width: 12px; height: 12px; }
.ask-dig[open] summary .ic:last-child { transform: rotate(180deg); }
.ask-dig-menu { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); width: min(360px, 70vw); padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.ask-dig-menu button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--body); line-height: 1.4; }
.ask-dig-menu button:hover { background: var(--ask-softer); color: var(--ask-ink); }
.tabs [data-tab="ask"].has-chat .ic path { fill: currentColor; }
.send-btn { height: 34px; padding: 0 16px; font-size: 13.5px; border-radius: 10px; }
/* The draft stands out from the chat: a heavier border and a plain dark heading. */
.ask-draft { border: 2px solid #8fb9b2; box-shadow: 0 2px 6px rgb(16 24 40 / .06); }
.ask-draft-head > span:first-child { color: var(--fg); }
.ask-draft-head > span:first-child .ic { color: var(--body); }
/* The draft's header bar: dark, so the card reads as the thing to send. */
.ask-draft { border-color: var(--ask-ink); }
.ask-draft-head { background: var(--ask-ink); border-bottom-color: var(--ask-ink); }
.ask-draft-head > span:first-child, .ask-draft-head > span:first-child .ic { color: #fff; }
.ask-draft-head .btn { background: transparent; color: #fff; border-color: rgb(255 255 255 / .35); }
.ask-draft-head .btn:hover { background: rgb(255 255 255 / .12); }
.ask-draft-head .btn.primary, .ask-draft .ask-draft-head .btn.primary { background: #fff; border-color: #fff; color: var(--ask-ink); }
.ask-draft-head .btn.primary:hover, .ask-draft .ask-draft-head .btn.primary:hover { background: var(--ask-soft); border-color: var(--ask-soft); }
.ask-draft + .ask-hang summary { border-color: var(--ask-ink); border-width: 0 2px 2px; }
/* Refine draft: checkboxes for changes, then Update draft. */
.ask-refine-menu { width: min(300px, 70vw); padding: 8px; gap: 2px; }
.ask-menu-h { margin: 6px 6px 2px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ask-menu-h:first-child { margin-top: 2px; }
.ask-check { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; font-size: 13px; color: var(--body); cursor: pointer; }
.ask-check:hover { background: var(--ask-softer); }
.ask-check input { margin: 0; width: 14px; height: 14px; accent-color: var(--ask); flex: none; }
.ask-check:has(input:checked) { color: var(--ask-ink); font-weight: 700; }
.ask-refine-other { margin: 6px 0 4px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.ask-refine-other:focus { outline: 0; border-color: var(--ask); box-shadow: 0 0 0 3px var(--ask-ring); }
.ask-refine-menu .btn.primary { align-self: flex-end; background: var(--ask); border-color: var(--ask); }
.ask-refine-menu .btn.primary:hover { background: var(--ask-ink); border-color: var(--ask-ink); }
.ask-refine summary { color: var(--ask-ink); }
.ask-refine-menu .btn.primary { color: #fff; display: inline-flex; padding: 0 12px; height: 30px; font-weight: 700; text-align: center; }
/* Why the reviewer would have stopped the draft. */
.ask-draft-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 9px 14px; background: #fff4e5; color: #93370d; font-size: 12.5px; line-height: 1.45; border-bottom: 1px solid #f5d9b0; }
.ask-draft-warn .ic { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.ask-about { display: inline-flex; align-items: center; gap: 4px; color: var(--ask-ink); font-weight: 700; text-decoration: none; }
.ask-about:hover { text-decoration: underline; }
.ask-about .ic { width: 11px; height: 11px; }
.pb-select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13.5px; max-width: 320px; }
.pb-select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.v1-admin { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 700; color: var(--navy-ink); text-decoration: none; }
.v1-admin:hover { background: var(--mist); }
.v1-admin .ic { width: 12px; height: 12px; color: var(--muted); }
.attach-chip .icon-btn { width: 22px; height: 22px; border-radius: 999px; }
.ask-auto details { font-size: 12.5px; color: var(--muted); }
.ask-auto summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.ask-auto summary::-webkit-details-marker { display: none; }
.ask-auto summary .ic { color: #067647; flex: none; }
.ask-auto summary time { margin-left: auto; }
.ask-auto .ask-bubble { margin-top: 6px; white-space: pre-wrap; }
.ask-draft-attach { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 14px 12px; font-size: 12px; color: var(--muted); }
.ask-draft-attach .attach-chip { padding-right: 10px; }

/* The conversation on the left, Robin and the team on the right. */
.convo.split { flex-direction: row; }
.convo.split > section { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.convo-main { flex: 1 1 0; min-width: 320px; }
/* A remembered width gives way before the conversation does. */
.robin-pane { position: relative; flex: 0 1 var(--robin-w, min(400px, 40%)); min-width: 320px; border-left: 1px solid var(--line); background: var(--ask-softer); }
.robin-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--ask-line); font-size: 13px; color: var(--muted); }
.robin-head b { color: var(--fg); font-size: 14px; }
.robin-head span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo.split .thread, .convo.split .ask-chat { display: flex; }
.convo.split .thread-scroll { background: transparent; }
.convo.split .convo-main .trace, .convo.split .convo-main .review { display: none; }
.robin-feed:empty { display: none !important; }
.robin-feed .ac-card { max-width: none; }
.convo.split .robin-pane .composer { border-top: 1px solid var(--ask-line); }
/* Robin's side is narrower than the full view Ask was drawn for. */
.robin-pane .thread, .robin-pane .ask-chat { padding: 14px 16px 18px; gap: 12px; }
.robin-pane .ask-chat { padding-top: 4px; }
.robin-pane .ask-turn { max-width: 94%; }
.robin-pane .ask-draft-head { flex-wrap: wrap; }
.robin-pane .ask-auto summary span { flex: 1; min-width: 0; }

/* Split view: top nav, filters under the search, resizable panels, Robin / Customer. */
.topnav, .list-filters { display: none; }
.app.split-layout { grid-template-columns: var(--list-w) minmax(0, 1fr); grid-template-areas: 'top top' 'list main'; }
.app.split-layout[data-pane="page"] { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'top' 'main'; }
.app.split-layout .side { display: none; }
.app.split-layout .topnav { display: flex; align-items: center; gap: 2px; margin-left: 14px; min-width: 0; overflow-x: auto; }
.topnav a { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; color: var(--body); font-size: 13.5px; font-weight: 700; text-decoration: none; }
.topnav a .ic { color: var(--muted); }
.topnav a:hover { background: var(--mist); }
.topnav a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.topnav a[aria-current] .ic { color: var(--accent); }
.topnav .count { font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 999px; background: var(--line-soft); color: var(--body); }
.topnav .count.hot { background: #fdecea; color: #b42318; }
.app.split-layout .list-filters { display: flex; flex-wrap: nowrap; gap: 5px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
.list-filters::-webkit-scrollbar { display: none; }
.list-filters a { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--body); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.list-filters a:hover { border-color: var(--line-strong, #d4d4d8); }
.list-filters a.on { background: var(--navy-ink); border-color: var(--navy-ink); color: #fff; }
.list-filters .count { font-size: 11px; opacity: .8; }
.list { position: relative; }
.resizer { position: absolute; top: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 6; touch-action: none; }
.resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background .12s; }
.resizer:hover::after, .resizer.dragging::after { background: var(--accent); }
.list > .resizer { right: -5px; display: none; }
.app.split-layout .list > .resizer { display: block; }
.robin-pane > .resizer { left: -5px; }
body.resizing { cursor: col-resize; user-select: none; }
.pane-switch { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px 12px 0; padding: 4px; border-radius: 12px; background: #fff; border: 1px solid var(--ask-line); }
.pane-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; min-width: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; }
.pane-switch button > span:not(.tab-count) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-switch button:hover { color: var(--fg); }
.pane-switch button[aria-selected="true"] { background: var(--ask-ink); color: #fff; }
.pane-switch button[aria-selected="true"] .ic { color: #fff; }
.pane-view { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.pane-view[hidden] { display: none; }
.pane-note { margin: 8px 16px 0; font-size: 12px; color: var(--muted); }
.robin-pane .pane-view.sidebar { border-left: 0; margin: 10px 0 0; background: #fff; border-top: 1px solid var(--ask-line); }

/* Robin's chat box (split view): one rounded line that grows, a round send button beside it. */
.composer.chat { padding: 8px 12px 12px; }
.composer.chat .composer-box { display: flex; align-items: flex-end; gap: 6px; padding: 4px 4px 4px 4px; border-radius: 22px; box-shadow: none; }
.composer.chat [role="tabpanel"] { flex: 1; display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.composer.chat .editor { min-height: 0; max-height: 160px; padding: 7px 4px 7px 12px; line-height: 1.45; }
.composer.chat .composer-bar { padding: 0; gap: 0; }
.composer.chat .composer-hint, .composer.chat .composer-ai, .composer.chat .composer-gap, .composer.chat [data-close-after-wrap], .composer.chat .composer-attach { display: none; }
.composer.chat .send-btn { width: 36px; height: 36px; padding: 0; border-radius: 999px; justify-content: center; }
.composer.chat .send-btn [data-send-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.composer.chat .send-btn .ic { margin: 0; }

/* Robin's chat box: white, with her latest suggestions as pills underneath. */
.composer.chat .composer-box, .composer.chat.is-ask .composer-box { background: #fff; }
.chat-suggest { display: flex; flex-wrap: nowrap; gap: 6px; padding: 8px 2px 0; overflow-x: auto; scrollbar-width: none; }
.chat-suggest::-webkit-scrollbar { display: none; }
.chat-suggest:empty { display: none; }
.chat-pill { flex: none; max-width: 240px; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 11px 5px 9px; border: 1px solid var(--ask-line); border-radius: 999px; background: #fff; color: var(--ask-ink); font-size: 12.5px; font-weight: 700; text-align: left; line-height: 1.3; }
.chat-pill:hover { background: var(--ask-softer); border-color: var(--ask); }
.chat-pill .ic { flex: none; width: 13px; height: 13px; }
.chat-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* In split view they're under the chat box, not under each answer. */
.convo.split .ask-dirs, .convo.split .ask-dig:not(.ask-refine) { display: none; }

/* Split view, less crowded: the conversation gets the room, nothing said twice. */
.app.split-layout { --side-w: 280px; }
.app.split-layout .brand-name { display: none; }
.topnav .dot.hot { width: 7px; height: 7px; border-radius: 999px; background: #d92d20; }
.app.split-layout .list-head.conv-head { display: none; }
/* List rows on two lines: who and when, then the subject with its owner. */
.app.split-layout .row-main { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 6px; }
.app.split-layout .row-top { flex: 1 0 100%; }
.app.split-layout .row-subject { flex: 1 1 0; min-width: 0; }
.app.split-layout .row-snippet { display: none; }
.app.split-layout .row-line { flex: none; }
.app.split-layout .row { padding-top: 9px; padding-bottom: 9px; }
/* A Reply box that starts short and grows. */
.convo.split .convo-main .composer { padding: 4px 14px 12px; }
.convo.split .convo-main .composer .editor { min-height: 64px; max-height: 260px; }
/* The customer sidebar: no reference or reply count (the header and thread have them). */
.app.split-layout .facts [data-fact="Reference"], .app.split-layout .facts [data-fact="Robin replies"] { display: none; }
/* Robin's turns: no name or avatar on each (it's her panel); the team's own messages unlabelled. */
.convo.split .ask-robin > .ask-meta { display: none; }
.convo.split .ask-staff.mine .ask-meta b { display: none; }
.ask-draft-old { font-size: 12.5px; color: var(--muted); }
.ask-draft-old > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--ask-line); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 700; }
.ask-draft-old > summary::-webkit-details-marker { display: none; }
.ask-draft-old[open] > summary .ic:last-child { transform: rotate(180deg); }
.ask-draft-old[open] > .ask-draft { margin-top: 6px; }
.ask-steps-done { margin-top: 6px; }
/* The toggle in the Send row (split view). */
.tabs.in-bar { padding: 0; flex: none; }
.composer-bar:has(.tabs.in-bar) { padding-left: 6px; }
.convo.split .convo-main .composer .editor { padding-top: 10px; }
/* Robin's panel is narrow: Copy is an icon there, so Move to reply stays on the header row. */
.convo.split .draft-copy span { display: none; }
.convo.split .draft-copy { padding: 0 8px; }
.convo.split .robin-pane .ask-draft-head { flex-wrap: nowrap; }
.app.split-layout .list-filters { gap: 4px; padding: 0 10px 8px; }
.app.split-layout .list-filters a { padding: 0 8px; }
.app.split-layout .list-filters a { padding: 0 7px; gap: 4px; }
.app.split-layout .list-filters .count { font-size: 10.5px; }
/* Split view: the controls sit beside Close; priority and snooze are icons (the tooltip names them). */
.convo.split .head-top { align-items: center; }
.convo.split .head-top .head-actions { flex: none; flex-wrap: nowrap; margin-top: 0; gap: 6px; }
.convo.split .prio-btn, .convo.split .snooze-btn { width: 32px; padding: 0; justify-content: center; gap: 0; }
.convo.split .prio-btn > span, .convo.split .snooze-btn > span, .convo.split .prio-btn > .ic:last-child, .convo.split .snooze-btn > .ic:last-child { display: none; }
.convo.split .snooze-btn > .ic:first-child { margin: 0; }
/* The team's notes look like post-its: square, pale yellow. */
.bubble.note { border-radius: 3px; border: 1px solid var(--note-line); background: #fff8d6; color: #3b3200; padding: 11px 14px; min-width: 150px; box-shadow: none; }
/* Their name, time and "Only staff" line up with the note's edge. */
.msg-row:has(> .msg > .bubble.note) .msg-meta, .msg-row:has(> .msg > .bubble.note) .msg-foot { padding: 0; }
/* A run of notes: stacked with a small gap, and "Only staff" once, under the last. */
.msg-row.grouped:has(> .msg > .bubble.note) { margin-top: 8px; }
.msg-row:has(> .msg > .bubble.note):has(+ .msg-row.grouped > .msg > .bubble.note) > .msg > .msg-foot { display: none; }
/* Robin's panel: room to breathe between turns and at the edges. */
.robin-pane .thread, .robin-pane .ask-chat { padding: 20px 22px 26px; gap: 22px; }
.robin-pane .robin-feed + .ask-chat { padding-top: 4px; }
.robin-pane .msg-av { display: none; }
.robin-pane .msg { max-width: 100%; }
.robin-pane .msg-meta { margin-bottom: 2px; }
.robin-pane .day { margin: 0 0 2px; }
.robin-pane .ask-turn { gap: 6px; }
.robin-pane .ask-bubble { padding: 12px 15px; }
.robin-pane .ask-bubble .text p + p, .robin-pane .ask-bubble .text p + ul, .robin-pane .ask-bubble .text ul + p { margin-top: 10px; }
.robin-pane .ask-steps-done { margin-top: 10px; }
.robin-pane .ask-draft, .robin-pane .ask-draft-old { margin-top: 4px; }
.robin-pane .composer.chat { padding: 12px 18px 16px; border-top: 1px solid var(--ask-line); }
/* In her panel Robin is on the left, like her chat answers; everything there is staff-only, so no label. */
.robin-pane .msg-row.right:has(.bubble.robin-note), .robin-pane .msg-row.right:has(.bubble.agent) { flex-direction: row; }
.robin-pane .msg-row.right:has(.bubble.robin-note) .msg, .robin-pane .msg-row.right:has(.bubble.agent) .msg { align-items: flex-start; }
.robin-pane .msg-row.right:has(.bubble.robin-note) .msg-meta, .robin-pane .msg-row.right:has(.bubble.agent) .msg-meta { justify-content: flex-start; }
.robin-pane .marker.staff-only { display: none; }
.robin-pane .msg-foot:not(:has(> :not(.staff-only))) { display: none; }
/* More vertical room in Robin's panel. */
.robin-pane .thread, .robin-pane .ask-chat { gap: 32px; padding-top: 24px; padding-bottom: 32px; }
.robin-pane .day { margin: 0 0 6px; }
.robin-pane .msg-meta, .robin-pane .ask-meta { margin-bottom: 4px; }
.robin-pane .ask-turn { gap: 8px; }
.robin-pane .ask-bubble, .robin-pane .bubble { padding: 14px 16px; line-height: 1.65; }
.robin-pane .ask-bubble .text p { margin-bottom: 12px; }
.robin-pane .ask-bubble .text p:last-child { margin-bottom: 0; }
.robin-pane .ask-bubble .text ul, .robin-pane .ask-bubble .text ol { margin: 12px 0; }
.robin-pane .ask-bubble .text li + li { margin-top: 8px; }
.robin-pane .ask-steps-done { margin-top: 12px; }
.robin-pane .ask-draft .text { line-height: 1.65; }
.robin-pane .ask-draft .text p + p { margin-top: 12px; }
/* With the taller lines, a note folds after six lines, not four. */
.robin-pane .bubble.collapsible .text, .robin-pane .bubble.clamped .text { max-height: calc(1.65em * 6); }
/* The team's messages to Robin get extra room before her answer. */
.robin-pane .ask-staff { margin-bottom: 12px; }

/* Split view's list filters: status on the left, assignee on the right. */
.app.split-layout .list-filters { align-items: center; gap: 8px; overflow: visible; padding: 0 12px 8px; }
.list-filters .pop-wrap { position: relative; }
.filter-btn { height: 30px; padding: 0 8px 0 10px; gap: 6px; }
.filter-btn .av { margin-left: -4px; }
.filter-btn .count { font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 999px; background: var(--line-soft); color: var(--body); }
.list-filters .pop [role="menuitemradio"] .count { margin-left: auto; font-size: 11px; color: var(--muted); }
.pop-right .pop { left: auto; right: 0; }

/* Robin's chat in split view, like a messaging app. */
/* 1: plain bubbles, no name lines; a centered time only after a break. */
.convo.split .ask-chat .ask-robin > .ask-meta { display: none; }
.convo.split .ask-time { align-self: center; font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 0 0 -16px; }
.convo.split .ask-robin .ask-bubble { position: relative; background: #e9eeed; border: 0; box-shadow: none; border-radius: 20px 20px 20px 6px; }
.convo.split .ask-staff .ask-bubble { border-radius: 20px 20px 6px 20px; }
/* 3: the team's messages are plain bubbles; who, when and which draft show on hover. */
.convo.split .ask-staff { position: relative; margin-bottom: 0 !important; }
.convo.split .ask-staff .ask-meta { position: absolute; bottom: calc(100% + 3px); right: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.convo.split .ask-staff:hover .ask-meta { opacity: 1; pointer-events: auto; }
/* 4: the typing bubble. */
.convo.split .ask-typing { display: inline-flex; padding: 4px 2px; }
.convo.split .ask-typing .dots i { width: 7px; height: 7px; }
.convo.split .ask-now { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.convo.split .ask-robin.working .ask-bubble { padding: 10px 16px; }
/* 5: steps behind an (i) that shows on hover. */
.convo.split .ask-steps-done { margin: 0 !important; }
.convo.split .ask-steps-done > summary { position: absolute; top: 8px; right: -30px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; list-style: none; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 0; cursor: pointer; opacity: 0; transition: opacity .12s; }
.convo.split .ask-steps-done > summary::-webkit-details-marker { display: none; }
.convo.split .ask-steps-done > summary::before { content: 'i'; font: italic 700 12px/1 Georgia, serif; }
.convo.split .ask-robin:hover .ask-steps-done > summary, .convo.split .ask-steps-done[open] > summary { opacity: 1; }
.convo.split .ask-steps-done[open] .ask-steps { margin-top: 10px; }
.convo.split .ask-robin { max-width: calc(100% - 34px); }
/* 6: a draft is a light card: Use, with Copy on hover; clicking the text uses it too. */
.convo.split .robin-pane .ask-draft { border: 1px solid var(--ask-line); border-radius: 18px; background: #fff; box-shadow: none; }
.convo.split .robin-pane .ask-draft-head { background: transparent; border-bottom: 0; padding: 8px 8px 0 16px; }
.convo.split .robin-pane .ask-draft-head > span:first-child, .convo.split .robin-pane .ask-draft-head > span:first-child .ic { color: var(--muted); font-size: 11px; }
.convo.split .robin-pane .ask-draft [data-draft-move] { background: var(--ask-ink); border-color: var(--ask-ink); color: #fff; }
.convo.split .robin-pane .ask-draft .draft-copy { opacity: 0; transition: opacity .12s; }
.convo.split .robin-pane .ask-draft:hover .draft-copy, .convo.split .robin-pane .ask-draft .draft-copy:focus-visible { opacity: 1; }
.convo.split .robin-pane .ask-draft .text { cursor: pointer; padding-top: 4px; }
/* 7: one draft at a time. */
.convo.split .ask-earlier-draft { display: none; }
.convo.split .ask-chat.show-earlier .ask-earlier-draft { display: block; opacity: .75; }
.ask-earlier { align-self: flex-start; border: 0; background: none; padding: 2px 4px; font-size: 12px; font-weight: 700; color: var(--ask-ink); cursor: pointer; }
.ask-earlier:hover { text-decoration: underline; }
.ask-earlier .when-shown, .ask-chat.show-earlier .ask-earlier .when-hidden { display: none; }
.ask-chat.show-earlier .ask-earlier .when-shown { display: inline; }
/* 8: no Refine draft dropdown in split view; the pills do it. */
.convo.split .ask-refine { display: none; }
/* Split view: the header fits the conversation's width, not the window's. */
.convo.split .convo-main { container: convo / inline-size; }
@container convo (max-width: 600px) {
  .convo.split .head-top { flex-wrap: wrap; row-gap: 8px; }
  .convo.split .head-title { flex: 1 1 100%; }
  .convo.split .head-top .head-actions { flex: 1 1 auto; }
}
@container convo (max-width: 420px) {
  .convo.split .head-actions .pop-wrap:first-child .pill-btn { width: 32px; padding: 0; justify-content: center; gap: 0; }
  .convo.split .head-actions .pop-wrap:first-child .pill-btn > span:not(.av), .convo.split .head-actions .pop-wrap:first-child .pill-btn > .ic:last-child { display: none; }
  .convo.split .close-btn { width: 32px; padding: 0; justify-content: center; }
  .convo.split .close-btn > span { display: none; }
  .convo.split .close-btn .ic { margin: 0; }
}
/* The conversation never goes below 320px, however wide Robin's panel is dragged. */
.convo.split > .convo-main { min-width: 320px; }
@container convo (max-width: 460px) {
  .convo.split .convo-main .composer-bar { flex-wrap: wrap; row-gap: 6px; }
  .convo.split .convo-main .composer-bar .composer-gap { flex-basis: 100%; height: 0; }
  .convo.split .convo-main .composer-bar .close-after { margin-left: auto; }
}

/* Stopping the AI (Settings), and Robin's drafts held for approval */
.st-switch { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.st-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.st-limits input:disabled { background: var(--bg, #f7f7f8); color: var(--muted); }
.st-switch-label { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.held-draft { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.held-text { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; resize: vertical; }
.held-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Phone (Luke, 2026-11-19) ──────────────────────────────────────────
   One screen at a time: the list, or a conversation with its reply box.
   Robin's panel and the customer details stay on bigger screens (the
   details still open as a drawer from the top bar). Last in the file so it
   wins over the split view above. */
@media (max-width: 760px) {
  html, body, #app { height: 100dvh; }
  body { overscroll-behavior-y: none; }
  .app.split-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: calc(52px + env(safe-area-inset-top)) minmax(0, 1fr); grid-template-areas: 'top' 'main'; }
  .app.split-layout .list, .app.split-layout .detail { grid-area: main; border-right: 0; }
  .app.split-layout[data-pane="list"] .detail { display: none; }
  .app.split-layout[data-pane="detail"] .list, .app.split-layout[data-pane="page"] .list { display: none; }
  .app.split-layout .list > .resizer, .robin-pane { display: none !important; }

  /* The top bar: the brand, the sections, the live dot and you. Status chips stay on bigger screens. */
  .topbar { gap: 6px; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
  .app.split-layout .topnav { margin-left: 4px; }
  .topnav a { padding: 0 9px; gap: 5px; }
  /* Conversations only: playbooks, Robin's actions and sent email stay on bigger screens. */
  .topnav a:not(:first-child) { display: none; }
  .topbar .silent-chip { display: none; }

  /* The list: full width, bigger rows to tap, its subject line back. */
  .list-search { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .search input { font-size: 16px; }
  .search-key { display: none; }
  .app.split-layout .row { padding-top: 12px; padding-bottom: 12px; }
  .app.split-layout .row-line { flex: 1 0 100%; }
  .app.split-layout .row-snippet { display: block; }
  .list-body { padding-bottom: env(safe-area-inset-bottom); }

  /* A conversation: back to the list, the thread, and the reply box at the bottom. */
  .convo.split > .convo-main { min-width: 0; }
  /* Its header: back, the subject and Close on one line; who and the reference under the subject; assign, priority and snooze below. */
  .convo-head { padding: 8px 12px 8px 6px; }
  .convo.split .head-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; column-gap: 4px; row-gap: 8px; }
  .head-top .back { display: inline-flex; grid-column: 1; grid-row: 1; margin: 0; }
  .head-top .head-title { grid-column: 2; grid-row: 1; padding-top: 4px; }
  .head-title h2 { font-size: 17px; }
  .head-top [data-set-status] { grid-column: 3; grid-row: 1; }
  .head-top [data-delete-ticket] { display: none; }
  .convo.split .head-top .head-actions { grid-column: 2 / -1; grid-row: 2; margin: 0; flex-wrap: wrap; justify-content: flex-start; }
  .thread, .convo.split .thread { padding: 12px 12px 16px; }
  .msg { max-width: 92%; }
  .convo.split .convo-main .composer { padding: 4px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  /* 16px or more, or iPhone zooms in when the box is tapped. */
  .composer .editor, .convo.split .convo-main .composer .editor { font-size: 16px; min-height: 44px; max-height: 40dvh; }
  .composer-hint, .kbd-hint { display: none; }
  /* Reply / Note and Send on one line. Closing is the header's Close button. */
  .convo.split .convo-main .composer-bar { flex-wrap: nowrap; padding: 4px 6px 6px; }
  .convo.split .convo-main .composer-bar .composer-gap { flex: 1 1 auto; height: auto; }
  .convo.split .convo-main .composer-bar [data-close-after-wrap] { display: none; }
  .detail > .sidebar, .detail.sidebar-closed > .sidebar { width: min(340px, 92%); padding-bottom: env(safe-area-inset-bottom); }
  .toasts { top: calc(60px + env(safe-area-inset-top)); }
}

/* Settings › Notifications: which messages (inbox.ts loadNotifications). */
.st-choices { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.st-choice { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.st-choice input { margin: 3px 0 0; accent-color: var(--navy-ink); width: 16px; height: 16px; flex: none; }
.st-choice > span { display: flex; flex-direction: column; gap: 2px; }
.st-choice b { font-size: 14px; color: var(--fg); }

/* Under a customer's first question: the quick route's decision (inbox.ts routeHtml). */
.route-line { margin: 6px 0 0; max-width: 420px; font-size: 12px; color: var(--muted); }
.route-line summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.route-line summary::-webkit-details-marker { display: none; }
.route-line summary .ic { flex: none; width: 13px; height: 13px; color: var(--ask, #7c5cd6); }
.route-line summary > span { font-weight: 700; }
.route-meter { position: relative; flex: none; width: 74px; height: 6px; margin-left: 2px; border-radius: 999px; background: linear-gradient(90deg, #dff3e8, #f6efe0 55%, #fbe3df); }
.route-cut { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--muted); border-radius: 1px; }
.route-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(16 24 40 / .2); }
.route-dot.quick { background: #12805c; }
.route-dot.long { background: #c4320a; }
.route-body { margin: 6px 0 2px 19px; display: flex; flex-direction: column; gap: 4px; }
.route-body p { margin: 0; }
.route-items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.route-items li { display: flex; justify-content: space-between; gap: 12px; max-width: 260px; }
.route-items b.up { color: #c4320a; }
.route-items b.down { color: #12805c; }
.route-time { color: var(--faint, #9a9aa3); }

/* A message's ••• menu (inbox.ts openMsgMenu): beside the bubble, shown on hover. */
.msg { position: relative; }
.msg-more { position: absolute; top: 20px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); opacity: 0; transition: opacity .12s, background .12s; cursor: pointer; }
.msg-row.left .msg-more { right: -32px; }
.msg-row.right .msg-more { left: -32px; }
.msg-row.grouped .msg-more { top: 2px; }
.msg-row:hover .msg-more, .msg-more:focus-visible, .msg-more[aria-expanded="true"] { opacity: 1; }
.msg-more:hover, .msg-more[aria-expanded="true"] { background: var(--mist, #f1f1f4); color: var(--fg); }
/* No hover on a phone or tablet: always there, faintly. */
@media (hover: none) { .msg-more { opacity: .55; } }
.msg-menu { position: fixed; z-index: 200; min-width: 180px; }
.msg-menu[hidden] { display: none; }
/* Save as snippet. */
.snip-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); color: var(--fg); background: #fff; }
.snip-dialog::backdrop { background: rgb(16 24 40 / .32); }
.snip-dialog .outbox-title { margin: 0 0 2px; }
.msg-menu [role="menuitem"] { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; border: 0; background: transparent; text-align: left; width: 100%; font-size: 13px; color: var(--fg); cursor: pointer; }
.msg-menu [role="menuitem"]:hover, .msg-menu [role="menuitem"]:focus-visible { background: var(--mist); outline: 0; }
.msg-menu [role="menuitem"] .ic { color: var(--muted); }
/* A website visitor's pages this visit (inbox.ts siteVisitHtml). */
.site-visit .site-trail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
