/* Same look as okak0.com: dark dot-grid page, charcoal cards, white pill buttons.
   Theme follows the system (dark unless it prefers light) until the visitor picks one with
   the toggle, which is stored as data-theme on <html>. */
:root {
  --bg: #121212;
  --dot: rgba(255, 255, 255, 0.075);
  --card: #1d1d1d;
  --card-line: rgba(255, 255, 255, 0.07);
  --panel: #161616;
  --panel-line: rgba(255, 255, 255, 0.05);
  --chip: #232323;
  --text: #ececec;
  --dim: #9a9a9a;
  --faint: #6a6a6a;
  --yellow: #f2d633;
  --green: #3fd77f;
  --red: #ff5b54;
  --blue: #4c9dff;
  --font: "Outfit", "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --btn: #f5f5f5;
  --btn-hover: #ffffff;
  --btn-ink: #121212;
  --hover: #2a2a2a;
  --shadow: rgba(0, 0, 0, 0.4);
  --card-hover-line: rgba(255, 255, 255, 0.12);
  --dot-main: #f0f0f0;
  --dot-ring: rgba(255, 255, 255, 0.06);
  --dot-off: #5c5c5c;
  --dashed: rgba(255, 255, 255, 0.14);
  --toggle: #5a5a5a;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f3f1;
    --toggle: #2b2b2b;
    --dot: rgba(0, 0, 0, 0.11);
    --card: #ffffff;
    --card-line: rgba(0, 0, 0, 0.08);
    --panel: #f6f6f4;
    --panel-line: rgba(0, 0, 0, 0.05);
    --chip: #e9e9e6;
    --text: #161616;
    --dim: #5d5d5d;
    --faint: #8a8a8a;
    --btn: #161616;
    --btn-hover: #000000;
    --btn-ink: #f5f5f5;
    --hover: #e2e2de;
    --shadow: rgba(0, 0, 0, 0.08);
    --card-hover-line: rgba(0, 0, 0, 0.16);
    --dot-main: #161616;
    --dot-ring: rgba(0, 0, 0, 0.06);
    --dot-off: #b5b5b5;
    --dashed: rgba(0, 0, 0, 0.18);
    --yellow: #d9b600;
    --green: #1fa85a;
    --red: #e0443d;
    --blue: #2f7fe0;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f3f1;
  --toggle: #2b2b2b;
  --dot: rgba(0, 0, 0, 0.11);
  --card: #ffffff;
  --card-line: rgba(0, 0, 0, 0.08);
  --panel: #f6f6f4;
  --panel-line: rgba(0, 0, 0, 0.05);
  --chip: #e9e9e6;
  --text: #161616;
  --dim: #5d5d5d;
  --faint: #8a8a8a;
  --btn: #161616;
  --btn-hover: #000000;
  --btn-ink: #f5f5f5;
  --hover: #e2e2de;
  --shadow: rgba(0, 0, 0, 0.08);
  --card-hover-line: rgba(0, 0, 0, 0.16);
  --dot-main: #161616;
  --dot-ring: rgba(0, 0, 0, 0.06);
  --dot-off: #b5b5b5;
  --dashed: rgba(0, 0, 0, 0.18);
  --yellow: #d9b600;
  --green: #1fa85a;
  --red: #e0443d;
  --blue: #2f7fe0;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.4px);
  background-size: 22px 22px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
main.wrap { max-width: 880px; }

/* ---------- header ---------- */

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 400; font-size: 17px; }
.logo svg { width: 30px; height: 30px; }
.top nav { display: flex; align-items: center; gap: 8px; }
.tab {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--dim);
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); background: var(--chip); }

/* ---------- dots ---------- */

.dot { display: inline-block; width: 9px; height: 1.5px; border-radius: 1px; background: currentColor; flex: none; }
.dot.status.green { background: var(--green); }
.dot.status.yellow { background: var(--yellow); }
.dot.status.red { background: var(--red); }
.dot.status.blue { background: var(--blue); }
.dot.status.gray { background: var(--dot-off); }
.eyebrow .dot.green, .dot.status { width: 8px; height: 8px; border-radius: 50%; }
.eyebrow .dot.green { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }

/* ---------- hero ---------- */

.hero { padding: 56px 0 32px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--card-line);
  font-size: 13px;
  color: var(--dim);
}
.hero h1 {
  font-size: clamp(38px, 6vw, 60px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 22px 0 16px;
}
.hero .lead { color: var(--dim); font-size: 18px; margin: 0; max-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 22px 0 0; padding: 0; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-line);
  font-size: 13.5px;
  color: var(--dim);
}

/* ---------- cards & panels ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 18px 40px var(--shadow);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 12px;
}
.card > .panel + .panel,
.card > * + .panel { margin-top: 10px; }

/* ---------- buttons (pills) ---------- */

.btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  border: 1px solid var(--card-line);
  background: var(--chip);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform .12s, background .15s, color .15s;
}
.btn:hover { background: var(--hover); }
.btn.solid {
  background: var(--btn);
  color: var(--btn-ink);
  border-color: transparent;
  box-shadow: 0 6px 20px var(--shadow);
}
.btn.solid:hover { background: var(--btn-hover); transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); padding: 8px 10px; }
.btn.ghost:hover { background: var(--chip); color: var(--text); }
.btn.ghost.danger:hover { color: var(--red); }
.btn.copied { background: var(--green); border-color: var(--green); color: #fff; }
.btn:focus-visible, .drop input:focus-visible + * { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- footer ---------- */

.foot { margin-top: 96px; border-top: 1px solid var(--card-line); }
.foot .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
  padding-bottom: 36px;
  color: var(--faint);
  font-size: 13.5px;
}
.foot a:hover { color: var(--text); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--btn);
  color: var(--btn-ink);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- theme toggle ---------- */

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--chip);
  border: 1px solid var(--card-line);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: background .15s;
}
.theme-toggle:hover { background: var(--hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .moon { display: none; }
}

/* ---------- chat.okak0.com ---------- */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
button { font-family: var(--font); }
.ic { width: 16px; height: 16px; flex: none; }
.ic.red { color: var(--red); }
.ic.dim { color: var(--faint); }
.grow { flex: 1; min-width: 0; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.tab { border: 0; background: transparent; font-family: var(--font); cursor: pointer; }
.top-l { display: flex; align-items: center; gap: 10px; }
.toast { z-index: 100; }
.toast.has-act { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast:not(.show) { pointer-events: none; }
.toast-act { font: inherit; font-weight: 500; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.btn.big { padding: 11px 18px; font-size: 15px; }
.btn.danger { color: var(--red); }
.btn.solid.danger { background: var(--red); color: #fff; }
.btn.danger-soft { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.btn.danger-soft:hover { background: color-mix(in srgb, var(--red) 20%, transparent); }
.btn.accept { background: var(--green); color: #fff; border-color: transparent; }
.btn.accept:hover { background: color-mix(in srgb, var(--green) 85%, #000); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.linkish { font: inherit; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--dashed); }
.linkish:hover { text-decoration-color: currentColor; }

.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none;
  border-radius: 10px; border: 0; background: transparent; color: var(--dim); cursor: pointer; padding: 0;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--chip); color: var(--text); }
.icon-btn.on { color: var(--text); background: var(--chip); }
.icon-btn.off { color: var(--red); }
.icon-btn.danger:hover { color: var(--red); }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn.xs .ic { width: 14px; height: 14px; }
.icon-btn:focus-visible, .side-row:focus-visible, .rail-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.ic.down { transform: rotate(180deg); }

.input, .chip-input {
  font: inherit; font-size: 15px; color: var(--text); width: 100%;
  background: var(--panel); border: 1px solid var(--card-line); border-radius: 10px; padding: 10px 12px; outline: none;
}
.input:focus { border-color: var(--card-hover-line); }
textarea.input { resize: vertical; line-height: 1.45; }
select.input { appearance: auto; }
.field-label { font-size: 13px; color: var(--dim); margin: 2px 0 -4px; }
.form-err { color: var(--red); font-size: 13.5px; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-gap .input { flex: 1; min-width: 180px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--dim); cursor: pointer; line-height: 1.45; }
.check input { margin: 3px 0 0; accent-color: var(--text); width: 16px; height: 16px; flex: none; }
.range { width: 100%; accent-color: var(--text); }
.tag { font-size: 11px; color: var(--faint); border: 1px solid var(--card-line); border-radius: 6px; padding: 0 5px; line-height: 16px; margin-left: 6px; font-weight: 400; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; }
.seg-btn { font: inherit; font-size: 14px; color: var(--dim); background: none; border: 0; border-radius: 9px; padding: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg-btn.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px var(--shadow), inset 0 0 0 1px var(--card-line); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--card); }

/* avatars */
.av { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 500; letter-spacing: .02em; user-select: none; }
.av.xxs { width: 16px; height: 16px; font-size: 8px; }
.av.xs { width: 22px; height: 22px; font-size: 9.5px; }
.av.sm { width: 30px; height: 30px; font-size: 12px; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av.xl { width: 84px; height: 84px; font-size: 28px; }
.av-wrap { position: relative; display: inline-flex; flex: none; }
.dot.status.pres { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border: 2.5px solid var(--panel); box-sizing: content-box; }

/* ---------- welcome ---------- */

.welcome .hero { padding: 48px 0 28px; }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel.pad { padding: 18px; display: flex; flex-direction: column; gap: 12px; height: 100%; }
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 400; }
.panel.pad p { margin: 0; line-height: 1.5; }
.panel.pad b { font-weight: 500; color: var(--text); }

/* ---------- app shell ---------- */

body.in-app { overflow: hidden; }
body.in-app .top .wrap { height: 60px; max-width: none; padding: 0 20px; }
body.in-app .logo svg { width: 26px; height: 26px; }
.shell { height: calc(100dvh - 60px); padding: 0 16px 16px; position: relative; z-index: 1; }
.app-card {
  height: 100%; display: grid; gap: 10px; position: relative;
  grid-template-columns: 64px 248px minmax(0, 1fr);
}
.app-card.with-members { grid-template-columns: 64px 248px minmax(0, 1fr) 236px; }
.app-card > .panel { min-height: 0; overflow: hidden; }
.app-card > * + .panel { margin-top: 0; }
.conn-banner {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20;
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 999px;
  background: var(--chip); border: 1px solid var(--card-line); font-size: 13px; color: var(--dim); box-shadow: 0 8px 24px var(--shadow);
}
.acct-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 6px; max-width: 200px;
  border-radius: 12px; background: var(--chip); border: 1px solid var(--card-line); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.acct-btn:hover { background: var(--hover); }
.acct-btn span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* rail */
.rail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-btn {
  position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--chip); color: var(--dim); display: grid; place-items: center; transition: border-radius .18s, background .15s, color .15s;
}
.rail-btn .ic { width: 19px; height: 19px; }
.rail-btn:hover, .rail-btn.on { border-radius: 14px; color: var(--text); }
.rail-btn:hover { background: var(--hover); }
.rail-btn.on:not(:has(.srv-ic)) { background: var(--btn); color: var(--btn-ink); }
.rail-btn::before {
  content: ""; position: absolute; left: -10px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: var(--text); transform: translateY(-50%); transition: height .18s;
}
.rail-btn.unread::before { height: 8px; }
.rail-btn:hover::before { height: 18px; }
.rail-btn.on::before { height: 34px; }
.srv-ic { width: 100%; height: 100%; border-radius: inherit; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 500; overflow: hidden; }
.srv-ic.big { width: 72px; height: 72px; border-radius: 22px; font-size: 24px; margin: 0 auto; }
.rail-sep { width: 28px; height: 1.5px; background: var(--card-line); border-radius: 1px; flex: none; }
.badge {
  position: absolute; right: -4px; bottom: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 500; display: grid; place-items: center; border: 2.5px solid var(--panel); box-sizing: content-box;
}
.badge.inline { position: static; border: 0; height: 18px; min-width: 18px; box-sizing: border-box; }
.rail-voice { position: absolute; right: -4px; top: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; border: 2.5px solid var(--panel); }
.rail-voice .ic { width: 10px; height: 10px; }

/* sidebar */
.side { display: flex; flex-direction: column; }
.side-head { height: 52px; flex: none; display: flex; align-items: center; padding: 0 8px; border-bottom: 1px solid var(--panel-line); }
.side-title {
  flex: 1; min-width: 0; height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 10px; border-radius: 10px; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; text-align: left;
}
.side-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-title:not(.static):hover { background: var(--chip); }
.side-title.static { cursor: default; padding-right: 2px; }
.side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.side-sec {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 14px 8px 4px 10px;
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 500;
}
.side-sec:first-child { padding-top: 6px; }
.side-row {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 5px 8px 5px 10px; border-radius: 9px;
  border: 0; background: none; color: var(--dim); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; position: relative;
}
.side-row:hover { background: var(--chip); color: var(--text); }
.side-row.on { background: var(--hover); color: var(--text); }
.side-row.unread { color: var(--text); font-weight: 500; }
.side-row.unread::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); transform: translateY(-50%); }
.side-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-row .row-act { opacity: 0; margin: -4px -4px -4px 0; }
.side-row:hover .row-act, .side-row.on .row-act { opacity: 1; }
.side-row .ic.incall { color: var(--green); }
.side-empty { color: var(--faint); font-size: 13px; padding: 8px 10px; margin: 0; line-height: 1.5; }
.vmembers { display: flex; flex-direction: column; gap: 1px; padding: 0 0 4px 26px; }
.vmember { display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: 8px; font-size: 13.5px; color: var(--dim); cursor: pointer; }
.vmember:hover { background: var(--chip); color: var(--text); }
.vmember .av { transition: box-shadow .1s; }
.vmember.speaking .av { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--green); }
.vmember .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { font-size: 10px; font-weight: 600; letter-spacing: .04em; color: #fff; background: var(--red); border-radius: 5px; padding: 1px 5px; line-height: 14px; }
.compose-btn { margin: 4px 2px 6px; }
.addr-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin: 0 2px; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.addr-card .mono { overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.addr-card .ic { color: var(--faint); }

/* voice bar + user bar */
.voice-bar { flex: none; border-top: 1px solid var(--panel-line); padding: 8px 8px 6px; display: flex; flex-direction: column; gap: 6px; }
.vb-top { display: flex; align-items: center; gap: 6px; }
.vb-place { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 3px 6px; border-radius: 8px; border: 0; background: none; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.vb-place:hover { background: var(--chip); }
.vb-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; }
.vb-status.green { color: var(--green); }
.vb-status.yellow { color: var(--yellow); }
.vb-status.red { color: var(--red); }
.vb-name { font-size: 12px; color: var(--faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vb-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 5px; border-radius: 9px; border: 1px solid var(--card-line); background: var(--chip); color: var(--dim); font: inherit; font-size: 11.5px; cursor: pointer; }
.vb-btn:hover { background: var(--hover); color: var(--text); }
.vb-btn.on { background: var(--btn); color: var(--btn-ink); border-color: transparent; }
.user-bar { flex: none; height: 56px; display: flex; align-items: center; gap: 2px; padding: 0 6px; border-top: 1px solid var(--panel-line); background: color-mix(in srgb, var(--panel) 70%, var(--card)); }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 4px; border-radius: 10px; border: 0; background: none; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.me-btn:hover { background: var(--chip); }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-handle { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-bar .dot.status.pres { border-color: color-mix(in srgb, var(--panel) 70%, var(--card)); }

/* members */
.members { display: flex; flex-direction: column; }
.mem-head { height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; border-bottom: 1px solid var(--panel-line); font-size: 14px; color: var(--dim); }
.mem-list { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.mem-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; border-radius: 9px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14.5px; cursor: pointer; text-align: left; }
.mem-row:hover { background: var(--chip); }
.mem-row.offline { opacity: .5; }
.mem-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crown { color: var(--yellow); display: inline-flex; }
.crown .ic { width: 14px; height: 14px; }
.show-lg-hide { display: none; }

/* main */
.main { display: flex; flex-direction: column; }
.main-head { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--panel-line); }
.mh-title { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 15.5px; font-weight: 500; }
.mh-title > span:not(.av-wrap):not(.mh-sub) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-title .ic { color: var(--faint); width: 18px; height: 18px; }
.mh-title.btnish { border: 0; background: none; color: var(--text); font: inherit; font-size: 15.5px; font-weight: 500; cursor: pointer; padding: 4px 8px 4px 4px; margin-left: -6px; border-radius: 10px; }
.mh-title.btnish:hover { background: var(--chip); }
.mh-title .dot.status.pres { border-color: var(--panel); }
.mh-sub { font-size: 13.5px; font-weight: 300; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-sub.topic { border-left: 1px solid var(--card-line); padding-left: 10px; margin-left: 2px; max-width: 44vw; }
.main-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.empty-state { margin: auto; text-align: center; padding: 30px 20px; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state p { margin: 0 0 8px; line-height: 1.5; }
.es-title { font-size: 20px; font-weight: 400; }
.es-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--chip); display: grid; place-items: center; color: var(--dim); margin-bottom: 4px; }
.es-ic .ic { width: 24px; height: 24px; }

/* home */
.home { padding: 36px clamp(18px, 4vw, 48px); overflow-y: auto; height: 100%; }
.home-h { font-size: clamp(30px, 4vw, 42px); font-weight: 400; letter-spacing: -.02em; margin: 18px 0 6px; }
.home > p { margin: 0 0 24px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.home-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; text-align: left; cursor: pointer; color: var(--text); font: inherit; background: var(--card); border: 1px solid var(--card-line); transition: border-color .15s, transform .15s; }
.home-tile:hover { border-color: var(--card-hover-line); transform: translateY(-1px); }
.ht-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--chip); display: grid; place-items: center; margin-bottom: 6px; }
.ht-title { font-size: 15.5px; font-weight: 500; }
.ht-text { font-size: 13.5px; color: var(--dim); line-height: 1.45; }
.guest-note { margin-top: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--dim); line-height: 1.55; max-width: 720px; }
.guest-note .dot { margin-top: 7px; }
.guest-note b { color: var(--text); font-weight: 500; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.chat.drop::after { content: "Drop files to upload"; position: absolute; inset: 8px; border: 2px dashed var(--dashed); border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--panel) 85%, transparent); font-size: 18px; z-index: 5; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 14px; overflow-anchor: none; }
.msgs-empty { color: var(--faint); text-align: center; padding: 40px 0; font-size: 14px; }
.msgs-more { color: var(--faint); text-align: center; padding: 14px 0; font-size: 13px; }
.intro { padding: 30px 18px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.intro p { margin: 0; }
.intro-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; }
.intro-ic .ic { width: 28px; height: 28px; }
.intro-title { font-size: 26px; font-weight: 400; letter-spacing: -.01em; }
.day-sep, .new-sep { display: flex; align-items: center; gap: 10px; margin: 16px 16px 6px; font-size: 12px; color: var(--faint); }
.day-sep::before, .day-sep::after, .new-sep::before, .new-sep::after { content: ""; flex: 1; height: 1px; background: var(--card-line); }
.new-sep { color: var(--red); margin: 8px 16px 2px; }
.new-sep::before, .new-sep::after { background: color-mix(in srgb, var(--red) 55%, transparent); }
.new-sep span { font-weight: 500; text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; }

.msg { position: relative; padding: 2px 16px; margin-top: 12px; }
.msg.grouped { margin-top: 0; }
.msg:hover { background: color-mix(in srgb, var(--text) 3.5%, transparent); }
.msg.mention { background: color-mix(in srgb, var(--yellow) 9%, transparent); box-shadow: inset 2px 0 0 var(--yellow); }
.msg.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--blue) 18%, transparent); } }
.msg-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.msg-av { border: 0; padding: 0; background: none; cursor: pointer; align-self: start; margin-top: 2px; border-radius: 50%; }
.msg-gut { display: flex; justify-content: flex-end; padding-top: 3px; }
.msg-gut .time { opacity: 0; font-size: 10.5px; }
.msg:hover .msg-gut .time { opacity: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; line-height: 1.35; }
.uname { font: inherit; font-weight: 500; font-size: 15px; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; }
.uname:hover { text-decoration: underline; text-underline-offset: 2px; }
.time { font-size: 12px; color: var(--faint); white-space: nowrap; }
.msg-text { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; color: var(--text); font-weight: 300; }
.msg-text.big { font-size: 40px; line-height: 1.2; }
.msg-text a, .mc-body a { color: var(--blue); text-decoration: none; }
.msg-text a:hover, .mc-body a:hover { text-decoration: underline; }
.msg-text b, .mc-body b { font-weight: 600; }
.msg-text code, .mc-body code { font-family: var(--mono); font-size: 13px; background: var(--chip); border: 1px solid var(--card-line); border-radius: 5px; padding: 1px 5px; }
.msg-text pre, .mc-body pre { background: var(--panel); border: 1px solid var(--card-line); border-radius: 9px; padding: 10px 12px; overflow-x: auto; margin: 4px 0; max-width: 760px; }
.msg-text pre code, .mc-body pre code { background: none; border: 0; padding: 0; }
.quote { display: inline-block; border-left: 3px solid var(--dashed); padding-left: 10px; color: var(--dim); }
.spoiler { background: var(--text); color: transparent; border-radius: 4px; cursor: pointer; padding: 0 2px; transition: background .15s; }
.spoiler.shown { background: var(--chip); color: inherit; }
.mention { background: color-mix(in srgb, var(--blue) 20%, transparent); color: var(--text); border-radius: 4px; padding: 0 3px; font-weight: 400; cursor: pointer; }
.edited { font-size: 11px; color: var(--faint); }
.msg.system { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; padding-left: 26px; }
.msg.system .uname { font-size: 14px; }
.sys-ic { color: var(--green); font-weight: 600; width: 28px; text-align: center; }
.reply-line { display: flex; align-items: center; gap: 6px; padding: 0 0 2px 54px; font-size: 13px; color: var(--dim); cursor: pointer; min-width: 0; position: relative; }
.reply-line b { font-weight: 500; color: var(--text); white-space: nowrap; }
.rl-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rl-curve { position: absolute; left: 34px; top: 9px; width: 16px; height: 10px; border-left: 1.5px solid var(--dashed); border-top: 1.5px solid var(--dashed); border-top-left-radius: 6px; }
.reply-line:hover .rl-text { color: var(--text); }

