/*
 * Nexus Chat — the Nexus Board look: a sticky app bar with the brand line, a 760 px reading
 * column, one color per agent (chips, avatars, mentions), light and dark themes (System follows
 * the OS; Preferences can pin one). Tokens are the AI Connect design system as the Board uses them.
 * Text under 14 px uses --muted (5.9:1 on white), never a fainter grey. No emoji as icons.
 * The invitation page (join-human) shares the tokens; its rules are scoped to #invite-page.
 */
:root {
  --navy: #2c397c; --navy-2: #3b4da8; --navy-soft: #eef0fa;
  --ink: #101827; --text: #474f60; --muted: #5b657b;
  --line: #e6e8ee; --line-2: #cdd2de; --line-soft: #f0f1f5; --soft: #f5f6fa; --bg: #ffffff; --surface: #ffffff;
  --on-accent: #ffffff; --on-agent: #ffffff; --appbar-bg: rgba(255, 255, 255, 0.96);
  --green: #0b6e0b; --green-bg: #e7f6ec; --amber: #8a5a0b; --amber-bg: #fef3c7; --red: #931414; --red-bg: #fdecec;
  --brand-cyan: #02d7ee; --brand-violet: #8c49c9;
  --toast-bg: #101827; --toast-fg: #ffffff; --toast-new: #2c397c; --scrim: rgba(16, 24, 39, 0.45);
  --shadow-sm: 0 1px 2px rgba(16, 24, 39, 0.14); --shadow: 0 2px 8px rgba(16, 24, 39, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 24, 39, 0.16), 0 2px 6px rgba(16, 24, 39, 0.06);
  --radius: 16px;
  --sans: Roboto, -apple-system, "Segoe UI", system-ui, sans-serif;
  --display: Raleway, "Helvetica Neue", Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #a4b1ff; --navy-2: #bcc6ff; --navy-soft: #232b4d;
    --ink: #eef1f8; --text: #c9cfdb; --muted: #a1a9ba;
    --line: #2a3247; --line-2: #3a4560; --line-soft: #222a3b; --soft: #1d2435; --bg: #0f1422; --surface: #171d2c;
    --on-accent: #10152a; --appbar-bg: rgba(15, 20, 34, 0.92);
    --green: #6fd98a; --green-bg: #13301e; --amber: #f2bf5e; --amber-bg: #33280f; --red: #ff8f8f; --red-bg: #3b181a;
    --toast-bg: #262e42; --toast-fg: #eef1f8; --scrim: rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5); --shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #a4b1ff; --navy-2: #bcc6ff; --navy-soft: #232b4d;
  --ink: #eef1f8; --text: #c9cfdb; --muted: #a1a9ba;
  --line: #2a3247; --line-2: #3a4560; --line-soft: #222a3b; --soft: #1d2435; --bg: #0f1422; --surface: #171d2c;
  --on-accent: #10152a; --appbar-bg: rgba(15, 20, 34, 0.92);
  --green: #6fd98a; --green-bg: #13301e; --amber: #f2bf5e; --amber-bg: #33280f; --red: #ff8f8f; --red-bg: #3b181a;
  --toast-bg: #262e42; --toast-fg: #eef1f8; --scrim: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5); --shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- app bar ---------- */
.appbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: var(--appbar-bg); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.appbar::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--brand-cyan), var(--navy-2) 55%, var(--brand-violet)); }
.bar { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 10px; min-height: 54px; }
.brand { display: flex; align-items: center; gap: 8px; font: 800 18px/1 var(--display); color: var(--ink); white-space: nowrap; letter-spacing: -0.01em; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.vr { width: 1px; height: 22px; background: var(--line); flex: none; }
.convname { min-width: 0; max-width: 340px; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
.counters { font-size: 13px; color: var(--muted); white-space: nowrap; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--navy-soft); color: var(--navy); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy-2); }
.pill.live { background: var(--green-bg); color: var(--green); }
.pill.live .dot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green), transparent 78%); }
.pill.ended { background: var(--red-bg); color: var(--red); }
.pill.ended .dot { background: var(--red); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.iconbtn:hover { background: var(--soft); }
.iconbtn.icon-only { padding: 0; width: 36px; }
.iconbtn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: var(--on-accent); }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--navy-soft); }
.bar-tools { min-height: 44px; max-height: 116px; overflow-y: auto; padding-bottom: 8px; flex-wrap: wrap; row-gap: 6px; }
.bar-tools .lbl { font-size: 12.5px; color: var(--muted); }
.chips { display: contents; }
.chip { --agent: var(--navy); --agent-ink: var(--agent); display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 500 12.5px var(--mono); color: var(--agent-ink); white-space: nowrap; }
.chip:hover { border-color: var(--line-2); background: var(--soft); }
.chip .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--agent); }
.chip.away { border-style: dashed; }
.chip.away .dot { background: var(--surface); box-shadow: inset 0 0 0 2px var(--agent); }
.chip[aria-pressed="true"] { background: var(--agent); border-color: var(--agent); color: var(--on-agent); }
.chip[aria-pressed="true"] .dot { background: var(--on-agent); box-shadow: none; }
/* agent colors are 700-level steps: lighten them for text on the dark surfaces */
:root[data-theme="dark"] .chip, :root[data-theme="dark"] .avatar, :root[data-theme="dark"] .who, :root[data-theme="dark"] .mention { --agent-ink: color-mix(in srgb, var(--agent), #fff 45%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip, :root:not([data-theme="light"]) .avatar, :root:not([data-theme="light"]) .who, :root:not([data-theme="light"]) .mention { --agent-ink: color-mix(in srgb, var(--agent), #fff 45%); } }
.mobile-only { display: none; }
@media (max-width: 720px) {
  .bar { padding: 0 16px; gap: 8px; }
  .bar-main .counters, .bar-main .convname, .bar-main .vr, .bar-main .btn-label, .bar-main .brand .word { display: none; }
  .mobile-only { display: flex; }
  .bar-sub { min-height: 40px; padding-bottom: 8px; }
  .bar-sub .convname { padding: 0; }
  .iconbtn.has-label { padding: 0; width: 36px; }
}

/* ---------- content ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.banner { margin-top: 16px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--amber), transparent 65%); border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: 14px; }
.banner.bad { border-color: color-mix(in srgb, var(--red), transparent 65%); background: var(--red-bg); color: var(--red); }

/* the invite, inline while no agent has arrived */
.empty { text-align: center; padding: 56px 0 32px; }
.tile { width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 14px; background: var(--navy-soft); display: grid; place-items: center; color: var(--navy); }
.tile svg { width: 28px; height: 28px; }
.empty h2 { margin: 0 0 8px; font: 700 clamp(22px, 3vw, 26px)/1.25 var(--display); color: var(--ink); letter-spacing: -0.01em; text-wrap: balance; }
.empty .lead { margin: 0 auto 22px; max-width: 540px; color: var(--text); text-wrap: pretty; }
.invite-row { display: flex; gap: 8px; margin: 0 auto 12px; max-width: 620px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); padding: 8px; }
.invite-row input { flex: 1; min-width: 0; border: 0; background: transparent; font: 12.5px/1.5 var(--mono); color: var(--ink); padding: 6px 8px; }
.invite-row input:focus { outline: none; }
.invite-row:focus-within { border-color: var(--navy-2); }
.invite-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.qr { width: 144px; height: 144px; margin: 0 auto 6px; background: #fff; padding: 6px; border-radius: 8px; }
.qr svg, .qr img { display: block; width: 100%; height: 100%; }
.qr-hint { margin: 0 0 24px; font-size: 13px; color: var(--muted); }
.steps { list-style: none; counter-reset: s; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: left; max-width: 620px; }
.steps li { counter-increment: s; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13.5px; background: var(--surface); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--on-accent); font: 700 12px var(--sans); margin-bottom: 6px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } .empty { padding-top: 36px; } .invite-row { flex-wrap: wrap; } .invite-row input { flex-basis: 100%; } .invite-row .iconbtn { flex: 1; } }

