/* Trợ lý AI Khoa CNTT – TDTU · chat features of KS-07 (W15a): formulas, server history,
   assistant picker, attachments, tutor status, hand-off, error notes.
   Every colour comes from /static/shared/fit-tokens.css (semantic tokens); no raw values. */

/* ─────────────── Formulas (KaTeX) ─────────────── */
.math-block {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0.45em 0;
  padding: 3px 1px;
}
.math-block .katex-display { margin: 0.2em 0; }
.math-block:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 4px; }
/* An inline formula wider than the bubble scrolls on its own (marked by markScrollable). */
.math-inline.is-wide { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 3px 1px; }
.math-pending { font-family: var(--font-mono-stack); font-size: 0.9em; overflow-wrap: anywhere; }
code.math-fallback {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  vertical-align: bottom;
}
.table-wrap:focus-visible, .msg-content pre:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ─────────────── Assistant picker (top bar + list) ─────────────── */
.assistant-picker { flex: 0 1 auto; min-width: 0; margin-left: 4px; }
.assistant-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 300px;
  min-height: 36px;
  padding: 5px 10px;
  background: var(--chat-header-control);
  color: var(--chat-header-fg);
  border: 1px solid var(--chat-header-line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .14s;
}
.assistant-btn:hover, .assistant-btn[aria-expanded="true"] { background: var(--chat-header-hover); }
.assistant-btn:focus-visible { outline: 2px solid var(--chat-header-fg); outline-offset: 2px; }
.assistant-btn-icon { flex-shrink: 0; font-size: 16px; line-height: 1; }
.assistant-btn-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-caret { flex-shrink: 0; width: 14px; height: 14px; }

