/* Dark, modern ATC console. Function first, polish second. */

:root {
  --bg: #070b10;
  --panel: #101820;
  --border: #2a3a48;
  --text: #d7e4ee;
  --muted: #7f93a4;
  --accent: #00aeef;
  --accent-strong: #3dc4f5;
  --green: #3dff8a;
  --amber: #ffbf3c;
  --red: #ff4d4d;
  --ptt: #1c2a36;
  --ptt-active: #7a1c1c;
  --row: #0b1218;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #15202b 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.panel {
  width: min(440px, 92vw);
  padding: 28px 28px 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 0 0 1px #000, 0 18px 40px rgba(0, 0, 0, 0.45);
}

.panel.radio-wide {
  width: min(1280px, 97vw);
}

body.console-mode {
  align-items: stretch;
  background: #071018;
}

body.console-mode .panel {
  margin: 12px auto;
  background: #0d141c;
  border-color: #243140;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

body.console-mode .header,
body.console-mode .subtitle {
  display: none;
}

.panel.configuration-wide {
  width: min(820px, 94vw);
}

.setup-mode {
  margin: 4px 0 18px;
  padding: 0;
  border: 0;
}

.setup-mode legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-button,
.compact-action {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #18222c;
  color: var(--text);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.mode-button.selected {
  border-color: var(--accent);
  background: #082838;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.builder-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.pilot-badge {
  color: var(--green);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.position-builder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 10px;
}

.position-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--row);
}

.position-fields {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}

.position-fields input {
  margin-bottom: 8px;
  background: #070d12;
}

.optional {
  color: #566b7c;
  font-size: 0.65rem;
}

.position-card-actions,
.management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.position-card-actions .back-button {
  margin: 0;
  color: var(--red);
}

.position-advanced {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.position-advanced[hidden] {
  display: none;
}

.section .check-field {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0;
  letter-spacing: 0.05em;
}

.check-field input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.configuration-management {
  margin: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.configuration-management summary {
  padding: 13px 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.management-actions {
  padding: 0 0 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

@media (max-width: 650px) {
  .position-fields,
  .position-advanced {
    grid-template-columns: 1fr;
  }
}

.header {
  text-align: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(220px, 72%);
  max-height: 42px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  margin: 0 0 18px;
  color: var(--muted);
  text-align: center;
}

.section-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section label,
.g2g-modal-card label,
.label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--row);
  color: var(--text);
  font-size: 1rem;
}

input:focus,
select:focus {
  outline: 1px solid var(--accent);
}

button {
  font-family: inherit;
}

.choice-button,
#confirm-create-button,
#join-button,
#ptt-button,
#ai-help-button {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.choice-button {
  margin-bottom: 12px;
  padding: 18px 12px;
  background: #082838;
  color: var(--accent);
  font-weight: 700;
}

.choice-button:hover,
#confirm-create-button:hover,
#join-button:hover {
  background: #0c3a4e;
}

.choice-button.secondary {
  background: #18222c;
  color: var(--text);
}

.choice-button.secondary:hover {
  background: #22303c;
}

#confirm-create-button,
#join-button {
  margin-top: 4px;
  padding: 12px;
  background: #082838;
  color: var(--accent);
  font-weight: 700;
}

.back-button {
  display: inline-block;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  cursor: pointer;
}

.back-button:hover {
  color: var(--text);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.list-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--row);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.list-button:hover:not(:disabled) {
  border-color: var(--accent);
}

