/*
 * ВИЗУАЛЬНЫЕ СТИЛИ CONFERENCE MANAGER.
 * ВАЖНО ДЛЯ ПОДДЕРЖКИ: новые override-правила добавляйте только после проверки существующего селектора.
 * В файле есть desktop/tablet/mobile media queries; случайный общий selector может затронуть login/admin/manager одновременно.
 */

/* Цветовая палитра приложения. Не менять фирменные цвета без согласования. */
:root {
  --primary: #002179;
  --secondary: #0c349e;
  --error: #d30410;
  --success: #15803d;
  --surface: #ffffff;
  --surface-low: #f8f9fb;
  --surface-container: #f0f1f5;
  --surface-high: #e8e9ed;
  --outline: #c3c6d7;
  --outline-variant: #dfe0e4;
  --text: #111111;
  --text-soft: #4a4a4a;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Oswald", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--surface); color: var(--text); font-family: var(--font-sans); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 256px; background: var(--primary); color: white; display: flex; flex-direction: column; flex: 0 0 256px; min-height: 100vh; position: sticky; top: 0; }
.brand { height: 64px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.2); }
.brand img { width: 34px; height: 34px; }
.brand-text, .top-title { font-family: var(--font-display); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.brand-text { font-size: 15px; }
.sidebar-close { margin-left: auto; display: none !important; }
.nav-list { padding: 10px 8px; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; color: rgba(255,255,255,.7); background: transparent; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-size: 14px; text-align: left; border-left: 4px solid transparent; transition: .15s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.1); }
.nav-item.active { color: white; background: rgba(255,255,255,.1); border-left-color: var(--error); }
.nav-item .material-symbols-outlined { font-size: 21px; }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.2); }
.server-box { padding: 12px; background: rgba(255,255,255,.08); }
.server-label { font: 600 10px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.55); margin-bottom: 8px; }
.server-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.server-sub { margin-top: 5px; color: rgba(255,255,255,.5); font: 10px var(--font-mono); text-transform: uppercase; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a3a3a3; display: inline-block; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.status-dot.ok { background: #22c55e; }
.status-dot.warn { background: #f59e0b; }
.status-dot.bad { background: #ef4444; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
/* Верхняя синяя шапка: бренд, четыре действия комнаты, состояние соединения и пользователь. */
.topbar { height: 56px; background: var(--primary); color: white; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.2); position: sticky; top: 0; z-index: 20; }
.topbar-left, .topbar-right, .manager-badge, .connection-pill { display: flex; align-items: center; }
.topbar-left { gap: 10px; }
.topbar-right { gap: 8px; }
.top-title { font-size: 20px; }
.top-section { font-size: 12px; color: rgba(255,255,255,.55); }
.icon-btn { border: 0; background: transparent; color: rgba(255,255,255,.72); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; transition: .15s; }
.icon-btn:hover { color: white; background: rgba(255,255,255,.1); }
.mobile-menu { display: none; }
.connection-pill { gap: 7px; border: 1px solid rgba(255,255,255,.22); padding: 7px 10px; font: 10px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }
.manager-badge { gap: 6px; color: rgba(255,255,255,.7); font-size: 12px; }
.main-content { flex: 1; overflow: auto; background: var(--surface); }
.view { display: none; padding: 28px; }
.view.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading.compact { margin-bottom: 18px; }
.eyebrow { color: var(--primary); font: 700 11px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 7px; }
h1, h2, h3, p { margin: 0; }
h1 { font: 600 30px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .035em; }
.page-heading p { color: var(--text-soft); font-size: 13px; margin-top: 6px; }
.primary-btn, .secondary-btn, .small-btn { border: 1px solid var(--primary); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .15s; }
.primary-btn { background: var(--primary); color: white; padding: 10px 14px; font: 600 12px var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.primary-btn:hover { background: var(--secondary); }
.secondary-btn { background: white; color: var(--primary); padding: 9px 12px; font: 600 11px var(--font-mono); text-transform: uppercase; }
.secondary-btn:hover { background: var(--surface-container); }
.secondary-btn.recording { border-color: var(--error); color: var(--error); background: #fff5f5; }
.small-btn { width: 34px; height: 34px; background: white; color: var(--primary); border-color: var(--outline-variant); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { border: 1px solid var(--outline-variant); background: var(--surface-low); padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 42px; height: 42px; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; }
.stat-label { color: var(--text-soft); font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: .055em; }
.stat-value { font: 600 28px/1.1 var(--font-display); margin-top: 4px; }
.panel { border: 1px solid var(--outline-variant); background: white; }
.panel-header { padding: 15px 16px; border-bottom: 1px solid var(--outline-variant); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-header h2 { font: 600 16px var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.panel-header p { font-size: 11px; color: var(--text-soft); margin-top: 3px; }
.updated-at { font: 10px var(--font-mono); color: var(--text-soft); }
.room-summary-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.summary-room { padding: 16px; border-right: 1px solid var(--outline-variant); min-height: 125px; cursor: pointer; transition: .15s; }
.summary-room:last-child { border-right: 0; }
.summary-room:hover { background: var(--surface-low); }
.summary-top { display: flex; justify-content: space-between; gap: 10px; }
.summary-number { font: 700 12px var(--font-mono); color: var(--primary); }
.summary-room h3 { font: 600 16px var(--font-display); margin-top: 6px; }
.summary-meta { font-size: 11px; color: var(--text-soft); margin-top: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; background: var(--surface-container); font: 600 9px var(--font-mono); text-transform: uppercase; }
.badge.live { color: var(--success); }
.badge.record { color: var(--error); background: #fde8e8; }
.empty-list { padding: 28px; color: var(--text-soft); font-size: 13px; text-align: center; grid-column: 1/-1; }
/* Базовый двухколоночный layout интерфейса конференций. */
.conference-layout { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0,1fr); gap: 14px; align-items: start; }
.room-panel { position: sticky; top: 76px; }
.room-list { max-height: calc(100vh - 220px); overflow: auto; }
.room-item { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--outline-variant); background: white; padding: 14px 15px; transition: .12s; }
.room-item:hover { background: var(--surface-low); }
.room-item.active { background: var(--surface-container); border-left: 4px solid var(--error); padding-left: 11px; }
.room-item-top { display: flex; justify-content: space-between; gap: 8px; }
.room-id { color: var(--primary); font: 700 11px var(--font-mono); }
.room-title { margin-top: 5px; font: 600 14px var(--font-display); }
.room-sub { margin-top: 7px; color: var(--text-soft); font-size: 11px; display: flex; gap: 10px; }
.detail-panel { min-height: 430px; }
.empty-state { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-soft); text-align: center; padding: 30px; }
.empty-state .material-symbols-outlined { font-size: 50px; color: var(--outline); }
.empty-state h3 { font: 600 18px var(--font-display); text-transform: uppercase; margin-top: 10px; }
.empty-state p { font-size: 12px; margin-top: 5px; }
.hidden { display: none !important; }
.conference-header { padding: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--outline-variant); }
.conference-number { color: var(--primary); font: 700 11px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.conference-header h2 { font: 600 22px var(--font-display); text-transform: uppercase; margin-top: 4px; }
.conference-meta { font-size: 11px; color: var(--text-soft); margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--surface-container); color: var(--text-soft); font: 700 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: .07em; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--outline-variant); }
td { padding: 12px; border-bottom: 1px solid var(--outline-variant); font-size: 12px; vertical-align: middle; }
.participant-main { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font: 600 11px var(--font-mono); }
.participant-name { font-weight: 600; }
.participant-channel { font: 9px var(--font-mono); color: var(--text-soft); margin-top: 3px; }
.state-wrap { display: flex; align-items: center; gap: 6px; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }
.state-dot.talking { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.14); }
.state-dot.muted { background: #f59e0b; }
.actions-col { width: 180px; text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.action-btn { width: 34px; height: 32px; border: 1px solid var(--outline-variant); background: white; color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.action-btn:hover { background: var(--surface-container); }
.action-btn.danger { color: var(--error); }
.action-btn .material-symbols-outlined { font-size: 18px; }
.participants-empty { padding: 34px; text-align: center; color: var(--text-soft); font-size: 12px; }
.toast-stack { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { min-width: 250px; max-width: 360px; background: #111; color: white; padding: 11px 13px; font-size: 12px; box-shadow: 0 10px 25px rgba(0,0,0,.18); animation: toast-in .18s ease; }
.toast.error { background: #930a0a; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.mobile-overlay { display: none; }
@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .room-summary-list { grid-template-columns: 1fr; }
  .summary-room { border-right: 0; border-bottom: 1px solid var(--outline-variant); }
  .conference-layout { grid-template-columns: 270px minmax(0,1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: -270px; top: 0; bottom: 0; z-index: 50; transition: .2s ease; }
  .sidebar.open { left: 0; }
  .sidebar-close, .mobile-menu { display: inline-flex !important; }
  .mobile-overlay.show { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); }
  .top-section, .connection-pill, .manager-badge span:last-child { display: none; }
  .view { padding: 18px 12px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr; }
  .conference-layout { grid-template-columns: 1fr; }
  .room-panel { position: static; }
  .room-list { max-height: 280px; }
  .conference-header { flex-direction: column; }
  .actions-col { width: auto; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}

.badge.idle{background:#eef0f5;color:#5a6270;border-color:#d7dbe5}
button:disabled{opacity:.45;cursor:not-allowed;pointer-events:none}

/* Authentication */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 78% 16%, rgba(255,255,255,.08), transparent 27%),
    linear-gradient(135deg, #00195f 0%, #002179 42%, #0b389d 100%);
  position: relative;
  overflow: hidden;
}
.auth-screen::before,
.auth-screen::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(255,255,255,.06);
  transform: rotate(24deg);
  pointer-events: none;
}
.auth-screen::before { width: 520px; height: 520px; right: -230px; top: -260px; }
.auth-screen::after { width: 360px; height: 360px; left: -200px; bottom: -220px; }
.auth-shell {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  min-height: 410px;
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  background: rgba(0, 19, 76, .78);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .30);
  backdrop-filter: blur(10px);
}
.auth-brand-panel {
  padding: 42px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 55%),
    rgba(0, 16, 66, .32);
  border-right: 1px solid rgba(255,255,255,.12);
}
.auth-logo { width: 72px; height: 72px; object-fit: contain; }
.auth-brand-copy { margin-top: auto; }
.auth-brand-title {
  color: white;
  font: 600 30px/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.auth-brand-sub {
  margin-top: 10px;
  max-width: 240px;
  color: rgba(255,255,255,.62);
  font: 10px/1.6 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.auth-form-panel {
  display: flex;
  align-items: center;
  padding: 42px 44px;
  background: rgba(255,255,255,.035);
}
.auth-form-panel form { width: 100%; }
.auth-kicker {
  color: #9fb7ff;
  font: 700 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 8px;
}
.login-title {
  color: white;
  font: 600 32px/1.05 var(--font-display);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.login-description {
  margin: 10px 0 24px;
  color: rgba(255,255,255,.64);
  font-size: 12px;
  line-height: 1.55;
}
.field-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--text-soft);
  font: 700 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.auth-field-label { color: rgba(255,255,255,.58); }
.text-input {
  width: 100%;
  height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--outline);
  background: white;
  color: var(--text);
  outline: none;
}
.text-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,33,121,.09); }
.auth-input {
  height: 44px;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.09);
  color: white;
}
.auth-input:focus {
  border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: white;
  -webkit-box-shadow: 0 0 0 1000px #17377f inset;
  transition: background-color 5000s ease-in-out 0s;
}
.login-error {
  margin-top: 14px;
  padding: 10px 11px;
  border-left: 3px solid #ff5a64;
  background: rgba(211,4,16,.14);
  color: #ffd4d7;
  font-size: 12px;
}
.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
  border: 1px solid rgba(255,255,255,.9);
  background: white;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 700 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: .15s ease;
}
.auth-submit:hover { background: #eef2ff; }
.auth-submit:disabled { opacity: .55; }
.auth-submit .material-symbols-outlined { font-size: 19px; }
.auth-shell-message { min-height: 340px; }
.system-message-panel { flex-direction: column; align-items: flex-start; justify-content: center; }
.system-message-icon { color: #ffbf4a; font-size: 38px; margin-bottom: 18px; }
.manager-badge { white-space: nowrap; }

@media (max-width: 700px) {
  .auth-screen { padding: 16px; }
  .auth-shell { grid-template-columns: 1fr; width: min(440px, 100%); }
  .auth-brand-panel { min-height: 150px; padding: 24px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .auth-logo { width: 52px; height: 52px; }
  .auth-brand-title { font-size: 22px; }
  .auth-brand-sub { margin-top: 6px; }
  .auth-form-panel { padding: 28px 24px 30px; }
}

/* Conference controls, contacts and bulk actions */
.conference-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 720px;
}
.secondary-btn.danger-outline {
  color: var(--error);
  border-color: #e4a4a8;
}
.secondary-btn.danger-outline:hover { background: #fff1f1; }
.secondary-btn.locked {
  color: #8a5a00;
  border-color: #e8c36f;
  background: #fff9e8;
}
.room-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--outline-variant);
  background: var(--surface-low);
}
.room-tab {
  border: 0;
  border-right: 1px solid var(--outline-variant);
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-soft);
  min-height: 44px;
  padding: 10px 16px 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.room-tab:hover { background: white; color: var(--primary); }
.room-tab.active { background: white; color: var(--primary); border-bottom-color: var(--error); }
.room-tab .material-symbols-outlined { font-size: 18px; }
.tab-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-container);
  color: var(--text-soft);
  font-size: 9px;
}
.room-tab.active .tab-count { background: #e7ecff; color: var(--primary); }
.room-tab-panel { min-height: 310px; }
.inline-toolbar {
  min-height: 48px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--outline-variant);
  background: white;
}
.toolbar-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--success);
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.toolbar-note::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.toolbar-note.locked { color: #9a6400; }
.toolbar-note.locked::before { background: #f59e0b; }
.text-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
}
.text-btn:hover { background: var(--surface-container); }
.text-btn .material-symbols-outlined { font-size: 17px; }
.contacts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--outline-variant);
  background: white;
}
.contact-search-wrap {
  flex: 1 1 280px;
  max-width: 460px;
  height: 38px;
  border: 1px solid var(--outline);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: white;
}
.contact-search-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,33,121,.08); }
.contact-search-wrap .material-symbols-outlined { font-size: 18px; color: var(--text-soft); }
.contact-search {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}
.contacts-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.contacts-table .check-col, .check-col { width: 42px; text-align: center; }
.contacts-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); }
.contact-name { font-weight: 600; }
.contact-phone { font: 800 13px var(--font-mono); color: var(--primary); }
.contacts-loading { text-align: center; color: var(--text-soft); padding: 28px !important; }
.action-btn.call { color: var(--success); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 17, 42, .58);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  width: min(480px, 100%);
  background: white;
  border: 1px solid var(--outline-variant);
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
}
.modal-header {
  min-height: 72px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--outline-variant);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.modal-header h2 { font: 600 21px var(--font-display); text-transform: uppercase; }