.assistant-backdrop { position: fixed; inset: 0; z-index: 94; background: var(--overlay); }
.assistant-pop {
  position: fixed;
  z-index: 95;
  max-height: min(72vh, 560px);
  overflow-y: auto;
  padding: 14px 12px 12px;
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.assistant-pop.is-sheet {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  max-height: 82vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
@supports (height: 100dvh) { .assistant-pop.is-sheet { max-height: 82dvh; } }
.assistant-pop-head { padding: 0 6px 8px; }
.assistant-pop-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--heading);
}
.assistant-pop-sub { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.assistant-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.assistant-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.assistant-opt:hover { background: var(--panel-2); }
.assistant-opt[aria-selected="true"] { background: var(--primary-soft); border-color: var(--primary); }
.assistant-opt:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ao-icon {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border-radius: 8px;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.assistant-opt[aria-selected="true"] .ao-icon { background: var(--paper); }
.ao-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ao-name { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--heading); }
.ao-desc {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-2);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.ao-audience { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.ao-audience-k { font-weight: 600; }
.ao-check { flex: none; align-self: center; width: 16px; height: 16px; color: var(--primary); visibility: hidden; }
.assistant-opt[aria-selected="true"] .ao-check { visibility: visible; }

/* Welcome screen: who this assistant is for + a way to the picker. */
.welcome-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--text-2);
}
.welcome-audience b { font-weight: 600; color: var(--text); }
.welcome-change {
  padding: 2px 4px;
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.welcome-change:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ─────────────── History (sidebar) ─────────────── */
.history-section { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; border: none; }
.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 6px;
}
.history-head .sidebar-label { margin-bottom: 0; }
.history-scope { font-size: 11px; color: var(--muted); text-align: right; }
.history-search { position: relative; padding: 0 12px 6px; }
.history-search input {
  width: 100%;
  min-height: 34px;
  padding: 5px 8px 5px 30px;
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
}
.history-search input::placeholder { color: var(--muted); }
.history-search input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.history-search svg {
  position: absolute;
  left: 21px;
  top: 10px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.history-group + .history-group { margin-top: 6px; }
.history-group-label { padding: 6px 10px 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.history-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 1px;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.history-row:hover, .history-row:focus-within, .history-row.is-active { background: var(--primary-soft); }
.history-row .history-item { flex: 1; min-width: 0; margin: 0; background: transparent; }
.history-row .history-item:hover { background: transparent; }
.history-row .history-item.active { background: transparent; }
.history-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.history-meta {
  overflow: hidden;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-actions { flex: none; display: flex; width: 0; overflow: hidden; opacity: 0; }
.history-row:hover .history-actions,
.history-row:focus-within .history-actions,
.history-row.is-active .history-actions { width: auto; overflow: visible; opacity: 1; padding-right: 3px; }
@media (hover: none) { .history-actions { width: auto; overflow: visible; opacity: 1; padding-right: 3px; } }
.history-act {
  width: 30px;
  height: 30px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--text-2);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.history-act svg { width: 14px; height: 14px; }
.history-act:hover { background: var(--paper); color: var(--primary); }
.history-act.is-danger:hover { color: var(--danger); }
.history-act:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.history-rename { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; padding: 4px; }
.history-rename input {
  flex: 1;
  min-width: 0;
  min-height: 30px;
  padding: 3px 7px;
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
}
.history-rename input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.history-confirm { flex: 1; min-width: 0; padding: 6px 8px 8px 10px; font-size: 12.5px; color: var(--text); }
.history-confirm-title {
  display: block;
  overflow: hidden;
  margin-bottom: 6px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-confirm-actions { display: flex; gap: 6px; }
.history-confirm button {
  min-height: 30px;
  padding: 3px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.history-confirm .is-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.history-confirm button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.history-empty-state { padding: 14px 12px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); text-align: center; }
.history-empty-state strong { display: block; margin-bottom: 3px; font-weight: 600; color: var(--text); }
.history-empty-action {
  margin-top: 8px;
  padding: 5px 12px;
  background: var(--paper);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.history-empty-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.history-skeleton { padding: 8px 10px; }
.sk-line {
  display: block;
  height: 11px;
  margin-bottom: 6px;
  border-radius: 4px;
  background: var(--rule);
  animation: sk-pulse 1.3s ease-in-out infinite;
}
.sk-line.is-short { width: 55%; height: 9px; }
@keyframes sk-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.sidebar-phone-actions { display: none; flex-direction: column; align-items: flex-start; gap: 2px; }

/* Opening a conversation from the server. */
.conv-loading { display: flex; align-items: center; gap: 10px; padding: 28px 4px; color: var(--muted); font-size: 13px; }
.conv-spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid var(--rule);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: conv-spin .8s linear infinite;
}
@keyframes conv-spin { to { transform: rotate(360deg); } }
.conv-notice {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  padding: 9px 12px;
  background: var(--chat-notice-bg);
  color: var(--chat-notice-fg);
  border: 1px solid var(--chat-notice-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}
.conv-notice svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }

/* ─────────────── Error notes with a next step ─────────────── */
.msg-note-body { min-width: 0; }
.msg-note-title { display: block; font-weight: 700; }
.msg-note .msg-note-text { display: block; }
.msg-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.note-action {
  padding: 5px 12px;
  background: var(--paper);
  color: var(--text-2);
  border: 1px solid var(--border-input);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.note-action:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.note-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ─────────────── Tutor status ─────────────── */
.msg-meta .tag-policy {
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.msg-meta .tag-policy.is-exam { background: var(--danger-soft); color: var(--danger); }
.msg-meta .tag-policy.is-graded { background: var(--warning-soft); color: var(--warning); }
.msg-meta .tag-policy.is-practice { background: var(--success-soft); color: var(--success); }
.composer-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  padding: 7px 10px;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
}
.composer-banner svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }

/* ─────────────── Hand-off to another assistant ─────────────── */
.handoff {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 68ch;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}
.handoff-text { flex: 1 1 220px; min-width: 0; }
.handoff-text b { font-weight: 700; }
.handoff-reason { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.handoff-btn {
  flex: none;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 12px;
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.handoff-btn:hover { background: var(--primary-strong); }
.handoff-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ─────────────── Attachments ─────────────── */
.attach-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--text-2);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.attach-btn svg { width: 18px; height: 18px; }
.attach-btn:hover { background: var(--primary-soft); color: var(--primary); }
.attach-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.attach-btn.is-locked { color: var(--muted); cursor: not-allowed; }
.attach-btn.is-locked:hover { background: transparent; color: var(--muted); }
.composer-wrap.is-drop { border-color: var(--primary); background: var(--primary-soft); }
.attach-tray { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.attach-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(290px, 100%);
  padding: 5px 4px 5px 5px;
  background: var(--panel);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
}
.attach-chip.is-error { background: var(--danger-soft); border-color: var(--danger); }
.attach-thumb {
  flex: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--panel-2);
  color: var(--primary);
  border-radius: 6px;
}
.attach-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.attach-thumb svg { width: 18px; height: 18px; }
.attach-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; line-height: 1.35; }
.attach-name { overflow: hidden; font-weight: 600; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.attach-meta { color: var(--text-2); }
.attach-chip.is-error .attach-meta { font-weight: 600; color: var(--danger); }
.attach-error { color: var(--text); }
.attach-progress { display: block; height: 3px; margin-top: 2px; overflow: hidden; background: var(--rule); border-radius: 2px; }
.attach-progress-fill { display: block; height: 100%; background: var(--primary); transition: width .15s; }
.attach-actions { flex: none; display: flex; }
.attach-act {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--text-2);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.attach-act svg { width: 14px; height: 14px; }
.attach-act:hover { background: var(--panel-2); color: var(--text); }
.attach-act:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.attach-hint { margin: 0 0 8px; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.attach-hint.is-warning { color: var(--warning); }
/* Files sent with a question, under the user's bubble. */
.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.msg-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 3px 8px 3px 3px;
  background: var(--panel-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.msg-attachment img, .msg-attachment .msg-attachment-icon {
  flex: none;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}
.msg-attachment .msg-attachment-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--primary); }
.msg-attachment .msg-attachment-icon svg { width: 15px; height: 15px; }
.msg-attachment-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Waiting for the follow-up suggestions: readable, not faded. */
.followup-wait { font-size: 12px; color: var(--muted); }

/* ─────────────── W15b: waiting for the first word ─────────────── */
/* After a long wait the bubble says it is still working and how to stop (files, Chuyên sâu). */
.typing-slow {
  display: block;
  max-width: 60ch;
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}

/* ─────────────── W15b: welcome states and first steps by role ─────────────── */
.welcome .welcome-state, .welcome .welcome-onboard { text-align: left; }
.welcome-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: -8px 0 18px;
  padding: 10px 12px;
  background: var(--chat-notice-bg);
  color: var(--chat-notice-fg);
  border: 1px solid var(--chat-notice-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}
/* An exam is on for this tutor (walkthrough 06/11, C9): the same colours as the exam tag. */
.welcome-state.is-exam { margin: 0 0 14px; background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.welcome-state svg { flex: none; width: 15px; height: 15px; }
.welcome-state span { flex: 1 1 220px; min-width: 0; }
.welcome-onboard {
  margin: -8px 0 20px;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}
.welcome .welcome-onboard p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.5; }
.welcome-onboard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
/* Buttons of the welcome notes and the role dialog (same look as .note-action, own name). */
.welcome-act {
  padding: 5px 12px;
  background: var(--paper);
  color: var(--text-2);
  border: 1px solid var(--border-input);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.welcome-act:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.welcome-act:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.persona-staff { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 14px 0 0; font-size: 13px; color: var(--text-2); }

/* The stream was cut: what was written stays, with a way to ask again. */
.retry-row.is-interrupted { color: var(--warning); font-size: 13px; }
.retry-row.is-interrupted svg { flex: none; width: 14px; height: 14px; }

/* ─────────────── W15b: a guest's conversations while signed in; greeting not kept ─────────────── */
.history-guest {
  margin: 10px 8px 4px;
  padding: 10px;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}
.history-guest-text { margin: 0; }
.history-guest-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.history-guest .history-empty-action { margin-top: 8px; }
.history-guest .history-empty-action.is-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.history-guest-list { display: grid; gap: 2px; margin-top: 8px; }
.history-guest-row .history-item { width: 100%; }
.msg-unsaved { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.acct-guest { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: 13px; line-height: 1.45; color: var(--text); cursor: pointer; }
.acct-guest input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary); }

/* ─────────────── W15b: academic advising outcome (ADR-T024b) ─────────────── */
.advising {
  max-width: 68ch;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}
.advising.is-dat { border-left-color: var(--success); }
.advising.is-chua_dat { border-left-color: var(--danger); }
.advising.is-chua_xac_dinh, .advising.is-chua_co_du_lieu { border-left-color: var(--warning); }
.advising-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.advising-state, .advising-badge {
  flex: none;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  background: var(--panel-2);
  color: var(--text);
}
.advising.is-dat .advising-state, .advising-badge.is-dat { background: var(--success-soft); color: var(--success); }
.advising.is-chua_dat .advising-state, .advising-badge.is-chua_dat { background: var(--danger-soft); color: var(--danger); }
.advising.is-chua_xac_dinh .advising-state, .advising.is-chua_co_du_lieu .advising-state,
.advising-badge.is-chua_xac_dinh, .advising-badge.is-chua_co_du_lieu { background: var(--warning-soft); color: var(--warning); }
.advising-what { flex: 1 1 200px; min-width: 0; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.advising-conds { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.advising-cond { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.advising-cond-name { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.advising-src { margin: 8px 0 0; font-size: 12px; color: var(--text-2); }
/* No record read (walkthrough C6): how to get a personal answer, not a verdict. */
.advising-login {
  max-width: 68ch; margin-top: 10px; padding: 10px 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  background: var(--primary-soft); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.45;
}
.advising-login-text { flex: 1 1 220px; margin: 0; min-width: 0; }

/* ─────────────── W15b: evidence of web browsing (ADR-T023) ─────────────── */
.browse-evidence {
  max-width: 68ch;
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}
.browse-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  list-style: revert;
}
.browse-summary svg { flex: none; width: 15px; height: 15px; color: var(--primary); }
.browse-summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: var(--radius-sm); }
.browse-list { display: grid; gap: 6px; margin: 0; padding: 0 12px 4px 34px; list-style: none; }
.browse-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-left: 8px; border-left: 3px solid var(--success); }
.browse-item.is-blocked { border-left-color: var(--warning); }
.browse-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 24px;          /* WCAG 2.2 target size: the link stands alone on its line */
  color: var(--primary);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-underline-offset: 2px;
}
.browse-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
.browse-host { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.browse-meta { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.browse-note { margin: 6px 12px 8px 34px; font-size: 12px; color: var(--text-2); }

@media (max-width: 720px) {
  .assistant-btn { max-width: 42vw; }
  .browse-list { padding-left: 14px; }
  .browse-note { margin-left: 14px; }
  .history-search input { font-size: 16px; }
  .history-rename input { font-size: 16px; }
  .attach-chip { width: 100%; }
}
@media (max-width: 480px) {
  /* The assistant's name is what the top bar is for on a phone. Theme and transcript move to
     the drawer; the account chip keeps a short width. */
  .topbar-spacer, #themeBtn, #exportBtn { display: none; }
  .assistant-picker { flex: 1 1 auto; margin-left: 0; }
  .assistant-btn { max-width: 100%; padding: 5px 8px; gap: 5px; font-size: 12.5px; }
  .assistant-btn-icon { display: none; }
  #accountChip { flex: 0 1 auto; max-width: 96px; margin-left: auto; }
  .sidebar-phone-actions { display: flex; }
}