.list-button.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.list-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.list-status {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-status.occupied {
  color: var(--amber);
}

.list-status.available {
  color: var(--green);
}

.empty-state {
  padding: 28px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
}

.empty-title {
  margin: 0 0 8px;
  color: var(--amber);
  letter-spacing: 0.14em;
  font-weight: 700;
}

.empty-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.message {
  margin: 12px 0 0;
  color: var(--amber);
  font-size: 0.9rem;
}

.freq-row,
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.freq-row.compact {
  margin-bottom: 18px;
}

.meta-value {
  color: var(--text);
  letter-spacing: 0.04em;
  font-weight: 700;
}

.freq {
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.status {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.status-disconnected {
  color: var(--muted);
}

.status-connecting {
  color: var(--amber);
}

.status-connected,
.status-restored {
  color: var(--green);
}

.status-reconnecting,
.status-restoring {
  color: var(--amber);
}

.restore-status {
  margin: 0 0 10px;
  text-align: center;
  color: var(--amber);
  letter-spacing: 0.12em;
  font-weight: 700;
}

#home-clear-button {
  margin-top: 16px;
}

.leave-session {
  margin-top: 18px;
  width: 100%;
  text-align: center;
}

.audio-block {
  margin-top: 0;
  padding: 14px 16px;
  border: 1px solid #2a3d4f;
  border-radius: 14px;
  background: #121a22;
}

.audio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}

.audio-row {
  display: grid;
  grid-template-columns: 6.4rem 1fr 2.6rem;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.audio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.row-icon {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.audio-row input[type="range"] {
  --fill: 0%;
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    var(--accent) var(--fill),
    #263340 var(--fill)
  );
  border-radius: 3px;
  cursor: pointer;
}

.audio-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 6px rgba(0, 174, 239, 0.5);
  cursor: pointer;
}

.audio-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 6px rgba(0, 174, 239, 0.5);
  cursor: pointer;
}

.audio-row input[type="range"]::-moz-range-progress {
  background: var(--accent);
  height: 4px;
  border-radius: 3px;
}

.audio-value {
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.list-status.reconnecting {
  color: var(--amber);
}

.txrx-row {
  display: flex;
  gap: 12px;
  margin: 8px 0 6px;
}

.indicator {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: #31404c;
  background: var(--row);
}

.indicator.active-tx {
  color: #fff;
  background: #8b1e1e;
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.35);
}

.indicator.active-rx {
  color: #062214;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(61, 255, 138, 0.35);
}

.tx-user {
  min-height: 1.2em;
  margin: 0 0 18px;
  text-align: center;
  color: var(--amber);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

#ptt-button {
  height: 140px;
  background: var(--ptt);
  font-size: 2rem;
  font-weight: 800;
}

#ptt-button:hover {
  background: #243644;
}

#ptt-button.active {
  background: var(--ptt-active);
  border-color: var(--red);
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--red);
}

.hint {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

#remote-audios {
  display: none;
}

.radio-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 14px;
}

.radio-row {
  display: grid;
  grid-template-columns: minmax(7.2rem, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--row);
}

.radio-row.pilot {
  grid-template-columns: minmax(7.2rem, 1fr) auto auto;
  cursor: pointer;
}

.radio-row.pilot:hover {
  border-color: #3d5366;
}

.radio-freq {
  font-size: 1.45rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.radio-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-role {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--border);
}

.radio-sub {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rx-btn,
.tx-btn {
  min-width: 64px;
  padding: 12px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #121a22;
  color: #3a4c5a;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  cursor: pointer;
}

.rx-btn.on {
  color: #062214;
  background: var(--green);
  border-color: var(--green);
}

.tx-btn.on {
  color: #fff;
  background: #8b1e1e;
  border-color: var(--red);
}

.radio-row.rx-live {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(61, 255, 138, 0.18);
}

.radio-row.tx-live {
  border-color: var(--red);
  box-shadow: 0 0 16px rgba(255, 77, 77, 0.22);
}

.radio-row.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.radio-row.selected .radio-freq {
  color: var(--accent-strong);
}

.radio-row.busy {
  border-color: var(--amber);
}

.radio-row.blocked {
  border-color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 191, 60, 0.2);
}

.radio-flag {
  justify-self: end;
  min-width: 5.6rem;
  padding: 6px 8px;
  border-radius: 4px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.radio-flag.busy {
  color: #2a1c00;
  background: var(--amber);
}

.radio-flag.blocked {
  color: #2a1c00;
  background: var(--amber);
}

.radio-flag.tx-active {
  color: #fff;
  background: #8b1e1e;
}

#ptt-button.blocked {
  background: #4a3a12;
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: inset 0 0 0 2px var(--amber);
}

