/* 삐리리 본부 - web console. Dark "walkie-talkie" theme, no external assets. */

:root {
  --bg: #1d2230;
  --panel: #262c3d;
  --panel-hi: #2b3245;
  --well: #171b26;
  --line: #39415a;
  --mint: #5be3a8;
  --amber: #ffc857;
  --coral: #ff6b6b;
  --text: #ededed;
  --muted: #9aa3b5;
  --radius: 14px;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, "D2Coding", "Noto Sans Mono KR", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(91, 227, 168, 0.09), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(255, 200, 87, 0.06), transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, 0.028) 1px, transparent 1.4px);
  background-size: auto, auto, 16px 16px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.mono {
  font-family: var(--mono);
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------ top bar */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 14px 22px;
  background: linear-gradient(180deg, #222838, #1d2230);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mascot {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
}

.mascot img,
.mascot svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 23px);
  letter-spacing: 0.22em;
  color: var(--mint);
  text-shadow: 0 0 14px rgba(91, 227, 168, 0.65), 0 0 2px rgba(91, 227, 168, 0.9);
  white-space: nowrap;
}

.logo-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  padding-top: 5px;
}

.topmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}

.family {
  color: var(--muted);
  white-space: nowrap;
}

.family b {
  color: var(--text);
  font-weight: 700;
  margin-left: 4px;
}

.server {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.badge-on {
  color: #0b2a1d;
  background: var(--mint);
}

.badge-off {
  color: #3a1414;
  background: var(--coral);
}

.badge-wait {
  color: #3a2a08;
  background: var(--amber);
}

.badge-viewer {
  color: #0f2233;
  background: #8fb9e8;
}

/* ------------------------------------------------------------ layout */

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 16px;
  max-width: 1680px;
  margin: 0 auto;
}

.panel {
  grid-column: span 6;
  min-width: 0;
  padding: 16px 18px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--mint);
}

.panel h2::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}

.pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}

.pill-live {
  color: #0b2a1d;
  background: var(--mint);
}

.hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.hint b {
  color: var(--amber);
}

.empty {
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (min-width: 760px) {
  .panel-rx,
  .panel-channels,
  .panel-weekly,
  .panel-hq {
    grid-column: span 3;
  }
}

@media (min-width: 1120px) {
  .grid {
    gap: 16px;
    padding: 18px 22px 26px;
  }
  .panel-broadcast,
  .panel-rx,
  .panel-channels,
  .panel-join,
  .panel-weekly,
  .panel-hq {
    grid-column: span 3;
  }
  .panel-members {
    grid-column: span 3;
    grid-row: span 2;
  }
  .mlist {
    max-height: 560px;
    overflow-y: auto;
  }
}

@media (max-width: 759px) {
  .topbar {
    padding: 12px 14px;
  }
  .grid {
    padding: 12px;
    gap: 12px;
  }
  .panel {
    padding: 14px 14px 16px;
  }
}

/* Phones: a member row needs the name on one line, so the columns stack. */
@media (max-width: 560px) {
  .mhead {
    display: none;
  }

  .mrow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "id week"
      "id ch"
      "id st"
      "mute mute"
      "act act";
    row-gap: 3px;
  }

  .m-mute {
    justify-content: flex-start;
    margin-top: 6px;
  }

  .m-act {
    justify-content: flex-start;
    margin-top: 6px;
  }

  .m-name,
  .m-sub {
    overflow-wrap: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ------------------------------------------------------------ shared controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #2f374b;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}

.btn:hover {
  background: #374057;
  border-color: #4a5475;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--mint);
  border-color: var(--mint);
  color: #0b2a1d;
}

.btn-primary:hover {
  background: #74ebba;
  border-color: #74ebba;
}

.btn-sm {
  min-height: 30px;
  padding: 3px 11px;
  font-size: 12.5px;
}

.btn-apk {
  align-self: flex-start;
  background: rgba(255, 200, 87, 0.12);
  border-color: rgba(255, 200, 87, 0.55);
  color: var(--amber);
}

.btn-apk:hover {
  background: rgba(255, 200, 87, 0.2);
}

.ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.ibtn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: #4a5475;
}

.ibtn svg {
  width: 15px;
  height: 15px;
}

.ibtn-danger:hover {
  color: var(--coral);
  border-color: rgba(255, 107, 107, 0.6);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.field em {
  font-style: normal;
  opacity: 0.75;
}

input[type="text"],
input:not([type]),
input[type="number"],
select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text);
  outline: none;
}

input[readonly] {
  color: var(--muted);
}

input:focus,
select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 2px rgba(91, 227, 168, 0.18);
}

