/* Fonts (self-hosted, SIL OFL): Geist for UI text, Outfit for display (headings, numbers, nav). */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/fonts/Outfit-latin.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
/* Denski in the Aura look (2026-11-25): Aura's cool greys, system blue, system type. Tokens first. */
:root {
  /* Aura palette: near-black base, cool white ink, ONE system-blue accent. */
  --bg: #0b0b0f; --panel: rgb(20 20 24 / .62); --card: rgb(255 255 255 / .045); --raise: rgb(255 255 255 / .08);
  --line: rgb(255 255 255 / .09); --solid: #141417;
  --ink: #f2f2f5; --dim: #a1a1aa; --faint: #8e8e96;
  --accent: #0a84ff; --glow: #0a84ff; --goInk: #ffffff;
  --go: var(--accent); --stop: #ff5f57; --rec: #ff5f57; --warn: #ffc233; --idle: #78787f;
  --mine: rgb(10 132 255 / .14); --link: #4da3ff;
  --glass: rgb(26 26 30 / .58); --glass-2: rgb(34 34 38 / .72); --hair: rgb(255 255 255 / .1);
  --hi: inset 0 1px 0 rgb(255 255 255 / .06); --blur: blur(22px) saturate(150%);
  --shadow: 0 12px 32px rgb(0 0 0 / .55);
  --fs-xs: 11px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 22px; --fs-2xl: 28px;
  --r-sm: 9px; --r-md: 12px; --r-lg: 16px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --side: 248px; --memb: 232px; --rail: 76px; --tabbar: 58px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --font-ui: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: var(--fs-md)/1.45 var(--font-ui); overscroll-behavior: none; }
body { height: 100dvh; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.grow { flex: 1; }
.err { color: #ffb4b4; min-height: 1.2em; margin: 0; font-size: 14px; }
.logo { width: 56px; height: 56px; border-radius: var(--r-lg); }
.logo.sm { width: 32px; height: 32px; border-radius: 10px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.sm svg.i, svg.i.sm { width: 16px; height: 16px; }

/* buttons */
.iconbtn { width: 36px; height: 36px; min-height: 36px; border-radius: var(--r-sm); display: inline-grid; place-items: center;
  color: var(--dim); position: relative; flex: none; }
.iconbtn.sm { width: 24px; height: 24px; min-height: 24px; border-radius: 6px; }
.iconbtn.on { color: var(--ink); background: var(--raise); }
.iconbtn.danger { color: var(--stop); }
.iconbtn.off { color: var(--stop); }
@media (hover: hover) { .iconbtn:hover { color: var(--ink); background: var(--raise); } }
.primary { background: var(--go); color: var(--goInk); border-radius: var(--r-md); padding: 12px 18px; font-weight: 700; font-size: 16px; --spinner: var(--goInk); }
.pillbtn { border-radius: 999px; padding: 6px 14px; min-height: 32px; font-weight: 700; font-size: 14px; background: var(--raise); }
.pillbtn.light { background: #fff; color: #3a1517; --spinner: #3a1517; }
.pillbtn.warn { background: var(--warn); color: #2b2000; }
.pillbtn.go { background: var(--go); color: var(--goInk); --spinner: var(--goInk); }
.pillbtn.ghost { background: none; border: 1px solid var(--line); color: var(--dim); }

/* gate (who's this / pending) */
.gate { height: 100%; display: grid; place-items: center; padding: var(--s5); padding-top: calc(var(--s5) + env(safe-area-inset-top)); }
.gatecard { width: min(400px, 100%); display: flex; flex-direction: column; gap: var(--s4); }
.gatepane { display: flex; flex-direction: column; gap: var(--s3); }
.gatepane h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.gatepane p { margin: 0; }
.gatepane label { font-weight: 600; font-size: 14px; margin-top: var(--s2); }
.gatepane input { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; font-size: 17px; }
.sk-title { height: 28px; width: 60%; }
.sk-line { height: 16px; width: 90%; }
.waitdots { display: flex; gap: 6px; }
.waitdots i, .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); animation: dot 1.2s infinite var(--ease); display: inline-block; }
.waitdots i:nth-child(2), .typing i:nth-child(2) { animation-delay: .15s; }
.waitdots i:nth-child(3), .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* layout */
.app { display: grid; grid-template-columns: var(--side) 1fr var(--memb); height: 100%; }
.app.nomembers { grid-template-columns: var(--side) 1fr 0; }
.app.nomembers .members { display: none; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
  padding-top: env(safe-area-inset-top); }
.sidehead { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); min-height: 56px; }
.servername { font-size: 16px; }
.chanscroll { flex: 1; overflow-y: auto; padding: var(--s2) var(--s2) var(--s4); overscroll-behavior: contain; }
.sect { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s2) var(--s1) var(--s2);
  color: var(--faint); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.chanlist { display: flex; flex-direction: column; gap: 2px; }
.chan { display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 36px; padding: 6px var(--s2); border-radius: var(--r-sm);
  color: var(--dim); text-align: left; font-size: 15px; }
.chan .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan.on { background: var(--raise); color: var(--ink); font-weight: 600; }
.chan.unread { color: var(--ink); font-weight: 700; }
/* "Past calls" under the voice rooms (owners): a quiet row with a hairline above, so it reads as the rooms' history */
.pastcalls { margin-top: var(--s2); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); padding-top: 10px; }
.chan .more { opacity: 0; }
.chan.on .more, .chan:focus-within .more { opacity: 1; }
@media (hover: hover) { .chan:hover { background: var(--card); color: var(--ink); } .chan:hover .more { opacity: 1; } }
@media (hover: none) { .chan.on .more { opacity: 1; } }
.badge { background: var(--stop); color: #fff; font-weight: 800; font-size: 11px; border-radius: 999px; min-width: 18px; height: 18px;
  padding: 0 6px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.chanedit { width: 100%; background: var(--bg); border: 1px solid var(--go); border-radius: var(--r-sm); padding: 7px var(--s2); font-size: 15px; }
.vmembers { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 var(--s1) 30px; }
.vm { display: flex; align-items: center; gap: var(--s2); font-size: 14px; color: var(--dim); min-height: 28px; }
.vm .avs { width: 22px; height: 22px; font-size: 11px; }
.vm .vmicon { color: var(--faint); display: inline-flex; gap: 2px; margin-left: auto; padding-right: var(--s1); }
.vm.talk .avs { box-shadow: 0 0 0 2px var(--go); }

.voicepanel { border-top: 1px solid var(--line); padding: var(--s2) var(--s3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); background: rgb(10 132 255 / .07); }
.vpinfo { flex: 1 1 128px; min-width: 0; display: flex; flex-direction: column; }
.vpstate { white-space: nowrap; color: var(--go); font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.vpname { color: var(--dim); font-size: 13px; text-align: left; min-height: 0; padding: 0; }
.vpleave { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s3); margin-left: auto; flex: none; border-radius: 999px;
  background: rgb(255 95 87 / .14); border: 1px solid rgb(255 95 87 / .45); color: #ffb4b6; font-weight: 700; font-size: var(--fs-sm);
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease); }
.vpleave svg.i { width: 16px; height: 16px; }
.vpleave:active { transform: scale(.96); }
@media (hover: hover) { .vpleave:hover { background: var(--stop); color: #fff; } }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: var(--go); display: inline-block; flex: none; }
.userbar { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3) calc(var(--s2) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); }
.meinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.meinfo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--stop); border: 2px solid var(--solid); }