.msg-acts {
  position: absolute; right: 14px; top: -16px; display: none; gap: 1px; padding: 2px;
  background: var(--card); border: 1px solid var(--card-line); border-radius: 10px; box-shadow: 0 6px 18px var(--shadow); z-index: 2;
}
.msg:hover .msg-acts, .msg-acts:focus-within { display: flex; }
.msg.system .msg-acts { display: none; }

.atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.att-img { border: 0; padding: 0; background: var(--panel); border-radius: 10px; overflow: hidden; cursor: zoom-in; max-width: min(420px, 100%); }
.att-img img { display: block; max-width: 100%; max-height: 320px; object-fit: contain; }
.att-video { max-width: min(480px, 100%); max-height: 320px; border-radius: 10px; background: #000; }
.att-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; max-width: 440px; flex-wrap: wrap; }
.att-file > .ic { width: 26px; height: 26px; color: var(--dim); }
.af-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.af-name { color: var(--blue); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-size { font-size: 12px; color: var(--faint); }
.att-file audio { width: 100%; height: 36px; }
.lightbox { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 10px; }

.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--card-line); background: var(--chip); color: var(--dim); cursor: pointer; font: inherit; font-size: 13px; }
.react:hover { border-color: var(--card-hover-line); }
.react.mine { background: color-mix(in srgb, var(--blue) 16%, var(--chip)); border-color: color-mix(in srgb, var(--blue) 50%, transparent); color: var(--text); }
.react .re { font-size: 15px; }
.react.add { opacity: 0; padding: 0 6px; }
.msg:hover .react.add { opacity: 1; }
.edit-box { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.edit-input { resize: none; }

.typing { height: 22px; flex: none; padding: 0 18px; font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); animation: bob 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.composer { margin: 0 14px 14px; background: var(--chip); border: 1px solid var(--card-line); border-radius: 14px; position: relative; flex: none; }
.comp-row { display: flex; align-items: flex-end; gap: 2px; padding: 5px; }
.comp-input { flex: 1; font: inherit; font-size: 15px; color: var(--text); background: none; border: 0; outline: none; resize: none; padding: 7px 6px; max-height: 220px; line-height: 1.45; }
.comp-input::placeholder { color: var(--faint); }
.icon-btn.send { color: var(--text); }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; font-size: 13px; color: var(--dim); border-bottom: 1px solid var(--card-line); }
.reply-bar b { color: var(--text); font-weight: 500; }
.pending { display: flex; gap: 8px; padding: 8px; overflow-x: auto; border-bottom: 1px solid var(--card-line); flex-wrap: wrap; }
.compose .pending { border: 0; padding: 0; }
.pend { position: relative; display: grid; grid-template-columns: 36px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; width: 220px; padding: 6px 4px 6px 6px; background: var(--panel); border: 1px solid var(--card-line); border-radius: 10px; overflow: hidden; }
.pend.err { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.pend-thumb { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 7px; overflow: hidden; background: var(--chip); display: grid; place-items: center; color: var(--dim); }
.pend-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pend-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pend-sub { font-size: 11.5px; color: var(--faint); grid-column: 2; }
.pend .icon-btn { grid-column: 3; grid-row: 1 / 3; }
.pend-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--card-line); }
.pend-bar span { display: block; height: 100%; background: var(--blue); width: 0; transition: width .2s; }
.mention-pop { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); padding: 6px; z-index: 6; display: flex; flex-direction: column; gap: 1px; max-height: 280px; overflow-y: auto; }
.mp-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.mp-row .faint { margin-left: auto; font-size: 12.5px; }
.mp-row:hover, .mp-row.on { background: var(--chip); }