.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--outline-variant);
  background: white;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--primary); background: var(--surface-container); }
.modal-body { padding: 18px; }
.form-hint { margin-top: 8px; color: var(--text-soft); font-size: 11px; line-height: 1.45; }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1180px) {
  .conference-header { flex-direction: column; }
  .conference-actions { justify-content: flex-start; max-width: none; }
  .contacts-toolbar { align-items: stretch; flex-direction: column; }
  .contact-search-wrap { max-width: none; flex-basis: auto; }
  .contacts-toolbar-actions { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .conference-actions { width: 100%; }
  .conference-actions .secondary-btn { flex: 1 1 calc(50% - 5px); }
  .room-tabs { overflow-x: auto; }
  .room-tab { white-space: nowrap; }
  .inline-toolbar { align-items: flex-start; flex-direction: column; }
  .contacts-toolbar-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .contacts-toolbar-actions .primary-btn,
  .contacts-toolbar-actions .secondary-btn { width: 100%; }
  .contacts-table th:nth-child(3),
  .contacts-table td:nth-child(3) { display: table-cell; }
}

/* Быстрый звонок из телефонной книги */
.quick-call-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: #f8f9fb;
}
.quick-call-copy { min-width: 190px; }
.quick-call-title { font-family: 'Oswald', sans-serif; font-weight: 600; text-transform: uppercase; font-size: 14px; }
.quick-call-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.quick-call-form { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }
.quick-call-input { width: min(420px, 100%); }
@media (max-width: 760px) {
  .quick-call-bar { align-items: stretch; flex-direction: column; }
  .quick-call-form { align-items: stretch; flex-direction: column; }
  .quick-call-input { width: 100%; }
}