.comms-block {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.g2g-status.intercom-open {
  color: var(--red);
  font-weight: 800;
}

.intercom-alert {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: #3a1c1c;
  color: #ffd0d0;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  animation: intercom-pulse 0.8s linear infinite;
}

@keyframes intercom-pulse {
  0%,
  100% {
    background: #3a1c1c;
  }
  50% {
    background: #7a1c1c;
  }
}

.g2g-status {
  min-height: 1.3em;
  margin: 0;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: right;
}

.g2g-targets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.g2g-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #1c2b38;
  border-radius: 8px;
  background: #141c25;
  color: var(--text);
  letter-spacing: 0.06em;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.g2g-icon {
  flex: 0 0 auto;
  color: var(--muted);
}

.g2g-name {
  flex: 1;
  text-align: left;
  text-transform: none;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.g2g-button .list-status {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 800;
}

.g2g-chevron {
  flex: 0 0 auto;
  color: var(--muted);
}

.g2g-button.available .g2g-icon {
  color: var(--green);
}

.g2g-button.available .list-status {
  color: var(--green);
}

.g2g-button.offline .list-status {
  color: var(--muted);
}

.g2g-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #182029;
}

.g2g-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.g2g-button.busy {
  border-color: var(--amber);
}

.g2g-button.busy .g2g-icon,
.g2g-button.busy .list-status {
  color: var(--amber);
}

.g2g-button.calling,
.g2g-button.ringing {
  border-color: var(--accent);
}

.g2g-button.connected,
.g2g-button.conference {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.g2g-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.g2g-actions button {
  flex: 1;
  min-width: 120px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}

.g2g-answer {
  background: #163024;
  color: var(--green);
}

.g2g-reject,
.g2g-cancel,
.g2g-end {
  background: #3a1c1c;
  color: #ffb3b3;
}

.g2g-add {
  background: #18222c;
  color: var(--text);
}

#g2g-audios {
  display: none;
}

.console-section {
  margin-top: 0;
}

.console-top {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 18px;
  border: 1px solid #243140;
  border-radius: 12px;
  background: linear-gradient(180deg, #131c25, #0d151d);
}

.console-logo {
  width: 104px;
  height: 30px;
  max-width: 104px;
  max-height: 30px;
  margin: 0;
  object-fit: contain;
}

.console-top-item .label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.console-top-status {
  justify-self: center;
}

.console-top-status .status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.console-top-status .status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}

.console-top-actions {
  display: flex;
  gap: 10px;
}

.console-top .leave-session {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  width: auto;
  padding: 8px 14px;
  border: 1px solid #243140;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.console-top .leave-session:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: rgba(0, 174, 239, 0.08);
}

.btn-icon {
  flex: 0 0 auto;
}

.title-icon {
  flex: 0 0 auto;
  margin-right: 8px;
  color: var(--accent-strong);
  vertical-align: -3px;
}

.console-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.console-card {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 18px;
  border: 1px solid #233240;
  border-radius: 14px;
  background: #121a22;
}

.console-card > .section-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 1.15em;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1c2b38;
  color: #9eb4c4;
  font-size: 0.78rem;
}

.console-grid .console-card[hidden] {
  display: none;
}

.freq-col .radio-stack {
  flex: 1;
}