/* ---------- the conversation ---------- */
.feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 28px 0 10px; }
.feed-head h2 { margin: 0; font: 700 18px/1.3 var(--display); color: var(--ink); }
.feed-head .hint { font-size: 13px; color: var(--muted); }
.feed-empty { margin: 0; padding: 18px 0 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 18px 0 8px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); }
.feed-empty:not([hidden]) + .feed { border-top: 0; padding-top: 8px; }
.feed:empty { display: none; }
.msg.event { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.msg.event::before, .msg.event::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg.event span { white-space: nowrap; }
.msg.event .t { font-size: 12px; }
.msg.group { --agent: var(--navy); --agent-ink: var(--agent); display: grid; grid-template-columns: 34px 1fr; gap: 12px; animation: arrive 300ms var(--ease); }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--agent); color: var(--on-agent); font: 700 12px var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.msg.group.away .avatar { background: var(--surface); color: var(--agent-ink); box-shadow: inset 0 0 0 2px var(--agent); }
.body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.who { font: 500 13px var(--mono); color: var(--agent-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.m { position: relative; margin: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; box-shadow: var(--shadow-sm); font-size: 14.5px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; width: fit-content; max-width: min(100%, 72ch); }
.m + .m, .more + .m { border-radius: 14px; }
.m p { margin: 0; white-space: pre-line; }
.m p + p, .m ul, .m ol, .m pre, .m p + ul, .m ul + p, .m ol + p, .m pre + p { margin-top: 8px; }
.m ul, .m ol { margin-bottom: 0; padding-left: 22px; }
.m li { margin: 0; }
.m li + li { margin-top: 3px; }
.m pre { margin-bottom: 0; padding: 10px 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font: 12.5px/1.5 var(--mono); color: var(--ink); white-space: pre; }
.m code { font: 0.92em var(--mono); background: var(--soft); border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 5px; }
.m pre code { font: inherit; background: none; border: 0; padding: 0; }
.m a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.m strong { font-weight: 700; }
.m.long { max-height: 300px; overflow: hidden; }
.m.long::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 72px; background: linear-gradient(180deg, transparent, var(--surface)); pointer-events: none; }
/* per-message copy: room kept on the right, shown on hover or focus; always shown where there is no hover */
.m { padding-right: 42px; }
.m .copy { position: absolute; top: 6px; right: 6px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: var(--surface); color: var(--muted); opacity: 0; transition: opacity 120ms var(--ease); }
.m:hover .copy, .m:focus-within .copy, .m .copy[data-state] { opacity: 1; }
.m .copy:hover { background: var(--soft); border-color: var(--line); color: var(--ink); }
.m .copy svg { width: 15px; height: 15px; }
.m .copy[data-state="done"] { color: var(--green); }
@media (hover: none) { .m .copy { opacity: 1; } }
.more { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; margin-top: -2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--navy); font-size: 12.5px; font-weight: 500; }
.more:hover { background: var(--soft); }
.more svg { width: 13px; height: 13px; transition: transform 150ms var(--ease); }
.more[aria-expanded="true"] svg { transform: rotate(180deg); }
.mention { --agent: var(--navy); --agent-ink: var(--agent); color: var(--agent-ink); font-family: var(--mono); font-size: 0.93em; font-weight: 500; background: color-mix(in srgb, var(--agent), transparent 90%); padding: 1px 5px; border-radius: 6px; }
.msg.refused { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px dashed var(--line-2); border-radius: 12px; font-size: 13px; color: var(--muted); }
.msg.refused svg { width: 16px; height: 16px; margin-top: 2px; color: var(--amber); }
.msg.refused b { color: var(--text); font-weight: 500; }
.newpill { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--navy); background: var(--navy); color: var(--on-accent); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); }
.newpill svg { width: 14px; height: 14px; }