/* Web administration */
.page-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.admin-panel-header { gap: 18px; }
.admin-user-search-wrap { max-width: 360px; flex: 0 1 360px; }
.admin-user-name { font-weight: 600; }
.admin-user-login { margin-top: 3px; font: 10px var(--font-mono); color: var(--text-soft); }
.self-mark { display: inline-block; margin-left: 5px; padding: 2px 5px; background: #e7ecff; color: var(--primary); font: 700 8px var(--font-mono); text-transform: uppercase; }
.role-badge, .account-status { display: inline-flex; align-items: center; padding: 4px 7px; font: 700 9px var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.role-badge.admin { background: #e7ecff; color: var(--primary); }
.role-badge.manager { background: var(--surface-container); color: var(--text-soft); }
.account-status.enabled { background: #eaf8ef; color: #14733a; }
.account-status.disabled { background: #fdecec; color: #981b1b; }
.room-chip-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 440px; }
.room-chip { display: inline-flex; align-items: center; padding: 3px 6px; background: var(--surface-container); color: var(--primary); font: 600 9px var(--font-mono); }
.room-chip.more { color: var(--text-soft); }
.admin-all-rooms { font-size: 11px; color: var(--primary); font-weight: 600; }
.muted-copy { color: var(--text-soft); font-size: 11px; }
.admin-user-modal-card { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.toggle-row { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.toggle-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.admin-room-assignment { margin-top: 18px; border: 1px solid var(--outline-variant); background: var(--surface-low); }
.admin-room-heading { padding: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--outline-variant); background: white; }
.room-label-no-margin { margin: 0 0 4px; }
.admin-room-actions { display: flex; align-items: center; gap: 8px; }
.admin-room-search-wrap { margin: 10px 12px; max-width: none; }
.admin-room-list { max-height: 250px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--outline-variant); }
.admin-room-option { min-height: 52px; padding: 9px 11px; display: flex; align-items: center; gap: 9px; border-right: 1px solid var(--outline-variant); border-bottom: 1px solid var(--outline-variant); background: white; cursor: pointer; }
.admin-room-option:nth-child(2n) { border-right: 0; }
.admin-room-option:hover { background: var(--surface-container); }
.admin-room-option input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--primary); }
.admin-room-option span { min-width: 0; display: flex; flex-direction: column; }
.admin-room-option strong { font: 700 11px var(--font-mono); color: var(--primary); }
.admin-room-option small { margin-top: 2px; color: var(--text-soft); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-room-selected { padding: 8px 12px; background: white; color: var(--text-soft); font: 600 10px var(--font-mono); text-align: right; }
.admin-room-empty { grid-column: 1/-1; padding: 22px; color: var(--text-soft); text-align: center; font-size: 11px; }
.notice { margin-top: 14px; padding: 11px 12px; background: #eef2ff; border-left: 3px solid var(--primary); color: var(--text); font-size: 11px; line-height: 1.45; }
.admin-role-notice { margin-top: 18px; }

@media (max-width: 760px) {
  .page-heading-actions { width: 100%; justify-content: stretch; }
  .page-heading-actions .primary-btn, .page-heading-actions .secondary-btn { flex: 1 1 100%; }
  .admin-panel-header { align-items: stretch; flex-direction: column; }
  .admin-user-search-wrap { max-width: none; flex-basis: auto; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-room-heading { flex-direction: column; }
  .admin-room-list { grid-template-columns: 1fr; }
  .admin-room-option { border-right: 0; }
  .admin-users-table th:nth-child(3), .admin-users-table td:nth-child(3) { display: none; }
}

/* v6 — компактный рабочий экран менеджера */
.app-shell.manager-mode .sidebar { display: none; }
.app-shell.manager-mode .workspace { width: 100%; }
.app-shell.manager-mode .mobile-menu { display: none !important; }
.app-shell.manager-mode #view-dashboard { display: none !important; }
.app-shell.manager-mode .main-content { background: #fff; }
.app-shell.manager-mode .view { padding-top: 16px; }

.conference-page-toolbar {
  min-height: 58px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-low);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.conference-page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.room-selector-wrap { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.room-selector-wrap label { color: var(--text-soft); font: 700 9px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.room-selector { height: 36px; min-width: 170px; border: 1px solid var(--outline); background: white; color: var(--text); padding: 0 30px 0 10px; font: 600 11px var(--font-mono); }

/* Менеджер: слева Контакты, справа выбранная Комната. */
.manager-conference-layout { grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); gap: 12px; }
/* Левая телефонная книга; sticky/высота должны согласовываться с layout менеджера. */
.contact-panel { position: sticky; top: 68px; max-height: calc(100vh - 86px); display: flex; flex-direction: column; overflow: hidden; }
.contacts-panel-header { flex: 0 0 auto; }
.contacts-side-search { margin: 10px; max-width: none; flex: 0 0 38px; }
.contacts-side-actions { padding: 0 7px 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--outline-variant); }
.contacts-side-actions .text-btn { font-size: 8px; padding: 6px; }
.contacts-side-list { overflow: auto; min-height: 120px; }
.contact-card { min-height: 82px; padding: 10px 8px; border-bottom: 1px solid var(--outline-variant); display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 7px; align-items: center; background: white; }
.contact-card:hover { background: var(--surface-low); }
.contact-check-wrap { align-self: stretch; display: flex; align-items: center; justify-content: center; }
.contact-check-wrap input { width: 14px; height: 14px; accent-color: var(--primary); }
.contact-card-body { min-width: 0; }
.contact-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.contact-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 12px; }
.contact-card-meta { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; color: var(--text-soft); font: 9px var(--font-mono); }
.contact-card-meta span:first-child { color: var(--primary); font-weight: 700; }
.contact-card-actions { display: flex; gap: 3px; }
.contact-card-actions .action-btn { width: 30px; height: 30px; }

.call-status { display: inline-flex; align-items: center; min-height: 20px; padding: 3px 6px; font: 700 8px var(--font-mono); text-transform: uppercase; white-space: nowrap; background: var(--surface-container); color: var(--text-soft); }
.call-status.calling { background: #fff4d6; color: #8a5a00; }
.call-status.answered, .call-status.connected { background: #e8f8ed; color: #14733a; }
.call-status.rejected, .call-status.failed { background: #fdeaea; color: #a3121a; }
.call-status.busy, .call-status.no-answer, .call-status.unavailable, .call-status.cancelled { background: #f1f2f5; color: #5f6470; }
.call-status.completed { background: #eaf0ff; color: var(--primary); }

/* Компактная шапка комнаты: Комната | активные вызовы | быстрый набор. */
.compact-conference-header { align-items: center; padding: 14px 16px; }
.conference-title-block { flex: 0 0 auto; }
.compact-conference-header h2 { margin-top: 0; font-size: 21px; }
.header-quick-call { margin-left: auto; width: min(580px, 62%); }
.header-quick-call-row { display: flex; gap: 7px; align-items: center; }
.header-quick-call .quick-call-input { min-width: 0; flex: 1; height: 38px; }
.header-quick-call .primary-btn { height: 38px; white-space: nowrap; }
.quick-call-status { min-height: 16px; margin-top: 4px; text-align: right; color: var(--text-soft); font: 9px var(--font-mono); }
.quick-call-status.calling { color: #8a5a00; }
.quick-call-status.connected, .quick-call-status.answered { color: var(--success); }
.quick-call-status.rejected, .quick-call-status.failed { color: var(--error); }

@media (max-width: 1050px) {
  .manager-conference-layout { grid-template-columns: 310px minmax(0,1fr); }
  .conference-page-toolbar { align-items: flex-start; flex-direction: column; }
  .conference-page-actions { justify-content: flex-start; width: 100%; }
}
@media (max-width: 760px) {
  .manager-conference-layout { grid-template-columns: 1fr; }
  .contact-panel { position: static; max-height: 400px; }
  .conference-page-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .conference-page-actions .secondary-btn { width: 100%; }
  .compact-conference-header { align-items: stretch; }
  .header-quick-call { width: 100%; margin-left: 0; }
  .header-quick-call-row { align-items: stretch; flex-direction: column; }
  .header-quick-call .primary-btn { width: 100%; }
  .quick-call-status { text-align: left; }
}

/* v12 — компактная полоса исходящих вызовов в шапке комнаты */
.compact-conference-header {
  display: grid;
  grid-template-columns: 170px minmax(420px, 1fr) minmax(360px, 500px);
  gap: 14px;
  align-items: center;
}
.conference-title-block { min-width: 0; }
.call-activity-strip { min-width: 0; overflow: hidden; }
.call-activity-strip.empty { min-height: 1px; }
.call-activity-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}
/* Одна строка активного/недавнего исходящего вызова. */
.call-activity-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(155px, 1fr) 138px 116px;
  gap: 10px;
  align-items: center;
  padding: 2px 8px;
  border-left: 0;
}
.call-activity-item.recent { opacity: .78; }
.call-activity-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 750;
  color: var(--text);
}
.call-activity-number {
  min-width: 0;
  white-space: nowrap;
  font: 800 13.5px/1.2 var(--font-mono);
  color: var(--primary);
}
.call-activity-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  max-width: 116px;
  padding: 4px 8px;
  border-radius: 999px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 9px var(--font-mono);
  background: var(--surface-container);
  color: var(--text-soft);
}
.call-activity-status.calling { background: #eef4ff; color: #1254b8; }
.call-activity-status.answered { background: #fff1d6; color: #a65b00; }
.call-activity-status.rejected,
.call-activity-status.failed { background: #fde9ea; color: #b31b24; }
.call-activity-status.busy,
.call-activity-status.no-answer,
.call-activity-status.unavailable,
.call-activity-status.cancelled { background: #f0f1f4; color: #545b68; }
.call-activity-caption {
  margin-top: 5px;
  padding-left: 8px;
  color: var(--text-soft);
  font-size: 10px;
  white-space: nowrap;
}
.call-activity-caption span { padding: 0 3px; }
.header-quick-call { width: 100%; margin-left: 0; }
.quick-call-status { display: none; }

/* Контакты: номер больше и контрастнее */
.contact-name { font-size: 14.5px; }
.contact-card-meta { margin-top: 5px; font-size: 12px; line-height: 1.3; }
.contact-card-meta span:first-child { font-size: 14px; font-weight: 800; letter-spacing: .01em; }
.contact-phone { font-size: 13.5px; line-height: 1.25; }
.call-status { font-size: 10px; min-height: 24px; padding: 4px 8px; }

@media (max-width: 1350px) {
  .compact-conference-header { grid-template-columns: 150px minmax(360px, 1fr) minmax(330px, 430px); gap: 10px; }
  .call-activity-item { grid-template-columns: minmax(135px, 1fr) 125px 108px; gap: 7px; padding-left: 5px; padding-right: 5px; }
  .call-activity-name { font-size: 12px; }
  .call-activity-number { font-size: 12.5px; }
}
@media (max-width: 1050px) {
  .compact-conference-header { display: flex; flex-wrap: wrap; }
  .conference-title-block { flex: 0 0 160px; }
  .call-activity-strip { flex: 1 1 600px; order: 2; width: 100%; }
  .header-quick-call { flex: 1 1 420px; }
}
@media (max-width: 760px) {
  .call-activity-item { grid-template-columns: 1fr; gap: 2px; padding: 5px 0; }
  .call-activity-status { justify-content: flex-start; }
  .call-activity-name, .call-activity-number { font-size: 12px; }
}


/* v12.3 — разделённый roster и компактные контакты */
.app-shell.manager-mode .detail-panel {
  height: calc(100vh - 160px);
  min-height: 430px;
  overflow: hidden;
}
.app-shell.manager-mode .conference-content {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.app-shell.manager-mode .compact-conference-header { flex: 0 0 auto; }
/* Две таблицы участников 50/50: Добавочные и Сотовые. */
.participants-split {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-top: 0;
}
.participant-group {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
}
.participant-group + .participant-group { border-left: 1px solid var(--outline-variant); }
.participant-group-title {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 11px 14px 9px;
  border-bottom: 1px solid var(--outline-variant);
  background: white;
  color: var(--text);
  font: 650 15px/1.2 var(--font-sans);
}
.participant-group-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--surface-container);
  color: var(--text-soft);
  font: 700 9px var(--font-mono);
}
/* Внутренний scroll roster: страница не должна расти при 100+ участниках. */
.participant-table-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  scrollbar-gutter: auto;
  background: #fff;
}
/* Таблица live-участников. Ширины колонок настроены под отсутствие горизонтального scroll. */
.participants-table { min-width: 610px; table-layout: fixed; margin: 0; }
.participants-table thead { background: var(--surface-container); }
.participants-table thead tr { background: var(--surface-container); }
.participants-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-container); box-sizing: border-box; }
.participants-table thead th:last-child { padding-right: 12px; }
.participant-table-scroll::-webkit-scrollbar-corner { background: var(--surface-container); }
.participants-table th:nth-child(1), .participants-table td:nth-child(1) { width: 43%; }
.participants-table th:nth-child(2), .participants-table td:nth-child(2) { width: 20%; }
.participants-table th:nth-child(3), .participants-table td:nth-child(3) { width: 16%; }
.participants-table th:nth-child(4), .participants-table td:nth-child(4) { width: 21%; }
.participants-table td { padding: 9px 10px; }
.participants-table .participant-main { gap: 8px; }
.participants-table .avatar { width: 28px; height: 28px; font-size: 10px; }
.participant-copy { min-width: 0; }
.participants-table .participant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.participants-table .participant-channel { font-size: 8px; }
.participants-table .actions-col { width: auto; }
.participants-table .action-btn { width: 30px; height: 28px; }
.participants-table .action-btn .material-symbols-outlined { font-size: 17px; }
.participant-empty-row td { height: 90px; text-align: center; color: var(--text-soft); font-size: 11px; }

/* Контакты рассчитаны на большие книги: больше строк в одном экране, список прокручивается внутри панели. */
.contact-card {
  min-height: 62px;
  padding: 7px 6px;
  grid-template-columns: 22px minmax(0,1fr) auto;
  gap: 5px;
}
.contact-name { font-size: 11.5px; line-height: 1.2; }
.contact-card-meta { margin-top: 3px; gap: 6px; font-size: 9.5px; line-height: 1.15; }
.contact-card-meta span:first-child { font-size: 11px; font-weight: 750; letter-spacing: 0; }
.contact-phone { font-size: 11px; line-height: 1.15; }
.contact-card-actions { gap: 2px; }
.contact-card-actions .action-btn { width: 27px; height: 27px; }
.contact-card-actions .action-btn .material-symbols-outlined { font-size: 17px; }
.call-status { font-size: 8px; min-height: 20px; padding: 3px 5px; }
.contacts-side-list { overflow: auto; min-height: 120px; scrollbar-gutter: stable; }

@media (max-width: 1280px) {
  .participants-table { min-width: 560px; }
  .participant-group-title { font-size: 14px; }
}
@media (max-width: 900px) {
  .app-shell.manager-mode .detail-panel { height: auto; max-height: none; overflow: visible; }
  .app-shell.manager-mode .conference-content { height: auto; }
  .participants-split { grid-template-columns: 1fr; }
  .participant-group + .participant-group { border-left: 0; border-top: 1px solid var(--outline-variant); }
  .participant-table-scroll { max-height: 320px; }
}

/* v12.5 — согласованный компактный экран менеджера без изменения фирменных цветов */
.topbar {
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  gap: 12px;
}
.topbar-left { justify-self: start; min-width: 0; gap: 8px; }
.topbar-right { justify-self: end; min-width: 0; gap: 6px; }
.top-title { font-size: 18px; }
.top-section { font-size: 11px; }
.topbar .icon-btn { width: 30px; height: 30px; }
.topbar .icon-btn .material-symbols-outlined { font-size: 19px; }
.topbar .connection-pill { padding: 5px 8px; font-size: 9px; }
.topbar .manager-badge { font-size: 11px; }
.topbar .manager-badge .material-symbols-outlined { font-size: 19px; }

.topbar-conference-actions {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.app-shell.conference-view .topbar-conference-actions { display: flex; }
.topbar-control-btn {
  height: 30px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.35);
  background: transparent;
  color: rgba(255,255,255,.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  font: 650 9px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .025em;
  transition: .15s ease;
}
.topbar-control-btn:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.08);
}
.topbar-control-btn .material-symbols-outlined { font-size: 17px; }
.topbar-control-btn.danger-outline {
  color: #ff8d92;
  border-color: rgba(255,141,146,.78);
}
.topbar-control-btn.danger-outline:hover:not(:disabled) { background: rgba(211,4,16,.13); }
.topbar-control-btn.recording {
  color: #ff8d92;
  border-color: rgba(255,141,146,.78);
  background: rgba(211,4,16,.10);
}
.topbar-control-btn.locked {
  color: #fff;
  border-color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.08);
}
.topbar-control-btn:disabled { opacity: .38; cursor: default; }

/* В основном окне остаётся только селектор комнаты, когда менеджеру назначено > 1 комнаты. */
.conference-page-toolbar {
  min-height: 0;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  justify-content: flex-start;
}
.conference-page-toolbar.hidden { display: none !important; }
.conference-page-toolbar .room-selector-wrap {
  min-height: 34px;
  padding: 0;
}
.conference-page-toolbar .room-selector { height: 34px; }

.app-shell.manager-mode .view { padding: 10px 14px 12px; }
.manager-conference-layout { grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); gap: 12px; }
.app-shell.manager-mode .contact-panel {
  top: 54px;
  max-height: calc(100vh - 66px);
}
.app-shell.manager-mode .detail-panel {
  height: calc(100vh - 66px);
  min-height: 430px;
}

/* Верх комнаты: тот же состав блоков, но заметно меньше высота. */
.compact-conference-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 210px minmax(380px, 1fr) minmax(330px, 430px);
  gap: 12px;
  align-items: start;
  padding: 10px 12px 9px;
  min-height: 0;
  border-bottom: 1px solid var(--outline-variant);
}
.compact-conference-header h2 {
  margin-top: 0;
  font-size: 21px;
  line-height: 1.05;
}
.conference-title-block { padding-top: 2px; }
.conference-meta { margin-top: 5px; font-size: 10px; }

.call-activity-strip {
  min-width: 0;
  max-height: 118px;
  overflow: hidden;
  padding: 0 10px;
  border-left: 1px solid var(--outline-variant);
  border-right: 1px solid var(--outline-variant);
}
.call-activity-strip.empty { min-height: 1px; }
.call-activity-caption {
  margin: 0 0 4px;
  padding: 0;
  color: var(--primary);
  font: 700 9px/1.2 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .035em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.call-activity-caption span { padding: 0 2px; }
.call-activity-items { gap: 1px; }
.call-activity-item {
  grid-template-columns: minmax(120px, 1fr) 116px 96px;
  gap: 7px;
  min-height: 19px;
  padding: 1px 3px;
}
.call-activity-name {
  font-size: 10.5px;
  line-height: 1.15;
  font-weight: 650;
}
.call-activity-number {
  font: 700 10px/1.15 var(--font-mono);
  color: var(--primary);
}
.call-activity-status {
  min-height: 19px;
  max-width: 96px;
  padding: 2px 5px;
  border-radius: 0;
  font-size: 7.5px;
}

.header-quick-call { width: 100%; margin-left: 0; min-width: 0; }
.header-section-label {
  margin-bottom: 5px;
  color: var(--primary);
  font: 700 9px/1.2 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.header-quick-call-row { gap: 6px; }
.header-quick-call .quick-call-input { height: 34px; font-size: 11px; }
.header-quick-call .primary-btn { height: 34px; padding: 0 13px; font-size: 10px; }
.header-quick-call .primary-btn .material-symbols-outlined { font-size: 17px; }

/* Больше полезной высоты для двух roster-таблиц. */
.participants-split { flex: 1 1 auto; min-height: 0; }
.participant-group-title {
  min-height: 38px;
  padding: 9px 12px 8px;
  font-size: 14px;
}
.participant-table-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: auto;
}
.participants-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}
.participants-table th,
.participants-table td { min-width: 0 !important; }
.participants-table th:nth-child(1), .participants-table td:nth-child(1) { width: 38%; }
.participants-table th:nth-child(2), .participants-table td:nth-child(2) { width: 23%; }
.participants-table th:nth-child(3), .participants-table td:nth-child(3) { width: 20%; white-space: nowrap; }
.participants-table th:nth-child(4), .participants-table td:nth-child(4) { width: 19%; }
.participants-table thead th {
  padding: 8px 6px;
  font-size: 8px;
  white-space: nowrap;
}
.participants-table td { padding: 7px 6px; }
.participants-table .actions-col { white-space: nowrap; }
.participants-table .row-actions { gap: 3px; flex-wrap: nowrap; }
.participants-table .action-btn { width: 28px; height: 27px; }
.participants-table .action-btn .material-symbols-outlined { font-size: 17px; }

/* Текстовая кнопка mute/unmute. */
.participants-table .action-btn.mic-state {
  width: 54px;
  flex: 0 0 54px;
  font-size: 11px;
  font-weight: 600;
}
.action-btn.mic-state.is-live { color: var(--primary); }
.action-btn.mic-state.is-muted { color: var(--error); }
.action-btn.mic-state.is-talking {
  color: var(--primary);
  background: #f4f7ff;
}

@media (max-width: 1450px) {
  .topbar { grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr); gap: 7px; }
  .topbar-control-btn { padding: 0 7px; font-size: 8px; gap: 4px; }
  .topbar-control-btn .material-symbols-outlined { font-size: 16px; }
  .compact-conference-header { grid-template-columns: 185px minmax(340px, 1fr) minmax(300px, 380px); gap: 9px; }
  .call-activity-item { grid-template-columns: minmax(105px, 1fr) 105px 90px; gap: 5px; }
}

@media (max-width: 1120px) {
  .topbar { display: flex; }
  .topbar-left { flex: 1 1 auto; }
  .topbar-right { margin-left: auto; }
  .topbar-conference-actions { position: static; }
  .topbar-control-btn span:not(.material-symbols-outlined) { display: none; }
  .topbar-control-btn { width: 30px; padding: 0; }
  .compact-conference-header { display: flex; flex-wrap: wrap; }
  .conference-title-block { flex: 0 0 180px; }
  .call-activity-strip { flex: 1 1 520px; order: 2; width: 100%; border-right: 0; }
  .header-quick-call { flex: 1 1 360px; }
}

@media (max-width: 760px) {
  .topbar { height: 44px; min-height: 44px; }
  .top-section, .manager-badge span:last-child { display: none; }
  .app-shell.conference-view .topbar-conference-actions { gap: 3px; }
  .app-shell.manager-mode .detail-panel { height: auto; }
  .call-activity-strip { max-height: none; border-left: 0; padding: 6px 0 0; }
  .call-activity-item { grid-template-columns: minmax(0,1fr) auto auto; }
}


/* v12.7 — live voice activity как в astbridge: без polling, обновление по member.stats */
.participant-table-scroll { scrollbar-gutter: auto !important; }

/* Больше места voice-телеметрии, но таблица по-прежнему всегда укладывается в 50%. */
.participants-table th:nth-child(1), .participants-table td:nth-child(1) { width: 35%; }
.participants-table th:nth-child(2), .participants-table td:nth-child(2) { width: 30%; }
.participants-table th:nth-child(3), .participants-table td:nth-child(3) { width: 18%; }
.participants-table th:nth-child(4), .participants-table td:nth-child(4) { width: 17%; }

.participant-row { transition: background-color .16s ease, box-shadow .16s ease; }
.participant-row.is-talking {
  background: #d9f2dd;
  box-shadow: inset 3px 0 0 #27954b;
}
.participant-row.is-talking td { background: transparent; }

/* Индивидуальное усиление участника, управляемое Astbridge API. */
.participant-volume {
  display: inline-flex;
  align-items: center;
  height: 27px;
  border: 1px solid var(--outline-variant);
  background: #fff;
  white-space: nowrap;
}
.volume-step {
  width: 19px;
  height: 25px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.volume-step:hover:not(:disabled) { background: var(--surface-container); }
.volume-step:disabled { color: var(--muted); cursor: default; }
.volume-value {
  min-width: 26px;
  text-align: center;
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
}

/* Держим кнопки участника внутри своей колонки даже при узком окне. */
.participants-split .participants-table th:nth-child(1),
.participants-split .participants-table td:nth-child(1) { width: 32% !important; }
.participants-split .participants-table th:nth-child(2),
.participants-split .participants-table td:nth-child(2) { width: 20% !important; }
.participants-split .participants-table th:nth-child(3),
.participants-split .participants-table td:nth-child(3) { width: 16% !important; white-space: nowrap; }
.participants-split .participants-table td:nth-child(3) { overflow: hidden; text-overflow: ellipsis; }
.participants-split .participants-table th:nth-child(4),
.participants-split .participants-table td:nth-child(4) { width: 32% !important; }
.participants-split .participants-table td.actions-col { padding-left: 4px; padding-right: 4px; }
.participants-split .participants-table .row-actions {
  width: 100%;
  max-width: 100%;
  gap: 2px;
  flex-wrap: wrap;
}
.participants-split .participant-volume { flex: 0 0 auto; }

.participant-row.is-muted .state-dot { background: var(--error); box-shadow: none; }

.voice-state-wrap { min-width: 0; }
.voice-state-label { white-space: nowrap; }
.voice-telemetry {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 3px;
}
.voice-telemetry.hidden { display: none; }
.voice-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 8px;
  flex: 0 0 auto;
}
.voice-meter i {
  display: block;
  width: 3px;
  height: 6px;
  background: var(--surface-high);
}
.voice-meter i:nth-child(3n+1) { height: 5px; }
.voice-meter i:nth-child(3n+2) { height: 7px; }
.voice-meter i.active {
  background: #f59e0b;
  transform-origin: bottom;
  animation: voice-meter-bounce .62s ease-in-out infinite alternate;
}
.voice-meter i.active:nth-child(2n) { animation-duration: .48s; animation-delay: -.24s; }
.voice-meter i.active:nth-child(3n) { animation-duration: .72s; animation-delay: -.41s; }
@keyframes voice-meter-bounce {
  from { transform: scaleY(.35); opacity: .72; }
  to { transform: scaleY(1.35); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-meter i.active { animation: none; }
}
.voice-telemetry-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font: 7.5px/1.1 var(--font-mono);
}

/* Мягкий индикатор активности говорящего. */
.action-btn.mic-state.is-talking {
  color: var(--primary);
  background: rgba(0, 33, 121, .055);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .16) inset;
}
.action-btn.mic-state.is-muted {
  color: var(--error);
  background: rgba(211, 4, 16, .035);
}

@media (max-width: 1280px) {
  .voice-telemetry-text { display: none; }
  .participants-table th:nth-child(1), .participants-table td:nth-child(1) { width: 36%; }
  .participants-table th:nth-child(2), .participants-table td:nth-child(2) { width: 28%; }
  .participants-table th:nth-child(3), .participants-table td:nth-child(3) { width: 18%; }
  .participants-table th:nth-child(4), .participants-table td:nth-child(4) { width: 18%; }
}

/* FIX: контакты и комната на одном уровне */
.conference-layout,
.conference-main,
.room-workspace {
  align-items: start !important;
}

.contacts-panel,
.contacts-column,
.contacts-wrap {
  margin-top: 0 !important;
  align-self: start !important;
}

.room-panel,
.room-column,
.room-wrap {
  margin-top: 0 !important;
  align-self: start !important;
}

/* Жёстко убираем отступ именно у левого блока */
.contacts-panel {
  position: relative;
  top: -16px;
}
/* FIX: у менеджера Контакты и Комната начинаются на одном уровне */
.app-shell.manager-mode .contact-panel {
  top: 0 !important;
  align-self: start;
}



/* ==========================================================================
   v12.8 — адаптация для половины Full HD (viewport 800–1099 px)
   --------------------------------------------------------------------------
   На широком экране сохраняются две независимые таблицы 50/50.
   В узком рабочем окне менеджера показывается ОДНА общая таблица участников,
   чтобы имена, номера, статусы и кнопки не ужимались до нечитаемого состояния.
   Контакты остаются слева и имеют собственный scroll.
   ========================================================================== */

/* Общая таблица существует в DOM всегда, но на обычном desktop скрыта. */
.participants-combined {
  display: none;
  min-height: 0;
  flex: 1 1 auto;
}

.participant-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid var(--outline-variant);
  background: var(--surface-low);
  color: var(--text-soft);
  font: 700 8px/1 var(--font-mono);
  white-space: nowrap;
}
.participant-type-badge.extension { color: var(--primary); }
.participant-type-badge.mobile { color: var(--text-soft); }