/* avatars */
.av { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; flex: none;
  color: var(--goInk); background: var(--go); font-size: 15px; position: relative; }
.avs { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; flex: none; font-size: 13px; }
.c0 { background: #f0b06a; color: #2a1704; } .c1 { background: #ece2cf; color: #26262b; } .c2 { background: #c98a5b; color: #241104; }
.c3 { background: #d9c08a; color: #2a2108; } .c4 { background: #d9a194; color: #2c120c; } .c5 { background: #a9a197; color: #1b1b1f; }

/* main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.mainhead { display: flex; align-items: center; gap: var(--s2); padding: calc(var(--s2) + env(safe-area-inset-top)) var(--s3) var(--s2) var(--s4);
  border-bottom: 1px solid var(--line); min-height: 56px; background: var(--bg); }
.mainhead h2 { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.headicon { color: var(--faint); display: inline-flex; }
.headsub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phoneonly { display: none; }
.pbanner { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s2) var(--s4); background: rgb(10 132 255 / .1); border-bottom: 1px solid rgb(10 132 255 / .25); font-size: 14px; }
.pbanner b { font-weight: 700; }
.recbanner { display: flex; align-items: center; justify-content: center; gap: var(--s3); flex-wrap: wrap; background: #3a1517;
  border-bottom: 1px solid #6b2226; padding: var(--s2) var(--s4); font-weight: 700; }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--rec); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.recask { display: flex; align-items: center; justify-content: center; gap: var(--s3); flex-wrap: wrap; background: #3b2f10;
  border-bottom: 1px solid #6b5520; padding: var(--s3) var(--s4); font-weight: 600; text-align: center; }
.recaskbtns { display: flex; gap: var(--s2); }

/* text view */
.textview { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.feed { flex: 1; overflow-y: auto; padding: var(--s4) 0 var(--s2); display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.feed > * { flex-shrink: 0; }
.loadmore { align-self: center; margin-bottom: var(--s2); }
.day { display: flex; align-items: center; gap: var(--s3); color: var(--faint); font-size: 12px; font-weight: 700; margin: var(--s4) var(--s4) var(--s2); }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.empty { margin: auto; text-align: center; color: var(--dim); padding: var(--s5); max-width: 34ch; }
.empty b { color: var(--ink); display: block; font-size: 18px; margin-bottom: var(--s1); }
.msg { display: grid; grid-template-columns: 40px 1fr; column-gap: var(--s3); padding: 2px var(--s4); position: relative; }
.msg.first { margin-top: var(--s3); }
.msg .gut { grid-row: span 2; }
.msg .av { width: 40px; height: 40px; }
.msg .hd { display: flex; align-items: baseline; gap: var(--s2); }
.msg .who { font-weight: 700; }
.msg .tm { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.msg .side-tm { color: var(--faint); font-size: 11px; opacity: 0; text-align: right; padding-top: 3px; font-variant-numeric: tabular-nums; }
.msg .body { overflow-wrap: anywhere; white-space: pre-wrap; min-width: 0; }
.msg .body a { color: var(--link); }
/* a link to a note or file inside Denski: a chip that opens it in place (app.js denChip) */
.msg .body a.denlink { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; vertical-align: bottom;
  padding: 3px 11px 3px 8px; border-radius: 999px; background: rgb(10 132 255 / .16); color: var(--link); text-decoration: none;
  font-weight: 600; line-height: 1.35; transition: transform .14s ease-out, background-color .15s ease-out; -webkit-tap-highlight-color: transparent; }
.msg .body a.denlink::after { content: ""; position: absolute; inset: -9px -4px; } /* a finger-sized target around a text-sized chip */
.msg .body a.denlink span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg .body a.denlink .i { width: 15px; height: 15px; flex: none; }
.msg .body a.denlink:active { transform: scale(.97); background: rgb(10 132 255 / .28); }
.msg .body a.denlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .msg .body a.denlink:hover { background: rgb(10 132 255 / .26); } }
@media (prefers-reduced-motion: reduce) { .msg .body a.denlink { transition: none; } .msg .body a.denlink:active { transform: none; } }
.msg .body code { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 13px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.msg .body pre { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s2) var(--s3); margin: var(--s1) 0;
  overflow-x: auto; white-space: pre; font-size: 13px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.msg .edited { color: var(--faint); font-size: 11px; margin-left: 4px; }
.msg.deleted .body { color: var(--faint); font-style: italic; }
.msg.pending .body { opacity: .55; }
.msg.failed .body { color: #ffb4b4; }
.msg.editing .body { white-space: normal; }
.msg img.photo { display: block; max-width: min(360px, 100%); max-height: 360px; border-radius: var(--r-md); margin: var(--s1) 0; cursor: zoom-in; background: var(--card); }
.filecard { display: inline-flex; align-items: center; gap: var(--s3); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s2) var(--s3); margin: var(--s1) 0; color: var(--ink) !important; text-decoration: none; max-width: 100%; }
.filecard .fn { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reacts { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); }
.react { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 0 8px; min-height: 26px; font-size: 13px; font-variant-numeric: tabular-nums; }
.react.mine { border-color: var(--accent); background: rgb(10 132 255 / .14); }
.msgtools { position: absolute; right: var(--s4); top: -14px; display: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 2px; box-shadow: 0 4px 14px rgb(0 0 0 / .35); z-index: 2; }
.msg.tools .msgtools { display: flex; }
@media (hover: hover) {
  .msg:hover { background: rgb(255 255 255 / .03); }
  .msg:hover .side-tm { opacity: 1; }
  .msg:hover .msgtools { display: flex; }
}
.sys { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s4); margin: var(--s2) 0; color: var(--dim); font-size: 14px; }
.sys .ic { color: var(--go); display: inline-flex; }
.editbox { width: 100%; background: var(--card); border: 1px solid var(--go); border-radius: var(--r-sm); padding: var(--s2); resize: none; font-size: 15px; }
.edithint { font-size: 12px; color: var(--faint); }
.typing { min-height: 22px; padding: 0 var(--s4); font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.typing i { width: 5px; height: 5px; }
.composer { display: flex; align-items: flex-end; gap: var(--s2); margin: 0 var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }
.composer textarea { flex: 1; resize: none; max-height: 180px; background: none; border: 0; padding: 8px 4px; font-size: 16px; line-height: 1.35; outline: none; }
.composer:focus-within { border-color: rgb(10 132 255 / .45); }
.attach { cursor: pointer; }
.sendbtn { width: 36px; height: 36px; min-height: 36px; border-radius: var(--r-sm); background: var(--go); color: var(--goInk); display: grid; place-items: center; flex: none; --spinner: var(--goInk); }
.sendbtn svg.i { width: 18px; height: 18px; }

/* voice view */
.voiceview { flex: 1; display: flex; flex-direction: column; min-height: 0; }
/* before joining: one centered card (channel, who's here, mic pre-check chip, Join) */
.joinpane { flex: 1; display: grid; place-items: center; padding: var(--s5) var(--s4); min-height: 0; overflow-y: auto; }
.jcard { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center;
  padding: var(--s6) var(--s5) var(--s5); background: var(--glass); border: 1px solid var(--hair); border-radius: calc(var(--r-lg) + 4px);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--hi), 0 18px 48px rgb(0 0 0 / .4); }
.jhead { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.jicon { width: 56px; height: 56px; border-radius: var(--r-lg); display: grid; place-items: center; color: var(--accent);
  background: rgb(10 132 255 / .1); box-shadow: inset 0 0 0 1px rgb(10 132 255 / .22); }
.jicon svg { width: 26px; height: 26px; }
.jname { margin: 0; font-size: var(--fs-xl); letter-spacing: -.01em; overflow-wrap: anywhere; }
.jcard #joinWho { margin: 0; }
.javs { display: flex; justify-content: center; }
.javs .av { width: 34px; height: 34px; font-size: 14px; box-shadow: 0 0 0 3px var(--solid); }
.javs .av + .av { margin-left: -8px; }
.jdev { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; max-width: 100%; padding: 0 var(--s4); border-radius: 999px;
  background: var(--card); border: 1px solid var(--hair); color: var(--dim); font-size: var(--fs-sm); font-weight: 600; }
.jdev svg { flex: none; }
.jdevt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jdev.ok { color: var(--ink); } .jdev.ok svg { color: var(--accent); }
.jdev.bad { color: #ffb4b4; border-color: rgb(255 95 87 / .45); }
@media (hover: hover) { .jdev:hover { background: var(--raise); } }
.jcard #joinBtn { width: 100%; min-height: 48px; margin-top: var(--s2); }
/* in a call: the stage hugs the tiles and the control bar sits right under it; focused or with the transcript, it fills */
.voiceview { position: relative; }
.stage { flex: 1; display: flex; min-height: 0; position: relative; }
.voiceview.incall .stage { flex: 1 1 0; }
.voiceview:not(.incall) .stage { flex: 0 0 auto; }
/* the stage owns every spare pixel; tiles share it by cell, never wider than 16:9 on desktop, so there is no dead band */
.tiles { flex: 1; display: grid; gap: var(--s2); padding: var(--s3); min-height: 0; overflow: hidden; align-content: stretch; justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); grid-auto-rows: minmax(0, 1fr); }
.tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  display: grid; place-items: center; width: 100%; height: 100%; max-width: calc((100dvh - 190px) * 16 / 9); justify-self: center; min-width: 0; min-height: 44px; padding: 0;
  font: inherit; color: inherit; text-align: inherit; cursor: pointer; }
.tile:active { transform: scale(.992); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* amber speaking ring, drawn above the video so it shows with the camera on */
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; opacity: 0;
  box-shadow: inset 0 0 0 3px var(--go), inset 0 0 18px rgb(10 132 255 / .35); transition: opacity 160ms var(--ease); }
.tile.talk::after { opacity: 1; }
.tile.me { order: 9; }   /* the other people first, me last */
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.screen video { object-fit: contain; }
.tile.me video { transform: scaleX(-1); }
.tile.me.screen video, .tile.me.back video { transform: none; }
.tile video:not([hidden]) ~ .bigav { visibility: hidden; }
.tile .bigav { width: 84px; height: 84px; font-size: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.tile .lbl { position: absolute; left: var(--s2); bottom: var(--s2); background: rgb(0 0 0 / .6); padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; z-index: 2; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 2 * var(--s2)); }
.tile .lbl .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .st { position: absolute; right: var(--s2); top: var(--s2); background: rgb(0 0 0 / .6); padding: 3px 9px; border-radius: 999px; font-size: 12px; z-index: 2; color: var(--dim); }
/* focus: one tile fills the stage, the rest become a strip of thumbnails under it (one row, they shrink to fit) */
.tiles.focused { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; overflow: hidden; --thumb-w: 192px; --thumb-h: 108px; }
.tiles.focused .tile { flex: 1 1 0; max-width: var(--thumb-w); height: var(--thumb-h); aspect-ratio: auto; }
.tiles.focused .tile:not(.focus) .bigav { width: 44px; height: 44px; font-size: 19px; }
.tiles.focused .tile:not(.focus) .lbl { left: 6px; bottom: 6px; padding: 2px 8px; font-size: 12px; max-width: calc(100% - 12px); }
.tiles.focused .tile:not(.focus) .st { display: none; }
.tiles.focused .tile.focus { order: -1; flex: 0 0 100%; max-width: none; height: calc(100% - var(--thumb-h) - var(--s2)); }
.tiles.focused.solo .tile.focus { height: 100%; }

.txpanel { width: 320px; flex: none; display: flex; flex-direction: column; min-height: 0; margin: var(--s3) var(--s3) var(--s3) 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.txhead { display: flex; align-items: center; justify-content: space-between; padding: var(--s2) var(--s2) var(--s2) var(--s4); border-bottom: 1px solid var(--line); }
.txlist { flex: 1; overflow-y: auto; padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: var(--s2); overscroll-behavior: contain; }
.txline { overflow-wrap: anywhere; line-height: 1.4; }
.txline b { color: var(--go); }
.txempty { color: var(--dim); margin: auto; text-align: center; }
.callerr { text-align: center; padding: 0 var(--s4); }
.callerr:empty { display: none; }
/* controls: one glass bar docked at the bottom of the call. One toggle rule: neutral when off, amber when on,
   red with a slashed icon when muted. The icon swaps with the state, so the camera never looks inverted. */
.controls { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; flex: none; margin: 0 var(--s3) calc(var(--s3) + env(safe-area-inset-bottom)); padding: var(--s2);
  background: var(--glass-2); border: 1px solid var(--hair); border-radius: calc(var(--r-lg) + 2px); box-shadow: var(--hi), 0 10px 28px rgb(0 0 0 / .4);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.ctl { min-width: 72px; min-height: 56px; border-radius: var(--r-md); padding: var(--s2) var(--s3); background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 600; font-size: 12px; color: var(--ink);
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease); }
.ctl:active { transform: scale(.96); }
.ctl.on { background: rgb(10 132 255 / .16); border-color: rgb(10 132 255 / .5); color: var(--accent); }
.ctl.muted { background: rgb(255 95 87 / .16); border-color: rgb(255 95 87 / .5); color: #ff9b9e; }
.ctl.recon { background: rgb(255 95 87 / .18); border-color: var(--rec); color: #ffb4b6; }
.ctl.leave { background: var(--stop); border-color: var(--stop); color: #fff; }
@media (hover: hover) { .ctl:not(.on):not(.leave):not(.muted):not(.recon):hover { background: var(--raise); } }
.ctlmore { display: none; }
.ctlmenu { position: absolute; left: var(--s3); right: var(--s3); bottom: 0; z-index: 12; display: flex; flex-direction: column; padding: var(--s1);
  background: rgb(20 20 24 / .96); border: 1px solid var(--hair); border-radius: var(--r-lg); box-shadow: 0 -8px 32px rgb(0 0 0 / .5);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: sheetin 160ms var(--ease); }
.ctlrow { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s3); border-radius: var(--r-md); font-weight: 600; text-align: left; }
.ctlrow.recon { color: #ffb4b6; }
@media (hover: hover) { .ctlrow:hover { background: var(--raise); } }
.ctlrow + .ctlrow { border-top: 1px solid var(--line); }

/* members */
.members { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s2) var(--s4); }
.mgroup { color: var(--faint); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: var(--s3) var(--s2) var(--s1); }
.member { display: flex; align-items: center; gap: var(--s3); padding: 6px var(--s2); border-radius: var(--r-sm); }
.member.offline { opacity: .45; }
.member .av { width: 32px; height: 32px; font-size: 14px; }
.sdot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--panel); background: var(--faint); }
.sdot.online { background: var(--go); } .sdot.idle { background: var(--idle); }
.member .mname { font-weight: 600; }
.member .msub { font-size: 12px; color: var(--dim); }

/* phone bottom call bar */
.callbar { position: fixed; left: var(--s2); right: var(--s2); bottom: calc(var(--s2) + env(safe-area-inset-bottom)); z-index: 15;
  display: flex; align-items: center; gap: var(--s1); background: var(--glass-2); border: 1px solid var(--hair); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: var(--r-lg);
  padding: var(--s1) var(--s1) var(--s1) var(--s3); box-shadow: 0 8px 24px rgb(0 0 0 / .45); }
.cbinfo { flex: 1; display: flex; align-items: center; gap: var(--s2); text-align: left; font-weight: 700; min-height: 44px; }
.callbar .iconbtn { width: 44px; height: 44px; color: var(--ink); }
.callbar .iconbtn.danger { color: #fff; background: var(--stop); }
.app.withcallbar .composer { margin-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* settings sheet */
.sheetwrap { position: fixed; inset: 0; background: rgb(0 0 0 / .55); z-index: 40; display: grid; place-items: center; padding: var(--s4); }
.sheet { width: min(560px, 100%); max-height: min(720px, 92dvh); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  display: flex; flex-direction: column; box-shadow: 0 16px 48px rgb(0 0 0 / .5); animation: sheetin 220ms var(--ease); }
@keyframes sheetin { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.sheethead { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s3) var(--s3) var(--s5); border-bottom: 1px solid var(--line); }
.sheethead h2 { margin: 0; font-size: 18px; }
.sheetbody { overflow-y: auto; padding: var(--s2) var(--s5) var(--s5); }
.setgroup h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin: var(--s5) 0 var(--s2); }
.setgroup p { margin: 0 0 var(--s2); }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 48px; }
.devrow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.devrow .dinfo { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.devrow .dinfo b { overflow-wrap: anywhere; }
.devrow select { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 8px; min-height: 36px; }
.devrow .dact { display: flex; gap: var(--s2); align-items: center; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--raise); color: var(--dim); margin-left: 6px; }
.tag.pending { background: #3b2f10; color: var(--warn); } .tag.denied { background: #3a1517; color: #ffb4b4; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); transition: background var(--t-base, 200ms) var(--ease); }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform var(--t-base, 200ms) var(--ease), background var(--t-base, 200ms); }
.switch input:checked + i { background: rgb(10 132 255 / .25); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--go); }

/* popovers, viewer, toast */
.popover { position: fixed; z-index: 45; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s1);
  box-shadow: 0 12px 32px rgb(0 0 0 / .5); display: flex; flex-direction: column; min-width: 150px; animation: sheetin 160ms var(--ease); }
.popover button { text-align: left; padding: 8px 12px; border-radius: var(--r-sm); min-height: 40px; font-weight: 600; }
.popover button.danger { color: var(--stop); }
@media (hover: hover) { .popover button:hover { background: var(--raise); } }
.emojipick { flex-direction: row; min-width: 0; }
.emojipick button { font-size: 20px; padding: 6px 8px; min-height: 40px; }
.viewer { position: fixed; inset: 0; background: rgb(0 0 0 / .92); z-index: 50; display: grid; place-items: center; cursor: zoom-out; }
.viewer img { max-width: 96vw; max-height: 92vh; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--s5) + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--glass-2); border: 1px solid var(--hair); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r-md); max-width: 92vw;
  display: flex; align-items: center; gap: var(--s3); box-shadow: 0 10px 28px rgb(0 0 0 / .45); animation: sheetin 200ms var(--ease); min-height: 44px; }
.toastact { color: var(--go); font-weight: 800; padding: 6px 10px; border-radius: var(--r-sm); }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .5); z-index: 25; }

