:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --owner: #1d4ed8;
  --owner-text: #ffffff;
  --brain: #ffffff;
  --accent: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --fallback-bg: #fffbeb;
  --fallback-line: #fcd34d;
  --event-bg: #f0f9ff;
  --event-line: #7dd3fc;
  --code-bg: #f3f4f6;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --panel: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --line: #1f2937;
    --owner: #2563eb;
    --brain: #1f2937;
    --accent: #60a5fa;
    --fallback-bg: #2a2111;
    --fallback-line: #a16207;
    --event-bg: #0c2233;
    --event-line: #0369a1;
    --code-bg: #0b1220;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
input, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.error { color: var(--danger); margin: 0; }
.icon { background: none; border: 0; padding: 8px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.icon:hover { background: color-mix(in srgb, var(--muted) 12%, transparent); }

/* Đăng nhập */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.login-card input { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 16px; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.brand h1 { margin: 0; font-size: 20px; }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* Khung chat */
.app { height: 100%; display: flex; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar { position: relative; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--safe-top) + 6px) 6px 6px 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.room-title { flex: 1; min-width: 0; display: grid; }
.room-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-title small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; }
.status { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px; text-align: left; min-width: 0; max-width: 40%; }
.status .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.status[data-state="online"] .dot { background: var(--ok); }
.status[data-state="busy"] .dot { background: #eab308; }
.status[data-state="offline"] .dot { background: var(--danger); }
.status-text { display: grid; min-width: 0; }
.status-text b { font-size: 15px; }
.status-text small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: absolute; right: 8px; top: calc(100% + 4px); z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .15); padding: 6px; display: grid; min-width: 240px; }
.menu button { background: none; border: 0; text-align: left; padding: 10px 12px; border-radius: 10px; }
.menu button:hover { background: var(--bg); }
.status-more { padding: 8px 12px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; gap: 2px; }
.conn { background: var(--warn); color: #fff; text-align: center; font-size: 13px; padding: 4px; }

.messages { flex: 1; overflow-y: auto; padding: 12px 12px 4px; overscroll-behavior: contain; }
#list { display: flex; flex-direction: column; gap: 6px; max-width: 780px; margin: 0 auto; }
.load-older { display: block; margin: 0 auto 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted); }
.day { align-self: center; font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; margin: 8px 0 4px; }

.msg { max-width: min(86%, 620px); border-radius: var(--radius); padding: 9px 12px 6px; background: var(--brain); border: 1px solid var(--line); align-self: flex-start; overflow-wrap: anywhere; position: relative; }
.msg.owner { align-self: flex-end; background: var(--owner); color: var(--owner-text); border-color: transparent; border-bottom-right-radius: 6px; }
.msg.brain { border-bottom-left-radius: 6px; }
.msg.fallback { background: var(--fallback-bg); border-color: var(--fallback-line); border-bottom-left-radius: 6px; }
.msg.event { background: var(--event-bg); border-color: var(--event-line); max-width: min(94%, 680px); }
.msg.event.high { border-left: 4px solid var(--danger); }
.msg.system { align-self: center; background: none; border: 1px dashed var(--warn); color: var(--warn); font-size: 14px; text-align: center; }
.msg .label { font-size: 12px; font-weight: 600; color: var(--warn); margin-bottom: 2px; }
.msg .title { font-weight: 700; margin-bottom: 2px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.msg .badge { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); text-transform: uppercase; }
.msg .meta { display: flex; justify-content: flex-end; gap: 8px; font-size: 11px; opacity: .7; margin-top: 2px; }
.msg .meta .agent { margin-right: auto; font-weight: 600; opacity: .9; }
.msg .meta button { background: none; border: 0; padding: 0; font-size: 11px; color: inherit; text-decoration: underline; }
.msg .quote { font-size: 13px; opacity: .8; border-left: 3px solid currentColor; padding-left: 8px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: none; } }

.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body p { margin: 0 0 .5em; }
.body ul, .body ol { margin: .2em 0 .5em; padding-left: 1.3em; }
.body a { color: inherit; }
.msg:not(.owner) .body a { color: var(--accent); }
.body pre { background: var(--code-bg); padding: 8px 10px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.msg.owner .body code { background: rgb(255 255 255 / .15); padding: 0 3px; border-radius: 4px; }
.body table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; margin: .3em 0 .6em; }
.body th, .body td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.body blockquote { margin: .3em 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }

.files { display: grid; gap: 6px; margin: 6px 0 2px; }
.files img { max-width: 100%; max-height: 280px; border-radius: 10px; display: block; }
.files audio { width: 100%; min-width: 220px; height: 40px; }
.files video { max-width: 100%; border-radius: 10px; }
.file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, currentColor 8%, transparent); text-decoration: none; color: inherit; font-size: 14px; }
.file small { opacity: .7; }