select {
  cursor: pointer;
}

.copyrow {
  display: flex;
  gap: 6px;
  align-items: center;
}

.copyrow input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
}

input[type="range"] {
  flex: 1 1 120px;
  min-width: 80px;
  accent-color: var(--mint);
  cursor: pointer;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.switch input {
  width: 17px;
  height: 17px;
  accent-color: var(--mint);
  cursor: pointer;
}

/* fallback for a missing art file: a colored circle with the first character */
.art-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #141824;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 auto;
  user-select: none;
}

/* ------------------------------------------------------------ 본부 방송 */

.bc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.bc-row .field {
  flex: 1 1 220px;
}

.bc-state {
  font-size: 12.5px;
  color: var(--muted);
  padding-bottom: 9px;
  white-space: nowrap;
}

.bc-state.is-on {
  color: var(--amber);
  font-weight: 700;
}

.ptt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 112px;
  padding: 14px;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  color: #2b0d0d;
  background: linear-gradient(180deg, #ff8577, #ff5c5c 58%, #e04a4a);
  box-shadow: 0 6px 0 #a83232, 0 14px 26px rgba(255, 107, 107, 0.26), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.ptt:disabled {
  filter: grayscale(0.7) brightness(0.55);
  cursor: not-allowed;
}

.ptt:not(:disabled):hover {
  filter: brightness(1.05);
}

