@font-face {
  font-family: "Golos Text";
  src: url("/assets/fonts/GolosText-Variable.ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist/geist-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+202F, U+20BD, U+2116;
}

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist/geist-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist/geist-cyrillic-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist/geist-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono/geist-mono-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+202F, U+20BD, U+2116;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono/geist-mono-cyrillic-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono/geist-mono-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

/* ==========================================================================
   ПАЛИТРА «СВЯЗНЫЕ» v5 (ДНЕВНАЯ ПО УМОЛЧАНИЮ / НОЧНОЙ ЭФИР)
   ========================================================================== */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #F2EDE4;
  --canvas-dot: rgba(23, 22, 20, 0.085);
  --bg-panel: #FDFBF7;
  --bg-card: #FFFFFF;
  --bg-soft: #EBE5D9;
  --bg-hover: #E2DBD0;
  --line: #DED7C9;
  --line-control: #C6BEB0;
  --line-hover: #A89E8E;
  --ink: #171614;
  --ink-muted: #4D473F;
  --ink-subtle: #5C554C;
  --btn-active-bg: #171614;
  --btn-active-ink: #FDFBF7;
  --btn-active-hover: #2C2925;
  --terra: #C84B28;
  --terra-text: var(--terra);
  --terra-ink: #8C2B11;
  --terra-hover: #B03E1F;
  --terra-cta-bg: #C84B28;
  --terra-cta-hover: #B03E1F;
  --terra-soft: rgba(200, 75, 40, 0.10);
  --terra-soft-solid: #F8EAE5;
  --terra-border: rgba(200, 75, 40, 0.34);
  --chip-dot: #E05A36;
  --pine: #1F7A54;
  --pine-text: var(--pine);
  --pine-soft: rgba(31, 122, 84, 0.10);
  --pine-soft-solid: #E6F2EC;
  --pine-border: rgba(31, 122, 84, 0.28);
  --amber: #9A6008;
  --amber-text: #9A6008;
  --amber-soft: rgba(154, 96, 8, 0.11);
  --amber-soft-solid: #F7EFE0;
  --amber-border: rgba(154, 96, 8, 0.34);
  --msg-me-bg: #F4E4DC;
  --msg-me-border: rgba(200, 75, 40, 0.18);
  --msg-me-ink: #171614;
  --msg-peer-bg: #FFFFFF;
  --msg-peer-ink: #171614;
  --toast-bg: #171614;
  --toast-ink: #FDFBF7;
  --toast-border: #38332D;
  --backdrop-bg: rgba(23, 22, 20, 0.44);
  --shadow-card: 0 2px 6px rgba(23, 22, 20, 0.04), 0 14px 32px rgba(23, 22, 20, 0.05);
  --shadow-float: 0 14px 34px rgba(23, 22, 20, 0.14);
  --scrollbar-thumb: #CFC7B8;
  --scrollbar-track: transparent;
  --font-sans: "Golos Text", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-ui: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #11100E;
  --canvas-dot: rgba(242, 236, 225, 0.06);
  --bg-panel: #191714;
  --bg-card: #221F1B;
  --bg-soft: #2A2621;
  --bg-hover: #332E28;
  --line: #2E2A24;
  --line-control: #4A443A;
  --line-hover: #625A4D;
  --ink: #F2ECE1;
  --ink-muted: #C2BBB0;
  --ink-subtle: #C0B8AB;
  --btn-active-bg: #F2ECE1;
  --btn-active-ink: #171614;
  --btn-active-hover: #DFD8CB;
  --terra: #E05A36;
  --terra-text: #FA9F83;
  --terra-ink: #F8D3C8;
  --terra-hover: #EB6A47;
  --terra-cta-bg: #C84B28;
  --terra-cta-hover: #D65531;
  --terra-soft: rgba(224, 90, 54, 0.14);
  --terra-soft-solid: #2E1D17;
  --terra-border: rgba(224, 90, 54, 0.38);
  --chip-dot: #C84B28;
  --pine: #62CF9E;
  --pine-text: #62CF9E;
  --pine-soft: rgba(63, 166, 123, 0.14);
  --pine-soft-solid: #182A22;
  --pine-border: rgba(63, 166, 123, 0.34);
  --amber: #F0B956;
  --amber-text: #F0B956;
  --amber-soft: rgba(240, 185, 86, 0.14);
  --amber-soft-solid: #2E2517;
  --amber-border: rgba(240, 185, 86, 0.36);
  --msg-me-bg: #30221C;
  --msg-me-border: rgba(224, 90, 54, 0.24);
  --msg-me-ink: #F2ECE1;
  --msg-peer-bg: #201E1A;
  --msg-peer-ink: #F2ECE1;
  --toast-bg: #221F1B;
  --toast-ink: #F2ECE1;
  --toast-border: #3E3931;
  --backdrop-bg: rgba(7, 6, 5, 0.74);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.22), 0 16px 36px rgba(0, 0, 0, 0.28);
  --shadow-float: 0 20px 48px rgba(0, 0, 0, 0.54);
  --scrollbar-thumb: #3E3931;
  --scrollbar-track: transparent;
}

/* ==========================================================================
   БАЗОВАЯ ТИПОГРАФИКА И КАРКАС 100DVH
   ========================================================================== */
html {
  box-sizing: border-box;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  accent-color: var(--terra);
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 220ms var(--ease-ui), color 220ms var(--ease-ui);
}

h1,
h2,
h3,
p,
ul,
ol {
  margin-block: 0;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 2px;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.tabular {
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

::selection {
  background-color: var(--terra-soft);
  color: var(--ink);
}

.app-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   ЛИПКАЯ НАВИГАЦИОННАЯ ШАПКА 62PX (0 FLEX-WRAP)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 62px;
  height: 62px;
  min-height: 62px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  transition: background-color 220ms var(--ease-ui), border-color 220ms var(--ease-ui);
}

.header-inner {
  width: 100%;
  height: 100%;
  padding-inline: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-self: start;
  flex-wrap: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-word {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}

.header-nav-wrap {
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-self: center;
  min-width: 0;
}

.nav-tablist {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 4px;
  height: 100%;
}

.nav-tablist::before {
  content: "";
  position: absolute;
  position-anchor: --nav-active;
  inset-inline-start: anchor(left);
  inset-inline-end: anchor(right);
  inset-block-end: 0;
  border-block-end: 2.5px solid var(--terra);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .nav-tablist::before {
    transition: inset 220ms var(--ease-ui);
  }
}

.nav-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: color 160ms var(--ease-ui), background-color 160ms var(--ease-ui);
}

.nav-tab-btn:hover {
  color: var(--ink);
}

.nav-tab-btn[aria-selected="true"] {
  anchor-name: --nav-active;
  color: var(--ink);
}

@supports not (position-anchor: auto) {
  .nav-tablist::before {
    display: none;
  }

  .nav-tab-btn {
    border-bottom: 2.5px solid transparent;
  }

  .nav-tab-btn[aria-selected="true"] {
    border-bottom: 2.5px solid var(--terra);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.hdr-session-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--pine-border);
  background-color: var(--pine-soft-solid);
  color: var(--pine-text);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), transform 110ms var(--ease-ui);
}

.hdr-session-pill:hover {
  background-color: var(--pine-soft);
}

.hdr-session-pill:active {
  transform: scale(0.98);
}

.hdr-session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--pine);
  flex-shrink: 0;
  animation: beacon-pulse 1.8s ease-in-out infinite;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background-color: var(--pine-soft);
  border: 1px solid var(--pine-border);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.live-pill strong {
  color: var(--ink);
  font-weight: 650;
}

