/* ВидеоМост — calm utility UI with a distinct bridge-line signature. */
:root {
  --paper: #f3f5f7;
  --paper-deep: #e9edf1;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --ink: #15191f;
  --ink-soft: #343b45;
  --muted: #69727f;
  --line: #dfe4e9;
  --line-strong: #cfd6dd;
  --blue: #2864dc;
  --blue-hover: #1e55c3;
  --blue-soft: #eaf1ff;
  --cyan: #70d4ec;
  --success: #16865d;
  --danger: #d94a4a;
  --danger-hover: #bf3939;
  --warning: #9a6711;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --pill: 999px;
  --shadow-card: 0 18px 50px rgba(28, 40, 54, .09), 0 2px 8px rgba(28, 40, 54, .05);
  --shadow-float: 0 20px 54px rgba(0, 0, 0, .24);
  --font: "Segoe UI Variable", "Inter", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--paper); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, rgba(112, 212, 236, .13), transparent 27rem),
    var(--paper);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.hidden { display: none !important; }
::selection { background: #cbdcff; }
:focus-visible { outline: 3px solid rgba(40, 100, 220, .42); outline-offset: 3px; }

/* Header */
.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(18px, 4vw, 56px);
  background: rgba(243, 245, 247, .86);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -.03em;
}
.brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}
.brand-ico { width: 31px; height: 24px; overflow: visible; }
.brand-ico path { fill: none; stroke: var(--blue); stroke-width: 2.3; stroke-linecap: round; }
.brand-ico circle { fill: var(--blue); }
nav { display: flex; align-items: center; gap: 4px; }
.navlink {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  padding: 0 14px;
  border-radius: var(--pill);
  transition: background .16s ease, color .16s ease;
}
.navlink:hover { color: var(--blue); background: var(--surface); }

/* Buttons and fields */
.btn {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 10px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 680;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:hover { background: var(--surface-soft); border-color: #bfc8d1; }
.btn:active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .1); }
.btn-primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 9px 22px rgba(40, 100, 220, .22);
}
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-lg { min-height: 52px; border-radius: 16px; font-size: 15px; }
.btn:disabled { opacity: .46; cursor: not-allowed; box-shadow: none; }

.field { margin: 0 0 15px; text-align: left; }
.field label, .invite label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 720;
}
.field .hint { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; font-weight: 450; }
.field input[type="text"], .field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  padding: 10px 14px;
  appearance: none;
  background-color: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2369727f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(40, 100, 220, .11); }