.couple-key {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.line-keys .hmi-key {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.couple-key .key-icon,
.line-keys .hmi-key .key-icon {
  flex: 0 0 auto;
}

.couple-status {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 10px 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.couple-status span:first-child {
  color: var(--muted);
}

.couple-status span:last-child {
  color: var(--text);
  font-weight: 700;
}

.call-status-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1c2b38;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.call-status-label {
  color: var(--muted);
}

.line-keys,
.call-keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.hmi-key.hmi-end {
  border-color: var(--red);
  background: #c62828;
  color: #fff;
}

.hmi-key.hmi-end:hover {
  background: #d63a3a;
  border-color: #d63a3a;
  color: #fff;
}

.call-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.call-timer {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-align: center;
}

.call-waveform {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 26px;
  margin: 2px 0 10px;
}

#call-panel.call-live .call-waveform {
  display: flex;
}

.call-waveform span {
  width: 2px;
  border-radius: 1px;
  background: var(--accent-strong);
  opacity: 0.85;
  animation: waveform-pulse 1.6s ease-in-out infinite;
}

@keyframes waveform-pulse {
  0%,
  100% {
    transform: scaleY(0.55);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(1);
    opacity: 0.9;
  }
}

.call-waveform span:nth-child(8n + 1) {
  height: 7px;
  animation-delay: 0s;
}
.call-waveform span:nth-child(8n + 2) {
  height: 16px;
  animation-delay: 0.08s;
}
.call-waveform span:nth-child(8n + 3) {
  height: 24px;
  animation-delay: 0.16s;
}
.call-waveform span:nth-child(8n + 4) {
  height: 11px;
  animation-delay: 0.24s;
}
.call-waveform span:nth-child(8n + 5) {
  height: 20px;
  animation-delay: 0.32s;
}
.call-waveform span:nth-child(8n + 6) {
  height: 9px;
  animation-delay: 0.4s;
}
.call-waveform span:nth-child(8n + 7) {
  height: 22px;
  animation-delay: 0.48s;
}
.call-waveform span:nth-child(8n + 8) {
  height: 13px;
  animation-delay: 0.56s;
}

.call-keys .hmi-key {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #263646;
  border-radius: 10px;
  background: #121a22;
  color: #cddce6;
}

.call-keys .hmi-key .key-icon {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.call-keys .hmi-key:hover {
  border-color: var(--accent-strong);
}

.call-keys .hmi-key.hmi-teal {
  border-color: #263646;
  background: #121a22;
  color: #cddce6;
}

.call-keys .hmi-key.hmi-teal .key-icon {
  color: var(--accent-strong);
}

.call-keys .hmi-key.hmi-teal:hover {
  border-color: var(--accent-strong);
  background: #121a22;
}

.call-keys .hmi-key.hmi-end {
  border-color: rgba(255, 77, 77, 0.35);
  background: rgba(198, 40, 40, 0.1);
  color: var(--red);
}

.call-keys .hmi-key.hmi-end .key-icon {
  color: var(--red);
}

.call-keys .hmi-key.hmi-end:hover {
  border-color: var(--red);
  background: rgba(198, 40, 40, 0.18);
  color: #ff8a8a;
}

.call-keys .hmi-key[data-key="video"] {
  position: relative;
}

.call-keys .hmi-key[data-key="video"] .key-lamp {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #314357;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.call-keys .hmi-key[data-key="video"].active {
  border-color: #57b6ff;
  background: rgba(24, 56, 92, 0.55);
}

.call-keys .hmi-key[data-key="video"].active .key-lamp {
  background: #57b6ff;
  box-shadow: 0 0 8px rgba(87, 182, 255, 0.75);
}

.call-keys .hmi-key[data-key="video"]:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.end-icon {
  transform: rotate(135deg);
}

.observer-mode .couple-key,
.observer-mode .couple-status {
  display: none;
}

.observer-empty {
  margin: 0.5rem 0 0;
  color: #89a6cc;
  font-size: 0.82rem;
}

.observer-call-row {
  width: 100%;
  text-align: left;
}

.observer-stop {
  width: 100%;
}

.ptt-bar[hidden] {
  display: none;
}

.console-video-panel {
  margin-top: 16px;
  padding: 16px 18px 18px;
  border: 1px solid #233240;
  border-radius: 14px;
  background: #121a22;
}

.console-video-panel[hidden] {
  display: none;
}

.video-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1c2b38;
}

.video-panel-head .section-title {
  margin: 0;
  padding: 0;
  border: 0;
  flex: 1 1 auto;
}

.video-call-label,
.video-participant-count {
  margin: 0;
  font-size: 0.78rem;
  color: #89a6cc;
}

.video-participant-count {
  margin-left: auto;
  white-space: nowrap;
}

.video-notice {
  margin: 0 0 10px;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(87, 182, 255, 0.35);
  border-radius: 8px;
  background: rgba(24, 56, 92, 0.45);
  color: #b8dcff;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.video-notice[hidden] {
  display: none;
}

.video-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-bottom: 12px;
}

.video-toolbar[hidden] {
  display: none;
}

.video-toolbar-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.video-toolbar-label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #89a6cc;
  white-space: nowrap;
}