.online-suffix {
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.online-count-val {
  display: inline-block;
  min-width: 2ch;
  text-align: right;
}

.live-beacon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--pine);
  flex-shrink: 0;
}

.live-beacon-svg {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.live-beacon .beacon-ring {
  animation: beacon-pulse 2.2s ease-in-out infinite;
}

.live-beacon.is-reconnecting {
  color: var(--ink-subtle);
}

.live-beacon.is-reconnecting .beacon-ring {
  animation: none;
  opacity: 0.45;
}

@keyframes beacon-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.hdr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), color 140ms var(--ease-ui), transform 110ms var(--ease-ui);
}

.hdr-btn:hover {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.hdr-btn:active {
  transform: scale(0.985);
}

.hdr-btn-icon {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.hdr-icon-btn {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.hdr-icon-btn .hdr-btn-icon {
  width: 16px;
  height: 16px;
}

.hdr-filters-btn[aria-expanded="true"] {
  background-color: var(--btn-active-bg);
  border-color: var(--btn-active-bg);
  color: var(--btn-active-ink);
}

.hdr-filters-btn[aria-expanded="true"] circle {
  fill: var(--btn-active-bg);
}

.hdr-filters-btn[aria-expanded="true"]:hover {
  background-color: var(--btn-active-hover);
  border-color: var(--btn-active-hover);
}

.filters-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background-color: var(--terra-soft-solid);
  border: 1px solid var(--terra-border);
  color: var(--terra-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.hdr-filters-btn[aria-expanded="true"] .filters-count-badge {
  background-color: var(--terra);
  border-color: var(--terra);
  color: #FFFFFF;
}

.hdr-sound-btn.is-muted {
  color: var(--ink-muted);
  background-color: var(--bg-soft);
}

.hdr-sound-btn.is-muted .sound-wave {
  opacity: 0.25;
}

html[data-theme="light"] .hdr-theme-btn .icon-theme-sun,
:root:not([data-theme="dark"]) .hdr-theme-btn .icon-theme-sun {
  display: none;
}

html[data-theme="dark"] .hdr-theme-btn .icon-theme-moon {
  display: none;
}

/* ==========================================================================
   РАБОЧАЯ ОБЛАСТЬ И ВЫДВИЖНАЯ ПАНЕЛЬ ФИЛЬТРОВ (SLIDE-OVER DRAWER)
   ========================================================================== */
.workspace-grid {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100dvh - 62px);
  display: flex;
  flex-direction: column;
}

.filters-backdrop {
  position: fixed;
  inset: 0;
  top: 62px;
  z-index: 44;
  background-color: var(--backdrop-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease-ui);
}

body[data-filters-open="true"] .filters-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.filters-pane {
  position: fixed;
  inset-block-start: 62px;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: min(392px, 100vw);
  z-index: 45;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background-color: var(--bg-panel);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 320ms var(--ease-drawer), visibility 320ms var(--ease-drawer), background-color 220ms var(--ease-ui), border-color 220ms var(--ease-ui);
  transition-behavior: allow-discrete;
}

.filters-pane:not(.is-open) {
  visibility: hidden;
}

body[data-filters-open="true"] .filters-pane,
.filters-pane.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.filters-pane-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.filters-pane-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.filters-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  padding: 4px 20px 14px;
  display: flex;
  flex-direction: column;
}

.filter-accordion {
  border-bottom: 1px solid var(--line);
}

.filter-accordion-last {
  border-bottom: 0;
}

.acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 11px 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
}

.acc-trigger:hover .acc-title {
  color: var(--terra);
}

.acc-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 140ms var(--ease-ui);
}

.acc-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.acc-summary {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 185px;
}

.acc-chevron {
  display: block;
  width: 16px;
  height: 16px;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform 220ms var(--ease-ui), color 140ms var(--ease-ui);
}

.acc-trigger[aria-expanded="true"] .acc-chevron {
  transform: rotate(180deg);
  color: var(--ink);
}

.acc-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.filter-section-last {
  padding-bottom: 4px;
  border-bottom: 0;
}

.format-grid-2 {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 8px;
}

.seg-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.format-choice-btn {
  gap: 5px;
  padding: 6px 6px;
  font-size: 12.5px;
}

.choice-btn-icon {
  display: block;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.collapsible-wrap {
  interpolate-size: allow-keywords;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: grid-template-rows 260ms var(--ease-ui), opacity 220ms var(--ease-ui), margin 260ms var(--ease-ui), visibility 260ms var(--ease-ui);
  transition-behavior: allow-discrete;
}

.collapsible-wrap.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.collapsible-inner {
  min-height: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition: transform 260ms var(--ease-ui);
}

.collapsible-wrap.is-open .collapsible-inner {
  transform: translateY(0);
}

.trio-note-wrap:not(.is-open) {
  margin-top: -7px;
}

.trio-note-wrap.is-open {
  margin-top: 2px;
}

.trio-filter-note {
  margin: 0;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.38;
  color: var(--ink-muted);
}

.seg-3,
.age-grid-3 {
  transition: opacity 240ms var(--ease-ui), filter 240ms var(--ease-ui);
}

.is-soft-disabled {
  opacity: 0.46;
  filter: saturate(0.65);
}

.section-label {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.seg-3 {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 6px;
}

.age-row-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.age-row-5 .choice-btn {
  padding-inline: 2px;
  font-size: 12px;
}

.age-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 11px;
}

.topic-chip.is-active::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--chip-dot);
  flex-shrink: 0;
  margin-right: 7px;
}

.choice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 11px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 200ms var(--ease-ui), border-color 200ms var(--ease-ui), color 200ms var(--ease-ui), transform 140ms var(--ease-ui);
}

.choice-btn:hover:not(:disabled) {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.choice-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.choice-btn.is-active,
.choice-btn[aria-checked="true"],
.choice-btn[aria-pressed="true"] {
  background-color: var(--btn-active-bg);
  color: var(--btn-active-ink);
  border-color: var(--btn-active-bg);
  font-weight: 600;
}

.choice-btn.is-active:hover:not(:disabled),
.choice-btn[aria-checked="true"]:hover:not(:disabled),
.choice-btn[aria-pressed="true"]:hover:not(:disabled) {
  background-color: var(--btn-active-hover);
  border-color: var(--btn-active-hover);
}

.tag-input-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.text-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.35;
  transition: border-color 150ms var(--ease-ui), background-color 150ms var(--ease-ui);
}

.text-input::placeholder {
  color: var(--ink-subtle);
}

.text-input:hover {
  border-color: var(--line-hover);
}

.text-input:focus-visible {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 2px var(--terra-soft);
}

.nickname-input {
  flex: 0 0 auto;
  height: 36px;
  min-height: 36px;
  padding: 5px 12px;
}

.text-input.is-invalid {
  border-color: var(--terra);
  box-shadow: 0 0 0 2px var(--terra-soft);
}

.btn-add-tag {
  flex: 0 0 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui);
}

.btn-add-tag:hover {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.quick-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.quick-tag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 200ms var(--ease-ui), border-color 200ms var(--ease-ui), color 200ms var(--ease-ui), transform 140ms var(--ease-ui);
}

.quick-tag-btn:hover {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
  color: var(--ink);
}

.quick-tag-btn:active {
  transform: scale(0.98);
}

.quick-tag-btn.is-active,
.quick-tag-btn[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--terra-border);
  background-color: var(--terra-soft-solid);
  color: var(--terra-ink);
  font-weight: 600;
}

.selected-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

@keyframes tag-pop-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 7px 3px 10px;
  border-radius: 999px;
  background-color: var(--bg-soft);
  border: 1px solid var(--line-control);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  animation: tag-pop-in 200ms var(--ease-ui) both;
}

