:root {
  --bg: #0b1020;
  --panel: #151c30;
  --panel2: #1d2740;
  --text: #edf2ff;
  --muted: #aeb8d4;
  --accent: #4aa3ff;
  --danger: #ff4a66;
  --ok: #2ee59d;
  --warn: #ffcc66;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #18233f, var(--bg));
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  min-height: 100vh;
  padding: 24px 24px 92px;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.card {
  background: rgba(21, 28, 48, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.login {
  max-width: 980px;
  width: 100%;
  margin: auto;
  padding: 28px;
}

.brandBlock {
  text-align: center;
  margin-bottom: 18px;
}

.brandBlockMobile {
  display: none;
}

.loginContent {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  align-items: center;
  gap: 32px;
}

.loginForm {
  width: 100%;
}

.loginVisual {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.loginHeroLogo {
  max-width: min(100%, 300px);
  max-height: 280px;
  width: auto;
  object-fit: contain;
}

.brandLine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.brandLogo {
  max-height: 64px;
  width: auto;
  object-fit: contain;
}

.topbarBrand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.topbarSide {
  flex: 1 1 0;
  min-width: 0;
}

.topbarActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.brandLogosSmall {
  justify-content: center;
  gap: 10px;
}

.brandLogoSmall {
  max-height: 30px;
  width: auto;
  object-fit: contain;
}

.brandLineSmall {
  gap: 12px;
}

.brandLineSmall h1,
.brandBlock h1 {
  margin-bottom: 0;
}

#radio {
  width: 100%;
}

.siteFooter {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 20px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.footerContent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(21, 28, 48, 0.82);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
}

.footerLogo {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.footerLabel {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2 {
  margin-top: 0;
}

label {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

input, select, button {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
}

input, select {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
}

.login input,
.login select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
}

button {
  background: var(--accent);
  color: #06101f;
  font-weight: 800;
  cursor: pointer;
}

.login #joinBtn {
  margin-top: 16px;
}

button:hover:not(:disabled) {
  filter: brightness(1.08);
}

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

.secondaryBtn {
  background: #dceaff;
  color: #06101f;
  margin-bottom: 14px;
}

.dangerBtn {
  background: var(--danger);
  color: white;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.channelBox {
  display: flex;
  gap: 8px;
  max-width: 560px;
  width: auto;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 1 auto;
}

.channelBox select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
  margin-top: 0;
  min-width: 0;
  width: 220px;
  padding: 13px 14px;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.channelBox button {
  width: 190px;
  margin-top: 0;
  flex: 0 0 auto;
}

.iconBtn {
  width: 48px;
  min-width: 48px;
  height: 48px;
  margin-top: 0;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
}

.settingsModal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 18, 0.68);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.settingsPanel {
  width: min(100%, 460px);
}

.settingsPanel select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.settingsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settingsHeader h2 {
  margin-bottom: 0;
}

.closeBtn {
  font-size: 18px;
}

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

.panelHeader h2 {
  margin-bottom: 0;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.status, .micStatus {
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.status {
  background: rgba(46, 229, 157, 0.12);
  color: var(--ok);
}

.status.busy {
  background: rgba(255, 74, 102, 0.14);
  color: var(--danger);
}

.status.priority {
  background: rgba(255, 204, 102, 0.16);
  color: var(--warn);
}

.micOff {
  background: rgba(255, 74, 102, 0.14);
  color: var(--danger);
}

.micOn {
  background: rgba(46, 229, 157, 0.12);
  color: var(--ok);
}

.micWarn {
  background: rgba(255, 204, 102, 0.14);
  color: var(--warn);
}

.ptt {
  height: 160px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ff4a66, #bb1330);
  color: white;
  font-size: 22px;
  letter-spacing: 0.05em;
  user-select: none;
}

.ptt.active {
  background: linear-gradient(180deg, #2ee59d, #128657);
}

.hint {
  color: var(--muted);
}

.formMessage {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 74, 102, 0.14);
  color: var(--danger);
  font-weight: 700;
}

.user, .channel {
  background: var(--panel2);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.role {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(74, 163, 255, 0.18);
  color: var(--accent);
  font-size: 12px;
  margin-left: 6px;
}

.tx {
  color: var(--warn);
  font-weight: 800;
}

.log {
  height: 230px;
  overflow: auto;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

#channels {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.checkList {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid rgba(255,255,255,0.08);
}

.checkActions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.smallActionBtn {
  margin-top: 0;
  margin-bottom: 0;
  padding: 10px 12px;
  font-size: 14px;
}

.checkItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
}

.checkItem + .checkItem {
  margin-top: 4px;
}

.checkItem:hover {
  background: rgba(255,255,255,0.04);
}

.checkItem input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.checkItem span {
  color: var(--text);
  font-size: 15px;
}

.smallBtn {
  width: auto;
  padding: 7px 10px;
  font-size: 13px;
  margin-left: 8px;
}

.channelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

@media (max-width: 850px) {
  .login {
    max-width: 460px;
    padding: 20px;
  }

  .loginContent {
    display: block;
  }

  .loginVisual {
    display: none;
  }

  .brandBlockMobile {
    display: block;
  }

  .topbar, .topbarActions, .channelBox {
    flex-direction: column;
    align-items: stretch;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .channelBox button {
    width: 100%;
  }

  .iconBtn {
    width: 100%;
  }

  .panelHeader {
    align-items: center;
  }

  .panelHeader .iconBtn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    font-size: 20px;
    flex: 0 0 auto;
  }

  .panelHeader h2 {
    font-size: 1.2rem;
  }

  .siteFooter {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .footerLabel {
    width: auto;
  }

  .footerContent {
    width: 100%;
    justify-content: center;
  }
}
