:root {
  --bg: #0b0f14;
  --panel: #111826;
  --panel2: #0f1622;
  --text: #e6eefc;
  --muted: rgba(230, 238, 252, 0.65);
  --border: rgba(230, 238, 252, 0.10);
  --good: #33d17a;
  --bad: #ff5c5c;
  --accent: #00b7ff;
  --shadow: rgba(0, 0, 0, 0.55);
}

/* Ensure the HTML 'hidden' attribute works even if element classes set display. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 700px at 20% 10%, rgba(0, 183, 255, 0.14), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(51, 209, 122, 0.10), transparent 60%),
    radial-gradient(900px 700px at 50% 90%, rgba(255, 92, 92, 0.08), transparent 60%),
    var(--bg);
}

.wrap {
  max-width: 1050px;
  margin: 0 auto;
  padding: 22px 14px 40px;
}

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

.right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand { flex: 0 1 auto; }
.brandBanner {
  height: 64px;
  width: auto;
  max-width: min(520px, 50vw);
  display: block;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.brandRow {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brandLogo {
  width: 148px;
  height: 46px;
  border-radius: 0;
  border: 0;
  object-fit: contain;
  background: transparent;
}

.auth {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loginBtn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 183, 255, 0.30);
  background: rgba(0, 183, 255, 0.12);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}
.loginBtn:hover { background: rgba(0, 183, 255, 0.20); }
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.35);
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
}
.meText { display: flex; flex-direction: column; gap: 2px; }
.meLine { font-size: 12px; color: var(--muted); }
.meLink {
  font-size: 12px;
  color: rgba(0, 183, 255, 0.95);
  text-decoration: none;
}
.meLink:hover { text-decoration: underline; }

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17,24,38,0.8), rgba(15,22,34,0.8));
  box-shadow: 0 14px 34px var(--shadow);
}
.mic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  margin-right: 4px;
  border-right: 1px solid rgba(230, 238, 252, 0.08);
}
.micDot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(230, 238, 252, 0.25);
  box-shadow: 0 0 0 4px rgba(230, 238, 252, 0.08);
}
.micDot.on {
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(51, 209, 122, 0.15), 0 0 14px rgba(51, 209, 122, 0.35);
}
.micText { font-size: 12px; color: var(--muted); }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--bad);
  box-shadow: 0 0 0 4px rgba(255, 92, 92, 0.15);
}
.statusText { font-size: 13px; color: var(--muted); }

.panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(17,24,38,0.86), rgba(15,22,34,0.86));
  box-shadow: 0 14px 34px var(--shadow);
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.row.small { margin-top: 10px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1;
}
label span { font-size: 12px; color: var(--muted); }

input {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 14, 22, 0.55);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}
input:focus { border-color: rgba(0, 183, 255, 0.35); box-shadow: 0 0 0 3px rgba(0, 183, 255, 0.12); }

button {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0, 183, 255, 0.30);
  background: rgba(0, 183, 255, 0.14);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button:hover:not(:disabled) { background: rgba(0, 183, 255, 0.20); }

.hint {
  color: var(--muted);
  font-size: 12px;
  align-self: center;
}

.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 14px;
}

.settings {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgba(230, 238, 252, 0.10);
  border-radius: 14px;
  background: rgba(8, 12, 18, 0.22);
  margin-bottom: 12px;
}
.setting {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  flex: 1;
}
.sLabel {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.sControl {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.sValue {
  font-size: 12px;
  color: rgba(230, 238, 252, 0.80);
  min-width: 52px;
  text-align: right;
}
.settings input[type="range"] {
  height: 34px;
  padding: 0;
  background: transparent;
  border: 0;
  flex: 1;
  min-width: 140px;
}
.sToggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(230, 238, 252, 0.80);
  user-select: none;
}
.sToggle input { width: 16px; height: 16px; }

@media (max-width: 860px) {
  .top {
    flex-direction: column;
    align-items: stretch;
  }
  .brandBanner {
    height: 54px;
    max-width: 100%;
  }
  .right {
    flex-direction: column;
    align-items: stretch;
  }
  .auth { width: 100%; justify-content: flex-start; }
  .status { width: 100%; justify-content: flex-start; }
  .settings { flex-direction: column; align-items: stretch; }
  .setting { min-width: 0; }
}

h2 {
  margin: 0 0 10px;
  font-size: 14px;
  color: rgba(230, 238, 252, 0.9);
  letter-spacing: 0.2px;
}

.people {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.people li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  background: rgba(8, 12, 18, 0.45);
  padding: 10px 10px;
  border-radius: 12px;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.talkDot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(230, 238, 252, 0.18);
  box-shadow: 0 0 0 4px rgba(230, 238, 252, 0.06);
}
.talkDot.on {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 183, 255, 0.16), 0 0 14px rgba(0, 183, 255, 0.35);
}
.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.chatLog {
  height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  background: rgba(8, 12, 18, 0.45);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg .meta {
  font-size: 12px;
  color: var(--muted);
}
.msg .text {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 3px;
}

.chatForm {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.chatForm input { flex: 1; }

.audioBins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.audioCard {
  border: 1px solid var(--border);
  background: rgba(8, 12, 18, 0.45);
  border-radius: 12px;
  padding: 10px;
}
.audioCard .meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.audioMetaLeft {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 840px) {
  .grid { grid-template-columns: 1fr; }
}