.tag-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  transition: background-color 140ms var(--ease-ui), color 140ms var(--ease-ui);
}

.tag-remove-btn:hover {
  background-color: var(--bg-hover);
  color: var(--ink);
}

.filters-footer {
  flex: 0 0 auto;
  padding: 10px 20px 14px;
  border-top: 1px solid var(--line);
  background-color: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background-color 220ms var(--ease-ui), border-color 220ms var(--ease-ui);
}

.filters-footer-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filters-footer-btn {
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.mobile-voice-wrap {
  display: none !important;
}

.mobile-voice-wrap:not(.is-open) {
  margin-bottom: -8px;
}

.mobile-voice-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--line);
}

.voice-strip-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.voice-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-panel);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background-color 200ms var(--ease-ui), border-color 200ms var(--ease-ui), color 200ms var(--ease-ui), transform 140ms var(--ease-ui);
}

.voice-mini-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.voice-mini-btn[aria-pressed="true"]:not(.voice-test-btn) {
  background-color: var(--terra-soft-solid);
  border-color: var(--terra-border);
  color: var(--terra-ink);
}

.voice-mini-btn.voice-test-btn[aria-pressed="true"] {
  background-color: var(--pine-soft-solid);
  border-color: var(--pine-border);
  color: var(--pine-text);
}

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--terra-cta-bg);
  background-color: var(--terra-cta-bg);
  color: #FFFFFF;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), transform 110ms var(--ease-ui);
}

.btn-start:hover:not(:disabled) {
  background-color: var(--terra-cta-hover);
  border-color: var(--terra-cta-hover);
}

.btn-start:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-start:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-link-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.text-action-btn {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 140ms var(--ease-ui);
}

.text-action-btn:hover {
  color: var(--terra);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  height: 42px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), transform 110ms var(--ease-ui);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.btn-outline:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-outline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   ПРАВАЯ ОБЛАСТЬ С ФАКТУРНОЙ КАНВОЙ И НАПОЛНЕННЫМ ЛОББИ «ЭФИР СЕЙЧАС»
   ========================================================================== */
.chat-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  transition: background-color 220ms var(--ease-ui);
}

.stage-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

@keyframes stage-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stage-view.is-entering {
  animation: stage-enter 240ms var(--ease-ui) both;
}

@keyframes route-morph {
  0% {
    opacity: 0.52;
    transform: translateY(2px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.is-morphing {
  animation: route-morph 220ms var(--ease-ui);
}

@keyframes num-tick {
  0% {
    opacity: 0.48;
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.is-tick {
  animation: num-tick 220ms var(--ease-ui);
}

.stage-idle {
  overflow-y: auto;
  padding: 24px 28px;
}

.lobby-wrap {
  margin: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tab-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tab-panel.is-entering {
  animation: stage-enter 200ms var(--ease-ui) both;
}

.lobby-hero-card {
  width: min(680px, 100%);
  margin-inline: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: background-color 220ms var(--ease-ui), border-color 220ms var(--ease-ui);
}

.lobby-panel-card {
  margin-inline: auto;
  padding: 22px 24px 24px;
  gap: 14px;
}

.lobby-panel-topics {
  width: min(720px, 100%);
}

.lobby-panel-presets {
  width: min(760px, 100%);
}

.lobby-panel-rules {
  width: min(700px, 100%);
}

.panel-lead-note {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--ink-muted);
}

.lobby-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lobby-mode-group {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
}

.lobby-seg-btn {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12.5px;
  gap: 6px;
  border-color: transparent;
  background-color: transparent;
}

.lobby-seg-btn:hover:not(:disabled):not(.is-active):not([aria-checked="true"]) {
  background-color: var(--bg-soft);
  border-color: transparent;
}

.lobby-voice-wrap:not(.is-open) {
  margin-top: -18px;
}

.lobby-voice-strip-box {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
}

.voice-strip-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.voice-strip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background-color 200ms var(--ease-ui), border-color 200ms var(--ease-ui), color 200ms var(--ease-ui), transform 140ms var(--ease-ui);
}

.voice-strip-btn:hover:not(:disabled) {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.voice-strip-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.voice-strip-btn[aria-pressed="true"]:not(.is-test-btn) {
  background-color: var(--terra-soft-solid);
  border-color: var(--terra-border);
  color: var(--terra-ink);
}

.voice-strip-btn.is-test-btn {
  margin-left: auto;
}

.voice-strip-btn.is-test-btn[aria-pressed="true"] {
  background-color: var(--pine-soft-solid);
  border-color: var(--pine-border);
  color: var(--pine-text);
}

.voice-btn-svg {
  display: block;
  flex-shrink: 0;
}

[aria-pressed="false"] .icon-mic-off,
[aria-pressed="false"] .icon-sound-off {
  display: none;
}

[aria-pressed="true"] .icon-mic-on,
[aria-pressed="true"] .icon-sound-on {
  display: none;
}

.precall-meter-wrap {
  width: 100%;
}

.precall-mic-meter {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.precall-mic-meter-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background-color: var(--pine);
  transition: width 70ms linear, background-color 180ms var(--ease-ui);
}

.lobby-hero-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}

.lobby-subtitle {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.48;
  color: var(--ink-muted);
}

.route-diagram {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 160ms var(--ease-ui), background-color 160ms var(--ease-ui);
}

.route-diagram:hover {
  border-color: var(--line-hover);
}

.route-filters-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), color 140ms var(--ease-ui), transform 110ms var(--ease-ui);
}

.route-filters-btn:hover,
.route-diagram:hover .route-filters-btn {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.route-filters-btn:active {
  transform: scale(0.98);
}

.route-filters-chevron {
  display: block;
  width: 14px;
  height: 14px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.route-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.route-node-peer {
  text-align: right;
  align-items: flex-end;
}

.route-node-kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-subtle);
  line-height: 1.2;
}

.route-node-val {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
}

.route-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  color: var(--terra);
}

.route-line {
  flex: 1 1 4px;
  min-width: 0;
  height: 1px;
  border-top: 1.5px dashed var(--line-control);
}

.route-topic-pill {
  flex: 0 1 auto;
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: 4px 12px;
  border-radius: 999px;
  background-color: var(--terra-soft-solid);
  border: 1px solid var(--terra-border);
  color: var(--terra-ink);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-arrow-svg {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--terra);
}

.lobby-hero-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.stage-cta-btn {
  width: auto;
  min-width: 220px;
  padding-inline: 26px;
}

.lobby-conn-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-subtle);
  white-space: nowrap;
}

.ping-bars {
  display: block;
  width: 16px;
  height: 14px;
  flex-shrink: 0;
}

.ping-bar {
  fill: var(--line-control);
  transition: fill 260ms var(--ease-ui), opacity 260ms var(--ease-ui);
}

.ping-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-subtle);
  transition: color 260ms var(--ease-ui);
}

.ping-widget[data-signal="good"] .ping-bar.is-lit,
.ping-widget[data-signal="fair"] .ping-bar.is-lit {
  fill: var(--pine);
}

.ping-widget[data-signal="good"] .ping-value,
.ping-widget[data-signal="fair"] .ping-value {
  color: var(--pine-text);
}

.ping-widget[data-signal="warn"] .ping-bar.is-lit {
  fill: var(--amber);
}

.ping-widget[data-signal="warn"] .ping-value {
  color: var(--amber-text);
}

.ping-widget[data-signal="poor"] .ping-bar.is-lit {
  fill: var(--terra);
}

.ping-widget[data-signal="poor"] .ping-value {
  color: var(--terra-text);
}

.ping-widget[data-signal="offline"] .ping-value,
.ping-widget[data-signal="pending"] .ping-value {
  color: var(--ink-subtle);
}