/* mid width: members off by default */
@media (max-width: 1100px) {
  .app { grid-template-columns: var(--side) 1fr 0; }
  .app .members { display: none; }
  .app.showmembers { grid-template-columns: var(--side) 1fr var(--memb); }
  .app.showmembers .members { display: block; }
  .txpanel { width: 280px; }
}

/* phone: channels in a slide-out drawer, members in a right drawer, bottom call bar */
@media (max-width: 760px) {
  .app, .app.showmembers { grid-template-columns: 1fr; }
  .phoneonly { display: inline-grid; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(86vw, 320px); z-index: 30; transform: translateX(-102%);
    transition: transform 260ms var(--ease); box-shadow: 8px 0 32px rgb(0 0 0 / .5); }
  .app.drawer .side { transform: none; }
  .members, .app.showmembers .members { display: block; position: fixed; right: 0; top: 0; bottom: 0; width: min(80vw, 280px); z-index: 30;
    transform: translateX(102%); transition: transform 260ms var(--ease); }
  .app.mdrawer .members { display: block; transform: none; }   /* beats the mid-width .app .members { display: none } */
  .mainhead { padding-left: var(--s2); }
  .msg { padding: 2px var(--s3); grid-template-columns: 36px 1fr; column-gap: var(--s2); }
  .msg .av { width: 36px; height: 36px; }
  .composer { margin: 0 var(--s2) calc(var(--s2) + env(safe-area-inset-bottom)); }
  .stage { flex-direction: column; }
  .tiles { display: flex; flex-direction: column; flex: 1 1 0; overflow: hidden; padding: var(--s2); }
  .tile { flex: 1 1 0; width: 100%; max-width: none; height: auto; min-height: 96px; }
  .tiles.focused { flex-direction: row; --thumb-w: 148px; --thumb-h: 84px; }
  .tiles.focused .tile { flex: 1 1 0; width: auto; }
  .tiles.focused .tile:not(.focus) .bigav { width: 30px; height: 30px; font-size: 14px; transform: translateY(-12px); }
  .tiles.focused .tile.focus { flex: 0 0 100%; }
  .joinpane { padding: var(--s4) max(var(--s3), env(safe-area-inset-left)) calc(var(--s4) + env(safe-area-inset-bottom)) max(var(--s3), env(safe-area-inset-right)); }
  .jcard { padding: var(--s5) var(--s4) var(--s4); }
  /* one row of controls on a phone: they share the width, labels shrink */
  /* four primary controls (Mute, Camera, Share if supported, Leave) plus More for Record, Transcript, Devices */
  .controls { flex-wrap: nowrap; gap: 6px; margin: 0 var(--s2) calc(var(--s2) + env(safe-area-inset-bottom)); }
  .controls .ctl { flex: 1 1 0; min-width: 0; max-width: none; padding: 6px 2px; }
  .controls .ctl.ctl2 { display: none; }
  .controls .ctlmore { display: flex; }
  .controls .ctl .lbl { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ctlmenu { left: var(--s2); right: var(--s2); }
  .txpanel { width: auto; height: 36vh; margin: 0 var(--s2); flex: none; }
  .ctl { min-width: 56px; padding: var(--s2); }
  .msgtools { right: var(--s3); }
}
@media (prefers-reduced-motion: reduce) { .side, .members { transition: none; } }
body:has(.app.withcallbar:not([hidden])) .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }

/* voice & video device sheet */
.mediasheet .sheetbody { padding-bottom: var(--s5); }
.mdallow { margin-top: var(--s4); }
.mdfield { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--fs-sm); font-weight: 600; color: var(--dim); margin-bottom: var(--s3); }
.mdfield select, .devrow select { background: var(--card); color: var(--ink); border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 0 var(--s3);
  min-height: 44px; font-size: var(--fs-md); font-weight: 500; }
.mdfield select option { background: var(--solid); }
.mdmeter { height: 10px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; }
.mdmeter i { display: block; height: 100%; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, rgb(10 132 255 / .55), var(--glow)); box-shadow: 0 0 12px rgb(10 132 255 / .5); }
.mdnote { margin: var(--s1) 0 var(--s2) !important; }
.mdwarn { color: var(--warn); margin: 0 0 var(--s2) !important; }
.mdcam { position: relative; aspect-ratio: 16 / 9; max-width: 320px; border-radius: var(--r-md); overflow: hidden; background: #000;
  box-shadow: inset 0 0 0 1px var(--hair); display: grid; place-items: center; }
.mdcam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.mdcam p { position: relative; }
/* "Voice connected": a block (not flex) so a narrow sidebar ends it with an ellipsis instead of clipping it */
.vpstate { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 18px; }
.vpstate .livedot { vertical-align: 1px; margin-right: 6px; }
.vpname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* voice & video sheet: near-opaque (it floats over live video), camera preview fills its card, Done is always reachable */
.sheet.mediasheet { background: rgb(20 20 24 / .96); -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%); }
.mdcam { width: 100%; max-width: none; }
.mediasheet .sheetbody { min-height: 0; flex: 1 1 auto; }
.sheetfoot { flex: none; position: sticky; bottom: 0; padding: var(--s3) var(--s5) calc(var(--s3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  background: rgb(20 20 24 / .98); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.sheetfoot .primary { width: 100%; min-height: 48px; }
@media (max-width: 760px) {
  #mediaSheet.sheetwrap { place-items: end center; padding: 0; background: rgb(0 0 0 / .62); }
  #mediaSheet .sheet.mediasheet { width: 100%; max-height: 85dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; animation: sheetup 240ms var(--ease) both; }
  #mediaSheet .sheetbody { overscroll-behavior: contain; padding-inline: var(--s4); }
  #mediaSheet .sheethead { padding-left: var(--s4); }
  .sheetfoot { padding-inline: var(--s4); border-radius: 0; }
}
@keyframes sheetup { from { transform: translateY(24px); opacity: 0; } }

/* avatars: a two-letter monogram, one hue per person (set inline as --h), so people are told apart at a glance */
.av.mono, .avs.mono, .bigav.mono { background: hsl(var(--h, 35) 62% 74%); color: hsl(var(--h, 35) 60% 14%); letter-spacing: -.02em; font-family: var(--font-display); }
.avs.mono { font-size: 11px; }
.bigav.mono { letter-spacing: -.03em; }

/* a quiet channel says hi, and one tap does it */
.sayhi { display: inline-flex; align-items: center; gap: var(--s2); margin-top: var(--s3); min-height: 44px; padding: 0 var(--s5); }
.sayhi svg.i { width: 18px; height: 18px; }

/* ---------- call stage: glass tiles, a capped solo tile, a clear "connecting" state ---------- */
.vpleave > span[data-icon] { display: inline-flex; }
/* (.tiles .tile beats shell.css's flat .tile glass) warm glass: hairline, a soft amber light from the top, deep shadow */
.tiles .tile { container-type: size; border: 1px solid var(--hair);
  background: radial-gradient(120% 80% at 50% 0%, rgb(10 132 255 / .08), transparent 62%),
    linear-gradient(180deg, rgb(255 255 255 / .045), rgb(255 255 255 / 0) 45%), var(--glass);
  box-shadow: var(--hi), 0 1px 2px rgb(0 0 0 / .4), 0 14px 36px rgb(0 0 0 / .38); }
/* the avatar is about a quarter of the tile, never a dot in a big box nor a giant disc */
.tile .bigav { width: clamp(56px, min(25cqw, 44cqh), 168px); height: auto; aspect-ratio: 1; font-size: clamp(22px, min(10.5cqw, 18cqh), 70px);
  box-shadow: 0 0 0 4px rgb(0 0 0 / .22), 0 10px 30px rgb(0 0 0 / .35); }
.tiles.focused .tile:not(.focus) .bigav { height: auto; }
/* alone in the call: one centred 16:9 tile, at most 720 wide, instead of a wall-to-wall box */
.tiles:has(> .tile:only-child):not(.focused) { grid-template-columns: minmax(0, 720px); align-content: center; }
.tiles:not(.focused) > .tile:only-child { height: auto; aspect-ratio: 16 / 9; max-width: min(720px, calc((100dvh - 230px) * 16 / 9)); align-self: center; }
/* connecting / reconnecting: the avatar dims and the status pill carries a spinner */
.tile.connecting .bigav { opacity: .5; transition: opacity 200ms var(--ease); }
.tile .st { display: inline-flex; align-items: center; gap: 6px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tile.connecting .st { color: var(--ink); background: rgb(0 0 0 / .62); }
.tile.connecting .st::before { content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 2px solid rgb(255 255 255 / .22); border-top-color: var(--glow); animation: hu-spin 800ms linear infinite; }
@media (prefers-reduced-motion: reduce) { .tile.connecting .st::before { animation: none; border-color: var(--glow); } }

@media (max-width: 760px) {
  /* one or two people: stacked tiles, each at most ~38% of the screen, centred in the stage */
  .tiles:not(.focused) { justify-content: center; }
  .tiles:not(.focused) > .tile { max-height: 38dvh; }
  .tiles:not(.focused) > .tile:only-child { aspect-ratio: 4 / 5; width: auto; height: 100%; max-width: 100%; align-self: center; flex: 0 1 auto; }
  /* three or more: a 2-up grid */
  .tiles:not(.focused):has(> .tile:nth-child(3)) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 30dvh);
    align-content: center; overflow-y: auto; }
  .tiles:not(.focused):has(> .tile:nth-child(3)) > .tile { height: 100%; max-height: none; }
}

/* ---------- voice & video sheet: capped at 85% of the screen, pinned Done, one label per control ---------- */
.sheet.mediasheet { max-height: min(760px, 85dvh); }
.mediasheet .setgroup h3 { margin-bottom: var(--s2); }
.mediasheet .mdfield { margin-bottom: var(--s2); }
/* segmented level meter: 20 segments cut out of the track and the fill by one mask */
.mdmeter { position: relative; height: 12px; border-radius: 3px; background: rgb(255 255 255 / .1); box-shadow: none; margin-top: var(--s2);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 3px), transparent calc(5% - 3px) 5%);
  mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 3px), transparent calc(5% - 3px) 5%); }