.video-camera-select {
  min-width: 160px;
  max-width: 240px;
  padding: 0.35rem 0.5rem;
  border: 1px solid #2a4058;
  border-radius: 6px;
  background: #0b1520;
  color: #d7e6f5;
  font-size: 0.78rem;
}

.video-camera-select:disabled {
  opacity: 0.45;
}

.video-toolbar-btn {
  padding: 0.38rem 0.7rem;
  border: 1px solid #2a4058;
  border-radius: 6px;
  background: #152433;
  color: #c8dcf0;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.video-toolbar-btn:hover {
  border-color: #57b6ff;
  background: rgba(24, 56, 92, 0.55);
}

.video-toolbar-btn.active {
  border-color: #57b6ff;
  background: rgba(24, 56, 92, 0.75);
  color: #e8f4ff;
}

.video-grid {
  display: grid;
  gap: 12px;
  min-height: 140px;
}

.video-grid.layout-1 {
  grid-template-columns: minmax(0, 640px);
}

.video-grid.layout-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-grid.layout-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-grid.layout-many {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.video-grid.layout-pinned {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.video-grid.layout-pinned .video-tile-pinned {
  grid-column: 1 / -1;
  min-height: 300px;
}

.video-grid.layout-pinned .video-tile-pinned .video-frame {
  min-height: 260px;
}

.video-grid.layout-pinned .video-tile-thumb {
  min-height: 110px;
}

.video-grid.layout-pinned .video-tile-thumb .video-frame {
  min-height: 90px;
}

.video-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(120, 170, 255, 0.22);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(5, 14, 28, 0.88);
}

.video-tile-local {
  border-color: rgba(90, 190, 255, 0.45);
}

.video-frame {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 220px;
  aspect-ratio: 16 / 9;
  background: #020810;
  cursor: pointer;
}

.video-frame:focus-visible {
  outline: 2px solid #57b6ff;
  outline-offset: -2px;
}

.video-pin-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(8, 18, 34, 0.82);
  color: #9fd0ff;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

.video-tile:not(.has-video) .video-frame {
  cursor: default;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #020810;
}

.video-frame video.video-main {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-tile-screen-share .video-frame video.video-main {
  object-fit: contain;
}

.video-pip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-width: 96px;
  min-height: 72px;
  border: 2px solid rgba(87, 182, 255, 0.75);
  border-radius: 10px;
  overflow: hidden;
  background: #020810;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 4;
  touch-action: none;
}

.video-pip-interactive {
  cursor: grab;
}

.video-pip.dragging {
  cursor: grabbing;
}

.video-pip.resizing {
  cursor: nwse-resize;
}

.video-pip-remote {
  pointer-events: none;
}

.video-pip[hidden] {
  display: none;
}

.video-pip-label {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  background: rgba(8, 18, 34, 0.82);
  color: #b8dcff;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

.video-pip-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #020810;
  pointer-events: none;
}

.video-pip-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 5;
  background: linear-gradient(135deg, transparent 0 45%, rgba(87, 182, 255, 0.85) 45% 100%);
  pointer-events: auto;
}

.video-pip-remote .video-pip-resize {
  display: none;
}