.chat-ping-widget {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background-color: var(--bg-card);
  border: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  align-items: stretch;
}

.lobby-card {
  background-color: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.lobby-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.lobby-card-meta {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-subtle);
  white-space: nowrap;
}

.channels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.channel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-control);
  background-color: var(--bg-panel);
  color: var(--ink);
  text-align: left;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), transform 110ms var(--ease-ui);
}

.channel-row:hover {
  background-color: var(--bg-soft);
  border-color: var(--terra-border);
}

.channel-row:active {
  transform: scale(0.99);
}

.channel-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-meter {
  width: 68px;
  height: 5px;
  border-radius: 3px;
  background-color: var(--bg-soft);
  overflow: hidden;
  flex-shrink: 0;
}

.channel-meter-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background-color: var(--terra);
  transition: width 460ms var(--ease-ui);
}

.channel-count {
  min-width: 24px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.channel-arrow {
  display: block;
  width: 14px;
  height: 14px;
  color: var(--ink-subtle);
  flex-shrink: 0;
  transition: color 140ms var(--ease-ui);
}

.channel-row:hover .channel-arrow {
  color: var(--terra);
}

.presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.presets-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preset-card-wide {
  grid-column: 1 / -1;
}

.topics-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.topics-extra-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.topics-extra-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.topics-extra-btn {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 12.5px;
}

.rules-moderation-note {
  margin: 2px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.48;
  color: var(--ink-muted);
}

.rules-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 4px;
}

.preset-card-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 70px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-control);
  background-color: var(--bg-panel);
  text-align: left;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), transform 110ms var(--ease-ui);
}

.preset-card-btn:hover {
  background-color: var(--bg-soft);
  border-color: var(--terra-border);
}

.preset-card-btn:active {
  transform: scale(0.99);
}

.preset-title {
  max-width: 100%;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-desc {
  max-width: 100%;
  font-size: 12.5px;
  font-weight: 450;
  color: var(--ink-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   ЭКРАН УСТАНОВКИ СВЯЗИ (РАДИОВОЛНА И ОЧЕРЕДЬ)
   ========================================================================== */
.stage-search {
  overflow-y: auto;
  padding: 24px 28px;
}

.search-card {
  margin: auto;
  width: min(520px, 100%);
  background-color: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.radar-beacon {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.radar-wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--terra);
  opacity: 0;
  animation: radar-ring 2.6s var(--ease-ui) infinite;
}

.radar-wave-2 {
  border-color: var(--pine);
  animation-delay: 1.3s;
}

.radar-core {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--terra-soft-solid);
  border: 1px solid var(--terra-border);
  color: var(--terra);
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-core svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@keyframes radar-ring {
  0% {
    transform: scale(0.65);
    opacity: 0.72;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

.search-head-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.search-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.search-timer {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 650;
  color: var(--pine-text);
}

.params-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 11px;
  border-radius: 999px;
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-muted);
}

.summary-chip strong {
  color: var(--ink);
  font-weight: 600;
  margin-left: 5px;
}

.search-timeout-hint {
  margin: 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

/* ==========================================================================
   ЭКРАН ДИАЛОГА (УЮТНЫЙ ВЕБ-МЕССЕНДЖЕР ПОВЕРХ ФАКТУРНОЙ КАНВЫ)
   ========================================================================== */
.stage-view[hidden],
.chat-topbar[hidden] {
  display: none;
}

.stage-chat {
  width: min(820px, calc(100% - 48px));
  margin: 18px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background-color: var(--bg-canvas);
  overflow: hidden;
}

.chat-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 22px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
}

.chat-peer-side {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-peer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-status-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.peer-status {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peer-status.is-typing {
  color: var(--pine-text);
}

.peer-status.is-ended {
  color: var(--ink-muted);
}

.chat-sep {
  color: var(--ink-subtle);
}

.chat-timer {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-muted);
}

.chat-topic-line {
  font-size: 12.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.btn-top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), color 140ms var(--ease-ui);
}

.btn-top-action:hover:not(:disabled) {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.btn-top-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-top-action.is-terra {
  color: var(--terra-text);
  border-color: var(--terra-border);
}

.btn-top-action.is-terra:hover:not(:disabled) {
  background-color: var(--terra-soft);
  border-color: var(--terra);
}

.btn-top-action.is-confirming {
  background-color: var(--terra-cta-bg);
  color: #FFFFFF;
  border-color: var(--terra-cta-bg);
}

.btn-top-action.is-confirming:hover:not(:disabled) {
  background-color: var(--terra-cta-hover);
  border-color: var(--terra-cta-hover);
}

.btn-top-action.mobile-only-btn,
.btn-outline.mobile-only-btn,
.mobile-only-btn {
  display: none;
}

.stage-chat.is-voice-room {
  background-color: var(--bg-card);
}

.stage-chat.is-voice-room.is-voice-chat-open .chat-feed-wrap {
  background-color: var(--bg-canvas);
  background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px);
  background-size: 22px 22px;
}

.stage-chat.is-voice-room.is-room-active .chat-topbar {
  background-color: transparent;
  padding: 10px 20px;
}

.stage-chat.is-voice-room.is-room-active .chat-status-row {
  display: none;
}

.stage-chat.is-voice-room.is-room-active .chat-topic-line {
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-muted);
}

.stage-chat.is-voice-room.is-room-active .chat-top-actions {
  display: none;
}

.stage-chat.is-voice-room:not(.is-voice-chat-open) .chat-feed-wrap,
.stage-chat.is-voice-room:not(.is-voice-chat-open) .chat-compose-bar {
  display: none;
}

.voice-stage-deck {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 20px;
  background-color: var(--bg-card);
  transition: padding 220ms var(--ease-ui), background-color 220ms var(--ease-ui);
}

.voice-call-stage {
  margin: auto;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.voice-call-timer {
  font-family: var(--font-sans);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
}

.stage-chat.is-voice-room.is-room-ended .voice-call-timer {
  color: var(--ink-muted);
}

.voice-self-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 32px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background-color: var(--bg-panel);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.2;
  transition: border-color 200ms var(--ease-ui), background-color 200ms var(--ease-ui), color 200ms var(--ease-ui);
}

.voice-self-pill[data-state="speaking"] {
  border-color: var(--terra-border);
  background-color: var(--terra-soft);
  color: var(--terra-ink);
}

.voice-self-pill[data-state="muted"],
.voice-self-pill[data-state="deafened"] {
  border-color: var(--terra-border);
  background-color: var(--terra-soft-solid);
  color: var(--terra-ink);
}

.voice-self-meter {
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background-color: var(--bg-soft);
  overflow: hidden;
  flex-shrink: 0;
}

.voice-self-meter-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background-color: var(--terra);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

.voice-self-pill[data-state="muted"] .voice-self-meter-fill,
.voice-self-pill[data-state="ended"] .voice-self-meter-fill {
  opacity: 0.2;
}

.voice-context-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.voice-context-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line-control);
  background-color: var(--bg-panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui), color 140ms var(--ease-ui), transform 110ms var(--ease-ui);
}

.voice-context-btn:hover:not(:disabled) {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.voice-context-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.voice-context-btn.is-terra {
  background-color: var(--terra-soft-solid);
  border-color: var(--terra-border);
  color: var(--terra-ink);
}

.voice-context-btn.is-terra:hover:not(:disabled) {
  background-color: var(--terra-soft);
  border-color: var(--terra);
}

.voice-cards-grid {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
}

.voice-cards-grid[data-count="2"] {
  gap: 36px;
}

.voice-caller-orb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-width: 0;
  max-width: 260px;
  text-align: center;
  transition: opacity 240ms var(--ease-ui);
}