.mdmeter i { box-shadow: none; background: linear-gradient(90deg, rgb(10 132 255 / .7), var(--glow) 70%, #ffd9a8); }
/* camera preview: rounded 16:9, cover, with a designed "Camera is off" state until frames arrive */
.mdcam { border-radius: var(--r-lg); background: radial-gradient(90% 90% at 50% 20%, rgb(10 132 255 / .06), transparent 70%), #0b0b0f; }
.mdcamoff { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1);
  text-align: center; padding: var(--s4); }
.mdcamoff > span[data-icon] { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: var(--s1);
  color: var(--dim); background: var(--raise); }
.mdcamoff b { font-weight: 600; }

/* ---------- "Can't reach Denski" bar (api timeouts / network down) ---------- */
.netbar { position: fixed; z-index: 55; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + var(--s3));
  width: min(480px, calc(100vw - 2 * var(--s4))); display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s4);
  background: rgb(20 20 24 / .97); border: 1px solid var(--hair); border-radius: var(--r-lg); box-shadow: var(--hi), var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: netin 220ms var(--ease) both; }
@keyframes netin { from { opacity: 0; transform: translate(-50%, -8px); } }
@media (prefers-reduced-motion: reduce) { .netbar { animation: none; } }
.netdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--stop); box-shadow: 0 0 0 3px rgb(255 95 87 / .18); }
.nettext { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; font-size: var(--fs-sm); }
.netbar .pillbtn { min-height: 44px; padding: 0 var(--s4); flex: none; }