@media (min-width: 800px) and (max-width: 1099px) {
  /* Две основные колонки остаются рядом даже при окне примерно 960 px. */
  .app-shell.manager-mode .view { padding: 8px 9px 10px; }
  .app-shell.manager-mode .manager-conference-layout {
    grid-template-columns: clamp(225px, 26vw, 255px) minmax(0, 1fr);
    gap: 9px;
    align-items: start;
  }

  /* Контакты и Комната начинаются строго на одной горизонтали. */
  .app-shell.manager-mode .contact-panel {
    top: 0 !important;
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    align-self: start;
  }
  .app-shell.manager-mode .detail-panel {
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }
  .app-shell.manager-mode .conference-content {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* Верх комнаты: первая строка Комната + Быстрый набор, ниже компактные вызовы. */
  .app-shell.manager-mode .compact-conference-header {
    display: grid !important;
    grid-template-columns: 150px minmax(0, 1fr);
    grid-template-areas:
      "room quick"
      "calls calls";
    gap: 6px 8px;
    align-items: start;
    padding: 7px 8px 6px;
  }
  .app-shell.manager-mode .conference-title-block {
    grid-area: room;
    flex: none;
    padding-top: 1px;
  }
  .app-shell.manager-mode .compact-conference-header h2 {
    font-size: 17px;
    line-height: 1.05;
  }
  .app-shell.manager-mode .conference-meta {
    margin-top: 3px;
    font-size: 9px;
  }
  .app-shell.manager-mode .header-quick-call {
    grid-area: quick;
    min-width: 0;
  }
  .app-shell.manager-mode .header-section-label { margin-bottom: 3px; font-size: 8px; }
  .app-shell.manager-mode .header-quick-call .quick-call-input { height: 30px; min-width: 0; }
  .app-shell.manager-mode .header-quick-call .primary-btn { height: 30px; padding: 0 10px; }

  .app-shell.manager-mode .call-activity-strip {
    grid-area: calls;
    order: initial;
    width: 100%;
    min-width: 0;
    max-height: 78px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0 0;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--outline-variant);
  }
  .app-shell.manager-mode .call-activity-caption {
    margin-bottom: 2px;
    font-size: 7.5px;
  }
  .app-shell.manager-mode .call-activity-item {
    grid-template-columns: minmax(90px, 1fr) minmax(80px, 110px) 82px;
    gap: 4px;
    min-height: 18px;
    padding: 1px 2px;
  }
  .app-shell.manager-mode .call-activity-name { font-size: 9.5px; }
  .app-shell.manager-mode .call-activity-number { font-size: 9px; }
  .app-shell.manager-mode .call-activity-status { max-width: 82px; font-size: 7px; }

  /* Главное изменение v12.8: split скрыт, вместо него одна общая таблица. */
  .app-shell.manager-mode .participants-split { display: none !important; }
  .app-shell.manager-mode .participants-combined {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }
  .app-shell.manager-mode .participant-group-combined {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
  }
  .app-shell.manager-mode .participant-group-combined .participant-group-title {
    min-height: 34px;
    padding: 7px 9px 6px;
    font-size: 13px;
  }
  .app-shell.manager-mode .participant-group-combined .participant-table-scroll {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Пять колонок подобраны под реальную ширину правой части окна 960 px. */
  .app-shell.manager-mode .combined-participants-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
  }
  .app-shell.manager-mode .combined-participants-table th:nth-child(1),
  .app-shell.manager-mode .combined-participants-table td:nth-child(1) { width: 31%; }
  .app-shell.manager-mode .combined-participants-table th:nth-child(2),
  .app-shell.manager-mode .combined-participants-table td:nth-child(2) { width: 14%; }
  .app-shell.manager-mode .combined-participants-table th:nth-child(3),
  .app-shell.manager-mode .combined-participants-table td:nth-child(3) { width: 22%; }
  .app-shell.manager-mode .combined-participants-table th:nth-child(4),
  .app-shell.manager-mode .combined-participants-table td:nth-child(4) { width: 14%; white-space: nowrap; }
  .app-shell.manager-mode .combined-participants-table th:nth-child(5),
  .app-shell.manager-mode .combined-participants-table td:nth-child(5) { width: 19%; }

  .app-shell.manager-mode .combined-participants-table thead th {
    padding: 7px 5px;
    font-size: 7.5px;
  }
  .app-shell.manager-mode .combined-participants-table td {
    padding: 6px 5px;
  }
  .app-shell.manager-mode .combined-participants-table .avatar { display: none; }
  .app-shell.manager-mode .combined-participants-table .participant-main { gap: 0; }
  .app-shell.manager-mode .combined-participants-table .participant-name {
    font-size: 10.5px;
    line-height: 1.15;
  }
  .app-shell.manager-mode .combined-participants-table .participant-channel {
    margin-top: 2px;
    font-size: 8px;
    color: var(--primary);
  }
  .app-shell.manager-mode .combined-participants-table .participant-type-cell {
    overflow: hidden;
  }
  .app-shell.manager-mode .combined-participants-table .participant-type-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 7px;
  }
  .app-shell.manager-mode .combined-participants-table .voice-state-label { font-size: 9px; }
  .app-shell.manager-mode .combined-participants-table .voice-telemetry { gap: 3px; }
  /* На половине экрана оставляем шкалу голоса, но прячем длинную подпись телеметрии. */
  .app-shell.manager-mode .combined-participants-table .voice-telemetry-text { display: none; }
  .app-shell.manager-mode .combined-participants-table .row-actions { gap: 2px; }
  .app-shell.manager-mode .combined-participants-table .action-btn:not(.mic-state) {
    width: 26px;
  }
  .app-shell.manager-mode .combined-participants-table .action-btn {
    height: 25px;
  }
  .app-shell.manager-mode .combined-participants-table .action-btn .material-symbols-outlined { font-size: 16px; }

  /* Книга контактов тоже скроллится внутри, а не растягивает всю страницу. */
  .app-shell.manager-mode .contacts-side-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  .app-shell.manager-mode .contact-card {
    min-height: 58px;
    padding: 6px 5px;
  }
  .app-shell.manager-mode .contact-name { font-size: 10.5px; }
  .app-shell.manager-mode .contact-card-meta,
  .app-shell.manager-mode .contact-card-meta span:first-child { font-size: 9px; }
}