.voice-cards-grid[data-count="2"] .voice-caller-orb-wrap {
  gap: 24px;
}

.voice-caller-orb-wrap.is-left {
  opacity: 0.54;
}

.voice-orb-stage {
  --amp: 0;
  position: relative;
  width: 116px;
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voice-cards-grid[data-count="2"] .voice-orb-stage {
  width: 88px;
  height: 88px;
}

.voice-halo-outer,
.voice-halo-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity 260ms var(--ease-ui), background-color 220ms var(--ease-ui), border-color 220ms var(--ease-ui);
}

.voice-halo-inner {
  z-index: 1;
  background-color: var(--pine-soft);
  border: 1px solid var(--pine-border);
  opacity: 0;
  transform: scale(calc(1 + var(--amp, 0) * 0.14));
}

.voice-halo-outer {
  z-index: 0;
  background-color: var(--pine-soft);
  border: 1px solid var(--pine-border);
  opacity: 0;
  transform: scale(calc(1 + var(--amp, 0) * 0.24));
}

.voice-caller-orb-wrap.is-speaking .voice-halo-inner {
  opacity: calc(0.42 + var(--amp, 0) * 0.45);
  transform: scale(calc(1.04 + var(--amp, 0) * 0.14));
}

.voice-caller-orb-wrap.is-speaking .voice-halo-outer {
  opacity: calc(0.22 + var(--amp, 0) * 0.32);
  transform: scale(calc(1.08 + var(--amp, 0) * 0.24));
}

.voice-caller-orb {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--bg-soft);
  border: 1px solid var(--line-control);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 220ms var(--ease-ui), border-color 220ms var(--ease-ui), color 220ms var(--ease-ui);
}

.voice-caller-orb-wrap.is-speaking .voice-caller-orb {
  background-color: var(--pine-soft-solid);
  border-color: var(--pine-border);
  color: var(--pine-text);
}

.voice-caller-orb-wrap.is-failed .voice-caller-orb {
  background-color: var(--terra-soft-solid);
  border-color: var(--terra-border);
  color: var(--terra-ink);
}

.voice-caller-silhouette {
  display: block;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.voice-cards-grid[data-count="2"] .voice-caller-silhouette {
  width: 34px;
  height: 34px;
}

.voice-caller-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.voice-caller-name {
  max-width: 100%;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-cards-grid[data-count="2"] .voice-caller-name {
  font-size: 17px;
}

.voice-caller-status {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-muted);
  white-space: nowrap;
}

.voice-caller-orb-wrap.is-speaking .voice-caller-status {
  color: var(--pine-text);
  font-weight: 600;
}

.voice-caller-orb-wrap.is-failed .voice-caller-status {
  color: var(--terra-text);
}

.voice-card-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 4px;
}

.voice-card-badges:empty {
  display: none;
}

.voice-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background-color: var(--terra-soft-solid);
  border: 1px solid var(--terra-border);
  color: var(--terra-ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-stage-deck {
  flex: 0 0 auto;
  overflow: visible;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg-panel);
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-call-stage {
  margin: 0;
  max-width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-cards-grid {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-caller-orb-wrap {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  max-width: none;
  text-align: left;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-orb-stage {
  width: 40px;
  height: 40px;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-caller-silhouette {
  width: 20px;
  height: 20px;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-caller-meta {
  align-items: flex-start;
  text-align: left;
  gap: 1px;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-caller-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-caller-status {
  font-size: 12px;
  line-height: 1.2;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-card-badges {
  margin-top: 2px;
  justify-content: flex-start;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-call-timer {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-left: auto;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-self-pill {
  display: none;
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-context-actions {
  width: 100%;
  justify-content: flex-start;
}

.voice-audio-sink {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.stage-chat.is-voice-room.is-voice-chat-open .chat-feed-wrap {
  min-height: 180px;
  animation: stage-enter 240ms var(--ease-ui) both;
}

.stage-chat.is-voice-room.is-voice-chat-open .chat-compose-bar {
  animation: stage-enter 240ms var(--ease-ui) both;
}

.voice-control-dock {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 16px 22px;
  padding: 12px 20px 24px;
  background-color: transparent;
  transition: background-color 220ms var(--ease-ui), border-color 220ms var(--ease-ui);
}

.stage-chat.is-voice-room.is-voice-chat-open .voice-control-dock {
  background-color: var(--bg-panel);
  border-top: 1px solid var(--line);
  padding: 12px 18px 14px;
}

.voice-dock-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-width: 66px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  transition: opacity 160ms var(--ease-ui), color 160ms var(--ease-ui);
}

.voice-dock-btn:focus-visible {
  outline: none;
}

.voice-dock-btn:focus-visible .voice-dock-circle {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
}

.voice-dock-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-dock-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  transition: background-color 180ms var(--ease-ui), border-color 180ms var(--ease-ui), color 180ms var(--ease-ui), transform 130ms var(--ease-ui), box-shadow 180ms var(--ease-ui);
}

.voice-dock-btn:hover:not(:disabled) .voice-dock-circle {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.voice-dock-btn:active:not(:disabled) .voice-dock-circle {
  transform: scale(0.95);
}

.voice-dock-label {
  font-size: 12px;
  font-weight: 550;
  line-height: 1.2;
  color: var(--ink-muted);
  white-space: nowrap;
  text-align: center;
  transition: color 160ms var(--ease-ui);
}

.voice-dock-btn:hover:not(:disabled) .voice-dock-label {
  color: var(--ink);
}

.voice-dock-btn[aria-pressed="true"]:not(#call-toggle-chat-btn) .voice-dock-circle {
  background-color: var(--terra-soft-solid);
  border-color: var(--terra-border);
  color: var(--terra-ink);
}

.voice-dock-btn[aria-pressed="true"]:not(#call-toggle-chat-btn) .voice-dock-label {
  color: var(--terra-text);
  font-weight: 600;
}

#call-toggle-chat-btn[aria-pressed="true"] .voice-dock-circle {
  background-color: var(--btn-active-bg);
  border-color: var(--btn-active-bg);
  color: var(--btn-active-ink);
}

#call-toggle-chat-btn[aria-pressed="true"] .voice-dock-label {
  color: var(--ink);
  font-weight: 650;
}

.voice-dock-btn.is-report .voice-dock-circle {
  color: var(--ink-muted);
}

.voice-dock-btn.is-report:hover:not(:disabled) .voice-dock-circle {
  color: var(--terra-text);
  border-color: var(--terra-border);
  background-color: var(--terra-soft);
}

.voice-dock-btn.is-end .voice-dock-circle {
  background-color: var(--terra-cta-bg);
  border-color: var(--terra-cta-bg);
  color: #FFFFFF;
}

.voice-dock-btn.is-end:hover:not(:disabled) .voice-dock-circle {
  background-color: var(--terra-cta-hover);
  border-color: var(--terra-cta-hover);
}

.voice-dock-btn.is-confirming .voice-dock-circle {
  background-color: var(--terra-cta-bg);
  border-color: var(--terra-cta-bg);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px var(--terra-soft);
}

.voice-dock-btn.is-confirming .voice-dock-label {
  color: var(--terra-text);
  font-weight: 650;
}

.voice-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background-color: var(--terra-cta-bg);
  border: 2px solid var(--bg-card);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.chat-feed-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background-color: transparent;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@keyframes msg-pop-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-system {
  align-self: center;
  max-width: 86%;
  padding: 5px 14px;
  border-radius: 999px;
  background-color: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.4;
  animation: msg-pop-in 200ms var(--ease-ui) both;
}

.typing-indicator {
  flex: 0 0 auto;
  padding: 6px 28px 9px;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.3;
  color: var(--pine-text);
  background-color: var(--bg-panel);
  border-top: 1px solid var(--line);
}

.typing-indicator[hidden] {
  display: none;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: min(560px, 74%);
  animation: msg-pop-in 200ms var(--ease-ui) both;
}

.msg-row.is-me {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-row.is-peer {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble {
  padding: 10px 14px 8px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(23, 22, 20, 0.04);
  transition: background-color 220ms var(--ease-ui), border-color 220ms var(--ease-ui);
}

.msg-author {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--ink-muted);
}

.msg-row.is-peer-2 .msg-author {
  color: var(--terra-text);
}

.msg-row.is-peer-2 .msg-bubble {
  border-color: var(--terra-border);
}

.msg-row.is-peer-3 .msg-author {
  color: var(--pine-text);
}

.msg-row.is-peer-3 .msg-bubble {
  border-color: var(--pine-border);
}

.msg-row.is-me .msg-bubble {
  background-color: var(--msg-me-bg);
  border: 1px solid var(--msg-me-border);
  color: var(--msg-me-ink);
  border-bottom-right-radius: 4px;
}

.msg-row.is-peer .msg-bubble {
  background-color: var(--msg-peer-bg);
  color: var(--msg-peer-ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.msg-text {
  margin: 0;
}

.msg-time {
  align-self: flex-end;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 12px;
  line-height: 1;
  color: var(--ink-subtle);
}

.scroll-bottom-btn {
  position: absolute;
  right: 22px;
  bottom: 14px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui);
}

.scroll-bottom-btn:hover {
  background-color: var(--bg-soft);
  border-color: var(--line-hover);
}

.chat-compose-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 22px;
  background-color: var(--bg-panel);
  border-top: 1px solid var(--line);
}

.chat-textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 124px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-control);
  background-color: var(--bg-card);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  transition: border-color 150ms var(--ease-ui), background-color 150ms var(--ease-ui);
}

.chat-textarea::placeholder {
  color: var(--ink-subtle);
}

.chat-textarea:hover {
  border-color: var(--line-hover);
}

.chat-textarea:focus-visible {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 2px var(--terra-soft);
}

.btn-send {
  height: 44px;
  min-height: 44px;
  padding: 0 20px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--terra-cta-bg);
  background-color: var(--terra-cta-bg);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-ui), border-color 140ms var(--ease-ui);
}

.btn-send:hover:not(:disabled) {
  background-color: var(--terra-cta-hover);
  border-color: var(--terra-cta-hover);
}

.btn-send:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.chat-ended-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background-color: var(--bg-panel);
  border-top: 1px solid var(--line);
}

.ended-primary-btn {
  width: auto;
  flex: 1 1 200px;
  height: 42px;
  min-height: 42px;
}

/* ==========================================================================
   МОДАЛЬНЫЕ ОКНА (<dialog>) И ТОСТЫ
   ========================================================================== */
dialog.modal-dialog {
  margin: auto;
  width: min(500px, calc(100vw - 28px));
  max-height: calc(100dvh - 36px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  overflow: auto;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 220ms var(--ease-ui), transform 220ms var(--ease-ui), display 220ms allow-discrete, overlay 220ms allow-discrete;
}

dialog.modal-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  dialog.modal-dialog[open] {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

dialog.modal-dialog:modal {
  overscroll-behavior: contain;
}

dialog.modal-dialog::backdrop {
  background-color: var(--backdrop-bg);
  overflow: hidden;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity 220ms var(--ease-ui), display 220ms allow-discrete, overlay 220ms allow-discrete;
}

dialog.modal-dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog.modal-dialog[open]::backdrop {
    opacity: 0;
  }
}

.dialog-panel {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dialog-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--terra-text);
  margin-bottom: 3px;
}

.dialog-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.icon-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background-color: var(--bg-panel);
  color: var(--ink-muted);
  flex-shrink: 0;
}

.icon-close-btn:hover {
  background-color: var(--bg-soft);
  color: var(--ink);
}

.rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rules-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.rules-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background-color: var(--terra-soft-solid);
  color: var(--terra-ink);
  font-size: 13px;
  font-weight: 700;
}

.rules-body strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 2px;
}

.rules-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.report-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.report-target-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.target-chip-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-control);
  background-color: var(--bg-panel);
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms var(--ease-ui), background-color 180ms var(--ease-ui), color 180ms var(--ease-ui);
}