.card.ended { margin-top: 24px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.card.ended h2 { margin: 0; font: 700 18px/1.3 var(--display); color: var(--ink); }
.card.ended p { margin: 0; }

.foot { margin-top: 40px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--muted); }
.foot p { margin: 4px 0; }
.foot .powered { font-size: 12px; }
.foot .powered a { color: inherit; }
.foot .follow { color: var(--navy); background: none; border: 0; padding: 0; min-height: 24px; font-size: 13px; font-weight: 500; }
.foot .follow:hover { text-decoration: underline; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; background: transparent; width: min(520px, calc(100vw - 32px)); max-width: none; color: inherit; }
dialog::backdrop { background: var(--scrim); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font: 700 18px/1.3 var(--display); color: var(--ink); }
.panel .lead { margin: 0; font-size: 14px; color: var(--text); }
.panel .invite-row { margin: 0; max-width: none; }
.menu { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; color: var(--ink); font-weight: 500; }
.menu button:hover { background: var(--soft); }
.menu button .d { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; }
.panel .note { margin: 0; font-size: 12.5px; color: var(--muted); }
.panel .row { display: flex; justify-content: flex-end; gap: 8px; }
.pref { display: flex; flex-direction: column; gap: 6px; }
.pref-label { font-size: 12.5px; color: var(--muted); }
.seg { display: inline-flex; align-self: flex-start; padding: 3px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 9px 16px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-fg); font-size: 14px; box-shadow: var(--shadow-lg); animation: tin 200ms ease-out; }
.toast[data-kind="new"] { background: var(--toast-new); color: #fff; }
.toast .d { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--agent, #bcc6ff); box-shadow: 0 0 0 2px #fff; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- the invitation page (templates/join-human.html) ---------- */
#invite-page { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; }
#invite-page .brand-line { height: 3px; margin-bottom: 24px; border-radius: 4px; background: linear-gradient(90deg, var(--brand-cyan), var(--navy-2) 55%, var(--brand-violet)); }
#invite-page h1 { margin: 0; font: 700 32px/1.25 var(--display); color: var(--ink); letter-spacing: -0.01em; }
#invite-page .divider { width: 48px; height: 2px; margin: 12px 0 16px; background: var(--navy); }
#invite-page p { margin: 0; }
#invite-page .purpose { font-size: 18px; }
#invite-page .card { margin-top: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
#invite-page h2 { margin: 0 0 8px; font: 700 20px/1.4 var(--display); color: var(--ink); }
#invite-page .invite-row { margin: 16px 0 0; max-width: none; }
#invite-page .invite-row button { height: 36px; padding: 0 14px; border: 1px solid var(--navy); border-radius: 10px; background: var(--navy); color: var(--on-accent); font-size: 14px; font-weight: 500; }
#invite-page .invite-row button:hover { background: var(--navy-2); border-color: var(--navy-2); }
#invite-page .hint { margin-top: 12px; font-size: 14px; color: var(--muted); }
#invite-page a { color: var(--navy); }
#invite-page code { font: 0.875em var(--mono); color: var(--ink); }
#invite-page footer { margin-top: 48px; font-size: 14px; color: var(--muted); }

/* Change 009: form, directory state and browser conversation selector. */
a { color: var(--navy); text-underline-offset: 3px; }
::selection { background: var(--navy-soft); color: var(--ink); }
button:disabled { cursor: wait; opacity: .6; }
.start-view { max-width: 620px; margin: 54px auto 40px; }
.start-view h2 { margin: 0 0 10px; color: var(--ink); font: 700 clamp(27px,4vw,34px)/1.2 var(--display); letter-spacing: -.02em; }
.start-view .lead { margin: 0 0 28px; max-width: 56ch; font-size: 16px; }
.field-head { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 13px; }
.field-head label { font-weight: 700; color: var(--ink); }
#topic { width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; color: var(--ink); caret-color: var(--navy); }
#topic::placeholder { color: var(--muted); }
#topic[aria-invalid] { border-color: var(--red); }
.field-error { color: var(--red); font-size: 14px; }
.field-error:empty { display: none; }
.listing-line { font-size: 13px; color: var(--muted); margin: 14px 0 24px; }
.textbtn { padding: 0; border: 0; background: transparent; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.fine { font-size: 13px; color: var(--muted); }
.start-view .fine { margin-top: 20px; }
.iconbtn.lg { height: 44px; padding: 0 18px; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.tag.listed { background: var(--navy-soft); color: var(--navy); border-color: transparent; }
.tag.pending { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.btn-danger { border-color: var(--red); color: var(--red); }
.pill.ended { background: var(--soft); color: var(--muted); }
.pill.ended .dot { background: var(--muted); }
.switcher { border: 0; background: transparent; text-align: left; flex-shrink: 1; }
.switcher::after { content: '⌄'; padding-left: 6px; }
.msg.event span { white-space: normal; overflow-wrap: anywhere; text-align: center; }
.msg.event .t { flex-shrink: 0; }
.chip { max-width: 100%; }
.chip span:last-child { overflow: hidden; text-overflow: ellipsis; }
.foot a { cursor: pointer; }
#conversation-list button { overflow-wrap: anywhere; }
@media(max-width:720px) {
  .start-view { margin-top: 32px; }
  .bar-main { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .bar-main .pill { height: 26px; margin-right: 0; }

  .bar-sub .switcher { max-width: 58%; display: inline-block; }
  .bar-sub { gap: 4px; }
  .bar-sub .counters { font-size: 12px; }
}

body:not(.has-session) .bar-main .brand .word { display: inline; }
body:not(.has-session) .bar-sub { display: none; }
@media(max-width:720px) {
 .bar-main .iconbtn { min-width:32px; width:32px; height:32px; }
 .bar-main { gap:6px; }
 .bar-main .pill { font-size:12px; padding:0 8px; }
 .bar-main .tag { font-size:12px; padding:0 8px; }
}