/* ---------- round 5: opaque modal sheets, phone in-call layout, voice & video drawer ---------- */
/* every modal sheet is a solid warm-black surface with a thin glass edge; the scrim dims and blurs what is behind it */
:root { --sheet-solid: #141417; --sheet-edge: rgb(255 255 255 / .14); --eyebrow: #8e8e96; }
.sheetwrap, .moresheet { background: rgb(0 0 0 / .64); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheetwrap .sheet, .sheetwrap .sheet.mediasheet, .moresheet .sheet.moresheetbody {
  background: var(--sheet-solid); -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid var(--sheet-edge);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), 0 -8px 48px rgb(0 0 0 / .65); }
.sheetwrap .grab { display: none; }
.sheetfoot { background: var(--sheet-solid); }
@media (max-width: 760px) {
  .sheetwrap { place-items: end center; padding: 0; }
  .sheetwrap .sheet { width: 100%; max-width: 560px; max-height: 88dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom); animation: sheetup 240ms var(--ease) both; }
  .sheetwrap .grab { display: grid; }
  .sheetwrap .sheetbody { overscroll-behavior: contain; padding-inline: var(--s4); padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom)); }
  .sheetwrap .sheethead { padding-left: var(--s4); }
  .sheetwrap .sheetfoot { padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); }
}
/* desktop: Voice & video is a right-side drawer, so the call stays visible next to it */
@media (min-width: 761px) {
  #mediaSheet.sheetwrap { place-items: stretch end; padding: 0; background: rgb(0 0 0 / .4); -webkit-backdrop-filter: none; backdrop-filter: none; }
  #mediaSheet .sheet.mediasheet { width: min(400px, 100%); max-width: 400px; height: 100dvh; max-height: none; border-radius: var(--r-lg) 0 0 var(--r-lg);
    border-right: 0; border-top: 0; border-bottom: 0; animation: drawerin 260ms var(--ease) both; }
  #mediaSheet .sheetfoot { border-radius: 0; }
}
@keyframes drawerin { from { transform: translateX(32px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #mediaSheet .sheet.mediasheet, .sheetwrap .sheet { animation: none; } }
/* 44px targets inside every sheet (the visible switch stays small, its hit area does not) */
.sheetwrap .sheet .iconbtn { width: 44px; height: 44px; min-height: 44px; }
.sheetwrap .sheet .pillbtn { min-height: 44px; padding-inline: var(--s4); }
.sheetwrap .sheet .switch { width: 52px; height: 44px; }
.sheetwrap .sheet .switch i { inset: 8px 3px; }
.sheetwrap .sheet .devrow select { min-height: 44px; }
/* camera preview: a 16:9 box, never taller than ~200px; a clear Camera off state; the mic meter is amber from the first pixel */
.mdcam { width: min(100%, 356px); max-height: 200px; margin-inline: 0; }
.mdcamoff b { color: var(--ink); }
.mdmeter i { background: linear-gradient(90deg, var(--glow), var(--glow) 65%, #ffd9a8); }

/* eyebrows and group labels: 12px, AA on every surface they sit on */
:root .eyebrow, :root .sec-ops .ops-lbl, :root .setgroup h3, :root .mgroup { font-size: 12px; color: var(--eyebrow); }

/* Ops tabs: fade the right edge while there is more to scroll to */
.sec-ops .ops-tabs.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }

@media (max-width: 760px) {
  /* last card clears the tab bar and the home indicator */
  :root .sections { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + var(--s3)); }
  /* in a call the tab bar keeps its icons and labels (Home, Chat, Studio, Files, More); the call's own controls are
     what get compact. Tiles share the stage, each at most ~40% of the screen tall, centred in the spare height. */
  .voiceview.incall .stage { flex: 1 1 0; min-height: 0; }
  .voiceview.incall .tiles:not(.focused) { justify-content: center; }
  .voiceview.incall .tiles:not(.focused) > .tile { flex: 1 1 0; max-height: 40dvh; }
  .voiceview.incall .tiles:not(.focused) > .tile:only-child { width: 100%; height: auto; aspect-ratio: auto; max-width: 100%; }
  /* avatar is about 40% of the tile width */
  .voiceview.incall .tile .bigav { width: clamp(56px, 40cqw, 168px); font-size: clamp(24px, 16cqw, 64px); }
  /* control bar: icon-only, a label only on Leave */
  .controls .ctl:not(.leave) .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .controls .ctl:not(.leave) { min-height: 48px; }
  .controls .ctl.leave { min-height: 48px; }
  .controls { padding: 6px; }
}

/* ---------- round 6: blocked bar, speaking glyph, Auto focus, desktop tile sizing ---------- */
/* "Live updates are blocked": calm (amber dot, not red), stays until Retry */
.blockbar .netdot { background: var(--go); box-shadow: 0 0 0 3px rgb(10 132 255 / .2); }
/* speaking: three small bars on the tile next to the ring, so it is never colour alone */
.tile .spk { position: absolute; z-index: 4; top: var(--s2); left: var(--s2); display: none; align-items: flex-end; gap: 2px; height: 22px;
  padding: 4px 6px; border-radius: 999px; background: rgb(0 0 0 / .62); }
.tile .spk i { display: block; width: 3px; height: 100%; border-radius: 2px; background: var(--glow); transform-origin: bottom; animation: spkbar 900ms var(--ease) infinite; }
.tile .spk i:nth-child(2) { animation-delay: -300ms; }
.tile .spk i:nth-child(3) { animation-delay: -600ms; }
.tile.talk .spk { display: flex; }
@keyframes spkbar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .tile .spk i { animation: none; transform: scaleY(.8); } }
.tiles.focused .tile:not(.focus) .spk { top: 6px; left: 6px; }
/* Auto focus: a quiet chip at the top right of the stage, amber when on */
.autofocus { position: absolute; z-index: 6; top: calc(var(--s3) + 6px); right: calc(var(--s3) + 6px); display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s3); border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  background: rgb(20 20 24 / .82); border: 1px solid var(--hair); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease); }
.autofocus:active { transform: scale(.96); }
.autofocus .afdot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.autofocus[aria-pressed="true"] { color: var(--accent); border-color: rgb(10 132 255 / .5); }
.autofocus[aria-pressed="true"] .afdot { background: var(--go); box-shadow: 0 0 0 3px rgb(10 132 255 / .22); }
@media (hover: hover) { .autofocus:hover { background: var(--raise); } }
/* Full screen for a screen share (app.js "Full screen for someone's screen share"): the chip sits where Auto focus
   does (just under it when both show). .pop = the 8 s pop-up when a share starts: who is sharing + a blue edge.
   No backdrop blur on purpose: it sits over live video, and blurring that every frame costs more than it shows. */