/* ==========================================================================
   v12.9 — компактная строка активного вызова
   --------------------------------------------------------------------------
   Проблема предыдущей версии: имя, номер и статус были тремя отдельными
   колонками grid. На широком блоке номер визуально оказывался слишком далеко
   от имени. Теперь имя + номер образуют единый левый блок, а статус остаётся
   справа. Это особенно важно для режима 800–1099 px (половина Full HD).
   ========================================================================== */
.call-activity-item {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.call-activity-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.call-activity-person .call-activity-name {
  min-width: 0;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-activity-person .call-activity-number {
  flex: 0 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 800px) and (max-width: 1099px) {
  .app-shell.manager-mode .call-activity-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    min-height: 18px;
    padding: 1px 2px;
  }

  .app-shell.manager-mode .call-activity-person {
    gap: 5px;
  }

  .app-shell.manager-mode .call-activity-person .call-activity-name {
    max-width: 48%;
    font-size: 9.5px;
  }

  .app-shell.manager-mode .call-activity-person .call-activity-number {
    font-size: 9px;
  }

  .app-shell.manager-mode .call-activity-status {
    max-width: 82px;
    font-size: 7px;
  }
}

/* FIX: active call info compact inline */
.call-activity-item {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.call-activity-person {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex: 0 1 auto !important;
  min-width: 0;
  gap: 8px !important;
}

.call-activity-name {
  flex: 0 1 auto;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-activity-number {
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: visible;
}

.call-activity-right {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  margin-left: 10px !important;
  gap: 6px !important;
}

.call-activity-status {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (min-width: 800px) and (max-width: 1099px) {
  .call-activity-person {
    gap: 6px !important;
  }

  .call-activity-name {
    max-width: 130px;
  }

  .call-activity-right {
    margin-left: 7px !important;
  }
}


/* Wide participant table columns */
@media (min-width: 1400px) {

  .participants-table {
    width: 100%;
    table-layout: fixed;
  }

  .participants-split .participants-table th:nth-child(1),
  .participants-split .participants-table td:nth-child(1) {
    width: auto !important;
  }

  .participants-split .participants-table th:nth-child(2),
  .participants-split .participants-table td:nth-child(2) {
    width: 124px !important;
    max-width: 124px !important;
  }

  .participants-split .participants-table th:nth-child(3),
  .participants-split .participants-table td:nth-child(3) {
    width: 105px !important;
    max-width: 105px !important;
    white-space: nowrap;
  }

  .participants-split .participants-table th:nth-child(4),
  .participants-split .participants-table td:nth-child(4) {
    width: 198px !important;
    max-width: 198px !important;
    white-space: nowrap;
  }
}


/* HALF SCREEN: contacts wider + compact participant columns */
@media (min-width: 800px) and (max-width: 1099px) {

  .app-shell.manager-mode .manager-conference-layout {
    grid-template-columns:
      clamp(260px, 31vw, 300px)
      minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .app-shell.manager-mode .combined-participants-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
  }

  .app-shell.manager-mode .combined-participants-table th:nth-child(1),
  .app-shell.manager-mode .combined-participants-table td:nth-child(1) {
    width: auto !important;
    min-width: 0 !important;
  }

  .app-shell.manager-mode .combined-participants-table th:nth-child(2),
  .app-shell.manager-mode .combined-participants-table td:nth-child(2) {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
  }

  .app-shell.manager-mode .combined-participants-table th:nth-child(3),
  .app-shell.manager-mode .combined-participants-table td:nth-child(3) {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
  }

  .app-shell.manager-mode .combined-participants-table th:nth-child(4),
  .app-shell.manager-mode .combined-participants-table td:nth-child(4) {
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    white-space: nowrap;
  }

  .app-shell.manager-mode .combined-participants-table th:nth-child(5),
  .app-shell.manager-mode .combined-participants-table td:nth-child(5) {
    width: 184px !important;
    min-width: 184px !important;
    max-width: 184px !important;
    white-space: nowrap;
  }

  .app-shell.manager-mode .combined-participants-table th {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .app-shell.manager-mode .combined-participants-table td {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  .app-shell.manager-mode .combined-participants-table .row-actions {
    width: 100%;
    max-width: 100%;
    gap: 1px;
    flex-wrap: wrap;
  }
  .app-shell.manager-mode .combined-participants-table .action-btn:not(.mic-state) { width: 25px; }
  .app-shell.manager-mode .combined-participants-table .volume-step { width: 16px; }
  .app-shell.manager-mode .combined-participants-table .volume-value { min-width: 22px; }

  .app-shell.manager-mode
  .combined-participants-table
  .participant-type-badge {
    padding: 2px 3px !important;
    font-size: 7px !important;
    max-width: 60px;
  }

  .app-shell.manager-mode
  .combined-participants-table
  .participant-name {
    width: 100%;
    max-width: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-shell.manager-mode
  .combined-participants-table
  .participant-channel {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* Dense contacts list */
.contact-card {
  min-height: 48px !important;
  padding: 4px 5px !important;
  grid-template-columns: 20px minmax(0, 1fr) auto !important;
  gap: 4px !important;
}

.contact-check-wrap input {
  width: 13px !important;
  height: 13px !important;
}

.contact-card-top {
  gap: 4px !important;
}

.contact-name {
  font-size: 10.5px !important;
  line-height: 1.05 !important;
}

.contact-card-meta {
  margin-top: 2px !important;
  gap: 5px !important;
  font-size: 8px !important;
  line-height: 1 !important;
  flex-wrap: nowrap !important;
}

.contact-card-meta span:first-child {
  font-size: 9.5px !important;
  line-height: 1 !important;
}

.contact-card-actions {
  gap: 2px !important;
}

.contact-card-actions .action-btn {
  width: 25px !important;
  height: 25px !important;
  min-width: 25px !important;
  min-height: 25px !important;
  padding: 0 !important;
}

.contact-card-actions .action-btn .material-symbols-outlined {
  font-size: 15px !important;
}

.contact-card .call-status {
  min-height: 16px !important;
  padding: 2px 4px !important;
  font-size: 7px !important;
  line-height: 1 !important;
}

@media (min-width: 800px) and (max-width: 1099px) {

  .app-shell.manager-mode .contact-card {
    min-height: 44px !important;
    padding: 3px 4px !important;
    grid-template-columns: 19px minmax(0, 1fr) auto !important;
    gap: 3px !important;
  }

  .app-shell.manager-mode .contact-name {
    font-size: 10px !important;
    line-height: 1 !important;
  }

  .app-shell.manager-mode .contact-card-meta {
    margin-top: 1px !important;
    gap: 4px !important;
    font-size: 7.5px !important;
    line-height: 1 !important;
  }

  .app-shell.manager-mode .contact-card-meta span:first-child {
    font-size: 9px !important;
  }

  .app-shell.manager-mode .contact-card-actions {
    gap: 1px !important;
  }

  .app-shell.manager-mode .contact-card-actions .action-btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
  }

  .app-shell.manager-mode
  .contact-card-actions
  .action-btn
  .material-symbols-outlined {
    font-size: 14px !important;
  }

  .app-shell.manager-mode .contact-card .call-status {
    min-height: 15px !important;
    padding: 1px 3px !important;
    font-size: 6.5px !important;
  }
}


/* ULTRA COMPACT CONTACTS */

.contact-card {
  min-height: 38px !important;
  padding: 2px 4px !important;
  gap: 3px !important;
  grid-template-columns: 18px minmax(0, 1fr) auto !important;
}

.contact-name {
  font-size: 10px !important;
  line-height: 1 !important;
  margin: 0 !important;
}

.contact-card-meta {
  margin-top: 1px !important;
  gap: 4px !important;
  font-size: 7px !important;
  line-height: 1 !important;
  flex-wrap: nowrap !important;
}

.contact-card-meta span:first-child {
  font-size: 8.5px !important;
  line-height: 1 !important;
}

.contact-check-wrap {
  margin: 0 !important;
  padding: 0 !important;
}

.contact-check-wrap input {
  width: 12px !important;
  height: 12px !important;
  margin: 0 !important;
}

.contact-card-actions {
  gap: 1px !important;
  margin: 0 !important;
}

.contact-card-actions .action-btn {
  width: 23px !important;
  height: 23px !important;
  min-width: 23px !important;
  min-height: 23px !important;
  padding: 0 !important;
  margin: 0 !important;
}

.contact-card-actions .action-btn .material-symbols-outlined {
  font-size: 13px !important;
}

.contact-card .call-status {
  min-height: 14px !important;
  padding: 1px 3px !important;
  font-size: 6.5px !important;
  line-height: 1 !important;
}

.contact-card-top,
.contact-card-body {
  margin: 0 !important;
  padding: 0 !important;
}

@media (min-width: 800px) and (max-width: 1099px) {

  .app-shell.manager-mode .contact-card {
    min-height: 36px !important;
    padding: 2px 3px !important;
  }

  .app-shell.manager-mode .contact-name {
    font-size: 9.5px !important;
  }

  .app-shell.manager-mode .contact-card-meta {
    font-size: 6.5px !important;
  }

  .app-shell.manager-mode .contact-card-meta span:first-child {
    font-size: 8px !important;
  }

  .app-shell.manager-mode .contact-card-actions .action-btn {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
  }
}


/* Slightly larger compact contact text */
.contact-name {
  font-size: 11.5px !important;
}

.contact-card-meta {
  font-size: 8px !important;
}

.contact-card-meta span:first-child {
  font-size: 9.5px !important;
}

@media (min-width: 800px) and (max-width: 1099px) {
  .app-shell.manager-mode .contact-name {
    font-size: 11px !important;
  }

  .app-shell.manager-mode .contact-card-meta {
    font-size: 7.5px !important;
  }

  .app-shell.manager-mode .contact-card-meta span:first-child {
    font-size: 9px !important;
  }
}


.contact-name {
  font-size: 12.5px !important;
}

.contact-card-meta {
  font-size: 9px !important;
}

.contact-card-meta span:first-child {
  font-size: 10.5px !important;
}

@media (min-width: 800px) and (max-width: 1099px) {
  .app-shell.manager-mode .contact-name {
    font-size: 12px !important;
  }

  .app-shell.manager-mode .contact-card-meta {
    font-size: 8.5px !important;
  }

  .app-shell.manager-mode .contact-card-meta span:first-child {
    font-size: 10px !important;
  }
}

#importContactsModal .modal-card { max-height: calc(100vh - 40px); overflow: auto; }
.contacts-panel-header { flex-wrap: wrap; }

/* Полная строка участника без горизонтальной прокрутки. */
.conference-content { container: roster-layout / inline-size; }

.app-shell .participant-group .participants-table :is(th, td):nth-child(n) {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: nowrap;
}
.app-shell .participant-group .participants-table :is(th, td).actions-col {
  width: 190px !important;
}
.app-shell .participant-group .participants-table :is(th, td):nth-last-child(2) {
  width: 106px !important;
}
.app-shell .participant-group .participants-table :is(th, td):nth-last-child(3) {
  width: 146px !important;
}
.app-shell .participant-group .combined-participants-table :is(th, td):nth-child(2) {
  width: 56px !important;
}
.app-shell .participant-group .participants-table .row-actions {
  flex-wrap: nowrap;
}
.participant-state-cell { padding-right: 12px !important; }
.participant-state-cell .voice-state-label { overflow: hidden; text-overflow: ellipsis; }

@container roster-layout (max-width: 1150px) {
  .participants-split { grid-template-columns: minmax(0, 1fr); }
  .participant-group + .participant-group {
    border-left: 0;
    border-top: 1px solid var(--outline-variant);
  }
}

@container roster-layout (max-width: 560px) {
  .app-shell .participant-group .participants-table :is(th, td):nth-last-child(2) {
    width: 18% !important;
  }
  .app-shell .participant-group .participants-table :is(th, td):nth-last-child(3) {
    width: 23% !important;
  }
  .app-shell .participant-group .participants-table :is(th, td).actions-col {
    width: 146px !important;
  }
  .participant-state-cell { padding-right: 6px !important; }
  .participants-table .row-actions { gap: 1px !important; }
  .app-shell .participant-group .participants-table .row-actions .action-btn:not(.mic-state) {
    width: 22px;
  }
  .app-shell .participant-group .participants-table .action-btn.mic-state {
    width: 44px;
    flex-basis: 44px;
    font-size: 10px;
  }
  .app-shell .participant-group .participants-table .volume-step { width: 14px; }
  .app-shell .participant-group .participants-table .volume-value { min-width: 20px; }
  .participants-table .participant-main .avatar { display: none; }
}