input::placeholder { color: #8a929c; }
.grid2, .devices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dev-note { margin: 0 0 12px; padding: 10px 12px; color: var(--warning); background: #fff7e5; border-radius: 12px; font-size: 12px; }
#btnAllow { margin: 0 0 14px; }

/* Lobby */
.lobby { flex: 1; display: grid; place-items: center; padding: 34px 20px 64px; }
.lobby-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  grid-template-rows: auto auto auto auto auto auto;
  column-gap: 28px;
  padding: 0;
  animation: appear .34s ease-out both;
}
@keyframes appear { from { opacity: 0; transform: translateY(8px); } }
.lobby-head {
  grid-column: 1 / -1;
  text-align: center;
  margin: 0 auto 28px;
  max-width: 660px;
}
.lobby-icon {
  width: 62px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
}
.lobby-icon svg { width: 54px; height: 40px; overflow: visible; }
.lobby-icon path { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; }
.lobby-icon circle { fill: var(--blue); }
.lobby-kicker { color: var(--blue); font-size: 11px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.lobby-head h1 { margin: 7px 0 8px; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.08; letter-spacing: -.055em; }
.sub { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 14px; }
.lobby-card > .field,
.lobby-card > .grid2,
.lobby-card > .devices,
.lobby-card > .switch-field,
.lobby-card > .dev-note,
.lobby-card > #btnAllow {
  grid-column: 1;
  background: var(--surface);
}
.lobby-card > .field { padding: 22px 22px 0; margin: 0; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.lobby-card > .grid2 { padding: 14px 22px 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.lobby-card > .devices { padding: 0 22px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.lobby-card > .switch-field { padding: 0 22px 22px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.lobby-card > .dev-note, .lobby-card > #btnAllow { margin-top: 10px; }
.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch-field > div:first-child { min-width: 0; }
.switch-field > div > label { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.switch-field .hint { color: var(--muted); font-size: 11.5px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; }
.slider { position: absolute; inset: 0; border-radius: var(--pill); background: #cbd1d8; transition: background .18s ease; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .18s ease; }
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid rgba(40,100,220,.35); outline-offset: 3px; }

.preview-row {
  grid-column: 2;
  grid-row: 2 / span 6;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  position: relative;
}
.preview-row::before {
  content: "Предпросмотр";
  position: absolute;
  top: 27px;
  left: 28px;
  z-index: 3;
  padding: 5px 9px;
  border-radius: var(--pill);
  color: #dce7f7;
  background: rgba(11, 19, 31, .68);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.preview-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 42%, #25344a 0, #162131 46%, #101722 100%);
}
.preview-tile::after { content: ""; position: absolute; inset: auto 8% 0; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent); opacity: .7; }
.preview-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #aab6c6; font-size: 12px; }
.preview-ph svg { width: 54px; height: 54px; fill: #637188; }
.preview-controls { position: absolute; z-index: 2; left: 0; right: 0; bottom: 13px; display: flex; justify-content: center; gap: 8px; }
.ctrl {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f3f6fa;
  background: rgba(35, 44, 58, .9);
  box-shadow: 0 5px 18px rgba(0,0,0,.22);
  transition: background .15s ease, border-color .15s ease;
}
.ctrl:hover { background: #3c4657; border-color: rgba(255,255,255,.24); }
.ctrl svg { width: 21px; height: 21px; fill: currentColor; }
.ctrl .ic-off { display: none; }
.ctrl.off { color: #fff; background: var(--danger); border-color: var(--danger); }
.ctrl.off .ic-off { display: block; }
.ctrl.off .ic-mic, .ctrl.off > svg:not(.ic-off) { display: none; }
.lobby-actions { display: flex; flex-direction: column; gap: 9px; }
.invite { padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.invite-row { display: flex; gap: 7px; }
.invite-row input { min-width: 0; flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.err { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; font-weight: 650; }
.footnote { margin: 0; color: var(--muted); font-size: 11.5px; }

/* Call */
body.call-mode { overflow: hidden; background: #0f1115; color: #f5f6f8; }
body.call-mode .topbar { display: none; }
#view-call { min-height: 100vh; flex: 1; display: flex; flex-direction: column; background: #0f1115; color: #f5f6f8; }
.call-top { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; }
.call-info, .call-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.call-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 730; }
.call-brand i { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(112,212,236,.12); }
.room-tag, .timer, .rec-badge, .pill { min-height: 38px; display: inline-flex; align-items: center; border-radius: var(--pill); }
.room-tag { max-width: 170px; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; color: #9ba5b2; background: #191c22; font: 600 11px/1 ui-monospace, monospace; }
.timer { padding: 0 10px; color: #bdc4cd; font-size: 12px; font-variant-numeric: tabular-nums; }
.rec-badge { gap: 6px; padding: 0 11px; color: #ff8686; background: #2d1d20; font-size: 11px; font-weight: 720; }
.rec-badge i { width: 7px; height: 7px; border-radius: 50%; background: #ff6b6b; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.pill { gap: 7px; padding: 0 13px; border: 1px solid #2b2f36; color: #d7dbe1; background: #1c1f25; font-size: 12px; font-weight: 650; }
.pill:hover { background: #282c34; border-color: #3c424c; }
.pill svg { width: 17px; height: 17px; fill: currentColor; }

.stage-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 0 12px;
}
.screen { grid-column: 1 / -1; position: relative; overflow: hidden; border-radius: 14px; background: #07080a; }
.screen video { width: 100%; max-height: 43vh; display: block; object-fit: contain; }
.screen-info { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 6px 10px; color: #fff; background: rgba(12,14,18,.75); border-radius: var(--pill); font-size: 12px; }
.screen-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { min-height: 34px; border: 0; border-radius: var(--pill); padding: 0 12px; color: #fff; background: rgba(255,255,255,.13); font-weight: 650; }
.grid { min-width: 0; min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); grid-auto-rows: minmax(180px, 1fr); gap: 8px; }
.grid, .invite-stage { grid-row: 2; }
.grid:empty::before {
  content: "Подключаемся к встрече…";
  min-height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid #2b2e35;
  border-radius: 14px;
  color: #89919c;
  background: radial-gradient(circle at 50% 42%, #30333a, #24272d 72%);
  font-size: 12px;
}
.stage-wrap:has(.invite-stage.hidden) .grid { grid-column: 1 / -1; }
.tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #2b2e35; border-radius: 14px; background: radial-gradient(circle at 50% 42%, #30333a, #24272d 72%); }
.tile video { width: 100%; height: 100%; display: block; object-fit: cover; }
.tile .ph { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .avatar { width: clamp(68px, 10vw, 112px); height: clamp(68px, 10vw, 112px); display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: clamp(25px, 4vw, 42px); font-weight: 730; box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.tile-label { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: var(--pill); background: rgba(10,11,14,.72); color: #fff; font-size: 11px; font-weight: 650; backdrop-filter: blur(7px); }
.tile-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-label .mic-ico { width: 12px; height: 12px; fill: #a9b0ba; }
.tile-label .mic-ico.off { fill: #ff7979; }
.tile.self { border-color: #48515f; }
.tile.speaking { box-shadow: inset 0 0 0 2px var(--cyan); }
.invite-stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px; text-align: center; border: 1px solid #2b2e35; border-radius: 14px; background: #24272d; }
.invite-stage-mark { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 18px; color: var(--cyan); border-radius: 18px; background: #1b2e35; }
.invite-stage-mark svg { width: 26px; height: 26px; fill: currentColor; }
.invite-stage strong { margin-bottom: 7px; font-size: 15px; }
.invite-stage > span { max-width: 320px; color: #a5acb6; font-size: 12px; }
.stage-copy { min-height: 40px; margin-top: 18px; padding: 0 16px; border: 0; border-radius: var(--pill); color: #071a20; background: var(--cyan); font-size: 12px; font-weight: 750; }
.stage-copy:hover { background: #8be0f2; }

.controls { display: flex; justify-content: center; padding: 12px 12px 6px; }
.controls-inner { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid #30343c; border-radius: 18px; background: rgba(28,31,37,.92); box-shadow: var(--shadow-float); backdrop-filter: blur(16px); }
.ctrl.big { width: auto; min-width: 50px; height: 48px; gap: 8px; padding: 0 13px; border-radius: 13px; background: #292d35; box-shadow: none; }
.ctrl.big .lbl { font-size: 11.5px; font-weight: 650; }
.ctrl.big.rec .rec-dot { width: 14px; height: 14px; border: 3px solid #ff7575; border-radius: 50%; }
.ctrl.big.rec.on { background: #763033; }
.ctrl.big.rec.on .rec-dot { background: #fff; border-color: #fff; animation: blink 1.3s infinite; }
.ctrl.big.danger { margin-left: 5px; color: #fff; background: var(--danger); border-color: var(--danger); }
.ctrl.big.danger:hover { background: var(--danger-hover); }
.call-note { margin: 0 0 9px; color: #727983; text-align: center; font-size: 10.5px; }

/* Floating call panels */
.parts-panel { position: fixed; top: 70px; right: 16px; z-index: 60; width: min(340px, calc(100vw - 32px)); padding: 18px; border: 1px solid #353a43; border-radius: 18px; color: #f4f5f7; background: #22262d; box-shadow: var(--shadow-float); animation: appear .2s ease-out; }
.parts-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; font-size: 14px; font-weight: 750; }
#partsClose, #devClose { width: 44px; height: 44px; border: 0; border-radius: 12px; color: #a8afb8; background: transparent; font-size: 22px; }
#partsClose:hover, #devClose:hover { color: #fff; background: #323740; }
#partsList { max-height: 45vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.part-row { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 12px; background: #2a2f37; font-size: 13px; }
.part-row .dot { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg,#2864dc,#35a8c7); font-weight: 750; }
.part-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-row .st svg { width: 15px; height: 15px; fill: #a8afb8; }
.part-row .st svg.off { fill: #ff7777; }
.parts-foot { display: flex; gap: 7px; margin-top: 12px; }
.parts-foot input { flex: 1; min-width: 0; border: 1px solid #414752; border-radius: 10px; padding: 9px; color: #dce0e6; background: #191c21; font-size: 10px; }
.parts-foot button { min-height: 42px; border: 0; border-radius: 10px; padding: 0 11px; color: #071a20; background: var(--cyan); font-size: 11px; font-weight: 750; }
.dev-panel { width: min(370px, calc(100vw - 32px)); }
.dev-panel .field label, .dev-panel .switch-field label { color: #d6dbe2; }
.dev-panel .field select { color: #f2f4f7; background-color: #191c21; border-color: #414752; }
.dev-panel .footnote { color: #9ba3ae; }

/* Archive */
.archive, .detail { flex: 1; width: min(1040px, calc(100% - 40px)); margin: 40px auto 70px; }
.archive h1, .detail-head h1 { margin: 0; line-height: 1.12; letter-spacing: -.045em; }
.archive h1 { font-size: clamp(30px, 4vw, 44px); }
.meta-row { max-width: 760px; margin: 10px 0; color: var(--muted); font-size: 13px; }
.meet-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
a.card-link { color: var(--ink); text-decoration: none; }
.meet-card { min-height: 122px; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 13px 18px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease; }
.meet-card:hover { border-color: #afbed1; box-shadow: var(--shadow-card); }
.meet-card .when { font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.meet-card .desc { grid-column: 1 / -1; min-width: 0; }
.meet-card .desc .nm { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.badge { justify-self: end; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: var(--pill); font-size: 10px; font-weight: 750; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { color: #14784f; background: #e7f6ef; }
.badge.processing { color: #8b6015; background: #fff5dd; }
.badge.ready { color: #2259bd; background: var(--blue-soft); }
.badge.error { color: #b53939; background: #fdeaea; }
.badge.unknown { color: var(--muted); background: var(--paper-deep); }
.detail #backList { margin: -10px 0 28px; padding-left: 0; }
.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head h1 { font-size: clamp(26px, 3vw, 36px); }
.detail-head > span { flex: 1; }
.tabs { display: flex; gap: 18px; margin: 28px 0 0; border-bottom: 1px solid var(--line); }
.tab { min-height: 46px; margin-bottom: -1px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 13px; font-weight: 680; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--blue); border-color: var(--blue); }
.panel { padding: 20px 0; }
.proto-text { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.seg { margin-bottom: 18px; }
.seg .who { display: flex; align-items: center; gap: 7px; font-weight: 720; }
.seg .who .t { padding: 2px 7px; border-radius: 7px; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.seg .txt { margin-top: 5px; padding-left: 10px; border-left: 2px solid #bcd1fc; color: var(--ink-soft); }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.fcard { display: flex; flex-direction: column; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.fcard .fn { color: var(--ink-soft); font-size: 12px; font-weight: 680; word-break: break-all; }
.fcard audio, .fcard video { width: 100%; max-height: 180px; border-radius: 11px; background: #0b0d10; }
.dl { text-decoration: none; }
.empty { padding: 40px 0; color: var(--muted); text-align: center; }
#toasts { position: fixed; top: 16px; right: 16px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 350px; padding: 12px 16px; border: 1px solid #3a4049; border-radius: 13px; color: #fff; background: #22262d; box-shadow: var(--shadow-float); font-size: 12px; animation: appear .2s ease-out; }
.toast.err { background: var(--danger); border-color: var(--danger); }

@media (max-width: 880px) {
  .lobby { align-items: start; padding-top: 20px; }
  .lobby-card { grid-template-columns: 1fr; }
  .lobby-head { grid-column: 1; margin-bottom: 22px; }
  .preview-row { grid-column: 1; grid-row: auto; margin-top: 14px; }
  .meet-list { grid-template-columns: 1fr; }
  .stage-wrap { grid-template-columns: 1fr; overflow: auto; }
  .grid, .invite-stage { min-height: 38vh; }
  .invite-stage { grid-column: 1; }
  .invite-stage { grid-row: 3; }
  .stage-wrap:has(.invite-stage.hidden) .grid { grid-column: 1; }
  .call-brand { display: none; }
  .pill span:not(#partsCount) { display: none; }
  .pill { width: 42px; justify-content: center; padding: 0; }
}

@media (max-width: 560px) {
  .topbar { min-height: 58px; padding: 0 14px; }
  .brand small { display: none; }
  .navlink { min-height: 40px; padding: 0 9px; font-size: 11px; }
  .lobby { padding: 18px 12px 38px; }
  .lobby-head h1 { font-size: 30px; }
  .lobby-card > .field { padding: 18px 16px 0; }
  .lobby-card > .grid2, .lobby-card > .devices { padding-left: 16px; padding-right: 16px; }
  .lobby-card > .switch-field { padding: 0 16px 18px; }
  .grid2, .devices { grid-template-columns: 1fr; gap: 0; }
  .preview-row { padding: 9px; }
  .preview-row::before { top: 20px; left: 21px; }
  .preview-tile { aspect-ratio: 4 / 3; }
  .call-top { min-height: 54px; padding: 8px 10px; }
  .room-tag { max-width: 92px; }
  .timer { padding: 0 4px; }
  .stage-wrap { padding: 0 7px; }
  .grid { grid-auto-rows: minmax(210px, 1fr); }
  .controls { padding: 8px 6px max(6px, env(safe-area-inset-bottom)); }
  .controls-inner { width: 100%; justify-content: center; gap: 4px; border-radius: 16px; }
  .ctrl.big { width: 46px; min-width: 46px; padding: 0; }
  .ctrl.big .lbl { display: none; }
  .call-note { display: none; }
  .archive, .detail { width: calc(100% - 28px); margin-top: 24px; }
}

@media (max-height: 680px) and (orientation: landscape) {
  .call-top { min-height: 48px; padding-block: 5px; }
  .controls { padding-block: 7px 4px; }
  .ctrl.big { height: 44px; }
  .call-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