.video-tile-screen-share .video-pin-badge {
  left: 8px;
  right: auto;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #6f86a8;
  background: radial-gradient(circle at center, #0d1a30 0%, #050b16 100%);
}

.video-placeholder span {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.video-tile.has-video .video-placeholder {
  display: none;
}

.video-share-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.1rem 1.2rem;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(24, 56, 92, 0.55) 0%, #050b16 100%);
  z-index: 1;
}

.video-share-status[hidden] {
  display: none;
}

.video-share-status strong {
  color: #d7e6f5;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.video-share-status span {
  max-width: 22rem;
  color: #89a6cc;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.video-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-top: 1px solid rgba(120, 170, 255, 0.12);
  background: rgba(8, 18, 34, 0.95);
}

.video-name {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: #d7e6f5;
}

.video-role {
  font-size: 0.68rem;
  color: #89a6cc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.video-empty {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: #7f96b8;
  text-align: center;
}

.video-empty[hidden] {
  display: none;
}

.ptt-bar {
  position: relative;
  margin: 16px 0;
  padding: 0 100px;
}

.ptt-bar::before,
.ptt-bar::after {
  content: "";
  position: absolute;
  top: 4px;
  height: 80px;
  width: 90px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 80'%3E%3Ccircle cx='6' cy='6' r='4.2' fill='%233dc4f5' fill-opacity='0.85'/%3E%3Ccircle cx='6' cy='19' r='4.2' fill='%233dc4f5' fill-opacity='0.85'/%3E%3Ccircle cx='6' cy='32' r='4.2' fill='%233dc4f5' fill-opacity='0.85'/%3E%3Ccircle cx='6' cy='45' r='4.2' fill='%233dc4f5' fill-opacity='0.85'/%3E%3Ccircle cx='6' cy='58' r='4.2' fill='%233dc4f5' fill-opacity='0.85'/%3E%3Ccircle cx='6' cy='71' r='4.2' fill='%233dc4f5' fill-opacity='0.85'/%3E%3Ccircle cx='17' cy='6' r='3.8' fill='%233dc4f5' fill-opacity='0.8'/%3E%3Ccircle cx='17' cy='19' r='3.8' fill='%233dc4f5' fill-opacity='0.8'/%3E%3Ccircle cx='17' cy='32' r='3.8' fill='%233dc4f5' fill-opacity='0.8'/%3E%3Ccircle cx='17' cy='45' r='3.8' fill='%233dc4f5' fill-opacity='0.8'/%3E%3Ccircle cx='17' cy='58' r='3.8' fill='%233dc4f5' fill-opacity='0.8'/%3E%3Ccircle cx='17' cy='71' r='3.8' fill='%233dc4f5' fill-opacity='0.8'/%3E%3Ccircle cx='28' cy='6' r='3.3' fill='%233dc4f5' fill-opacity='0.72'/%3E%3Ccircle cx='28' cy='19' r='3.3' fill='%233dc4f5' fill-opacity='0.72'/%3E%3Ccircle cx='28' cy='32' r='3.3' fill='%233dc4f5' fill-opacity='0.72'/%3E%3Ccircle cx='28' cy='45' r='3.3' fill='%233dc4f5' fill-opacity='0.72'/%3E%3Ccircle cx='28' cy='58' r='3.3' fill='%233dc4f5' fill-opacity='0.72'/%3E%3Ccircle cx='28' cy='71' r='3.3' fill='%233dc4f5' fill-opacity='0.72'/%3E%3Ccircle cx='39' cy='19' r='2.7' fill='%233dc4f5' fill-opacity='0.62'/%3E%3Ccircle cx='39' cy='32' r='2.7' fill='%233dc4f5' fill-opacity='0.62'/%3E%3Ccircle cx='39' cy='45' r='2.7' fill='%233dc4f5' fill-opacity='0.62'/%3E%3Ccircle cx='39' cy='58' r='2.7' fill='%233dc4f5' fill-opacity='0.62'/%3E%3Ccircle cx='50' cy='19' r='2.1' fill='%233dc4f5' fill-opacity='0.5'/%3E%3Ccircle cx='50' cy='32' r='2.1' fill='%233dc4f5' fill-opacity='0.5'/%3E%3Ccircle cx='50' cy='45' r='2.1' fill='%233dc4f5' fill-opacity='0.5'/%3E%3Ccircle cx='50' cy='58' r='2.1' fill='%233dc4f5' fill-opacity='0.5'/%3E%3Ccircle cx='61' cy='32' r='1.6' fill='%233dc4f5' fill-opacity='0.4'/%3E%3Ccircle cx='61' cy='45' r='1.6' fill='%233dc4f5' fill-opacity='0.4'/%3E%3Ccircle cx='72' cy='32' r='1.1' fill='%233dc4f5' fill-opacity='0.3'/%3E%3Ccircle cx='72' cy='45' r='1.1' fill='%233dc4f5' fill-opacity='0.3'/%3E%3Ccircle cx='83' cy='38' r='0.8' fill='%233dc4f5' fill-opacity='0.22'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.ptt-bar::before {
  left: 0;
}

.ptt-bar::after {
  right: 0;
  transform: scaleX(-1);
}

.console-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: stretch;
}