/* popovers, menus, dialogs */
.pop { position: fixed; z-index: 60; padding: 6px; max-width: min(360px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; }
.pop.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; border-radius: 18px 18px 0 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); max-height: 80dvh; }
.menu { display: flex; flex-direction: column; min-width: 200px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--chip); }
.menu-item .ic { color: var(--dim); }
.menu-item.danger { color: var(--red); }
.menu-item.danger .ic { color: var(--red); }
.menu-sep { height: 1px; background: var(--card-line); margin: 4px 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 2px; }
.pop.sheet .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.emoji-btn { width: 36px; height: 36px; border-radius: 8px; border: 0; background: none; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.emoji-btn:hover { background: var(--chip); }
.btn.emoji-pick { font-size: 20px; padding: 4px 12px; }

.dlg { border: 0; padding: 0; background: none; color: var(--text); width: min(480px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); font-family: var(--font); overflow: visible; }
.dlg::backdrop { background: rgba(0, 0, 0, .5); }
.dlg .card { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100dvh - 24px); }
.dlg .card.wide { width: min(720px, calc(100vw - 24px)); }
.dlg:has(.card.wide) { width: min(720px, calc(100vw - 24px)); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-title { font-size: 17px; font-weight: 400; padding-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-body { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 2px; margin: -2px; }
.dlg-body > p { margin: 0; line-height: 1.5; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; align-items: center; }
.dlg-actions.spread .btn.solid { margin-left: auto; }
.dlg-actions.spread .faint { margin-left: auto; }
.dlg-actions.spread .faint + .btn.solid { margin-left: 8px; }
.note { padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--dim); line-height: 1.55; }
.note .dot { margin-top: 7px; }
.note b { color: var(--text); font-weight: 500; }
.kv { padding: 4px 14px; display: flex; flex-direction: column; font-size: 14px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.kv > div + div { border-top: 1px solid var(--panel-line); }
.kv b { font-weight: 500; }
.prof-preview { display: flex; align-items: center; gap: 14px; padding: 4px 0 6px; }
.set-tabs { grid-auto-columns: auto; overflow-x: auto; }
.set-body { min-height: 260px; }
.meter { flex: 1; min-width: 120px; height: 8px; border-radius: 4px; background: var(--panel); border: 1px solid var(--card-line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--green); transition: width .06s; }
.list-box { padding: 4px; display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 14.5px; }
.lb-row.btnish { border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; width: 100%; }
.lb-row.btnish:hover { background: var(--chip); }
.lb-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-empty { padding: 10px; margin: 0; }
.invite { text-align: center; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.inv-name { font-size: 22px; font-weight: 400; margin-top: 8px; }
.invite p { margin: 0 0 6px; }
.invite .dlg-actions { justify-content: center; }

/* user card */
.user-card { width: 280px; padding: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pop.sheet .user-card { width: auto; }
.uc-top { position: relative; margin-bottom: 6px; }
.uc-top .dot.status.pres { width: 14px; height: 14px; right: 0; bottom: 0; border-color: var(--card); }
.uc-name { font-size: 19px; font-weight: 500; display: flex; align-items: center; }
.uc-handle { font-size: 14px; color: var(--dim); }
.uc-mail { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; color: var(--faint); background: none; border: 0; padding: 2px 0; cursor: pointer; font-family: var(--mono); }
.uc-mail:hover { color: var(--text); }
.uc-mail .ic { width: 14px; height: 14px; }
.uc-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.uc-acts { display: flex; gap: 8px; width: 100%; margin-top: 8px; }
.uc-acts .btn { flex: 1; }
.uc-vol { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; }

/* ---------- voice stage ---------- */

.voice-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.stage { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 10px; overflow-y: auto; }
.tile {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--chip) 80%, #000); border: 1px solid var(--card-line); display: grid; place-items: center;
  width: calc(50% - 5px); transition: box-shadow .12s;
}
.stage.n1 .tile { width: min(100%, calc((100dvh - 330px) * 16 / 9)); }
.stage.n5 .tile, .stage.n6 .tile, .stage.n7 .tile, .stage.n8 .tile, .stage.n9 .tile { width: calc(33.33% - 7px); }
.stage.n10 .tile { width: calc(25% - 8px); }
.tile.speaking { box-shadow: 0 0 0 2px var(--green), 0 0 0 5px color-mix(in srgb, var(--green) 25%, transparent); }
.tile.sounded { animation: sounded .9s; }
@keyframes sounded { 0%, 50% { box-shadow: 0 0 0 3px var(--yellow); } }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.screen video { object-fit: contain; }
.tile video.mirror { transform: scaleX(-1); }
.tile-av .av { box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.tile.speaking .tile-av .av { box-shadow: 0 0 0 3px var(--green); }
.tile-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; }
.tile-wait .ic { width: 28px; height: 28px; }
.tile-label {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 7px; max-width: calc(100% - 60px);
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 8px; backdrop-filter: blur(6px);
}
.tile-label span:not(.live) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-label .ic { width: 14px; height: 14px; }
.tile-full { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-full { opacity: 1; }
.tile:fullscreen { border-radius: 0; border: 0; }
.stage.focused { flex-direction: column; flex-wrap: nowrap; align-content: stretch; }
.stage-main { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; }
.stage-main .tile { width: auto; height: 100%; max-width: 100%; max-height: 100%; }
.stage-strip { flex: none; display: flex; gap: 8px; overflow-x: auto; justify-content: center; padding-bottom: 2px; }
.stage-strip .tile { width: 168px; flex: none; }
.stage-strip .tile .av.xl { width: 44px; height: 44px; font-size: 16px; }
.stage-strip .tile-label { font-size: 11.5px; left: 6px; bottom: 6px; padding: 2px 7px; }
.stage-ctl { flex: none; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctl { width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--card-line); background: var(--chip); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .12s; }
.ctl .ic { width: 20px; height: 20px; }
.ctl:hover { background: var(--hover); transform: translateY(-1px); }
.ctl.off { color: var(--red); background: color-mix(in srgb, var(--red) 13%, var(--chip)); }
.ctl.on { background: var(--btn); color: var(--btn-ink); border-color: transparent; }
.ctl.leave { background: var(--red); color: #fff; border-color: transparent; width: 64px; border-radius: 25px; }
.call-stage { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-bottom: 1px solid var(--panel-line); background: color-mix(in srgb, var(--panel) 60%, #000); max-height: 52%; }
.call-stage .stage { max-height: calc(52dvh - 120px); }
.stage.compact .tile { width: min(calc(50% - 5px), 360px); }
.stage.compact.n1 .tile { width: min(100%, 420px); }
.call-wait { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--dim); padding: 6px 0; }

/* soundboard */
.sb-pop { width: 380px; padding: 10px; }
.pop.sheet.sb-pop { width: auto; }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 2px 4px 2px; font-size: 15px; font-weight: 500; }
.sb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sb-item { position: relative; }
.sb-btn { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 8px; border-radius: 10px; border: 1px solid var(--card-line); background: var(--chip); color: var(--text); font: inherit; cursor: pointer; transition: background .12s, transform .1s; }
.sb-btn:hover { background: var(--hover); }
.sb-btn:active { transform: scale(.96); }
.sb-emoji { font-size: 22px; line-height: 1.1; }
.sb-name { font-size: 12px; color: var(--dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-mini { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 6px; border: 0; background: var(--card); color: var(--dim); display: grid; place-items: center; cursor: pointer; opacity: 0; }
.sb-mini .ic { width: 11px; height: 11px; }
.sb-mini.del { right: auto; left: 3px; }
.sb-mini.del:hover { color: var(--red); }
.sb-item:hover .sb-mini { opacity: 1; }
.sb-add { width: 100%; margin-top: 6px; }
.sb-none { margin: 2px 4px 0; }
.sb-vol { display: flex; align-items: center; gap: 10px; padding: 12px 4px 2px; color: var(--dim); }

/* incoming call */
.call-card { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 300px; padding: 16px; display: flex; flex-direction: column; gap: 14px; animation: callin .3s; }
.call-card .av { animation: ringing 1.5s infinite; }
@keyframes ringing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 16px transparent; } }
@keyframes callin { from { transform: translateY(20px); opacity: 0; } }
.cc-top { display: flex; align-items: center; gap: 14px; }
.cc-name { font-size: 17px; font-weight: 500; }
.cc-sub { font-size: 13.5px; color: var(--dim); }
.cc-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- mail ---------- */

.mail-search { width: min(280px, 34vw); padding: 7px 12px; font-size: 14px; }
.mail-list { flex: 1; overflow-y: auto; padding: 6px; }
.mail-row {
  display: grid; grid-template-columns: 26px 30px minmax(90px, 200px) minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 9px 12px 9px 8px; border-radius: 10px; cursor: pointer; color: var(--dim); font-size: 14.5px;
}
.mail-row:hover { background: var(--chip); }
.mail-row.unread { color: var(--text); }
.mail-row.unread .mr-from, .mail-row.unread .mr-subj { font-weight: 500; }
.mail-row + .mail-row { box-shadow: 0 -1px 0 var(--panel-line); }
.mr-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.mr-count { font-size: 12px; color: var(--faint); margin-left: 6px; font-weight: 300; }
.mr-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-subj { color: var(--text); }
.mr-snip { color: var(--faint); }
.mr-time { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.star.on { color: var(--yellow); }
.thread { flex: 1; overflow-y: auto; padding: 20px clamp(14px, 3vw, 32px) 30px; display: flex; flex-direction: column; gap: 10px; }
.thread-subj { font-size: clamp(22px, 3vw, 28px); font-weight: 400; margin: 0 0 8px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mail-card { padding: 14px 16px; }
.mc-head { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.mc-who { flex: 1; min-width: 0; line-height: 1.4; }
.mc-who b { font-weight: 500; }
.mc-who > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-time { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.mc-body { margin: 12px 0 0 50px; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.mc-snip { display: none; margin: 4px 0 0 50px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-card .atts { margin-left: 50px; margin-top: 12px; }
.mail-card.collapsed .mc-body, .mail-card.collapsed .atts { display: none; }
.mail-card.collapsed .mc-snip { display: block; }
.thread-acts { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.to-row { display: flex; align-items: flex-start; gap: 10px; position: relative; background: var(--panel); border: 1px solid var(--card-line); border-radius: 10px; padding: 4px 6px 4px 12px; }
.to-row > .dim { padding-top: 7px; font-size: 14px; }
.chips-in { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 34px; cursor: text; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 8px; background: var(--chip); border: 1px solid var(--card-line); font-size: 13.5px; }
.chip button { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 2px; display: grid; place-items: center; border-radius: 5px; }
.chip button:hover { color: var(--text); background: var(--hover); }
.chip button .ic { width: 12px; height: 12px; }
.chip-input { flex: 1; min-width: 160px; border: 0; background: none; padding: 6px 2px; }
.to-sugg { left: 0; right: 0; top: calc(100% + 4px); bottom: auto; }
.mail-body { min-height: 220px; }

/* ---------- responsive ---------- */

.show-md { display: none; }
@media (max-width: 1100px) {
  .app-card.with-members { grid-template-columns: 64px 248px minmax(0, 1fr); }
  .members { position: absolute; right: 10px; top: 10px; bottom: 10px; width: 260px; z-index: 8; box-shadow: -10px 0 40px var(--shadow); background: var(--card); }
  .show-lg-hide { display: inline-grid; }
}
@media (max-width: 760px) {
  body.in-app .top .wrap { padding: 0 12px; height: 56px; }
  .shell { height: calc(100dvh - 56px); padding: 0 8px 8px; }
  .show-md { display: inline-grid; }
  .hide-sm { display: none; }
  .app-card, .app-card.with-members { grid-template-columns: minmax(0, 1fr); padding: 6px; }
  .rail, .side { position: absolute; top: 6px; bottom: 6px; z-index: 12; transition: transform .22s ease; box-shadow: 10px 0 40px var(--shadow); }
  .rail { left: 6px; width: 64px; transform: translateX(calc(-100% - 340px)); background: var(--card); }
  .side { left: 76px; width: min(280px, calc(100vw - 100px)); transform: translateX(calc(-100% - 100px)); background: var(--card); }
  .app-card.nav-open .rail, .app-card.nav-open .side { transform: none; }
  .nav-scrim { position: absolute; inset: 0; z-index: 11; background: rgba(0,0,0,.4); border-radius: inherit; }
  .main { grid-column: 1; }
  .members { right: 6px; top: 6px; bottom: 6px; width: min(280px, calc(100vw - 40px)); }
  .welcome-grid { grid-template-columns: 1fr; }
  .msg { padding: 2px 10px; }
  .msg-row { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .msg-av .av { width: 34px; height: 34px; font-size: 13px; }
  .reply-line { padding-left: 44px; }
  .rl-curve { left: 26px; }
  .msg-acts { right: 6px; }
  .composer { margin: 0 8px 8px; }
  .mail-row { grid-template-columns: 26px 30px minmax(0, 1fr) auto; grid-template-rows: auto auto; row-gap: 2px; }
  .mail-row .mr-from { grid-column: 3; }
  .mail-row .mr-time { grid-column: 4; grid-row: 1; }
  .mail-row .mr-text { grid-column: 3 / 5; grid-row: 2; }
  .mail-row > .ic { display: none; }
  .mail-row > .av { grid-row: 1 / 3; }
  .mail-row > .star { grid-row: 1 / 3; }
  .mail-search { width: 46vw; }
  .mc-body, .mc-snip, .mail-card .atts { margin-left: 0; }
  .tile, .stage.n1 .tile, .stage.compact .tile { width: 100%; }
  .stage.n3 .tile, .stage.n4 .tile, .stage.n5 .tile, .stage.n6 .tile, .stage.n7 .tile, .stage.n8 .tile, .stage.n9 .tile, .stage.n10 .tile { width: calc(50% - 5px); }
  .hide-xs { display: none; }
  .call-card { left: 12px; right: 12px; width: auto; bottom: 12px; }
  .acct-btn { padding: 0 6px; }
  .acct-btn #account-name { display: none; }
  .mh-sub.topic { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top .wrap { height: 72px; }
  .tab { padding: 10px 12px; }
  .hero { padding-top: 24px; }
  .hero .lead { font-size: 16px; }
}
@media (hover: none) {
  .msg-acts { display: none !important; }
  .msg.touch-acts .msg-acts { display: flex !important; }
  .react.add, .side-row .row-act, .sb-mini, .tile-full { opacity: 1; }
}
@media (max-width: 760px) {
  .stage.compact .tile, .stage.compact.n1 .tile { width: calc(50% - 5px); }
  .call-stage { max-height: 46%; }
  body.in-app .toast { bottom: 84px; }
}
.stage.compact .tile .av.xl { width: 56px; height: 56px; font-size: 20px; }
@media (max-width: 760px) { .stage .tile .av.xl { width: 52px; height: 52px; font-size: 19px; } }

/* ---------- language, devices, server types, class ---------- */

.lang-btn {
  height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 12px;
  background: var(--chip); border: 1px solid var(--card-line); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer;
}
.lang-btn:hover { background: var(--hover); }
.dev-pair { display: inline-flex; align-items: center; border-radius: 10px; }
.dev-pair:hover { background: var(--chip); }
.dev-pair .icon-btn { width: 30px; }
.dev-pair .icon-btn:hover { background: transparent; }
.dev-arrow { width: 16px; height: 34px; border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0; display: grid; place-items: center; border-radius: 0 10px 10px 0; }
.dev-arrow .ic { width: 12px; height: 12px; transform: rotate(180deg); }
.dev-arrow:hover { color: var(--text); background: var(--hover); }
.user-bar { gap: 0; }
.dev-menu { width: 300px; }
.pop.sheet .dev-menu { width: auto; }
.dev-title { padding: 8px 10px 4px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.dev-menu .menu-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-note { padding: 4px 10px 8px; margin: 0; line-height: 1.45; }
.dev-check { padding: 8px 10px; }
.dev-vol { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; text-align: start; cursor: pointer; color: var(--text); font: inherit; border: 1px solid var(--panel-line); }
.kind .ic { color: var(--dim); margin-bottom: 4px; }
.kind.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.kind-t { font-size: 14.5px; font-weight: 500; }
.kind-d { font-size: 12.5px; color: var(--dim); line-height: 1.4; }
.call-ring { width: 72px; height: 72px; margin: 4px auto 0; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; animation: ringing 1.5s infinite; }
.call-ring .ic { width: 30px; height: 30px; }
.class-sec { margin-top: 26px; max-width: 900px; }
.class-sec .side-sec { padding-inline-start: 0; justify-content: flex-start; gap: 10px; }
.class-sec > p { margin: 0 0 10px; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.mate { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; }
.mate-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mate-name { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mate-mail { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.sb-pop { width: 420px; }
.sb-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .lang-btn span { display: none; } .lang-btn { padding: 0 11px; } .kind-pick { grid-template-columns: 1fr; } }

/* ---------- right-to-left (Hebrew) ---------- */

[dir="rtl"] .dirflip { transform: scaleX(-1); }
[dir="rtl"] .rail-btn::before { left: auto; right: -10px; border-radius: 4px 0 0 4px; }
[dir="rtl"] .side-row.unread::before { left: auto; right: -8px; border-radius: 4px 0 0 4px; }
[dir="rtl"] .badge { right: auto; left: -4px; }
[dir="rtl"] .badge.inline { left: auto; }
[dir="rtl"] .rail-voice { right: auto; left: -4px; }
[dir="rtl"] .dot.status.pres { right: auto; left: -2px; }
[dir="rtl"] .side-row { padding: 5px 10px 5px 8px; text-align: right; }
[dir="rtl"] .side-row .row-act { margin: -4px 0 -4px -4px; }
[dir="rtl"] .side-sec { padding: 14px 10px 4px 8px; }
[dir="rtl"] .side-title, [dir="rtl"] .vb-place, [dir="rtl"] .me-btn, [dir="rtl"] .mem-row, [dir="rtl"] .menu-item, [dir="rtl"] .mp-row, [dir="rtl"] .home-tile, [dir="rtl"] .lb-row.btnish { text-align: right; }
[dir="rtl"] .vmembers { padding: 0 26px 4px 0; }
[dir="rtl"] .mh-sub.topic { border-left: 0; border-right: 1px solid var(--card-line); padding-left: 0; padding-right: 10px; margin-left: 0; margin-right: 2px; }
[dir="rtl"] .mh-title.btnish { margin-left: 0; margin-right: -6px; padding: 4px 4px 4px 8px; }
[dir="rtl"] .msg-acts { right: auto; left: 14px; }
[dir="rtl"] .msg.mention { box-shadow: inset -2px 0 0 var(--yellow); }
[dir="rtl"] .msg.system { padding-left: 16px; padding-right: 26px; }
[dir="rtl"] .reply-line { padding: 0 54px 2px 0; }
[dir="rtl"] .rl-curve { left: auto; right: 34px; border-left: 0; border-right: 1.5px solid var(--dashed); border-top-left-radius: 0; border-top-right-radius: 6px; }
[dir="rtl"] .quote { border-left: 0; border-right: 3px solid var(--dashed); padding-left: 0; padding-right: 10px; }
[dir="rtl"] .msg-gut { justify-content: flex-start; }
[dir="rtl"] .tag { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .mr-count { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .mp-row .faint { margin-left: 0; margin-right: auto; }
[dir="rtl"] .tile-label { left: auto; right: 10px; }
[dir="rtl"] .tile-full { right: auto; left: 10px; }
[dir="rtl"] .stage-strip .tile-label { right: 6px; }
[dir="rtl"] .sb-mini { right: auto; left: 3px; }
[dir="rtl"] .sb-mini.del { left: auto; right: 3px; }
[dir="rtl"] .call-card { right: auto; left: 20px; }
[dir="rtl"] .mc-body, [dir="rtl"] .mc-snip, [dir="rtl"] .mail-card .atts { margin-left: 0; margin-right: 50px; }
[dir="rtl"] .to-row { padding: 4px 12px 4px 6px; }
[dir="rtl"] .chip { padding: 3px 10px 3px 4px; }
[dir="rtl"] .dlg-actions.spread .btn.solid, [dir="rtl"] .dlg-actions.spread .faint { margin-left: 0; margin-right: auto; }
[dir="rtl"] .dlg-actions.spread .faint + .btn.solid { margin-right: 8px; }
[dir="rtl"] .dev-arrow { border-radius: 10px 0 0 10px; }
[dir="rtl"] .mate { padding: 8px 10px 8px 6px; }
[dir="rtl"] .acct-btn { padding: 0 6px 0 14px; }
[dir="rtl"] .eyebrow { padding: 7px 12px 7px 14px; }
[dir="rtl"] .chips li { padding: 7px 12px 7px 14px; }
[dir="rtl"] .members { box-shadow: 10px 0 40px var(--shadow); }
@media (max-width: 1100px) { [dir="rtl"] .members { right: auto; left: 10px; } }
@media (max-width: 760px) {
  [dir="rtl"] .rail { left: auto; right: 6px; transform: translateX(calc(100% + 340px)); }
  [dir="rtl"] .side { left: auto; right: 76px; transform: translateX(calc(100% + 100px)); }
  [dir="rtl"] .app-card.nav-open .rail, [dir="rtl"] .app-card.nav-open .side { transform: none; }
  [dir="rtl"] .members { left: 6px; }
  [dir="rtl"] .reply-line { padding-right: 44px; }
  [dir="rtl"] .rl-curve { right: 26px; }
  [dir="rtl"] .msg-acts { left: 6px; }
  [dir="rtl"] .mc-body, [dir="rtl"] .mc-snip, [dir="rtl"] .mail-card .atts { margin-right: 0; }
  [dir="rtl"] .call-card { left: 12px; }
}
/* addresses, handles and code stay left-to-right inside Hebrew text */
.mono, .uc-mail, .uc-handle, .me-handle, .mh-sub, .mc-who .faint { unicode-bidi: plaintext; }

/* ---------- email code + alerts prompt ---------- */

.code-step { margin-top: 2px; }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-family: var(--mono); direction: ltr; }
.alerts-card { position: fixed; left: 20px; bottom: 20px; z-index: 65; width: 340px; padding: 16px; display: flex; flex-direction: column; gap: 14px; animation: callin .3s; }
.ac-top { display: flex; gap: 12px; align-items: flex-start; }
.ac-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--chip); display: grid; place-items: center; color: var(--text); }
.ac-title { font-size: 15.5px; font-weight: 500; margin-bottom: 3px; }
.ac-text { font-size: 13.5px; color: var(--dim); line-height: 1.5; }
.ac-acts { display: flex; justify-content: flex-end; gap: 8px; }
[dir="rtl"] .alerts-card { left: auto; right: 20px; }
@media (max-width: 760px) { .alerts-card, [dir="rtl"] .alerts-card { left: 12px; right: 12px; width: auto; bottom: 12px; } }