.target-chip-option:hover {
  border-color: var(--line-hover);
}

.target-chip-option:has(input:checked) {
  border-color: var(--terra);
  background-color: var(--terra-soft-solid);
  color: var(--terra-ink);
  font-weight: 600;
}

.target-chip-option input {
  margin: 0;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.report-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-control);
  background-color: var(--bg-panel);
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms var(--ease-ui), background-color 140ms var(--ease-ui);
}

.radio-option:hover {
  border-color: var(--line-hover);
}

.radio-option:has(input:checked) {
  border-color: var(--terra);
  background-color: var(--terra-soft-solid);
}

.radio-option input {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
}

.checkbox-option input {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.report-comment {
  width: 100%;
  min-height: 68px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-control);
  background-color: var(--bg-panel);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.4;
  resize: vertical;
}

.report-comment:focus-visible {
  outline: none;
  border-color: var(--terra);
  background-color: var(--bg-card);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dialog-confirm-btn {
  width: auto;
  min-width: 124px;
  height: 42px;
  min-height: 42px;
}

.dialog-submit-terra {
  width: auto;
  height: 42px;
  min-height: 42px;
  background-color: var(--terra-cta-bg);
  border-color: var(--terra-cta-bg);
  color: #FFFFFF;
}

.dialog-submit-terra:hover:not(:disabled) {
  background-color: var(--terra-cta-hover);
  border-color: var(--terra-cta-hover);
}

dialog.modal-dialog.captcha-dialog {
  width: min(460px, calc(100vw - 24px));
  background-color: #13110F;
  background-image:
    linear-gradient(rgba(98, 207, 158, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 90, 54, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid rgba(224, 90, 54, 0.46);
  outline: 1px solid rgba(98, 207, 158, 0.22);
  outline-offset: -4px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.56);
  color: #F2ECE1;
}

dialog.modal-dialog.captcha-dialog.is-locked {
  border-color: rgba(224, 90, 54, 0.68);
  outline-color: rgba(224, 90, 54, 0.28);
}

.captcha-panel {
  position: relative;
  gap: 14px;
  padding: 22px 24px 24px;
}

.captcha-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #E05A36 0%, #62CF9E 100%);
  pointer-events: none;
}

.captcha-head-copy {
  min-width: 0;
}

@keyframes captcha-beacon-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.42;
    transform: scale(0.84);
  }
}

.captcha-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: #6CE8AE;
  margin-bottom: 5px;
}

.captcha-status-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #6CE8AE;
  flex-shrink: 0;
  animation: captcha-beacon-pulse 1.8s ease-in-out infinite;
}

dialog.modal-dialog.captcha-dialog.is-locked .captcha-status-tag {
  color: #FA9F83;
}

dialog.modal-dialog.captcha-dialog.is-locked .captcha-status-beacon {
  background-color: #E05A36;
}

.captcha-title {
  color: #F2ECE1;
  font-size: 19px;
  line-height: 1.25;
}

.captcha-close-btn {
  background-color: #1D1A16;
  border-color: #3E372F;
  color: #C2BBB0;
}

.captcha-close-btn:hover {
  background-color: #2A2520;
  border-color: #625A4D;
  color: #F2ECE1;
}

.captcha-reason-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.48;
  color: #D1C9BC;
}

.captcha-active-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.captcha-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.captcha-attempts-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  background-color: #1D1A16;
  border: 1px solid #3E372F;
  color: #EFE8DC;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}

