:root {
  color-scheme: dark;
  font-family: "Inter", "Geist", system-ui, sans-serif;
  background: #0b1425;
  color: #ecf4f3;
  --accent: #63f2df;
  --muted: #a6bbd1;
  --border: #2a4057;
  --panel: #172337;
  --surface: #101b21;
  --warning: #ffd489;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; background: radial-gradient(ellipse at 50% 0%, #19313a 0%, transparent 32rem); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 6vw, 2.15rem); letter-spacing: -.045em; line-height: 1.15; }
h2 { font-size: 1.2rem; letter-spacing: -.025em; }
.shell { width: min(100%, 35rem); margin: auto; padding: max(1rem, env(safe-area-inset-top)) 1rem 2rem; }
.masthead, .channel-head, .channel-strip { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.masthead { min-height: 2.75rem; margin: .25rem 0 1.35rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-size: 1.3rem; font-weight: 800; letter-spacing: -.055em; }
.brand-mark { display: grid; place-items: center; width: 2.55rem; height: 2.55rem; border-radius: .8rem; background: var(--accent); color: #16240e; }
.brand-mark svg { width: 1.8rem; }
.brand-accent { color: #bfd0d2; }
.connection, .active-tag { display: inline-flex; align-items: center; gap: .42rem; padding: .44rem .65rem; color: var(--muted); background: #101a20; border: 1px solid var(--border); border-radius: 2rem; font-size: .73rem; font-weight: 700; white-space: nowrap; }
.connection i, .active-tag i { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.connection[data-state="online"], .active-tag { color: var(--accent); }
.connection[data-state="connecting"] { color: var(--warning); }
.panel { border: 1px solid var(--border); background: var(--panel); border-radius: 1.1rem; padding: clamp(1rem, 4vw, 1.5rem); }
.eyebrow { display: block; margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .11em; font-size: .68rem; font-weight: 800; color: var(--muted); }

.join-screen { border: 1px solid var(--border); border-radius: 1.35rem; overflow: hidden; box-shadow: 0 1rem 3rem #02070a40; }
.join-visual { position: relative; isolation: isolate; display: grid; place-items: center; min-height: clamp(6.5rem, 24vh, 11rem); overflow: hidden; background: radial-gradient(circle at center, #294635, #14242b 65%, #101d24); }
.signal-grid { position: absolute; z-index: -1; inset: 0; background: linear-gradient(#9fc9b41c 1px, transparent 1px), linear-gradient(90deg, #9fc9b41c 1px, transparent 1px); background-size: 24px 24px; mask-image: radial-gradient(ellipse, #000, transparent 77%); }
.signal-dial { display: grid; place-items: center; width: 4.4rem; aspect-ratio: 1; border: 1px solid #baf2766b; border-radius: 50%; box-shadow: 0 0 0 .75rem #baf27616, 0 0 0 1.55rem #baf2760e, 0 0 0 2.35rem #baf27608; color: var(--accent); }
.signal-dial svg { width: 2.8rem; }
.join-panel { border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: clamp(1.15rem, 5vw, 1.8rem); }
.panel-head p { margin: .65rem 0 1.4rem; color: var(--muted); font-size: .92rem; line-height: 1.45; }
form { display: grid; }
label { font-size: .84rem; font-weight: 650; margin-bottom: .45rem; }
input { width: 100%; min-height: 3.25rem; padding: .75rem .9rem; margin-bottom: 1rem; background: #0f1b21; color: inherit; border: 1px solid #3b5159; border-radius: .65rem; }
input::placeholder { color: #8ea5aa; }
#code, #switch-code { font-variant-numeric: tabular-nums; }
.primary, .quiet { min-height: 2.75rem; border-radius: .7rem; }
.primary { display: flex; justify-content: space-between; align-items: center; min-height: 3.25rem; padding: .75rem 1rem; background: var(--accent); color: #16240e; border: 1px solid transparent; font-weight: 800; }
.primary:disabled, .quiet:disabled, .menu-button:disabled { opacity: .55; }
.quiet { padding: .5rem .8rem; background: #101c22; color: #d6e4e4; border: 1px solid var(--border); font-size: .85rem; font-weight: 650; }
.create { margin-top: .65rem; }
.notice { margin: .8rem 0 0; color: var(--warning); font-size: .87rem; line-height: 1.45; }
.notice.success { color: var(--accent); }

#radio-screen { padding-bottom: calc(4.7rem + env(safe-area-inset-bottom)); }
.screen { display: grid; gap: .75rem; }
.screen-heading { margin-bottom: .2rem; }
.channel-strip { padding: .9rem 1rem; }
.channel-strip h1 { font-size: 1.35rem; }
.channel-label { display: flex; align-items: center; gap: .45rem; }
.channel-label i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 .65rem #63f2df99; animation: channel-pulse 1.5s ease-in-out infinite; }
@keyframes channel-pulse { 50% { opacity: .35; } }
.team-shortcut { display: flex; align-items: center; gap: .4rem; min-width: 3.45rem; font-variant-numeric: tabular-nums; }
.team-shortcut svg, .bottom-nav svg { width: 1.3rem; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.activity { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5.6rem; padding: .9rem 1rem; background: #111e25; }
.activity-label { color: var(--accent); }
.activity strong { display: block; overflow-wrap: anywhere; font-size: clamp(1.1rem, 4.8vw, 1.42rem); letter-spacing: -.025em; }
.signal-bars { display: flex; flex: 0 0 auto; align-items: center; gap: .23rem; color: #3f575c; }
.signal-bars i { display: block; width: .25rem; height: 2.25rem; background: currentColor; border-radius: 1rem; transform: scaleY(.08); transition: transform .04s linear; }
[data-radio="listening"] .signal-bars { color: var(--accent); }
[data-radio="speaking"] .signal-bars, [data-radio="speaking"] .activity-label { color: var(--warning); }
.talk-zone { display: grid; justify-items: center; text-align: center; padding-top: .4rem; min-width: 0; }
.talk-ring { display: grid; place-items: center; width: min(100%, clamp(12.8rem, 56vw, 16rem)); aspect-ratio: 1; border: 1px solid #63f2df36; border-radius: 50%; background: radial-gradient(circle, #234455, #111c31 70%); box-shadow: inset 0 0 0 .5rem #0b142566, inset 0 0 0 .57rem #63f2df26; }
.talk { display: flex; width: 78%; aspect-ratio: 1; flex-direction: column; gap: .45rem; align-items: center; justify-content: center; border: 2px solid #396778; border-radius: 50%; background: radial-gradient(circle at 50% 20%, #20374c, #111d31 75%); color: var(--accent); box-shadow: 0 .5rem 1.5rem #05091080; transition: box-shadow .14s, border-color .14s; font-size: clamp(1rem, 4.6vw, 1.25rem); font-weight: 850; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.talk { position: relative; }
.talk svg { width: 3.8rem; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.talk span { position: absolute; top: 73%; font-size: .77rem; pointer-events: none; }
[data-radio="listening"] .talk { background: #23393d; border-color: #507375; color: #e5f0ef; }
[data-radio="speaking"] .talk, .talk[data-held="true"] { border-color: var(--accent); color: #fff; background: radial-gradient(circle at 50% 20%, #26877e, #16344a 80%); box-shadow: 0 0 1.2rem #63f2dfaa, 0 0 3rem #63f2df55, inset 0 0 1rem #63f2df60; }
[data-radio="speaking"] .signal-bars, [data-radio="speaking"] .activity-label { color: var(--accent); }
.urgent-option { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; color: #ffb5a7; }
.urgent-option input { width: 1.15rem; min-height: 0; margin: 0; accent-color: #ffb5a7; }
.channel-list { display: grid; min-width: 0; gap: .5rem; }
.channel-list-item { display: flex; align-items: center; justify-content: space-between; gap: .7rem; width: 100%; min-height: 3.4rem; padding: .7rem .85rem; text-align: start; background: var(--panel); color: inherit; border: 1px solid var(--border); border-radius: .75rem; }
.channel-list-name { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.channel-list-status { display: inline-flex; align-items: center; gap: .4rem; flex-shrink: 0; font-size: .78rem; }
.channel-list-item:disabled { opacity: .55; }
.channel-list-item.current-channel { background: #1b353e; color: var(--accent); border-color: #376971; opacity: 1; }
.channel-head > div { min-width: 0; overflow-wrap: anywhere; }
.live-dot { width: .46rem; height: .46rem; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 .65rem #63f2df99; animation: channel-pulse 1.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .channel-label i, .live-dot { animation: none; }
  .talk, .signal-bars i { transition: none; }
}
.talk:disabled { opacity: .55; }
.radio-message { min-height: 1.25rem; margin-top: .6rem; color: var(--muted); font-size: .84rem; line-height: 1.4; }
#enable-audio { margin-top: .6rem; }
.channel-details { background: linear-gradient(135deg, #1c332f, var(--panel) 72%); }
.share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .85rem; border-top: 1px solid var(--border); padding-top: .85rem; }
.share strong { color: var(--accent); font-size: 1.2rem; font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.channel-menu { display: grid; padding: 0 1rem; }
.menu-button { display: flex; align-items: center; justify-content: space-between; gap: .6rem; text-align: left; width: 100%; min-height: 3.5rem; padding: .72rem .1rem; border: 0; background: transparent; color: inherit; font-weight: 700; }
.menu-button + .menu-button { border-top: 1px solid var(--border); }
.menu-button small { display: block; margin-top: .25rem; font-weight: 450; color: var(--muted); }
.menu-button > span:last-child { font-size: 1.25rem; color: var(--accent); }
.menu-button.leave, .menu-button.leave > span:last-child { color: #ffb5a7; }
#member-count { display: grid; place-items: center; min-width: 2.4rem; min-height: 2.4rem; padding-inline: .35rem; border-radius: .7rem; background: #213b32; color: var(--accent); font-size: 1rem; font-weight: 800; }
#members { padding: 0; margin: .6rem 0 0; list-style: none; }
#members li { display: flex; align-items: center; gap: .7rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
#members li:last-child { border-bottom: 0; padding-bottom: 0; }
#members li > span:nth-child(2) { overflow-wrap: anywhere; min-width: 0; }
.member-avatar { display: grid; place-items: center; flex: 0 0 2rem; aspect-ratio: 1; border-radius: .6rem; background: #253942; color: #d7e5e7; font-size: .75rem; font-weight: 800; }
.member-status { flex-shrink: 0; margin-left: auto; color: var(--accent); font-size: .74rem; }
[data-speaking="true"] .member-avatar { background: #2a4934; color: var(--accent); }

.bottom-nav { position: fixed; z-index: 2; bottom: 0; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; width: min(100%, 35rem); padding: .55rem .8rem max(.55rem, env(safe-area-inset-bottom)); border: 1px solid var(--border); border-bottom: 0; border-radius: 1rem 1rem 0 0; background: #101c23; box-shadow: 0 -.75rem 2rem #040a0d50; }
.bottom-nav button { display: grid; gap: .2rem; justify-items: center; align-content: center; min-height: 3rem; border: 1px solid transparent; border-radius: .65rem; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 700; }
.bottom-nav button[aria-pressed="true"] { background: #223a33; border-color: #314d40; color: var(--accent); }
dialog { color: inherit; width: min(calc(100% - 2rem), 23rem); }
dialog::backdrop { background: #03070bc0; }
dialog h2 { margin-bottom: 1rem; }
.channel-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; }
dialog .primary { min-height: 2.75rem; }