.ai-help-slot {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.console-keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.hmi-key {
  min-height: 48px;
  padding: 8px 6px;
  border: 1px solid #263646;
  border-radius: 8px;
  background: #1a2530;
  color: #cddce6;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hmi-key:hover {
  border-color: #375064;
  color: #eaf3f8;
}

.hmi-key.hmi-teal {
  border-color: var(--accent);
  background: var(--accent);
  color: #04222c;
}

.hmi-key.hmi-teal:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.hmi-key:active {
  transform: translateY(1px);
}

.hmi-key.active {
  border-color: var(--accent);
  background: var(--accent-strong);
  color: #04222c;
  box-shadow: 0 0 12px rgba(0, 174, 239, 0.4);
}

.hmi-key.hmi-teal.couple-picking,
.hmi-key.couple-picking {
  background: linear-gradient(#c62828, #7a1c1c);
  border-color: #ff8a8a;
  color: #fff;
  box-shadow: inset 0 0 0 1px #ff8a8a, 0 0 14px rgba(255, 77, 77, 0.5);
}

.console-section .radio-row.couple-selectable {
  outline: 1px dashed rgba(255, 77, 77, 0.55);
}

.console-section .radio-row.couple-selected .freq-mid {
  background: #3a1c1c;
  box-shadow: inset 0 0 0 1px var(--red);
}
.hmi-key.intercom-live {
  background: linear-gradient(#c62828, #7a1c1c);
  border-color: #ff8a8a;
  box-shadow: inset 0 0 0 1px #ff8a8a, 0 0 14px rgba(255, 77, 77, 0.5);
}

.hmi-key[data-key="intercom"].intercom-live .key-lamp {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.85);
}

.hmi-key[data-key="ring-off"],
.hmi-key[data-key="intercom"] {
  position: relative;
  padding-top: 14px;
}

.key-lamp {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border: 1px solid #0a0c0e;
  border-radius: 1px;
  background: #1a1d20;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.hmi-key[data-key="ring-off"].active .key-lamp {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 191, 60, 0.85);
}

.hmi-key[data-key="ring-off"].ring-off-alert .key-lamp,
.hmi-key[data-key="intercom"].intercom-live .key-lamp {
  animation: lamp-flash 0.7s steps(1, end) infinite;
}

@keyframes lamp-flash {
  0%,
  49% {
    background: var(--amber);
    box-shadow: 0 0 10px rgba(255, 191, 60, 0.95);
  }
  50%,
  100% {
    background: #3a2a10;
    box-shadow: none;
  }
}

.console-key-hint {
  margin: -6px 0 12px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.g2g-button.armed {
  border-color: var(--accent);
  background: #08384c;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.console-section .radio-row.coupled .freq-mid {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.coupled-badge {
  color: var(--accent);
}

.freq-mid.selectable {
  cursor: pointer;
  outline: 1px dashed var(--accent);
}

.freq-mid.selected {
  background: #08384c;
}

.console-section .radio-stack {
  gap: 8px;
}

.console-section .radio-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 56px 56px;
  gap: 0;
  padding: 0;
  border: 1px solid #1c2b38;
  border-radius: 8px;
  overflow: hidden;
  background: #131b23;
  transition: border-color 0.15s ease;
}

.freq-channel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16222d;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
}

.freq-rx,
.freq-tx {
  min-height: 50px;
  border: 0;
  border-left: 1px solid #1c2b38;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.freq-rx {
  background: #182029;
  color: #56707f;
}

.freq-rx.on {
  background: var(--accent-strong);
  color: #04222c;
}

.freq-mid {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  background: #141c25;
  color: #d7e4ee;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.freq-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 4px;
  border: 1px solid #2f5468;
  border-radius: 4px;
  background: #0f2532;
  color: #7fd6ef;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.freq-tx {
  background: #182029;
  color: #56707f;
}

.freq-tx.on {
  background: var(--amber);
  color: #2a1c00;
}

.console-section .radio-row.rx-live {
  border-color: var(--accent-strong);
}

.console-section .radio-row.tx-live {
  border-color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 191, 60, 0.25);
}