.ptt:not(:disabled):active,
.ptt.is-held {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #a83232, 0 6px 14px rgba(255, 107, 107, 0.24), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.ptt.is-on,
.ptt.is-on:active {
  color: #0b2a1d;
  background: linear-gradient(180deg, #74f2bd, #5be3a8 56%, #2fc08a);
  box-shadow: 0 2px 0 #1b8f66, 0 0 0 6px rgba(91, 227, 168, 0.16), 0 0 30px rgba(91, 227, 168, 0.45);
  animation: ptt-pulse 1.1s ease-out infinite;
}

.ptt-main {
  font-size: clamp(20px, 2.3vw, 25px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.ptt-sub {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.78;
}

@keyframes ptt-pulse {
  0% {
    box-shadow: 0 2px 0 #1b8f66, 0 0 0 0 rgba(91, 227, 168, 0.55), 0 0 26px rgba(91, 227, 168, 0.45);
  }
  100% {
    box-shadow: 0 2px 0 #1b8f66, 0 0 0 16px rgba(91, 227, 168, 0), 0 0 26px rgba(91, 227, 168, 0.45);
  }
}

.meter {
  height: 8px;
  margin-top: 14px;
  border-radius: 6px;
  background: var(--well);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--mint) 0%, var(--mint) 62%, var(--amber) 84%, var(--coral) 100%);
  transition: width 0.07s linear;
}

/* ------------------------------------------------------------ 멤버 */

.mhead,
.mrow {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.15fr) auto auto;
  grid-template-areas:
    "id ch week mute"
    "id st act act";
  gap: 2px 10px;
  align-items: center;
}

.mhead {
  grid-template-areas: none;
  padding: 0 10px 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.mhead span:nth-child(3),
.mhead span:nth-child(4) {
  text-align: right;
}

/* ------------------------------------------------------------ 조용히: 마이크 · 스피커 */

.h2-tools {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.h2-tools[hidden],
.join-grid[hidden] {
  display: none;
}

.m-mute {
  grid-area: mute;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.m-mute-note {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.m-mute-note.is-off {
  color: var(--coral);
  font-weight: 800;
}

.mbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.mbtn svg {
  width: 15px;
  height: 15px;
}

.mbtn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: #4a5475;
}

.mbtn.is-off {
  color: #fff;
  background: rgba(255, 107, 107, 0.24);
  border-color: rgba(255, 107, 107, 0.8);
}

.mrow.is-calling {
  background: rgba(90, 156, 248, 0.1);
  border-color: rgba(90, 156, 248, 0.55);
}

.mrow.is-calling .dot {
  background: #5a9cf8;
  animation: call-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes call-pulse {
  from {
    box-shadow: 0 0 0 rgba(90, 156, 248, 0);
  }
  to {
    box-shadow: 0 0 10px #5a9cf8;
  }
}

.ibtn-call {
  color: #ffc857;
  border-color: rgba(255, 200, 87, 0.45);
}

.ibtn-call.is-calling {
  color: var(--coral);
  border-color: rgba(255, 107, 107, 0.65);
}

.mrow {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.mrow:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.mrow.is-talking {
  background: rgba(91, 227, 168, 0.1);
  border-color: rgba(91, 227, 168, 0.4);
}

.mrow.is-offline {
  opacity: 0.58;
}

.m-id {
  grid-area: id;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
}

.avatar img,
.avatar svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar .art-fallback {
  width: 100%;
  height: 100%;
  font-size: 17px;
}

.m-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.m-sub {
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.m-ch {
  grid-area: ch;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-ch .art-fallback {
  width: 18px;
  height: 18px;
  font-size: 9px;
}

.m-ch img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.m-st {
  grid-area: st;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.dot-on {
  background: var(--mint);
  box-shadow: 0 0 7px var(--mint);
}

.m-week {
  grid-area: week;
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.m-week small {
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.m-act {
  grid-area: act;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.bars i {
  width: 3px;
  height: 30%;
  border-radius: 1px;
  background: var(--mint);
  animation: bar 0.7s ease-in-out infinite;
}

.bars i:nth-child(2) {
  animation-delay: 0.18s;
}

.bars i:nth-child(3) {
  animation-delay: 0.36s;
}

.bars i:nth-child(4) {
  animation-delay: 0.09s;
}

@keyframes bar {
  0%,
  100% {
    height: 25%;
  }
  50% {
    height: 100%;
  }
}

/* ------------------------------------------------------------ PC 무전기 수신 */

.rx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.rx-now {
  margin-top: 10px;
  min-height: 20px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.rx-now.is-on {
  color: var(--mint);
  font-weight: 700;
}

.meter-rx {
  margin-top: 12px;
}

/* ------------------------------------------------------------ 채널 */

.chgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chip {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s, background 0.15s;
}

.chip.has-members {
  border-color: rgba(91, 227, 168, 0.32);
}

.chip.is-locked {
  border-color: rgba(255, 200, 87, 0.55);
  background: rgba(255, 200, 87, 0.06);
}

.chip-art {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
}

.chip-art img,
.chip-art svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chip-art .art-fallback {
  width: 100%;
  height: 100%;
  font-size: 17px;
}

.chip-body {
  flex: 1 1 auto;
  min-width: 0;
}

.chip-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
}

.chip-name:hover {
  color: var(--mint);
}

.chip-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-name svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  opacity: 0.6;
}

.chip-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.chip-lock {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  min-height: 18px;
}

.chip-lock img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.chip-lock .art-fallback {
  width: 16px;
  height: 16px;
  font-size: 8px;
}

.chip-lock .open {
  font-size: 11.5px;
  color: var(--mint);
}

.chip-unlock {
  margin-left: 4px;
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 6px;
}

.chip-edit {
  width: 100%;
  min-height: 28px;
  font-size: 13px;
  font-weight: 700;
}

/* ------------------------------------------------------------ 앱 설치 */

#apkMissing {
  margin: 0;
}

#keyField {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.field em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}

.join-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.qr {
  flex: 0 0 auto;
  width: 172px;
  height: 172px;
  padding: 10px;
  border-radius: 16px;
  background: #f4f6fa;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-fallback {
  color: #1d2230;
  font-size: 12px;
  text-align: center;
  font-weight: 700;
}

.join-fields {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ------------------------------------------------------------ 이번 주 무전왕 */

.ranks li {
  display: grid;
  grid-template-columns: 30px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 12px;
}

.ranks li:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.rank-no {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  color: var(--muted);
}

.rank-1 .rank-no {
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 200, 87, 0.7);
}

.rank-2 .rank-no {
  color: #cfd6e4;
}

.rank-3 .rank-no {
  color: #e0956a;
}

.ranks .avatar {
  width: 30px;
  height: 30px;
}

.rank-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.rank-sec {
  font-weight: 800;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-sec small {
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

/* ------------------------------------------------------------ 지난 본부 방송 */

.hqlist li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 12px;
}

.hqlist li:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.hq-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border-color: rgba(91, 227, 168, 0.5);
  color: var(--mint);
}

.hq-play:hover {
  background: rgba(91, 227, 168, 0.14);
  color: var(--mint);
}

.hq-play.is-playing {
  background: var(--mint);
  color: #0b2a1d;
}

.hq-when {
  font-size: 12.5px;
  font-weight: 700;
}

.hq-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.hq-ms {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------ 설정 */

.settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.settings-form .btn {
  min-height: 36px;
}

.foot {
  padding: 6px 22px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.foot .mono {
  margin-left: 8px;
  opacity: 0.7;
}

/* ------------------------------------------------------------ stamps */

.stamp-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: stamp-in 0.28s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.stamp.is-out {
  animation: stamp-out 0.4s ease-in both;
}

.stamp-art {
  width: clamp(150px, 24vw, 230px);
  height: clamp(150px, 24vw, 230px);
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.55));
  display: inline-flex;
}

.stamp-art img,
.stamp-art svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stamp-art .art-fallback {
  width: 100%;
  height: 100%;
  font-size: clamp(48px, 10vw, 84px);
}

.stamp-name {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 200, 87, 0.75), 0 2px 0 rgba(0, 0, 0, 0.6);
}

.stamp-from {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: scale(0.35) rotate(-9deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.07) rotate(1.5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes stamp-out {
  to {
    opacity: 0;
    transform: scale(1.12) translateY(-14px);
  }
}

/* ------------------------------------------------------------ toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: min(92vw, 520px);
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  border-radius: 12px;
  background: #141824;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.2s ease-out both;
  text-align: center;
  overflow-wrap: anywhere;
}

.toast-err {
  border-color: rgba(255, 107, 107, 0.65);
  color: #ffd0d0;
}

.toast-ok {
  border-color: rgba(91, 227, 168, 0.65);
  color: #c9f7e4;
}

.toast-warn {
  border-color: rgba(255, 200, 87, 0.65);
  color: #ffe9bd;
}

.toast.is-out {
  animation: toast-out 0.3s ease-in both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ------------------------------------------------------------ login dialog */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(13, 16, 24, 0.78);
  backdrop-filter: blur(3px);
}

.dialog {
  width: min(94vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.dialog h2 {
  font-family: var(--mono);
  letter-spacing: 0.14em;
  color: var(--mint);
  font-size: 19px;
}

.dialog .hint {
  margin-top: -6px;
}

.dialog .err {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--coral);
}

/* ------------------------------------------------------------ scrollbars */

* {
  scrollbar-width: thin;
  scrollbar-color: #4a5475 transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #4a5475;
  border-radius: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

/* Family HQ and installation share a single palette and the same clay artwork. */
:root {
  color-scheme: light;
  --bg: #f5f1fb;
  --panel: #fff;
  --panel-hi: #fff;
  --well: #f5f1fb;
  --line: #e6ddef;
  --mint: #5c3aa6;
  --amber: #714514;
  --coral: #a62c4f;
  --text: #25163b;
  --muted: #675a77;
  --radius: 22px;
}
html { scroll-padding-top: 90px; }
body { background: #f5f1fb; font-size: 16px; }
.topbar {
  padding: 12px max(20px, calc((100vw - 1200px) / 2));
  background: #fff;
  box-shadow: 0 2px 18px #2f1b4b0a;
}
.logo { color: #2d1a4c; font: 820 clamp(18px, 2vw, 24px)/1.1 var(--sans); letter-spacing: -.055em; text-shadow: none; }
.topmeta .server { display: none; }
.topmeta .family { color: #4d366d; }
.mascot { border-radius: 14px; background: #efe6fe; padding: 4px; }
.mascot.is-talking { outline: 2px solid #64d9ad; }
.grid {
  max-width: 1240px;
  padding: 22px 20px 38px;
  gap: 16px;
}
.hq-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 36%);
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 224px;
  padding: clamp(20px, 5vw, 48px);
  border-radius: 30px;
  background: radial-gradient(ellipse at 83% 43%, #7751bb 0%, #442674 48%, #302050 84%);
  color: #fff;
}
.hq-hero::before,
.hq-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 345px;
  aspect-ratio: 1;
  right: 8%;
  border-radius: 50%;
  border: 1px solid #f6deff36;
}
.hq-hero::after { width: 410px; right: 5.4%; }
.hq-hero h2,
.install-panel h1 {
  font-size: clamp(30px, 5.1vw, 61px);
  font-weight: 850;
  line-height: 1.06;
  letter-spacing: -.075em;
}
.hq-hero p { margin: 12px 0 20px; color: #f0e6fd; font-size: clamp(14px, 2vw, 18px); }
.hq-hero img { width: min(100%, 262px); height: auto; justify-self: center; filter: drop-shadow(0 12px 12px #190a3e5e); }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-actions .btn { min-height: 42px; padding-inline: 15px; }
.hero-actions .hero-primary { background: #ffd36a; border-color: #ffd36a; color: #2b183c; }
.hero-actions .hero-primary:hover { background: #ffe295; }
.hero-actions .hero-secondary { background: #ffffff15; border-color: #fff6; color: white; }
.hero-actions .hero-secondary:hover { background: #ffffff2b; }
.panel { background: #fff; box-shadow: 0 4px 16px #36224c0b; padding: 20px; }
.panel h2 { color: var(--text); font-size: 20px; letter-spacing: -.045em; gap: 9px; }
.panel h2::before { display: none; }
.pill { color: #523785; background: #eee4fc; }
.pill-live { background: #baf1d4; color: #184f3a; }
.badge { border-color: #e2d6ef; color: #4e3a71; background: #f3eafb; font-size: 13px; }
.badge-on { background: #daf4e4; color: #175640; border-color: #b4dfc5; }
.badge-off { background: #f2edf7; color: #5b4b70; }
.badge-wait { background: #fff3cd; color: #714915; border-color: #ffebac; }
.hint { font-size: 14px; }
.empty { font-size: 14px; }
.btn { background: #f7f2fd; border-color: #e1d5ed; color: #443066; min-height: 40px; font-size: 14px; }
.btn:hover { background: #eee4fa; border-color: #bc9ee0; color: #351c57; }
.btn-primary, .btn-apk, .nav-install {
  background: #6343ac;
  color: #fff;
  border-color: #6343ac;
}
.btn-primary:hover, .btn-apk:hover, .nav-install:hover { background: #4a2b91; color: #fff; border-color: #4a2b91; }
.ptt { background: #ffd36a; border-color: #e4aa33; color: #321b49; box-shadow: 0 5px 0 #d99c26; min-height: 120px; }
.ptt:not(:disabled):hover { background: #ffdf89; }
.ptt.is-on, .ptt.is-on:active { background: #99e7bc; border-color: #63b58a; color: #174b3a; box-shadow: 0 5px 0 #5ea97e; }
.ptt:disabled { background: #f7edff; border-color: #e2d6ef; box-shadow: 0 4px 0 #e2d6ef; color: #5f4874; }
.ptt-sub { color: inherit; opacity: .8; }
.dialog { background: #fff; border-color: #e2d6ef; }
.dialog h2 { color: #2e1b4f; }
.install-text-link { color: #5a389f; font-weight: 700; }
.install-nav {
  max-width: 1120px;
  padding: 18px 24px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.install-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 24px; font-weight: 800; text-decoration: none; letter-spacing: -.07em; }
.install-shell {
  margin: clamp(10px, 4vw, 52px) auto;
  width: min(calc(100% - 40px), 1060px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-radius: 34px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 18px 52px #51347a15;
}
.install-art { display: grid; place-items: center; min-height: 320px; background: radial-gradient(circle, #eee2ff 0 36%, #e6d4ff 37% 51%, #d9c2ff 52%); }
.install-art img { width: min(79%, 365px); height: auto; padding: 18px; }
.install-panel { padding: clamp(24px, 5vw, 58px); }
.install-platform { color: #604397; font-size: 14px; font-weight: 750; margin-bottom: 9px; }
.install-help { color: var(--muted); margin: 16px 0 26px; }
.install-form { display: grid; gap: 12px; }
.install-form .field input { min-height: 48px; font-size: 16px; background: #f8f3fc; }
.install-form .btn { min-height: 47px; font-size: 16px; }
#downloadStatus { color: #5a3691; min-height: 24px; font-size: 14px; }
.install-note { border-top: 1px solid var(--line); margin: 16px 0 0; padding-top: 16px; color: var(--muted); font-size: 14px; }
:where(a, button, input, select):focus-visible { outline: 3px solid #9e70e8; outline-offset: 3px; }
@media (min-width: 900px) {
  .grid {
    grid-template-areas:
      "hero hero hero hero hero hero"
      "cast cast cast members members members"
      "rx rx rx members members members"
      "join join join rooms rooms rooms"
      "record record record week week week"
      "settings settings settings settings settings settings";
  }
  .hq-hero { grid-area: hero; }
  .panel-broadcast { grid-area: cast; }
  .panel-rx { grid-area: rx; }
  .panel-members { grid-area: members; }
  .panel-join { grid-area: join; }
  .panel-channels { grid-area: rooms; }
  .panel-weekly { grid-area: week; }
  .panel-hq { grid-area: record; }
  .panel-settings { grid-area: settings; }
}
@media (max-width: 620px) {
  .grid { padding: 14px 12px 28px; }
  .topbar { padding: 10px 12px; }
  .topmeta .family { display: none; }
  .hq-hero { grid-template-columns: 1fr 29%; min-height: 180px; padding: 20px 15px 20px 20px; border-radius: 24px; }
  .hq-hero h2 { font-size: 31px; }
  .hq-hero img { width: 125%; max-width: none; }
  .hq-hero::before, .hq-hero::after { display: none; }
  .panel { padding: 16px; }
  .install-shell { grid-template-columns: 1fr; width: calc(100% - 28px); border-radius: 25px; }
  .install-art { min-height: 174px; }
  .install-art img { width: 172px; padding: 6px; }
}
