:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2430;
  --line: #2a3240;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #2f81f7;
  --live: #3fb950;
  --busy: #f0883e;
  --danger: #f85149;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  user-select: none;
}

.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.error { color: var(--danger); margin: 4px 0 0; }
[hidden] { display: none !important; }

.screen { height: 100%; display: flex; flex-direction: column; }

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

#login { align-items: center; justify-content: center; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card h1 { margin: 0 0 6px; font-size: 20px; letter-spacing: .5px; }
.card h2 { margin: 0 0 6px; font-size: 16px; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
label > span { color: var(--muted); }
label.row { flex-direction: row; align-items: center; gap: 8px; }

input[type=text], input[type=password], select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  user-select: text;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }

#f-submit, .primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------- chrome */

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  height: 46px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
}

.brand { font-weight: 700; letter-spacing: 1.5px; font-size: 13px; }

.pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.ok    { color: var(--live);   border-color: #1f4d2b; }
.pill.bad   { color: var(--danger); border-color: #5c2b28; }

button.icon {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  padding: 4px 8px;
}
button.icon:hover { color: var(--text); }

main { flex: 1; display: grid; grid-template-columns: 200px 1fr 210px; min-height: 0; }

nav, aside {
  background: var(--panel);
  overflow-y: auto;
  padding: 14px 12px;
}
nav { border-right: 1px solid var(--line); }
aside { border-left: 1px solid var(--line); }

nav h2, aside h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--muted);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.count {
  background: var(--panel-2);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
}

ul { list-style: none; margin: 0; padding: 0; }

#channel-list li {
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
#channel-list li:hover { background: var(--panel-2); }
#channel-list li.active { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.dot.live { background: var(--live); box-shadow: 0 0 6px var(--live); }

#roster-list li {
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#roster-list li.talking { color: var(--live); font-weight: 600; }

/* ---------------------------------------------------------- stage */

#stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
}

.now {
  font-size: 15px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.now.idle { color: var(--muted); }
.now.rx { color: var(--live); border-color: #1f4d2b; background: #0f2417; }
.now.tx { color: var(--bg); background: var(--live); border-color: var(--live); font-weight: 600; }

.ptt {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 3px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .06s, background .12s, border-color .12s;
}
.ptt:hover:not(:disabled) { border-color: var(--accent); }

.ptt-label { font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.ptt-key {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 8px;
}

.ptt.tx {
  background: var(--live);
  border-color: #7ee299;
  color: #08130c;
  transform: scale(.96);
  animation: pulse 1.4s ease-out infinite;
}
.ptt.tx .ptt-key { color: #08130c; border-color: #08130c66; }

.ptt.busy { background: var(--busy); border-color: var(--busy); color: #23150a; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 #3fb95066; }
  70%  { box-shadow: 0 0 0 22px #3fb95000; }
  100% { box-shadow: 0 0 0 0 #3fb95000; }
}

/* ---------------------------------------------------------- log */

#log-bar {
  flex: none;
  height: 88px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  overflow-y: auto;
  padding: 8px 14px;
  font-size: 12px;
}
#log li { color: var(--muted); padding: 1px 0; }
#log li b { color: var(--text); font-weight: 600; }
#log li time { color: #55606d; margin-right: 8px; font-family: ui-monospace, monospace; }

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

dialog {
  border: none;
  background: none;
  padding: 0;
  color: var(--text);
}
dialog::backdrop { background: #000a; }
dialog .card { width: 380px; }
dialog menu { display: flex; gap: 8px; justify-content: flex-end; margin: 6px 0 0; padding: 0; }

/* ---------------------------------------------------------- unduh app */

.dl {
  display: block;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 9px;
  border: 1px dashed var(--line);
  border-radius: 7px;
}
.dl:hover { color: var(--text); border-color: var(--accent); border-style: solid; }
