/* Research Assistant — new design (ChatColumn.dc.html migration plan §5–§7).
   Loaded after styles.css so the assistant column can be restyled without
   polluting global class names: every selector below is scoped to the dock
   (.chat-dock / .assistant*) or the shell grid tokens it owns. Visual values
   replicate the design reference: 460px expanded / 64px rail, 60px header,
   94px mode zone, 220ms cubic-bezier(.2,.8,.2,1) motion, the two-tier
   shadow and the rose accent ramp already declared as global tokens. */

/* ---------- shared column layout ---------- */

.chat-dock.assistant { background: #ffffff; }

.assistant__expanded { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.assistant__expanded.hidden { display: none; }

.assistant-rail { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.assistant-rail.hidden { display: none; }
.assistant-rail-label { margin-top: auto; writing-mode: vertical-rl; transform: rotate(180deg); color: var(--muted); font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- icon buttons (36px, shared across header/rail/composer) ---------- */

.assistant-ib { width: 36px; height: 36px; flex: 0 0 36px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: #ffffff; color: var(--muted); cursor: pointer; transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing); }
.assistant-ib svg { display: block; }
.assistant-ib:hover { background: var(--canvas); color: var(--ink); }
.assistant-ib:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.assistant-ib[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.assistant-ib-accent { background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent); }
.assistant-ib-accent:hover { background: var(--accent); color: var(--ink); }

/* ---------- header (60px, single row, never wraps) ---------- */

.assistant-header { height: var(--assistant-header-h); flex: 0 0 var(--assistant-header-h); display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); background: #ffffff; }
.assistant-head-mark { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent); display: grid; place-items: center; color: var(--accent-strong); }
.assistant-head-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.assistant-head-copy h2 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-status { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.3; }
.assistant-status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 999px; background: var(--green); }
.assistant-status.is-off .assistant-status-dot { background: var(--amber); }
.assistant-status.is-down .assistant-status-dot { background: var(--red); }
.assistant-status-text { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

/* ---------- mode segmented control + hint (94px zone) ---------- */

.assistant-mode { flex: 0 0 auto; min-height: var(--assistant-mode-h); box-sizing: border-box; padding: 12px 16px 2px; display: flex; flex-direction: column; gap: 6px; }
.assistant-modes { position: relative; display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.assistant-mode-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px; background: #ffffff; box-shadow: 0 1px 0 rgba(44,32,36,0.04), 0 10px 24px rgba(44,32,36,0.06); transform: translateX(0); transition: transform var(--dur-2) var(--easing); }
.assistant-modes[data-active="research"] .assistant-mode-thumb { transform: translateX(100%); }
.assistant-modes button { position: relative; z-index: 1; flex: 1; min-width: 0; height: 34px; padding: 0 6px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; transition: color var(--dur-1) var(--easing); }
.assistant-modes button:hover { color: var(--ink); }
.assistant-modes button[aria-pressed="true"] { color: var(--ink); }
.assistant-modes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.assistant-mode-hint { margin: 0; padding: 0 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ---------- desktop rail behavior (>=1051px) ---------- */

/* Below 1051px the dock is an overlay/fullscreen layer and the old rules
   (display:none when closed, FAB when closed) still apply from styles.css.
   On desktop the assistant never disappears: it narrows to the 64px rail. */
@media (min-width: 1051px) {
  .shell.chat-closed .chat-dock { display: flex; }
  .shell.chat-closed ~ .chat-fab { display: none; }
}

/* 1051–1365px: 460px would squeeze the main workspace below a usable width,
   so the dock narrows toward 420px (1440px+ stays the reference 460px). */
@media (min-width: 1051px) and (max-width: 1365px) {
  :root { --assistant-expanded-w: clamp(420px, 32vw, 460px); }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .assistant-mode-thumb { transition: none; }
  .assistant-ib, .assistant-modes button { transition: none; }
}

/* ---------- timeline (§6.3) ---------- */

.assistant-timeline { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 20px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.assistant-timeline::-webkit-scrollbar { width: 8px; }
.assistant-timeline::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.ra-note { align-self: center; max-width: 88%; padding: 5px 12px; border-radius: 999px; background: var(--pearl); color: var(--muted); font-size: 11.5px; text-align: center; }

/* user messages */
.ra-msg-user { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ra-bubble-user { max-width: 88%; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 14px 14px 4px 14px; background: var(--accent-soft); font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.ra-msg-selection { align-items: flex-end; }
.ra-selection-label { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ra-msg-selection .ra-bubble-user { max-width: 72%; font-size: 13px; }
.ra-msg-time { color: var(--muted); font-size: 11px; line-height: 1.3; }
.ra-truncated { display: block; color: var(--muted); font-size: 10.5px; }

/* assistant messages */
.ra-msg { display: flex; flex-direction: column; gap: 10px; }
.ra-msg-head { display: flex; align-items: center; gap: 8px; }
.ra-msg-avatar { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent); display: grid; place-items: center; color: var(--accent-strong); }
.ra-msg-head strong { font-size: 12px; line-height: 1.4; font-weight: 700; }
.ra-msg-head time { font-size: 11px; line-height: 1.3; color: var(--muted); }
.ra-msg-body { margin-left: 32px; display: flex; flex-direction: column; gap: 10px; }
.ra-para { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.ra-msg.is-warn .ra-msg-body { border-left: 3px solid var(--amber); padding-left: 10px; }
.ra-msg.is-error .ra-msg-body { border-left: 3px solid var(--red); padding-left: 10px; }

/* choice chips */
.ra-choice-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ra-choice-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #ffffff; color: var(--ink); font-size: 12px; line-height: 1.4; font-weight: 600; cursor: pointer; transition: background var(--dur-1) var(--easing), border-color var(--dur-1) var(--easing); }
.ra-choice-chip:hover:not(:disabled), .ra-choice-chip:focus-visible:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.ra-choice-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ra-choice-chip.is-selected { background: var(--accent-soft); border-color: var(--accent); }
.ra-choice-check { font-size: 11px; color: var(--accent-strong); }
.ra-choice-chip:disabled { cursor: default; opacity: .75; }

/* candidate cards */
.ra-candidates { display: flex; flex-direction: column; gap: 8px; }
.ra-candidate { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff; box-shadow: 0 1px 0 rgba(44,32,36,0.04), 0 10px 24px rgba(44,32,36,0.06); display: flex; flex-direction: column; gap: 6px; }
.ra-candidate-top { display: flex; align-items: center; gap: 8px; }
.ra-candidate-top strong { flex: 1; font-size: 14px; line-height: 1.4; font-weight: 650; }
.ra-candidate-status { padding: 2px 8px; border-radius: 999px; font-size: 10.5px; line-height: 1.3; font-weight: 700; }
.ra-candidate-status.is-ok { background: var(--green-bg); color: var(--green); }
.ra-candidate-status.is-warn { background: var(--amber-bg); color: var(--amber); }
.ra-candidate-reason { font-size: 12px; line-height: 1.4; color: var(--muted); }
.ra-candidate-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ra-candidate-collect:disabled { opacity: .5; cursor: default; }
.ra-candidate-note { color: var(--amber); font-size: 11px; }

/* buttons (sketch rm-btn family) */
.ra-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--ink); color: #ffffff; font-size: 12px; font-weight: 700; cursor: pointer; transition: background var(--dur-1) var(--easing); }
.ra-btn:hover { background: var(--accent-strong); }
.ra-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ra-btn-2 { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff; color: var(--ink); font-size: 12px; font-weight: 650; cursor: pointer; transition: background var(--dur-1) var(--easing); }
.ra-btn-2:hover { background: var(--canvas); }
.ra-btn-2:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* sources (§6.6) */
.ra-sources { display: flex; flex-direction: column; gap: 6px; }
.ra-sources-label { margin: 2px 0 0; font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ra-src { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; color: var(--ink); cursor: pointer; text-align: left; transition: box-shadow var(--dur-2) var(--easing), border-color var(--dur-1) var(--easing); }
.ra-src:hover, .ra-src:focus-visible { box-shadow: 0 10px 28px rgba(44,32,36,0.12); border-color: var(--accent); }
.ra-src:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ra-src-n { width: 22px; height: 22px; border-radius: 999px; background: var(--pearl); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.ra-src-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ra-src-copy strong { font-size: 12px; line-height: 1.4; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-src-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; line-height: 1.3; color: var(--muted); }
.ra-src-meta code { font-family: ui-monospace, "SF Mono", Consolas, monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* message actions */
.ra-actions { margin-left: 26px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.ra-act { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing); }
.ra-act:hover { background: var(--canvas); color: var(--ink); }
.ra-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ra-act svg { flex: 0 0 auto; }
.ra-actions-meta { margin-left: auto; font-size: 11px; line-height: 1.3; color: var(--muted); }

/* typing indicator */
.ra-typing { display: flex; align-items: center; gap: 8px; margin-left: 32px; font-size: 12px; color: var(--muted); }
.ra-spin { width: 12px; height: 12px; flex: 0 0 12px; box-sizing: border-box; border-radius: 999px; border: 2px solid var(--line); border-top-color: var(--accent); animation: ra-spin 800ms linear infinite; }
@keyframes ra-spin { to { transform: rotate(360deg); } }
.ra-typing-stop { margin-left: 4px; }

/* empty state & suggestion cards (§6.4) */
.ra-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px 8px; text-align: center; }
.ra-empty-mark { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent); display: grid; place-items: center; color: var(--accent-strong); margin-bottom: 6px; }
.ra-empty-title { margin: 0; font-size: 25px; line-height: 1.2; font-weight: 400; letter-spacing: -0.035em; }
.ra-empty-sub { margin: 0; max-width: 320px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.ra-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.ra-suggestions--modes { padding: 8px 0; }
.ra-sugg { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff; text-align: left; cursor: pointer; color: var(--ink); box-shadow: 0 1px 0 rgba(44,32,36,0.04), 0 10px 24px rgba(44,32,36,0.06); transition: transform var(--dur-2) var(--easing), box-shadow var(--dur-2) var(--easing), border-color var(--dur-1) var(--easing); }
.ra-sugg:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 28px rgba(44,32,36,0.12); }
.ra-sugg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ra-sugg strong { font-size: 14px; line-height: 1.4; font-weight: 650; padding-right: 16px; }
.ra-sugg span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.ra-sugg-arrow { position: absolute; top: 12px; right: 12px; opacity: 0; transform: translateX(-4px); color: var(--accent-strong); transition: opacity var(--dur-1) var(--easing), transform var(--dur-2) var(--easing); }
.ra-sugg:hover .ra-sugg-arrow { opacity: 1; transform: none; }

/* entry animations — respects prefers-reduced-motion below */
.ra-msg, .ra-msg-user { animation: ra-rise 360ms var(--easing) both; }
@keyframes ra-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ra-msg, .ra-msg-user, .ra-sugg, .ra-src { animation: none; transition: none; }
  .ra-spin { animation: none; }
}

/* ---------- composer (§6.8–§6.11) ---------- */

.assistant-composer { position: relative; flex-shrink: 0; margin: 0 16px 8px; padding: 10px 10px 8px 12px; border: 1px solid var(--line); border-radius: 16px; background: #ffffff; box-shadow: 0 1px 0 rgba(44,32,36,0.04), 0 10px 24px rgba(44,32,36,0.06); display: flex; flex-direction: column; gap: 8px; transition: border-color var(--dur-1) var(--easing), box-shadow var(--dur-2) var(--easing); }
.assistant-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 28px rgba(44,32,36,0.12); }
.ra-composer-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.assistant-composer textarea { display: block; width: 100%; box-sizing: border-box; padding: 2px; border: 0; outline: none; resize: none; background: none; color: var(--ink); font: 14px/1.55 var(--font-body); }
.assistant-composer textarea::placeholder { color: var(--muted); }
.assistant-composer textarea:disabled { color: var(--muted); }
.assistant-composer textarea:disabled::placeholder { color: #b3a7ad; }

.ra-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ra-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--canvas); font-size: 12px; line-height: 1.4; max-width: 100%; min-width: 0; }
.ra-chip strong { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-chip-meta { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-chip-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 999px; background: var(--accent); }
.ra-chip button { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.ra-chip button:hover, .ra-chip button:focus-visible { background: var(--pearl); color: var(--ink); }
.ra-chip button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.ra-tools { display: flex; align-items: center; gap: 4px; }
.ra-provider { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: #ffffff; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; max-width: 55%; min-width: 0; transition: background var(--dur-1) var(--easing); }
.ra-provider:hover { background: var(--canvas); }
.ra-provider:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ra-provider span:not(.ra-provider-dot) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-provider-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 999px; background: var(--amber); }
.ra-provider-dot.is-on { background: var(--green); }
.ra-credits { margin-left: auto; margin-right: 6px; color: var(--muted); font-size: 11px; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ra-credits.hidden { display: none; }

.ra-send { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border: 0; border-radius: 10px; cursor: pointer; background: var(--accent-strong); color: #ffffff; transition: background var(--dur-1) var(--easing), transform var(--dur-1) var(--easing); }
.ra-send:hover { background: #2a1e23; }
.ra-send:active { transform: scale(.94); }
.ra-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ra-send:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.ra-send:disabled:hover { background: var(--line); }
.ra-send-stop { background: var(--ink); }
.ra-send-stop:hover { background: var(--red); }
.ra-send.hidden { display: none; }
.ra-flip { transform: rotate(180deg); }

.ra-charcount { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ra-charcount.is-over { color: var(--red); font-weight: 800; }

/* popover menus */
.ra-menu { position: absolute; z-index: 6; box-sizing: border-box; left: 0; right: 0; bottom: calc(100% - 2px); max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; box-shadow: 0 10px 28px rgba(44,32,36,0.12); animation: ra-pop 220ms var(--easing) both; }
@keyframes ra-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.ra-menu-title { margin: 4px 10px 6px; font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ra-menu-section { margin: 6px 10px 2px; font-size: 10.5px; line-height: 1.3; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: #b3a7ad; }
.ra-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; cursor: pointer; transition: background var(--dur-1) var(--easing); }
.ra-menu-item:hover, .ra-menu-item:focus-visible { background: var(--canvas); }
.ra-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ra-menu-item[aria-selected="true"] { background: var(--accent-soft); }
.ra-menu-cmd { min-width: 86px; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--accent-strong); }
.ra-menu-item code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11px; color: var(--accent-strong); min-width: 90px; }
.ra-menu-item span { font-size: 12px; line-height: 1.4; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-menu-item strong { font-size: 13px; font-weight: 650; }
.ra-menu-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ra-menu-copy span { color: var(--muted); font-size: 11.5px; }
.ra-menu-static { cursor: default; }
.ra-menu-static:hover { background: none; }
.ra-menu-check { color: var(--accent-strong); font-weight: 700; }
.ra-menu-empty { margin: 6px 10px 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }

.assistant-footnote { display: flex; justify-content: space-between; gap: 8px; margin: 0 18px 10px; font-size: 11px; line-height: 1.3; color: var(--muted); }
.assistant-footnote #chat-save-note.is-unavailable { color: var(--amber); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .ra-menu { animation: none; }
  .assistant-composer, .ra-send, .ra-provider { transition: none; }
}

/* ---------- history drawer (§6.12) ---------- */

.chat-history-view { position: absolute; top: var(--assistant-header-h); left: 0; right: 0; bottom: 0; z-index: 8; display: flex; flex-direction: column; background: #ffffff; animation: ra-drawer 220ms var(--easing) both; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
@keyframes ra-drawer { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.assistant__expanded { position: relative; }
.conversation-history-head { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; }
.conversation-history-head strong { flex: 1; font-size: 15px; line-height: 1.3; font-weight: 700; }
.conversation-search { flex-shrink: 0; display: flex; align-items: center; gap: 8px; height: 38px; margin: 0 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); color: var(--muted); }
.conversation-search:focus-within { border-color: var(--accent); background: #ffffff; }
.conversation-search svg { flex: 0 0 auto; }
.conversation-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font-size: 14px; }
.conversation-search input:focus-visible { outline: none; }
.conversation-history-body { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 0 12px; }
.conversation-history-foot { flex-shrink: 0; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.conversation-group-label { margin: 12px 16px 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.conversation-list { list-style: none; margin: 0; padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.conversation-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 8px 10px; border: 0; border-radius: 12px; background: none; }
.conversation-row:hover { background: var(--canvas); }
.conversation-row.is-active { background: var(--accent-soft); }
.conversation-row.is-confirming { background: #fff8f7; }
.conversation-open { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 4px 6px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.conversation-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.conversation-open strong { color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-open small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-row > time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.conversation-delete { padding: 4px 10px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.conversation-delete:hover, .conversation-delete:focus-visible { color: var(--red); background: var(--red-bg); }
.conversation-confirm { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink); }
.conversation-confirm-yes { padding: 4px 10px; border: 1px solid #e5b0aa; border-radius: 99px; background: var(--red-bg); color: var(--red); font-size: 11px; font-weight: 750; cursor: pointer; }
.conversation-confirm-no { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: white; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; }
.conversation-clear { width: 100%; padding: 8px; border: 1px dashed #d9ccd1; border-radius: 10px; background: white; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.conversation-clear:hover, .conversation-clear:focus-visible { color: var(--red); border-color: #e5b0aa; }
.conversation-history-empty { margin: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--canvas); color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; }
.conversation-persistence-note { margin: 10px 16px 0; padding: 8px 10px; border-radius: 8px; background: var(--amber-bg); color: var(--amber); font-size: 12px; }

/* ---------- responsive: tablet & phone (§7.2–§7.3) ---------- */

@media (max-width: 720px) {
  .ra-suggestions { grid-template-columns: 1fr; }
  .ra-suggestions--modes { grid-template-columns: 1fr; }
  .ra-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%); }
  .ra-chip { flex: 0 0 auto; }
  .ra-candidate-actions { flex-wrap: wrap; }
  .ra-candidate-actions .ra-btn, .ra-candidate-actions .ra-btn-2 { min-height: 44px; }
  .ra-act { min-height: 44px; }
  .assistant-composer { margin: 0 10px 6px; }
  .assistant-footnote { margin: 0 12px 8px; flex-wrap: wrap; }
  .conversation-history-head { padding: 12px 12px 8px; }
  .conversation-search { margin: 0 12px; }
  .conversation-list { padding: 0 6px; }
  .chat-save-note { padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 721px) and (max-width: 1050px) {
  .chat-dock { width: min(420px, calc(100vw - 72px)); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-history-view { animation: none; }
}