.captcha-attempts-badge.is-low {
  background-color: #2E1B16;
  border-color: rgba(224, 90, 54, 0.56);
  color: #F8D3C8;
}

.captcha-refresh-btn {
  flex: 0 0 auto;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-xs);
  border-color: #4A4339;
  background-color: #1D1A16;
  color: #F2ECE1;
  font-size: 12.5px;
  font-weight: 600;
}

.captcha-refresh-btn:hover:not(:disabled) {
  background-color: #2A2520;
  border-color: #62CF9E;
  color: #6CE8AE;
}

.captcha-refresh-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.captcha-noise-frame {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  background-color: #11100E;
  border: 1px solid rgba(98, 207, 158, 0.36);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}

.captcha-noise-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.16) 2px,
    rgba(0, 0, 0, 0.16) 3px
  );
  z-index: 2;
}

.captcha-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #62CF9E;
  border-style: solid;
  border-width: 0;
  pointer-events: none;
  z-index: 3;
}

.captcha-corner.tl {
  top: 6px;
  left: 6px;
  border-top-width: 2px;
  border-left-width: 2px;
}

.captcha-corner.tr {
  top: 6px;
  right: 6px;
  border-top-width: 2px;
  border-right-width: 2px;
}

.captcha-corner.bl {
  bottom: 6px;
  left: 6px;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.captcha-corner.br {
  bottom: 6px;
  right: 6px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.captcha-noise-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 200 / 72;
  height: auto;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  background-color: #11100E;
}

.captcha-hint-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #BDB5A8;
}

.captcha-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.captcha-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.captcha-code-input {
  width: 100%;
  height: 46px;
  min-height: 46px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #4A4339;
  background-color: #1A1714;
  color: #F2ECE1;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  text-align: center;
  text-transform: uppercase;
}

.captcha-code-input::placeholder {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 450;
  letter-spacing: normal;
  text-indent: 0;
  text-transform: none;
  color: #A8A093;
}

.captcha-code-input:hover {
  border-color: #6B6153;
}

.captcha-code-input:focus-visible {
  outline: 2px solid #62CF9E;
  outline-offset: 2px;
  border-color: #62CF9E;
  box-shadow: none;
}

.captcha-submit-btn {
  width: auto;
  min-width: 144px;
  height: 46px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  background-color: #C84B28;
  border-color: #C84B28;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 650;
}

.captcha-submit-btn:hover:not(:disabled) {
  background-color: #E05A36;
  border-color: #E05A36;
}

.captcha-lockout-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px 18px;
  border-radius: var(--radius-sm);
  background-color: #1C1513;
  border: 1px solid rgba(224, 90, 54, 0.46);
}

.captcha-lockout-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-xs);
  background-color: #2E1B16;
  border: 1px solid rgba(224, 90, 54, 0.48);
  color: #F8D3C8;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.captcha-lockout-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #EFE8DC;
}

.captcha-lockout-timer {
  padding: 10px 18px;
  border-radius: var(--radius-xs);
  background-color: #11100E;
  border: 1px solid rgba(224, 90, 54, 0.36);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #FA9F83;
}

@keyframes captchaShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}

.captcha-error-text {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(224, 90, 54, 0.52);
  background-color: #2B1813;
  color: #F8D3C8;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
}

.captcha-error-text.is-shaking {
  animation: captchaShake 320ms var(--ease-ui);
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  background-color: var(--toast-bg);
  color: var(--toast-ink);
  border: 1px solid var(--toast-border);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: var(--shadow-float);
}

/* ==========================================================================
   СКРОЛЛБАРЫ (WEBKIT FALLBACK), ДОСТУПНОСТЬ И ПЕЧАТЬ
   ========================================================================== */
@supports not (scrollbar-color: auto) {
  .chat-messages,
  .chat-textarea,
  .filters-scroll {
    scrollbar-width: auto;
  }

  .chat-messages::-webkit-scrollbar,
  .chat-textarea::-webkit-scrollbar,
  .filters-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .chat-messages::-webkit-scrollbar-thumb,
  .chat-textarea::-webkit-scrollbar-thumb,
  .filters-scroll::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
  }

  .chat-messages::-webkit-scrollbar-track,
  .chat-textarea::-webkit-scrollbar-track,
  .filters-scroll::-webkit-scrollbar-track {
    background-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-beacon .beacon-ring,
  .hdr-session-dot,
  .radar-wave,
  .captcha-status-beacon,
  .captcha-error-text.is-shaking,
  .stage-view.is-entering,
  .tab-panel.is-entering,
  .is-morphing,
  .is-tick,
  .tag-pill,
  .msg-system,
  .msg-row,
  .stage-chat.is-voice-room.is-voice-chat-open .chat-feed-wrap,
  .stage-chat.is-voice-room.is-voice-chat-open .chat-compose-bar {
    animation: none;
  }

  body,
  .site-header,
  .nav-tab-btn,
  .hdr-session-pill,
  .filters-backdrop,
  .filters-pane,
  .filters-footer,
  .acc-title,
  .acc-chevron,
  .chat-pane,
  .lobby-hero-card,
  .route-diagram,
  .route-filters-btn,
  .hdr-btn,
  .choice-btn,
  .text-input,
  .chat-textarea,
  .btn-start,
  .btn-outline,
  .btn-add-tag,
  .quick-tag-btn,
  .tag-remove-btn,
  .text-action-btn,
  .btn-top-action,
  .btn-send,
  .icon-close-btn,
  .radio-option,
  .target-chip-option,
  .scroll-bottom-btn,
  .channel-row,
  .channel-meter-fill,
  .channel-arrow,
  .preset-card-btn,
  .collapsible-wrap,
  .collapsible-inner,
  .seg-3,
  .age-grid-3,
  .ping-bar,
  .ping-value,
  .voice-strip-btn,
  .voice-mini-btn,
  .precall-mic-meter-fill,
  .voice-stage-deck,
  .voice-call-stage,
  .voice-caller-orb-wrap,
  .voice-caller-orb,
  .voice-halo-inner,
  .voice-halo-outer,
  .voice-self-pill,
  .voice-context-btn,
  .voice-dock-btn,
  .voice-dock-circle,
  .voice-dock-label,
  .msg-bubble,
  dialog.modal-dialog,
  dialog.modal-dialog::backdrop {
    transition: none;
  }

  .voice-caller-orb-wrap.is-speaking .voice-halo-inner {
    transform: scale(1.1);
    opacity: 0.55;
  }

  .voice-caller-orb-wrap.is-speaking .voice-halo-outer {
    transform: scale(1.2);
    opacity: 0.28;
  }
}

@media (prefers-contrast: more) {
  :root,
  html[data-theme="light"] {
    --line: #8A8275;
    --line-control: #524B42;
    --ink-muted: #2C2925;
  }

  html[data-theme="dark"] {
    --line: #4F493F;
    --line-control: #8F877B;
    --ink-muted: #EDE9E0;
  }
}

