:root {
  color-scheme: dark;
  --bg: #121412;
  --surface: #1c201d;
  --surface-2: #252a27;
  --line: #384039;
  --text: #f4f7f2;
  --muted: #aeb8ae;
  --accent: #4ecb71;
  --accent-2: #f3b34c;
  --danger: #ef6351;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(78, 203, 113, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(243, 179, 76, 0.08), transparent 42%),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-shell {
  width: min(100%, 440px);
}

.auth-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 32, 29, 0.94);
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-link {
  color: var(--muted);
  text-align: center;
}

.auth-link a {
  color: var(--accent);
  font-weight: 800;
}

.install-link {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 900;
}

.dashboard-shell {
  min-height: 100vh;
  padding: 20px;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.plan-panel {
  grid-column: 1 / -1;
}

.limit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.limit-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101310;
  padding: 12px;
}

.limit-grid strong,
.limit-grid span {
  display: block;
}

.limit-grid strong {
  color: var(--accent);
  font-size: 1.4rem;
}

.limit-grid span {
  color: var(--muted);
  font-size: 0.86rem;
}

.group-manager {
  grid-column: 1 / -1;
}

.group-list {
  display: grid;
  gap: 12px;
}

.group-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141714;
  padding: 14px;
}

.group-card-header,
.group-actions,
.member-row,
.member-actions,
.channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-card-header {
  justify-content: space-between;
}

.group-actions,
.member-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.group-card h2 {
  font-size: 1.15rem;
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
  gap: 14px;
}

.stack-list {
  display: grid;
  gap: 8px;
}

.channel-row,
.member-row {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101310;
  padding: 8px;
}

.channel-row {
  flex-wrap: wrap;
}

.channel-row input {
  flex: 1 1 180px;
}

.member-row {
  justify-content: space-between;
}

.member-row strong,
.member-row span {
  display: block;
}

.member-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

.role-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  padding: 6px 10px;
  font-weight: 800;
}

.member-role {
  width: auto;
}

.channel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.channel-links a,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101310;
  color: var(--text);
  padding: 8px 11px;
  text-decoration: none;
  font-weight: 800;
}

.channel-links a:hover,
.nav-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.empty-state,
.invite-line {
  color: var(--muted);
}

.sidebar,
.radio-room {
  border: 1px solid var(--line);
  background: rgba(28, 32, 29, 0.92);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

.radio-room {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  padding: 22px;
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.25rem;
}

h2 {
  margin-top: 4px;
  font-size: clamp(1.7rem, 3vw, 3.1rem);
  letter-spacing: 0;
}

p,
.eyebrow,
label,
.section-title,
small {
  color: var(--muted);
}

.panel,
.users-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.compact-panel {
  display: grid;
  gap: 10px;
}

.section-title,
.room-header,
.room-stats,
.create-row,
.user-pill {
  display: flex;
  align-items: center;
}

.section-title,
.room-header {
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  font-size: 0.9rem;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101310;
  color: var(--text);
  padding: 0 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78, 203, 113, 0.14);
}

button {
  border: 0;
  cursor: pointer;
}

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

.is-hidden {
  display: none !important;
}

.form-stack {
  display: grid;
  gap: 10px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-button,
.secondary-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101310;
  color: var(--text);
  font-weight: 800;
}

.tab-button.is-active,
.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.primary-button {
  width: 100%;
  height: 44px;
  margin-top: 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #071009;
  font-weight: 800;
}

.create-row {
  gap: 8px;
}

.icon-button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--accent-2);
  color: #140f04;
  font-size: 1.4rem;
  font-weight: 800;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.status-dot.online {
  color: var(--accent);
}

.status-dot.offline {
  color: var(--danger);
}

.speaker-strip {
  min-height: 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ptt-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
}

.floor-notice {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  max-width: min(90%, 460px);
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 179, 76, 0.42);
  border-radius: 999px;
  background: rgba(20, 23, 20, 0.96);
  color: #ffd890;
  padding: 8px 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  text-align: center;
  z-index: 2;
}

.floor-notice.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.talk-button {
  width: min(72vw, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 34%, #5bea83, #2a8f48 62%, #16612f);
  color: #061008;
  box-shadow: 0 0 0 14px rgba(78, 203, 113, 0.12), 0 28px 60px rgba(0, 0, 0, 0.38);
  text-align: center;
  user-select: none;
  touch-action: none;
}

.talk-button.is-talking {
  background: radial-gradient(circle at 50% 34%, #ffd57e, #f3b34c 62%, #a86a18);
  box-shadow: 0 0 0 18px rgba(243, 179, 76, 0.18), 0 28px 60px rgba(0, 0, 0, 0.38);
}

.talk-button strong {
  max-width: 78%;
  font-size: 1.22rem;
}

.talk-button small {
  max-width: 78%;
  color: rgba(6, 16, 8, 0.78);
  font-weight: 700;
}

.mic-icon {
  position: relative;
  width: 48px;
  height: 64px;
  border: 5px solid #061008;
  border-radius: 28px;
}

.mic-icon::before,
.mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #061008;
}

.mic-icon::before {
  bottom: -22px;
  width: 6px;
  height: 20px;
}

.mic-icon::after {
  bottom: -27px;
  width: 42px;
  height: 6px;
  border-radius: 999px;
}

.users-panel {
  min-height: 122px;
}

.users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.user-pill {
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #141714;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.talking-badge {
  display: none;
  border-radius: 999px;
  background: rgba(243, 179, 76, 0.18);
  color: #ffd890;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.user-pill.is-talking .talking-badge {
  display: inline-flex;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .radio-room {
    min-height: 640px;
  }

  .ptt-stage {
    min-height: 300px;
  }

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

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions button {
    flex: 1 1 auto;
  }

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

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

  .group-card-header,
  .member-row {
    align-items: stretch;
    flex-direction: column;
  }

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