/* ---------- tokens ---------- */
/* Navy + orange theme: deep navy frame (top bar, left rail), white cards on a soft blue-grey page,
   orange for actions and highlights. Dark mode keeps the same palette on navy surfaces. */
:root {
  --navy-950: #04101f;
  --navy-900: #06192d;
  --navy-800: #0a203b;
  --navy-700: #12375e;
  --orange: #ff7a18;
  --orange-2: #ff9a3d;
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --text: #0a1b33;
  --muted: #5a6876;
  --border: #dbe2e9;
  --accent: #ff7a18;
  --accent-ink: #c2540a;
  --accent-soft: #fff1e5;
  --accent-text: #ffffff;
  --topbar: #06192d;
  --topbar-console: #04101f;
  --topbar-text: #ffffff;
  --rail: #0a203b;
  --rail-text: #a3b5c6;
  --rail-active: #ffffff;
  --rail-hover: rgba(255, 255, 255, 0.07);
  --rail-sel: rgba(255, 122, 24, 0.16);
  --badge: #ff7a18;
  --error: #b33a2b;
  --ok-bg: #e6f4ec;
  --ok-text: #16744f;
  --warn-bg: #fff3e6;
  --warn-text: #9a4a06;
  --bad-bg: #fbeceb;
  --bad-text: #b33a2b;
  --chat-bg: #eef3f7;
  --mine-bg: #fff1e5;
  --mine-text: #0a1b33;
  --theirs-bg: #ffffff;
  --tick: #8a99a8;
  --tick-read: #16a36a;
  --unread: #ff7a18;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(7, 24, 45, 0.05), 0 6px 20px rgba(7, 24, 45, 0.06);
  --shadow-lg: 0 24px 70px rgba(7, 24, 45, 0.18);
  --font: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

/* Dark theme: used when Windows is dark (theme "system"), or when chosen in Me > Theme. */
:root[data-theme="dark"] {
  --bg: #04101f;
  --surface: #0a1d33;
  --surface-2: #0f2640;
  --text: #e7eef5;
  --muted: #93a7ba;
  --border: #1c3655;
  --accent: #ff7a18;
  --accent-ink: #ff9a3d;
  --accent-soft: #2b1d10;
  --accent-text: #ffffff;
  --topbar: #04101f;
  --topbar-console: #020a14;
  --topbar-text: #ffffff;
  --rail: #06192d;
  --rail-text: #93a7ba;
  --rail-active: #ffffff;
  --rail-hover: rgba(255, 255, 255, 0.06);
  --rail-sel: rgba(255, 122, 24, 0.18);
  --badge: #ff7a18;
  --error: #ff8a7a;
  --ok-bg: #0f2e22;
  --ok-text: #6fd3a2;
  --warn-bg: #33220c;
  --warn-text: #ffb86b;
  --bad-bg: #3a1714;
  --bad-text: #ff9a90;
  --chat-bg: #04101f;
  --mine-bg: #3a230d;
  --mine-text: #fbeee2;
  --theirs-bg: #0f2640;
  --tick: #7f93a7;
  --tick-read: #3ddc97;
  --unread: #ff9a3d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #04101f;
    --surface: #0a1d33;
    --surface-2: #0f2640;
    --text: #e7eef5;
    --muted: #93a7ba;
    --border: #1c3655;
    --accent: #ff7a18;
    --accent-ink: #ff9a3d;
    --accent-soft: #2b1d10;
    --accent-text: #ffffff;
    --topbar: #04101f;
    --topbar-console: #020a14;
    --topbar-text: #ffffff;
    --rail: #06192d;
    --rail-text: #93a7ba;
    --rail-active: #ffffff;
    --rail-hover: rgba(255, 255, 255, 0.06);
    --rail-sel: rgba(255, 122, 24, 0.18);
    --badge: #ff7a18;
    --error: #ff8a7a;
    --ok-bg: #0f2e22;
    --ok-text: #6fd3a2;
    --warn-bg: #33220c;
    --warn-text: #ffb86b;
    --bad-bg: #3a1714;
    --bad-text: #ff9a90;
    --chat-bg: #04101f;
    --mine-bg: #3a230d;
    --mine-text: #fbeee2;
    --theirs-bg: #0f2640;
    --tick: #7f93a7;
    --tick-read: #3ddc97;
    --unread: #ff9a3d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { min-height: 100%; }
.narrow { max-width: 440px; margin: 0 auto; padding: 8vh 16px 48px; }
.loading { text-align: center; color: var(--muted); padding-top: 20vh; }
a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.25; font-weight: 700; letter-spacing: -0.2px; }
::selection { background: rgba(255, 122, 24, 0.28); }
/* Small uppercase labels with letter spacing, used for section kickers and tile captions. */
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-ink); }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.18); }

/* ---------- basics ---------- */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: -0.2px; }
.brand p { margin: 0; color: var(--muted); font-size: 13px; }
.brand .brand-tag { font-size: 12px; letter-spacing: 0.4px; font-weight: 600; color: var(--accent-ink); }
.logomark { flex: none; display: block; }
/* Sign-in, allow and setup pages: soft brand gradient behind a centred card. */
/* Sign-in pages: deep navy with a faint grid and an orange glow, white card in front. */
.loginpage {
  min-height: 100vh; color-scheme: dark;
  background:
    radial-gradient(700px 420px at 85% 15%, rgba(255, 122, 24, 0.22), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(18, 55, 94, 0.9), transparent 65%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--navy-950);
}
.loginpage .brand h1 { color: #fff; }
.loginpage .brand p { color: #a3b5c6; }
.loginpage .brand .brand-tag { color: var(--orange-2); }
.loginpage .card { box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, 0.08); border-top: 3px solid var(--orange); color-scheme: light dark; }
.loginpage .hint { color: var(--muted); }
.gate-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 4px auto 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
button.big { padding: 10px 28px; font-size: 15px; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--orange), var(--orange-2)); color: #fff;
  font-weight: 700; letter-spacing: 0.5px;
}
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 16.5px; }
.card h3 { margin: 0 0 6px; font-size: 14px; }
.card p { margin: 0 0 12px; }