.watchfs { position: absolute; z-index: 7; top: calc(var(--s3) + 6px); right: calc(var(--s3) + 6px); display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s3); border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  background: rgb(20 20 24 / .92); border: 1px solid var(--hair);
  transition: background 160ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease), opacity 200ms var(--ease), transform 120ms var(--ease); }
.watchfs:active { transform: scale(.96); }
.watchfs:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.watchfs .i { width: 16px; height: 16px; flex: none; }
.watchfs .wfwho { display: none; font-weight: 500; color: var(--dim); padding-right: var(--s2); border-right: 1px solid var(--hair); }
.watchfs.pop { background: rgb(14 16 22 / .94); border-color: rgb(10 132 255 / .7); box-shadow: 0 0 0 3px rgb(10 132 255 / .2), 0 10px 30px rgb(0 0 0 / .5);
  animation: wfin 260ms var(--ease) both; }
.watchfs.pop .wfwho { display: inline; }
.watchfs.pop .i { color: #55aaff; }
@keyframes wfin { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
.autofocus:not([hidden]) + .watchfs { top: calc(var(--s3) + 58px); }
@media (hover: hover) { .watchfs:hover { background: rgb(44 44 50 / .9); } }
/* in full screen: only the shared screen, edge to edge on black; the chip becomes Exit and fades with the mouse */
.stage.fs { background: #000; }
.stage.fsfake { position: fixed; inset: 0; z-index: 1000; }
.stage.fs .tiles { padding: 0; gap: 0; }
.stage.fs .tiles .tile:not(.focus), .stage.fs .txpanel, .stage.fs .autofocus { display: none; }
.stage.fs .tiles .tile.focus { flex: 0 0 100%; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; cursor: default; transform: none; }
.stage.fs .tile .lbl { transition: opacity 200ms var(--ease); left: max(var(--s3), env(safe-area-inset-left)); bottom: max(var(--s3), env(safe-area-inset-bottom)); }
.stage.fs .watchfs { top: max(var(--s3), env(safe-area-inset-top)); right: max(var(--s3), env(safe-area-inset-right)); }
.stage.fs.idle { cursor: none; }
.stage.fs.idle .watchfs:not(:focus-visible) { opacity: 0; pointer-events: none; }
.stage.fs.idle .tile .lbl { opacity: 0; }
/* no talking ring around the whole display; the small bars stay and fade with the rest */
.stage.fs .tile.focus::after { display: none; }
.stage.fs .tile .spk { transition: opacity 200ms var(--ease); }
.stage.fs.idle .tile .spk { opacity: 0; }
/* desktop: one or two people sit side by side, each 16:9 and as big as the stage height allows */
@media (min-width: 761px) {
  .tiles.two:not(.focused) { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; align-content: center; }
  .tiles.two:not(.focused) > .tile { height: auto; aspect-ratio: 16 / 9; max-width: min(100%, calc((100dvh - 230px) * 16 / 9)); align-self: center; }
}

/* per-person volume: a small glass popover on a call tile + a pill on the tile when it isn't at 100% */
.volpop { width: min(260px, calc(100vw - 16px)); padding: 14px 14px 10px; gap: 10px; background: color-mix(in srgb, #18181c 84%, transparent); -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%); border-color: var(--hair);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--hi), 0 18px 48px rgb(0 0 0 / .5); z-index: 60; }
.volpop .vphead { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--dim); }
.volpop .vpname { font-weight: 700; color: var(--ink, #f2f2f5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.volpop .vprow { display: flex; align-items: center; gap: 12px; }
.volpop .vpval { flex: none; width: 3.6em; text-align: right; font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }
.volpop.muted .vpval { color: var(--dim); }
.volpop input[type=range] { flex: 1 1 auto; min-width: 0; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; --p: 50%; }
.volpop input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--p), rgb(255 255 255 / .16) var(--p)); }
.volpop input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: rgb(255 255 255 / .16); }
.volpop input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--go); }
.volpop input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: #f2f2f5; border: 0; box-shadow: 0 1px 6px rgb(0 0 0 / .5); }
.volpop input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #f2f2f5; border: 0; }
.volpop input[type=range]:focus-visible { outline: none; }
.volpop input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgb(10 132 255 / .45); }
.volpop .vpacts { display: flex; gap: 6px; border-top: 1px solid var(--hair); padding-top: 8px; margin: 0 -6px; }
.volpop .vpacts button { flex: 1 1 auto; text-align: center; min-height: 40px; font-size: 13px; }
.volpop .vpacts .vpmute[aria-pressed=true] { color: var(--accent); }
@media (pointer: coarse) { .volpop .vpacts button { min-height: 44px; } .volpop input[type=range] { height: 44px; } }
.tile .vpill { position: absolute; right: var(--s2); bottom: var(--s2); z-index: 2; background: rgb(0 0 0 / .6); padding: 3px 9px; border-radius: 999px;
  font-size: 12px; color: var(--accent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; }
.tile .vpill[hidden] { display: none; }
/* noise suppression: Off / Standard / Strong */
.nsblock .nsseg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); flex: none; }
.nsblock .nsseg button { min-height: 44px; padding: 0 var(--s3); border-radius: 999px; color: var(--dim); font-weight: 650; font-size: var(--fs-sm); background: none; border: 0; }
.nsblock .nsseg button[aria-checked="true"] { color: var(--accent); background: rgb(10 132 255 / .12); box-shadow: inset 0 0 0 1px rgb(10 132 255 / .22); }
.nsblock .nsseg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nsblock p { margin: 0 0 var(--s2); }