.console-section .radio-row.rx-live .freq-mid {
  color: #eaf9ff;
}

.console-section .radio-row.tx-live .freq-mid {
  color: #ffe9bf;
}

.console-section .radio-row.busy .freq-mid {
  color: var(--amber);
}

.console-section #ptt-button {
  height: 88px;
  border: 1px solid #2f6fb0;
  border-radius: 14px;
  font-size: 1.9rem;
  letter-spacing: 0.16em;
  background: linear-gradient(180deg, #1f7fa8 0%, #12587a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 24px rgba(0, 174, 239, 0.2);
}

.console-section #ptt-button.active {
  background: linear-gradient(180deg, #5fd4f7, var(--accent-strong));
  border-color: var(--accent-strong);
  color: #04222c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 34px rgba(0, 174, 239, 0.6);
}

.console-section .ai-help-slot #ai-help-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 88px;
  margin: 0;
  border: 1px solid #2f6fb0;
  border-radius: 14px;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  background: #123a52;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.console-section #ai-help-button.recording {
  border-color: var(--red);
  background: #7a1c1c;
}

.console-section #ai-help-button.processing {
  border-color: var(--amber);
  background: #6b4d0a;
}

.ai-help-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: min(420px, 92vw);
  padding: 16px 18px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: rgba(16, 24, 32, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.ai-help-bubble[hidden] {
  display: none;
}

.ai-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-help-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  font-weight: 800;
}

.ai-help-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0b1218;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.ai-help-close:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.ai-help-question,
.ai-help-answer {
  margin: 0;
  line-height: 1.45;
}

.ai-help-question {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.ai-help-answer .spoken {
  color: var(--accent-strong);
  background: rgba(0, 174, 239, 0.16);
}

.admin-settings-card {
  width: min(560px, 94vw);
  max-height: 88vh;
  overflow: auto;
}

.admin-settings-card textarea,
.admin-settings-card input,
.admin-settings-card select {
  width: 100%;
  margin: 6px 0 12px;
}

.knowledge-file-list {
  margin: 10px 0 14px;
  display: grid;
  gap: 6px;
}

.knowledge-file-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0b1218;
  font-size: 0.85rem;
}

.knowledge-file-row button {
  width: auto;
  margin: 0;
  padding: 6px 10px;
}

.g2g-button.flashing {
  animation: g2g-flash 0.7s linear infinite;
}

@keyframes g2g-flash {
  0%,
  100% {
    background: #18222c;
    box-shadow: none;
  }
  50% {
    background: #1aa3c4;
    box-shadow: 0 0 14px rgba(26, 163, 196, 0.55);
  }
}

.g2g-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.g2g-modal[hidden] {
  display: none;
}

.g2g-modal-card {
  width: min(420px, 92vw);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #101820;
}

.g2g-choice-text {
  margin: 0 0 16px;
  text-align: center;
  letter-spacing: 0.04em;
}

.g2g-modal-card button {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 980px) {
  .console-grid,
  .console-top,
  .console-bottom,
  .audio-grid {
    grid-template-columns: 1fr;
  }

  .console-top-status {
    justify-self: start;
  }
}