.card { margin-top: 8px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.card-prompt { margin: 0 0 8px; font-weight: 600; }
.card-options { display: flex; flex-wrap: wrap; gap: 8px; }
.card-options button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 14px; font-weight: 600; min-height: 40px; }
.card-options button.primary { background: var(--accent); color: #fff; border-color: transparent; }
.card-options button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.card-note { width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); resize: vertical; }
.card-state { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.card-state:empty { display: none; }
.card.decided .card-options button:not(.chosen) { opacity: .4; }
.card.decided .card-options button.chosen { outline: 2px solid var(--ok); opacity: 1; }

/* Soạn tin */
.composer { background: var(--bg); padding: 4px 10px calc(var(--safe-bottom) + 10px); }
.attach { cursor: pointer; }
.mic.on { color: var(--danger); }
.pending { display: flex; flex-wrap: wrap; gap: 6px; max-width: 780px; margin: 0 auto; }
.pending:not(:empty) { padding: 4px 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.chip button { background: none; border: 0; padding: 0 4px; color: var(--muted); }
.chip.loading { opacity: .6; }
.reply-to { display: flex; justify-content: space-between; align-items: center; gap: 8px; max-width: 780px; margin: 0 auto 6px; font-size: 13px; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 8px; }
.reply-to span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reply-to button { background: none; border: 0; color: var(--muted); }
.recording { display: flex; align-items: center; gap: 12px; max-width: 780px; margin: 0 auto; padding: 4px; }
.recording #rec-time { flex: 1; font-variant-numeric: tabular-nums; }
.recording button:not(.primary) { background: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Tìm kiếm */
.search { position: absolute; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; padding-top: var(--safe-top); }
.search-bar { display: flex; gap: 6px; padding: 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.search-bar input { flex: 1; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }
.search-results { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.search-results .hint { color: var(--muted); text-align: center; margin-top: 20px; }
.search-results .msg { max-width: 100%; align-self: stretch; cursor: pointer; }

/* Ngăn kéo phòng */
.drawer { width: 290px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding-top: var(--safe-top); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.drawer-head b { flex: 1; }
.logo.small { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 6px calc(var(--safe-bottom) + 12px); }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 8px 4px; font-size: 12px;
  font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.section-head .link { text-transform: none; letter-spacing: 0; }
.link { background: none; border: 0; color: var(--accent); padding: 2px 4px; font-size: 13px; font-weight: 600; }
.link.small { font-size: 12px; color: var(--muted); padding: 4px 8px; }
.room-list { display: grid; gap: 1px; }
.room { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 10px; padding: 8px; text-align: left; }
.room:hover { background: var(--bg); }
.room.active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.room-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 17px;
  background: color-mix(in srgb, var(--agent, var(--accent)) 16%, transparent); }
.room-main { flex: 1; min-width: 0; display: grid; }
.room-main b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room.archived .room-main b { color: var(--muted); }
.unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px;
  font-weight: 700; display: grid; place-items: center; }
.group-label { font-size: 12px; color: var(--muted); padding: 6px 8px 2px; }
.directory .room-main small.engine { opacity: .8; font-style: italic; }
.badge-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
#drawer-open { position: relative; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 39; }
.only-mobile { display: none; }
@media (max-width: 899px) {
  .only-mobile { display: inline-flex; }
  .drawer { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(86vw, 320px); transform: translateX(-102%);
    transition: transform .2s ease; box-shadow: 0 0 30px rgb(0 0 0 / .2); }
  .drawer.open { transform: none; }
  .status-text { display: none; }
  .status { max-width: none; }
}

/* Tên AI trên tin */
.who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--agent, var(--accent)); margin-bottom: 2px; }
.msg.has-agent { border-left: 3px solid var(--agent, var(--accent)); }
.archived-note { max-width: 780px; margin: 2px auto 6px; font-size: 13px; color: var(--muted); text-align: center; }
.search-results .room-tag { font-size: 11px; color: var(--muted); margin-bottom: 2px; }

/* Hộp thoại */
.dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, 94vw); background: var(--panel); color: var(--text);
  box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.dialog::backdrop { background: rgb(0 0 0 / .4); }
.dialog form { display: grid; gap: 12px; padding: 18px; max-height: 88vh; overflow-y: auto; }
.dialog h2 { margin: 0; font-size: 18px; }
.dialog label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.dialog input, .dialog textarea { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 16px; }
.dialog fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 0; }
.dialog legend { font-size: 14px; color: var(--muted); padding: 0 4px; }
.agent-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 10px; }
.agent-picks .group-label { grid-column: 1 / -1; padding: 6px 0 0; }
.agent-picks label { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; padding: 4px 0; }
.dialog-actions { display: flex; gap: 8px; align-items: center; }
.dialog-actions .spacer { flex: 1; }
.dialog-actions button:not(.primary):not(.danger-link) { background: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.danger-link { background: none; border: 0; color: var(--danger); font-weight: 600; padding: 8px 0; }

/* Sơ đồ tri thức */
.knowledge { flex: 1; overflow-y: auto; padding: 14px 14px calc(var(--safe-bottom) + 20px); }
.knowledge > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.k-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.k-head h2 { margin: 0; font-size: 20px; }
.k-head small { color: var(--muted); }
.k-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 12px auto; }
.k-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.k-stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.k-stat span { font-size: 12px; color: var(--muted); }
.k-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 12px; }
.k-card h3 { margin: 0 0 8px; font-size: 15px; }
.k-graph { width: 100%; height: min(70vh, 560px); display: block; touch-action: none; }
.k-graph text { font: 600 var(--fs, 11px) -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; fill: var(--text); pointer-events: none; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.k-graph line { stroke: var(--muted); stroke-opacity: .35; }
.k-graph circle { stroke: var(--panel); stroke-width: 1.5; cursor: grab; }
.k-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.k-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.k-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.k-table-wrap { overflow-x: auto; }
.k-table th, .k-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.k-table td.num, .k-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--line); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }
.k-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.k-recent li { display: grid; gap: 2px; font-size: 14px; }
.k-recent small { color: var(--muted); }
.k-empty { color: var(--muted); text-align: center; margin: 40px 0; }