@media (forced-colors: active) {
  .choice-btn.is-active,
  .choice-btn[aria-checked="true"],
  .choice-btn[aria-pressed="true"],
  .btn-start,
  .btn-send {
    border: 2px solid Highlight;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm 16mm;
  }

  html,
  body,
  .app-shell,
  .workspace-grid,
  .chat-pane,
  .stage-chat,
  .chat-feed-wrap {
    width: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    overflow: visible !important;
    display: block !important;
    background: #FFFFFF !important;
    background-image: none !important;
    color: #171614 !important;
    font-size: 11pt;
  }

  .site-header,
  .filters-backdrop,
  .filters-pane,
  .stage-idle,
  .stage-search,
  .chat-top-actions,
  .chat-ping-widget,
  .voice-stage-deck,
  .voice-control-dock,
  .chat-compose-bar,
  .chat-ended-bar,
  .typing-indicator,
  .scroll-bottom-btn,
  .toast-region,
  .modal-dialog,
  .mobile-only-btn {
    display: none !important;
  }

  .chat-topbar {
    background: #FFFFFF !important;
    border-bottom: 0.75pt solid #CFC7B8;
    padding: 0 0 8pt;
    margin-bottom: 10pt;
  }

  .chat-messages {
    overflow: visible;
    padding: 0;
  }

  .msg-bubble {
    border: 0.75pt solid #CFC7B8;
    background: #FFFFFF !important;
    color: #171614 !important;
    font-size: 10.5pt;
    box-shadow: none;
  }

  .msg-time {
    color: #5A544C !important;
    font-size: 9pt;
  }
}

/* ==========================================================================
   АДАПТИВНЫЕ БРЕЙКПОИНТЫ (1120PX, 900PX, 640PX, 540PX, 420PX, POINTER COARSE)
   ========================================================================== */
@media (max-width: 1120px) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-inline: 16px;
    gap: 12px;
  }

  .nav-tab-btn {
    padding: 0 11px;
  }
}

@media (max-width: 900px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  .site-header {
    flex: 0 0 auto;
    height: auto;
    min-height: 96px;
  }

  .header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 54px 42px;
    padding-inline: 0;
    gap: 0;
  }

  .brand-group {
    grid-column: 1;
    grid-row: 1;
    padding-left: 14px;
  }

  .brand-word {
    font-size: 17px;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    padding-right: 12px;
    gap: 6px;
  }

  .header-nav-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 42px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: stretch;
  }

  .nav-tablist {
    width: 100%;
    justify-content: space-around;
    gap: 0;
    padding-inline: 4px;
  }

  .nav-tab-btn {
    padding: 0 8px;
    font-size: 13px;
  }

  .live-pill {
    height: 34px;
    min-height: 34px;
    padding: 0 9px;
    font-size: 12.5px;
    gap: 5px;
  }

  .online-suffix {
    display: none;
  }

  .hdr-btn {
    padding: 0 10px;
    font-size: 12.5px;
    height: 34px;
    min-height: 34px;
  }

  .hdr-icon-btn {
    width: 34px;
    min-width: 34px;
    padding: 0;
  }

  .hdr-session-pill {
    height: 34px;
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }

  .workspace-grid {
    height: calc(100dvh - 96px);
  }

  .filters-backdrop {
    top: 0;
    z-index: 49;
  }

  .filters-pane {
    inset-block-start: 0;
    z-index: 50;
    width: min(392px, 100vw);
    border-right: 1px solid var(--line);
    height: 100dvh;
  }

  .filters-pane-head {
    padding: 13px 16px 10px;
  }

  .filters-scroll {
    padding: 4px 16px 14px;
  }

  .filters-footer {
    padding: 12px 16px 14px;
  }

  .voice-strip-btn.is-test-btn {
    margin-left: 0;
    flex: 1 1 100%;
  }

  .stage-chat {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .voice-stage-deck {
    padding: 20px 16px;
  }

  .stage-chat.is-voice-room.is-voice-chat-open .voice-stage-deck {
    padding: 10px 14px;
  }

  .voice-control-dock {
    gap: 14px 20px;
    padding: 12px 16px 20px;
  }

  .stage-chat.is-voice-room.is-voice-chat-open .voice-control-dock {
    padding: 10px 14px 14px;
  }

  .stage-chat.is-voice-room.is-room-active .chat-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
  }

  .stage-chat.is-voice-room.is-room-active .chat-peer-side {
    flex-direction: row;
    align-items: center;
  }

  .btn-top-action.mobile-only-btn:not([hidden]),
  .btn-outline.mobile-only-btn:not([hidden]),
  .mobile-only-btn:not([hidden]) {
    display: inline-flex;
  }

  .stage-idle,
  .stage-search {
    padding: 18px 14px;
  }

  .lobby-hero-card,
  .lobby-panel-card {
    padding: 18px 16px;
  }

  .lobby-title {
    font-size: 22px;
  }

  .route-diagram {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .route-node-peer {
    text-align: left;
    align-items: flex-start;
  }

  .route-node-val {
    max-width: 100%;
  }

  .route-bridge {
    justify-content: flex-start;
  }

  .route-line {
    display: none;
  }

  .route-filters-btn {
    width: 100%;
    justify-content: center;
    min-height: 38px;
    height: 38px;
  }

  .stage-cta-btn,
  .search-actions .btn-outline {
    width: 100%;
  }

  .search-card {
    padding: 24px 18px;
  }

  .chat-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 10px 14px;
  }

  .chat-peer-side {
    width: 100%;
  }

  .chat-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .chat-top-actions .btn-top-action {
    padding: 0 6px;
    font-size: 12.5px;
  }

  .chat-messages {
    padding: 14px 14px;
  }

  .typing-indicator {
    padding: 6px 14px 9px;
  }

  .msg-row {
    max-width: 86%;
  }

  .chat-compose-bar {
    padding: 10px 14px;
  }

  .btn-send {
    padding: 0 16px;
  }

  .chat-ended-bar {
    padding: 10px 14px;
  }

  .chat-ended-bar .btn-start,
  .chat-ended-bar .btn-outline {
    flex: 1 1 100%;
  }

  .toast-region {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .presets-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .preset-card-wide {
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  .voice-cards-grid[data-count="2"] {
    gap: 24px;
  }

  .voice-cards-grid[data-count="2"] .voice-caller-orb-wrap {
    max-width: 156px;
  }

  .voice-call-timer {
    font-size: 30px;
  }

  .stage-chat.is-voice-room.is-voice-chat-open .voice-cards-grid {
    gap: 10px 14px;
  }

  .stage-chat.is-voice-room.is-voice-chat-open .voice-cards-grid[data-count="2"] .voice-caller-orb-wrap {
    max-width: none;
  }

  .voice-control-dock {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    gap: 14px 20px;
    padding: 12px 14px 20px;
  }

  .voice-dock-circle {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 540px) {
  .site-header:has(#header-session-pill:not([hidden])) .live-pill,
  .site-header.has-session-pill .live-pill {
    display: none;
  }

  .site-header:has(#header-session-pill:not([hidden])) .hdr-filters-label,
  .site-header.has-session-pill .hdr-filters-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .site-header:has(#header-session-pill:not([hidden])) .hdr-filters-btn,
  .site-header.has-session-pill .hdr-filters-btn {
    padding: 0 8px;
  }

  .captcha-panel {
    padding: 18px 16px 20px;
  }

  .captcha-input-group {
    grid-template-columns: minmax(0, 1fr);
  }

  .captcha-submit-btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-group {
    padding-left: 10px;
  }

  .header-actions {
    padding-right: 10px;
    gap: 5px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .brand-word {
    font-size: 16px;
  }

  .nav-tab-btn {
    padding: 0 6px;
    font-size: 12.5px;
  }

  .age-row-5 .choice-btn {
    padding-inline: 3px;
    font-size: 12px;
  }

  .topic-chip {
    padding: 6px 10px;
    font-size: 12.5px;
  }
}

@media (max-width: 365px) {
  .hdr-filters-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .hdr-filters-btn {
    padding: 0 8px;
  }
}

@media (pointer: coarse) {
  .text-input,
  .chat-textarea,
  .report-comment {
    font-size: 16px;
  }

  .choice-btn {
    min-height: 40px;
  }

  .voice-context-btn {
    min-height: 40px;
    height: 40px;
  }
}