form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field span { font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.15); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input.code { font-size: 22px; letter-spacing: 6px; text-align: center; font-family: Consolas, "Cascadia Mono", monospace; }
button {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
button:hover:not(:disabled) { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; box-shadow: 0 6px 18px rgba(255, 122, 24, 0.28); }
button.primary:hover:not(:disabled) { background: #f06a08; border-color: #f06a08; transform: translateY(-1px); }
button { transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
button.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: default; }
button.icon { padding: 4px 6px; line-height: 0; color: var(--muted); border-color: transparent; background: transparent; }
button.icon:hover { color: var(--text); }
.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: none; border-radius: 8px; background: transparent; color: var(--muted);
}
.iconbtn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.status { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--muted); }
.status.error { color: var(--error); }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); }
.hint { font-size: 13px; color: var(--muted); }
.mono { font-family: Consolas, "Cascadia Mono", monospace; word-break: break-all; }
.mono.big { font-size: 20px; letter-spacing: 1px; }
.center { text-align: center; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.qr { display: flex; justify-content: center; margin: 8px 0; }
.qr svg { max-width: 100%; height: auto; border-radius: 6px; }
.secret { border: 1px dashed var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.codes { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.row.end { justify-content: flex-end; margin: 12px 0 0; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.check input { width: auto; }
.badge { padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.safety { font-size: 17px; letter-spacing: 1px; line-height: 1.8; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.invite { margin-top: 16px; padding: 14px; border-radius: 8px; background: var(--ok-bg); color: var(--ok-text); }
.invite[hidden] { display: none; }
.pill { padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.pill.active { background: var(--ok-bg); color: var(--ok-text); }
.pill.pending { background: var(--warn-bg); color: var(--warn-text); }
.pill.disabled { background: var(--bad-bg); color: var(--bad-text); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
tbody tr:hover { background: var(--surface-2); }
td.actions { white-space: normal; min-width: 220px; }
td.actions .small { margin: 2px 4px 2px 0; }
.secretbox { display: inline-flex; align-items: center; gap: 2px; }
.secretbox .secret-text { min-width: 9ch; letter-spacing: 1px; }
.modal { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 540px; width: calc(100% - 32px); padding: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }
.modal::backdrop { background: rgba(10, 15, 25, 0.5); }
.modal h2 { margin-top: 0; font-size: 17px; }
.modal form { margin-top: 8px; }

.avatar {
  --size: 40px;
  position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--avatar, var(--accent)); color: #fff;
  font-weight: 600; font-size: calc(var(--size) * 0.38); letter-spacing: 0.3px;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* ---------- presence ---------- */
:root { --st-available: #22c55e; --st-busy: #ef4444; --st-away: #f59e0b; --st-dnd: #dc2626; --st-offline: #9ca3af; }
.dot {
  position: absolute; right: -1px; bottom: -1px; width: max(10px, calc(var(--size) * 0.3)); height: max(10px, calc(var(--size) * 0.3));
  border-radius: 50%; border: 2px solid var(--surface); background: var(--st-offline); box-sizing: border-box;
}
.dot.inline { position: static; display: inline-block; width: 10px; height: 10px; border-width: 0; vertical-align: middle; }
.dot.available { background: var(--st-available); }
.dot.busy { background: var(--st-busy); }
.dot.away { background: var(--st-away); }
.dot.dnd { background: var(--st-dnd); }
.dot.dnd.inline { position: relative; }
.dot.dnd::after { content: ""; position: absolute; left: 22%; right: 22%; top: calc(50% - 1px); height: 2px; background: #fff; border-radius: 1px; }
.dot.offline { background: var(--st-offline); }
.dot.break { background: #8b5cf6; }
.st-break { color: #8b5cf6 !important; }
.statusmenu .menuhead { margin: 6px 10px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.statusmenu .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.st-available { color: var(--st-available) !important; }
.st-busy, .st-dnd { color: var(--st-busy) !important; }
.st-away { color: var(--st-away) !important; }
.convitem.offline .name { opacity: 0.75; }
.grouphead { display: flex; justify-content: space-between; padding: 12px 10px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.grouphead span { font-weight: 500; text-transform: none; letter-spacing: 0; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 10px; }
.segmented button { border: none; background: transparent; padding: 5px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.side-head .segmented { display: flex; }
.side-head .segmented button { flex: 1; }

/* ---------- app bar status picker ---------- */
.whowrap { position: relative; display: flex; align-items: center; gap: 10px; }
.rolechip { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
button.who { border: none; background: transparent; padding: 4px 8px; border-radius: 10px; text-align: left; }
button.who:hover { background: var(--surface-2); }
.statusmenu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; padding: 6px;
  display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}
.statusmenu[hidden] { display: none; }
.statusmenu button { border: none; background: transparent; text-align: left; padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 8px; }
.statusmenu button:hover { background: var(--surface-2); }
.statusmenu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }

/* ---------- me page ---------- */
.mepage { max-width: 860px; }
.profile { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-text h3 { margin: 0; font-size: 18px; }
.profile-text .hint { margin: 2px 0 10px; }
.statushelp { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.cardbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cardbar .hint { margin: 0 0 10px; flex: 1; min-width: 260px; }

/* ---------- organisation outline (tree view) ---------- */
.outline { border: 1px solid var(--border); border-radius: 12px; padding: 6px; background: var(--surface); }
.outline.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.tnode.over > .trow { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.trow {
  --depth: 0;
  display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 8px 4px calc(8px + var(--depth) * 26px);
  border-radius: 8px; position: relative;
}
.trow:hover { background: var(--surface-2); }
.trow::before { content: ""; position: absolute; left: calc(var(--depth) * 26px - 6px); top: 0; bottom: 0; border-left: 1px solid var(--border); }
.trow.rootrow::before, .trow[style*="--depth: 1"]::before { display: none; }
.rootrow { min-height: 48px; border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; margin-bottom: 4px; }
.unitrow { cursor: grab; }
.unitrow .tname strong { font-size: 14.5px; }
.person { cursor: grab; }
.twisty { width: 22px; height: 22px; padding: 0; border: none; background: transparent; color: var(--muted); font-size: 12px; border-radius: 6px; flex: none; }
.twisty:hover { background: var(--border); color: var(--text); }
.twisty-space { width: 22px; flex: none; }
.ticon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.ticon.big { width: 34px; height: 34px; }
.tname { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tname .kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tname .count { font-size: 12px; min-width: 22px; text-align: center; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.tname .sub { color: var(--muted); font-size: 12.5px; }
/* Row actions float over the right edge on hover, so names and counts keep their full width. */
.tactions {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 4px; padding-left: 16px;
  background: linear-gradient(to right, transparent, var(--surface-2) 16px);
  opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.trow:hover .tactions, .trow:focus-within .tactions { opacity: 1; pointer-events: auto; }
.tactions.always { position: static; transform: none; background: none; padding: 0; opacity: 1; pointer-events: auto; }
.person.role-head .tname strong::after, .person.role-branch_manager .tname strong::after, .person.role-supervisor .tname strong::after {
  content: " ★"; color: #f59e0b;
}
.empty-drop { color: var(--muted); font-style: italic; min-height: 30px; }
.mgmtrow .mgmt-people { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.mperson { display: inline-flex; align-items: center; gap: 4px; }
.chip .avatar { margin-left: -6px; }

/* ---------- app shell ---------- */
/* Teams-style frame: coloured top bar across, icon rail down the left, content on the right. */
.app {
  display: grid; grid-template-columns: 76px 1fr; grid-template-rows: 52px 1fr;
  grid-template-areas: "top top" "rail main"; height: 100vh; overflow: hidden;
}
.topbar {
  grid-area: top; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 0 16px 0 12px; background: var(--topbar); color: var(--topbar-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); position: relative;
}
/* A thin orange line under the top bar, fading out to the right. */
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--orange), rgba(255, 122, 24, 0) 70%); }
.topbrand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appname { font-weight: 800; font-size: 17px; letter-spacing: 1.6px; white-space: nowrap; text-transform: uppercase; }.apptag { font-size: 11px; color: #a3b5c6; white-space: nowrap; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.18); letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; }
@media (max-width: 900px) { .apptag { display: none; } }
.consolechip { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; padding: 3px 9px; border-radius: 6px; background: rgba(255, 122, 24, 0.16); color: var(--orange-2); border: 1px solid rgba(255, 122, 24, 0.45); }
.topcenter { min-width: 0; text-align: center; }
.topbar .appbar-title { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #cfdbe6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .rolechip { background: rgba(255, 255, 255, 0.08); color: #dbe6f0; border: 1px solid rgba(255, 255, 255, 0.14); }
.topbar .who { color: var(--topbar-text); }
.topbar .who-text span { color: rgba(255, 255, 255, 0.78); }
.topbar button.who { background: transparent; border: none; padding: 4px 8px; border-radius: 8px; }
.topbar button.who:hover { background: rgba(255, 255, 255, 0.12); }
.app.console .topbar { background: var(--topbar-console); }
.rail { grid-area: rail; background: var(--rail); border-right: 1px solid rgba(255, 255, 255, 0.06); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 12px; min-height: 0; overflow-y: auto; }
.rail-tabs, .rail-end { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 8px; }
.rail-end { margin-top: auto; }
.rail-btn {
  position: relative; display: grid; justify-items: center; gap: 2px; width: 100%; padding: 8px 2px;
  border: none; border-radius: 10px; background: transparent; color: var(--rail-text); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2px; text-decoration: none; text-align: center;
}
/* Each tool icon sits in its own rounded tile; the active one turns orange. */
.rail-btn .rico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06); transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.rail-btn:hover:not(:disabled) { background: transparent; color: var(--rail-active); }
.rail-btn:hover:not(:disabled) .rico { background: rgba(255, 255, 255, 0.1); }
.rail-btn.active { background: transparent; color: var(--rail-active); font-weight: 700; }
.rail-btn.active .rico { background: linear-gradient(135deg, var(--orange), var(--orange-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(255, 122, 24, 0.35); }
.rail-btn.active::before { content: ""; position: absolute; left: -8px; top: 12px; height: 30px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.rail-btn[data-count]::after {
  content: attr(data-count); position: absolute; top: 2px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--badge); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.rail-btn[hidden] { display: none; }
.appmain { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.appbar {
  height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.appbar-title { margin: 0; font-size: 17px; }
.who { display: flex; align-items: center; gap: 10px; }
.who-text { display: grid; line-height: 1.25; }
.who-text span { font-size: 12px; color: var(--muted); }
.tabbody { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.tabbody.flush { padding: 0; overflow: hidden; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 340px 1fr; height: 100%; min-height: 0; background: var(--surface); }
.card .chat { height: calc(100vh - 260px); min-height: 420px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.side { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.side-head { padding: 14px 14px 8px; }
.side-head h2 { margin: 0 0 10px; font-size: 18px; }
.side-head { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.searchbox { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.searchbox input { border: none; background: transparent; padding: 8px 0; outline: none; }
.side > input { margin: 12px; width: auto; }
.convlist { list-style: none; margin: 0; padding: 4px 8px 8px; overflow-y: auto; flex: 1; }
.convlist .empty { padding: 16px 12px; color: var(--muted); font-size: 13px; }
.convitem {
  width: 100%; text-align: left; border: none; border-radius: 10px; background: transparent;
  display: flex; align-items: center; gap: 12px; padding: 10px; color: var(--text);
}
.convitem:hover { background: var(--surface-2); }
.convitem.active { background: var(--accent-soft); }
.conv-text { display: grid; min-width: 0; flex: 1; }
.conv-top, .conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.convitem .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convitem .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convitem .when { font-size: 12px; color: var(--muted); flex: none; }
.convitem.unread .when { color: var(--tick-read); font-weight: 600; }
.convitem .count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--badge); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }

.pane { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--chat-bg); }
.chat-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; min-height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); }
.chat-title:empty { display: none; }
.chat-title .conv-text { flex: 0 1 auto; }
.chat-title .sub { color: var(--muted); font-size: 12px; }
.chat-title > .iconbtn:not(.backbtn) { margin-left: auto; }
.backbtn { display: none; }
.chat-title > .iconbtn + .titletools { margin-left: 0; }
.titletools { display: inline-flex; gap: 2px; margin-left: auto; }
.banner { padding: 10px 16px; background: var(--bad-bg); color: var(--bad-text); font-size: 14px; }
.banner[hidden] { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px 6%; display: flex; flex-direction: column; gap: 3px; }
.messages > .empty { margin: auto; color: var(--muted); text-align: center; display: grid; justify-items: center; gap: 4px; max-width: 360px; }
.messages > .empty p { margin: 0; }
.messages > .empty .sub { font-size: 13px; }
.daysep { align-self: center; margin: 10px 0 6px; }
.daysep span { display: inline-block; padding: 4px 12px; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 12px; box-shadow: var(--shadow); }
.msg {
  position: relative; display: flow-root; max-width: min(72%, 560px); padding: 6px 9px 4px; border-radius: 10px;
  background: var(--theirs-bg); color: var(--text); box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); align-self: flex-start;
}
.msg.mine { align-self: flex-end; background: var(--mine-bg); color: var(--mine-text); }
.msg.mine + .msg.theirs, .msg.theirs + .msg.mine { margin-top: 6px; }
.msg.bad { background: var(--bad-bg); color: var(--bad-text); }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -2px 10px; font-size: 11px; color: var(--muted); line-height: 1; }
.msg .meta::after { content: ""; display: block; clear: both; }
.ticks { color: var(--tick); }
.ticks.read { color: var(--tick-read); }

.composer { position: relative; padding: 10px 6% 12px; background: var(--chat-bg); }
.composer[hidden] { display: none; }
.composebox {
  display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px 6px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.composebox:focus-within { border-color: var(--accent); }
.composebox textarea {
  flex: 1; resize: none; border: none; outline: none; background: transparent; padding: 8px 0; max-height: 140px; line-height: 1.4;
}
.compose-tools { display: flex; align-items: center; gap: 2px; }
.compose-tools .divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.iconbtn.send.ready { color: var(--accent-ink); }
.composer .status { padding: 4px 4px 0; }
.emoji-panel {
  position: absolute; bottom: 100%; right: 6%; margin-bottom: -4px; z-index: 5;
  display: grid; grid-template-columns: repeat(7, 38px); gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.emoji-panel[hidden] { display: none; }
.emoji { border: none; background: transparent; font-size: 22px; padding: 4px; border-radius: 8px; }
.emoji:hover { background: var(--surface-2); }

.filewrap { display: grid; gap: 6px; margin-bottom: 2px; min-width: 240px; }
.filecard { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.05); }
.fileicon { font-size: 24px; }
.filemeta { display: grid; min-width: 0; flex: 1; }
.filemeta strong { overflow-wrap: anywhere; font-size: 14px; }
.filecard .sub { font-size: 12px; opacity: 0.75; }
.preview { max-width: 100%; max-height: 280px; border-radius: 8px; display: block; }

.monitor { background: var(--surface); }
.monitor .mrow { border-bottom: 1px solid var(--border); padding: 8px 0; }
.monitor .mrow .who { font-weight: 600; margin-right: 8px; }
.monitor .mrow .when { color: var(--muted); font-size: 12px; }
.monitor .mrow p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.monitor .mrow.bad p { color: var(--bad-text); }

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: calc(100vw - 32px); }
.toast {
  display: grid; gap: 2px; text-align: left; min-width: 280px; padding: 12px 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--unread);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}
.toast span { font-size: 13px; color: var(--muted); }

/* ---------- team chat ---------- */
.pinned {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 16px; border: none; border-radius: 0;
  border-bottom: 1px solid var(--border); background: var(--warn-bg); color: var(--warn-text); font-size: 13px;
}
.pinned[hidden] { display: none; }
.pinned span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.msg .sender { display: block; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); margin-bottom: 1px; }
.msg.headpost { border: 2px solid #f59e0b; }
.headtag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: #b45309; margin-bottom: 2px; }
.headbar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 6px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: 13px; }
.headbar[hidden] { display: none; }
.headbar .check { margin: 0 0 0 auto; }
.iconbtn.on { background: var(--warn-bg); color: #b45309; }
.iconbtn[hidden] { display: none; }
.readonly { padding: 14px; text-align: center; color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); font-size: 13px; }
.readonly[hidden] { display: none; }

/* ---------- reply, edit, delete, forward, mentions, typing, search, drop ---------- */
.msgactions {
  position: absolute; top: -14px; right: 8px; display: none; gap: 0; padding: 2px; z-index: 2;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
}
.msg.mine .msgactions { right: auto; left: 8px; }
.msg:hover .msgactions, .msg:focus-within .msgactions { display: flex; }
.msgactions .iconbtn { width: 28px; height: 28px; padding: 0; }
.quote {
  display: grid; width: 100%; text-align: left; gap: 1px; margin: 2px 0 4px; padding: 5px 8px; border: none;
  border-left: 3px solid var(--accent); border-radius: 6px; background: rgba(0, 0, 0, 0.05); color: inherit; font-size: 12.5px;
}
.quote strong { color: var(--accent-ink); font-size: 12px; }
.quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; color: var(--muted); }
.fwdtag { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-style: italic; color: var(--muted); margin-bottom: 2px; }
.msg .edited { font-style: italic; margin-right: 2px; }
.msg.deleted { background: transparent; box-shadow: none; border: 1px dashed var(--border); color: var(--muted); }
.msg.deleted p { font-style: italic; display: inline-flex; align-items: center; gap: 4px; }
.msg.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); } }
.mention { color: var(--accent-ink); font-weight: 600; }
.mention.me { background: var(--accent-soft); border-radius: 4px; padding: 0 2px; }
.msg.mentionme { border-left: 3px solid var(--accent); }
.composebar {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; margin-bottom: 6px;
  border-left: 3px solid var(--accent); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); color: var(--accent-ink);
}
.composebar[hidden] { display: none; }
.cb-text { display: grid; flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.cb-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mention-menu {
  position: absolute; bottom: 100%; left: 6%; margin-bottom: -4px; z-index: 6; display: grid; min-width: 240px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.mention-menu[hidden] { display: none; }
.mention-menu button { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: none; border-radius: 6px; background: transparent; color: var(--text); text-align: left; }
.mention-menu button:first-child, .mention-menu button:hover { background: var(--accent-soft); }
.mention-menu .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.typingline { min-height: 18px; padding: 0 6%; font-size: 12px; font-style: italic; color: var(--accent-ink); background: var(--chat-bg); }
.convitem .sub.typing { color: var(--accent-ink); font-style: italic; }
.convitem.muted .name { opacity: 0.8; }
.convitem .flag { display: inline-flex; vertical-align: -1px; margin-right: 4px; color: var(--muted); }
.latest {
  position: absolute; right: 24px; bottom: 120px; z-index: 3; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); font-weight: 600;
}
.latest[hidden] { display: none; }
.searchbar { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: var(--surface); border-bottom: 1px solid var(--border); color: var(--muted); }
.searchbar[hidden] { display: none; }
.searchbar input { flex: 1; border: none; outline: none; background: transparent; padding: 6px 0; color: var(--text); }
.searchbar > .sub { font-size: 12px; white-space: nowrap; }
.searchresults {
  position: absolute; top: 100%; left: 16px; right: 16px; z-index: 8; max-height: 360px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.searchresults[hidden] { display: none; }
.searchresults button { display: grid; gap: 2px; width: 100%; padding: 8px 10px; border: none; border-radius: 6px; background: transparent; color: var(--text); text-align: left; }
.searchresults button:hover { background: var(--accent-soft); }
.sr-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.sr-top .sub { color: var(--muted); font-size: 12px; }
.sr-text { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-text mark { background: #ffe58a; color: #222; border-radius: 2px; }
.pane.dropping::after {
  content: "Drop files to send them encrypted"; position: absolute; inset: 8px; z-index: 9; display: grid; place-items: center;
  border: 3px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 85%, transparent);
  color: var(--accent-ink); font-size: 18px; font-weight: 700; pointer-events: none;
}
.pickerlist { list-style: none; margin: 10px 0 0; padding: 0; max-height: 360px; overflow-y: auto; min-width: min(420px, 80vw); }
.pickerlist .convitem { width: 100%; }
.fullimage { display: block; max-width: min(88vw, 1200px); max-height: 78vh; margin: 0 auto; border-radius: 8px; }
.preview { cursor: zoom-in; }
.seen-0 { color: var(--tick-read) !important; }
.monitor .mrow .pill { margin-left: 8px; }
.monitor .mrow .earlier { color: var(--muted); font-style: italic; }
.monitor .mrow.wasdeleted { background: var(--bad-bg); }
table.report th { position: sticky; top: 0; background: var(--surface-2); cursor: pointer; white-space: nowrap; text-align: left; padding: 8px; border-bottom: 2px solid var(--border); font-size: 12.5px; }
table.report th.sorted { color: var(--accent-ink); }
table.report td { padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.report td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.report tr.inactive td { color: var(--muted); }
table.report tr.warn td { background: var(--warn-bg); }
.printsheet { display: none; }
.monitor .mrow.reaction { padding: 3px 0; font-size: 12.5px; }
@media print {
  body.printing > *:not(.printsheet) { display: none !important; }
  body.printing .printsheet { display: block; color: #000; background: #fff; font: 11pt/1.45 "Segoe UI", Arial, sans-serif; }
  .printsheet h1 { font-size: 16pt; margin: 0 0 4pt; }
  .printsheet .printrow { padding: 5pt 0; border-bottom: 0.5pt solid #ccc; break-inside: avoid; }
  .printsheet .earlier { color: #555; font-style: italic; }
}
.reactions { display: flex; flex-wrap: wrap; gap: 4px; clear: both; margin-top: 4px; }
.reactions[hidden] { display: none; }
.reactchip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 0 8px; font-size: 13px; line-height: 22px; color: var(--text); }
.reactchip.mine { border-color: var(--accent); background: var(--accent-soft); }
.reactpicker { position: absolute; top: -44px; right: 0; display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); z-index: 4; }
.reactpicker .emoji { font-size: 20px; padding: 2px 4px; }
.canned-menu { min-width: 320px; max-width: 520px; }
.canned-menu button > span { display: grid; text-align: left; }
.canned-menu .canned-body { margin-left: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 440px; }
.days { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.daybox { display: inline-flex; align-items: center; gap: 2px; margin: 0; font-size: 12px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
table.report td.indent-1 { padding-left: 24px; } table.report td.indent-2 { padding-left: 40px; } table.report td.indent-3 { padding-left: 56px; } table.report td.indent-4 { padding-left: 72px; } table.report td.indent-5 { padding-left: 88px; }
table.report td.wrap { white-space: normal; max-width: 420px; }
table.report td.actions { display: flex; gap: 6px; align-items: center; }
table.report input[type="time"] { width: 110px; }
.plainlist { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.breaklist { display: grid; gap: 8px; margin-bottom: 10px; }
.breakrow { display: grid; grid-template-columns: minmax(140px, 260px) 90px auto auto; gap: 8px; align-items: center; justify-content: start; }
.subopts { margin: -4px 0 8px 26px; padding-left: 10px; border-left: 2px solid var(--border); }
.subopts[hidden] { display: none; }
.linkbtn { border: none; background: none; padding: 0; color: var(--accent-ink); font: inherit; cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.persondetail[hidden] { display: none; }
.detailtop { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.detailtop .linkbtn { font-weight: 600; }
.personhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.personhead h2 { margin: 0; font-size: 20px; }
.personhead .sub { margin: 2px 0 0; color: var(--muted); }
.detailblock { margin-top: 18px; }
.detailhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.detailhead h3 { margin: 0; font-size: 15px; }
.segmented.wide { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 8px; }
.segmented.wide button { flex: 0 1 auto; }

/* ---------- feature switches ---------- */
.featuregrid { display: grid; gap: 10px; }
.featurerow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); margin: 0; }
.featurerow > span { display: grid; gap: 2px; }
.featurerow .sub { color: var(--muted); font-size: 12.5px; font-weight: normal; }
.featurerow select { min-width: 230px; }

/* ---------- voice notes ---------- */
.voicecard { display: flex; align-items: center; gap: 8px; min-width: 260px; color: var(--accent-ink); }
.voicecard .sub { color: var(--muted); font-size: 12px; }
.voiceplayer { height: 36px; max-width: 240px; }
.recbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  background: var(--surface); border: 1px solid var(--badge); border-radius: 12px; box-shadow: var(--shadow); color: var(--text);
}
.recbar[hidden] { display: none; }
.recbar .recclock { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: auto; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--badge); animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: 0.25; } }
.composebox[hidden] { display: none; }
.iconbtn.call { color: var(--accent-ink); }

/* ---------- call window ---------- */
.callwin {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 360px; display: grid; grid-template-rows: auto 1fr auto;
  background: #1f1f2e; color: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); overflow: hidden;
}
.callwin[hidden] { display: none; }
.callwin.video { width: 520px; }
.callwin.big { left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(1100px, 94vw); }
.callhead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.callhead .conv-text { display: grid; flex: 1; min-width: 0; }
.callhead .sub { color: rgba(255, 255, 255, 0.7); font-size: 12.5px; }
.callhead .iconbtn { color: #fff; }
.callhead .iconbtn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #fff; }
.stage { position: relative; display: grid; min-height: 220px; background: #14141f; }
.callwin.video .stage { aspect-ratio: 16 / 9; }
.callgrid { display: grid; gap: 6px; padding: 6px; min-height: 0; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.callgrid[data-count="2"] { grid-template-columns: 1fr 1fr; }
.callgrid[data-count="3"], .callgrid[data-count="4"] { grid-template-columns: 1fr 1fr; }
.callgrid[data-count="5"], .callgrid[data-count="6"] { grid-template-columns: 1fr 1fr 1fr; }
.ctile { position: relative; display: grid; place-items: center; min-height: 120px; border-radius: 10px; background: #1c1c2b; overflow: hidden; }
.ctile .avatar { box-shadow: 0 0 0 5px rgba(127, 133, 245, 0.3); }
.ctile video { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.ctile.live video { display: block; }
.ctile.live .tile-avatar { visibility: hidden; }
.ctile.waiting { opacity: 0.55; }
.tiletag { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage video.local { display: none; position: absolute; right: 10px; bottom: 10px; width: 28%; max-width: 220px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, 0.6); background: #000; }
.stage video.local.show { display: block; }
.remotetag { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); font-size: 12px; }
.remotetag[hidden] { display: none; }
.callcontrols { display: flex; justify-content: center; gap: 12px; padding: 14px; }
.callbtn { width: 50px; height: 50px; display: grid; place-items: center; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; }
.callbtn:hover { background: rgba(255, 255, 255, 0.24); }
.callbtn.on { background: #fff; color: #1f1f2e; }
.callbtn.off { background: #f5b335; color: #3a2600; }
.callbtn.accept { background: #22a55b; }
.callbtn.hangup { background: #d13438; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 48px 1fr 58px; grid-template-areas: "top" "main" "rail"; height: 100dvh; }
  .topbar { grid-template-columns: auto 1fr; gap: 8px; padding: 0 10px; }
  .topcenter, .apptag, .topbar .rolechip, .topbar .who-text { display: none; }
  .consolechip { font-size: 10px; padding: 1px 6px; }
  .rail { flex-direction: row; justify-content: space-around; padding: 0 4px; border-right: none; border-top: 1px solid rgba(255, 255, 255, 0.08); overflow: visible; }
  .rail-tabs, .rail-end { flex-direction: row; width: auto; padding: 0; margin: 0; gap: 2px; }
  .rail-btn { width: 60px; padding: 4px 2px; font-size: 9.5px; gap: 1px; }
  .rail-btn .rico { width: 30px; height: 30px; border-radius: 9px; }
  .rail-btn.active::before { display: none; }
  .rail-end .rail-btn[title^="Open the Admin"] span:not(.rico) { display: none; }
  .tabbody { padding: 12px; }
  .chat { grid-template-columns: 1fr; }
  .chat.has-active .side { display: none; }
  .chat:not(.has-active) .pane { display: none; }
  .backbtn { display: inline-grid; margin-right: -4px; }
  .chat-title { padding: 8px 10px; gap: 8px; min-height: 54px; }
  .chat-title .pill { display: none; }
  .messages { padding: 12px 10px; }
  .msg { max-width: 88%; }
  .composer { padding: 8px 8px 10px; }
  .msgactions { top: -16px; }
  .callwin, .callwin.video, .callwin.big { left: 0; right: 0; top: 0; bottom: 0; width: auto; transform: none; border-radius: 0; }
  .callwin .stage { aspect-ratio: auto; }
  .featurerow { flex-direction: column; align-items: stretch; }
  .featurerow select { min-width: 0; }
  .narrow { padding-top: 4vh; }
}
.memberlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.memberlist li { display: flex; align-items: center; gap: 10px; }
.memberlist .conv-text { flex: 1; }
.memberlist .sub { font-size: 12px; color: var(--muted); }

/* ---------- broadcasts ---------- */
.alertpop { border: none; border-radius: 16px; padding: 24px; width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.alertpop::backdrop { background: rgba(10, 15, 25, 0.6); }
.alertpop.important { border-top: 6px solid #f59e0b; }
.alertpop.normal { border-top: 6px solid var(--accent); }
.alertpop.critical { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; background: #b91c1c; color: #fff; display: grid; align-content: center; justify-items: center; text-align: center; }
.alertpop.critical .hint, .alertpop.critical .alert-from { color: #fee2e2; }
.alertpop.critical .alert-text { font-size: 22px; max-width: 800px; }
.alertpop.critical::backdrop { background: #7f1d1d; }
.alert-head { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 6px; }
.alert-from { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.alert-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; margin-bottom: 14px; }
button.big { padding: 12px 28px; font-size: 16px; }
.alertpop.critical button.primary { background: #fff; color: #b91c1c; border-color: #fff; }
.blist { display: grid; gap: 10px; }
.bitem { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.bitem.important { border-left-color: #f59e0b; }
.bitem.critical { border-left-color: #dc2626; }
.bitem p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bmeta .sub { color: var(--muted); }
.bstate { margin-left: auto; color: var(--muted); font-size: 12px; }
.pill.prio-normal { background: var(--accent-soft); color: var(--accent-ink); }
.pill.prio-important { background: #fef3c7; color: #92400e; }
.pill.prio-critical { background: #fee2e2; color: #991b1b; }
.scopebox { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0; }
.scopebox legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.scopelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 12px; max-height: 220px; overflow-y: auto; margin-top: 6px; }
.ackline { align-self: end; padding-bottom: 8px; }

/* ---------- system health ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 10px 0; }
.tile { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.tile.bad { border-color: #f59e0b; background: var(--warn-bg); }
.tlabel { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.tile strong { font-size: 18px; }
.tsub { font-size: 12px; color: var(--muted); }
.warnlist { margin: 0; padding: 10px 14px 10px 30px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); }
.okline { margin: 0; padding: 10px 14px; border-radius: 8px; background: var(--ok-bg); color: var(--ok-text); font-weight: 600; }

.pwrow { flex-wrap: nowrap; margin: 0; align-items: center; }
.pwrow input { flex: 1; min-width: 0; }

/* ---------- console dashboard ---------- */
.dash { display: grid; gap: 16px; max-width: 1480px; margin: 0 auto; }
.dash .card { margin: 0; padding: 18px 20px; }
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-head h2 { margin: 0; font-size: 15px; }
.dash-head .hint { font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: stretch; }
.dash-grid.g-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.dash-grid.g-2-3 { grid-template-columns: minmax(300px, 2fr) minmax(360px, 3fr); }
.dash-grid.g-3-2 { grid-template-columns: minmax(360px, 3fr) minmax(300px, 2fr); }
.subhead { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* Hero: navy panel with a faint grid and an orange glow, like the sign-in page. */
.hero {
  position: relative; overflow: hidden; border-radius: 16px; padding: 26px 28px; color: #fff;
  display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 24px; align-items: center;
  background:
    radial-gradient(520px 300px at 92% 0%, rgba(255, 122, 24, 0.28), transparent 65%),
    radial-gradient(700px 400px at 0% 120%, rgba(18, 55, 94, 0.95), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 36px 36px,
    var(--navy-900);
  box-shadow: var(--shadow-lg);
}
.hero h2 { margin: 10px 0 4px; font-size: 30px; letter-spacing: -0.6px; }
.hero-sub { margin: 0; color: #a3b5c6; }
.hero .kicker { color: var(--orange-2); }
.kicker.live::before { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 122, 24, 0.6); } 100% { box-shadow: 0 0 0 10px rgba(255, 122, 24, 0); } }
@media (prefers-reduced-motion: reduce) { .kicker.live::before { animation: none; } }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; font-size: 12.5px; color: #b8c5d3; }
.hero-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.hero-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid; }
.hero-pill.ok { color: #7ee2b0; border-color: rgba(126, 226, 176, 0.4); background: rgba(22, 116, 79, 0.25); }
.hero-pill.warn { color: #ffcf9e; border-color: rgba(255, 154, 61, 0.6); background: rgba(255, 122, 24, 0.18); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.hero-stats { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-ring { display: grid; justify-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #a3b5c6; }
.hero-ring .ring { width: 124px; height: 124px; }
.hero-nums { display: grid; grid-template-columns: repeat(3, minmax(110px, auto)); gap: 10px; }
.hero-nums > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09); backdrop-filter: blur(4px); }
.hero-nums strong { font-size: 26px; line-height: 1.1; letter-spacing: -0.5px; }
.hero-nums span { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #a3b5c6; }
.hero-nums em { font-style: normal; font-size: 12px; color: #93a7ba; }
.hero-nums em.warn { color: #ffb86b; }
.hero-nums .delta { text-transform: none; letter-spacing: 0; font-size: 12px; }
.hero .ring-num { fill: #fff; }
.hero .ring-sub { fill: #a3b5c6; opacity: 1; }
.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: #3ddc97; }
.delta.down { color: #ff9a90; }
.card .delta.up { color: var(--ok-text); }
.card .delta.down { color: var(--bad-text); }

/* Rings, donut and charts (inline SVG, coloured from CSS). */
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 9; }
.card .ring-track { stroke: var(--surface-2); }
.ring-bar { fill: none; stroke: var(--orange); stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.ring-num { font-size: 20px; font-weight: 800; fill: currentColor; }
.ring-sub { font-size: 10px; font-weight: 600; fill: currentColor; opacity: 0.7; }
.donutwrap { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.donut { width: 150px; height: 150px; }
.donut .seg { fill: none; stroke-width: 13; transition: stroke-dasharray 0.6s ease; }
.seg.st-available, .sw.st-available { stroke: var(--st-available); background: var(--st-available); }
.seg.st-busy, .sw.st-busy { stroke: var(--st-busy); background: var(--st-busy); }
.seg.st-away, .sw.st-away { stroke: var(--st-away); background: var(--st-away); }
.seg.st-dnd, .sw.st-dnd { stroke: #9f1239; background: #9f1239; }
.seg.st-break, .sw.st-break { stroke: #8b5cf6; background: #8b5cf6; }
.seg.st-offline, .sw.st-offline { stroke: var(--st-offline); background: var(--st-offline); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 44px; align-items: center; gap: 8px; font-size: 13.5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .lg-pct { color: var(--muted); font-size: 12px; text-align: right; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--muted); font-size: 10.5px; }
.chart .bar { fill: var(--orange); opacity: 0.85; }
.chart .bar.future { opacity: 0.18; }
.chart .bar.now { fill: var(--orange); opacity: 1; filter: drop-shadow(0 4px 6px rgba(255, 122, 24, 0.35)); }
.chart .line { fill: none; stroke: var(--navy-700); stroke-width: 2.2; stroke-linejoin: round; }
.chart .pt { fill: var(--surface); stroke: var(--navy-700); stroke-width: 2; }
:root[data-theme="dark"] .chart .line, :root[data-theme="dark"] .chart .pt { stroke: #7fb2ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart .line, :root:not([data-theme="light"]) .chart .pt { stroke: #7fb2ff; } }
.chartkey { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: -4px 0 6px; }
.chartkey .k { width: 14px; height: 10px; border-radius: 3px; margin-left: 8px; }
.chartkey .k:first-child { margin-left: 0; }
.chartkey .k.bar { background: var(--orange); }
.chartkey .k.line { height: 3px; background: var(--navy-700); }

/* KPI tiles with an icon chip. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpis.two { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: inherit; font: inherit;
}
.card .kpi { box-shadow: none; background: var(--surface-2); }
.kpi.link { cursor: pointer; }
.kpi.link:hover { border-color: var(--accent); transform: translateY(-1px); }
.kpi.bad { border-color: rgba(255, 122, 24, 0.55); background: var(--warn-bg); }
.kpi-text { display: grid; gap: 1px; min-width: 0; }
.kpi-text strong { font-size: 22px; line-height: 1.15; letter-spacing: -0.3px; }
.kpi-text .tsub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kchip { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; }
.kchip.orange { background: rgba(255, 122, 24, 0.14); color: var(--accent-ink); }
.kchip.navy { background: rgba(18, 55, 94, 0.1); color: var(--navy-700); }
.kchip.green { background: var(--ok-bg); color: var(--ok-text); }
.kchip.red { background: var(--bad-bg); color: var(--bad-text); }
.kchip.violet { background: rgba(139, 92, 246, 0.14); color: #7c3aed; }
:root[data-theme="dark"] .kchip.navy { background: rgba(127, 178, 255, 0.12); color: #9cc3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kchip.navy { background: rgba(127, 178, 255, 0.12); color: #9cc3ff; } }

/* Team pulse bars. */
.teams { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-height: 300px; overflow-y: auto; }
.team-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 4px; }
.stack { display: flex; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.stack .on { background: linear-gradient(90deg, var(--orange), var(--orange-2)); }
.stack .brk { background: #8b5cf6; }

/* People lists. */
.plist { list-style: none; margin: 0; padding: 0; display: grid; max-height: 300px; overflow-y: auto; }
.plist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.plist li:last-child { border-bottom: none; }
.who-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-line .who-text { min-width: 0; }
.who-line .who-text strong, .who-line .who-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist-end { display: flex; align-items: center; gap: 8px; flex: none; }
.meter { width: 90px; height: 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--orange), var(--orange-2)); }
.meter.bad > span { background: var(--bad-text); }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 10px 6px; max-height: 300px; overflow-y: auto; }
.facechip { display: grid; justify-items: center; gap: 4px; font-size: 11.5px; min-width: 0; }
.facechip span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dempty { display: flex; align-items: center; gap: 6px; padding: 14px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.dempty svg { color: var(--ok-text); }

/* Alerts strip. */
.alertbar, .okbar { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.alertbar { background: var(--warn-bg); color: var(--warn-text); border: 1px solid rgba(255, 122, 24, 0.45); }
.alertbar ul { margin: 0; padding-left: 18px; }
.okbar { background: var(--ok-bg); color: var(--ok-text); align-items: center; }

/* Server meters. */
.srv { display: grid; gap: 12px; }
.srvrow { display: grid; grid-template-columns: 70px 1fr 44px auto; align-items: center; gap: 10px; font-size: 13.5px; }
.srvrow .meter { width: 100%; height: 9px; }
.srvfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.srvfacts > div { display: grid; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.srvfacts > div.bad { background: var(--warn-bg); border-color: rgba(255, 122, 24, 0.5); }
.srvfacts span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }

/* Security timeline. */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; }
.timeline li { position: relative; display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 22px; bottom: -8px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--ok-text); box-shadow: 0 0 0 3px var(--ok-bg); }
.timeline li.bad .tl-dot { background: var(--bad-text); box-shadow: 0 0 0 3px var(--bad-bg); }
.timeline strong { text-transform: capitalize; }
.tl-meta { font-size: 12px; color: var(--muted); }

.tile.link { font: inherit; color: inherit; text-align: left; cursor: pointer; align-content: start; }
.tile.link:hover { border-color: var(--accent); }
@media (max-width: 1100px) {
  .dash-grid.g-2-3, .dash-grid.g-3-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dash-grid { grid-template-columns: 1fr; }
  .hero { padding: 20px; }
  .hero h2 { font-size: 24px; }
  .hero-nums { grid-template-columns: repeat(3, 1fr); }
  .hero-nums strong { font-size: 20px; }
  .donutwrap { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .srvrow { grid-template-columns: 60px 1fr 40px; }
  .srvrow .hint { display: none; }
}

/* ---------- organisation tree ---------- */
.org-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.orgtree { min-width: 0; }
.org-root, .unit { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); }
.org-root { background: var(--surface-2); }
.unit-children { display: grid; gap: 10px; margin-top: 10px; padding-left: 18px; border-left: 2px solid var(--border); }
.unit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: grab; }
.unit-head.root { cursor: default; }
.unit-head .kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.unit-head .sub { font-size: 12px; color: var(--muted); }
.unit-actions { margin-left: auto; display: flex; gap: 4px; }
.unit-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 30px; }
.management { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.unit.over, .org-root.over, .pool.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.dragging { opacity: 0.5; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; cursor: grab; }
.chip .sub { color: var(--muted); font-size: 12px; }
.chip.role-head, .chip.role-branch_manager { border-color: var(--accent); }
.chip.role-supervisor { border-style: dashed; border-color: var(--accent); }
.chip.role-sa, .chip.role-admin { cursor: default; background: var(--surface-2); }
.rolesel { width: auto; padding: 2px 4px; font-size: 12px; }
.chip button.icon { padding: 2px 4px; }
.pool { border: 1px solid var(--border); border-radius: 10px; padding: 10px; position: sticky; top: 0; max-height: calc(100vh - 140px); overflow-y: auto; background: var(--surface); }
.pool input { margin-bottom: 8px; }
.pool h3 { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.rules { margin: 0 0 8px; padding-left: 20px; }

/* ---------- small screens: forms and the org page (the app frame is in the 768px block above) ---------- */
@media (max-width: 768px) {
  .grid2, .grid3, .org-layout { grid-template-columns: 1fr; }
  .pool { position: static; max-height: none; }
  .chat .side { border-right: none; }
}

/* ---------- call sound: audio elements, "click to hear", speaking rings, connection hint ---------- */
.callaudio { display: none; }
.soundbtn { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 14px 8px; padding: 8px 12px; border: none; border-radius: 8px; background: #f5b335; color: #3a2600; font-weight: 700; }
.soundbtn[hidden] { display: none; }
.callhint { margin: 0 14px 8px; padding: 8px 10px; border-radius: 8px; background: rgba(245, 179, 53, 0.18); color: #ffe2a8; font-size: 12.5px; line-height: 1.4; }
.callhint[hidden] { display: none; }
.ctile.speaking { box-shadow: inset 0 0 0 3px #22c55e; }
.ctile.speaking .avatar { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.55); }
.callbtn.speaking { box-shadow: 0 0 0 3px #22c55e; }
.updatebar { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 80; padding: 10px 18px; border: none; border-radius: 999px; background: #f5b335; color: #3a2600; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