.update-bar { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 76px); transform: translateX(-50%); z-index: 60;
  background: #111827; color: #fff; border-radius: 999px; padding: 8px 8px 8px 16px; font-size: 14px; display: flex; gap: 10px;
  align-items: center; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }
.update-bar button { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 600; }


/* ---------- Chi phí Claude ---------- */
.usage .k-stat small { color: var(--muted); font-size: 12px; }
.u-banner { background: var(--fallback-bg); border: 1px solid var(--fallback-line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.u-meters { display: grid; gap: 12px; margin: 14px auto; }
.u-meter { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.u-meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.u-meter-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.u-track { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.u-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.u-fill.warn { background: var(--warn); }
.u-fill.over { background: var(--danger); }
.u-note { font-size: 12px; color: var(--muted); }
.u-section { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 14px auto; }
.u-section h3 { margin: 0 0 10px; font-size: 15px; }
.u-days { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.u-day { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; border-radius: 4px 4px 0 0; }
.u-day:hover, .u-day:focus-visible { background: color-mix(in srgb, var(--muted) 10%, transparent); outline: none; }
.u-bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.u-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.u-table-wrap { overflow-x: auto; }
.u-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.u-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.u-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.u-table td:not(:first-child), .u-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.u-foot { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }

/* ---------- Khung nhập kiểu Claude: ô chữ trên, hàng công cụ dưới ---------- */
.send-box { max-width: 780px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 10px 10px 8px 14px; display: grid; gap: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 4px 16px rgb(0 0 0 / 4%);
  transition: border-color .15s, box-shadow .15s; }
.send-box:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 2px 20px rgb(0 0 0 / 8%); }
.send-box[hidden] { display: none; }
#text { width: 100%; resize: none; max-height: 40vh; padding: 4px 2px; border: 0; outline: 0; background: transparent;
  line-height: 1.45; font-size: 16px; }
.send-tools { display: flex; align-items: center; gap: 4px; min-width: 0; }
.send-tools .icon { width: 34px; height: 34px; padding: 6px; border-radius: 10px; }
.send-tools .icon svg { width: 20px; height: 20px; }
.send-tools .attach { border: 1px solid var(--line); }
.send-spacer { flex: 1; }
.send { width: 34px; height: 34px; border: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--panel); margin-left: 2px; }
.send svg { width: 18px; height: 18px; stroke-width: 2.4; }
.send:hover { filter: brightness(1.08); }
.send:disabled { opacity: .45; }
.model-wrap { position: relative; min-width: 0; }
.model-wrap[hidden] { display: none; }
.model-chip { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 8px 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; }
.model-chip:hover, .model-chip[aria-expanded="true"] { background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--text); }
.model-chip .model-bolt { font-size: 12px; }
.model-chip .chev { width: 14px; height: 14px; transition: transform .15s; }
.model-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.model-menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; width: 280px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 14%), 0 2px 6px rgb(0 0 0 / 6%); }
.model-menu[hidden] { display: none; }
.model-menu-head { padding: 6px 10px 4px; font-size: 12px; color: var(--muted); }
.model-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.model-opt:hover, .model-opt:focus-visible { background: color-mix(in srgb, var(--muted) 12%, transparent); outline: none; }
.model-opt-text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.model-opt-text b { font-size: 14px; font-weight: 600; }
.model-opt-text small { font-size: 12px; color: var(--muted); }
.model-check { width: 16px; color: var(--accent); font-weight: 700; text-align: center; }
