:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: #101216;
  --panel-2: #15181d;
  --border: rgba(255,255,255,.09);
  --text: #f5f7fa;
  --muted: #8f98a7;
  --green: #31d77c;
  --amber: #f1b84b;
}

.recording-panel { margin-top: 24px; padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); }
.recording-panel h2 { margin: 0; font-size: 22px; }
.remote-recording-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.remote-recording-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.remote-recording-list span { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
.recording-filename { overflow-wrap: anywhere; }
#recordingPlayer { width: 100%; margin-top: 12px; }
#remoteRecordingStatus[data-mode="recording"], #remoteRecordingStatus[data-mode="error"] { color: #ffb2b2; }
.recording-panel .mic-toggle { display: flex; flex-wrap: wrap; }
.recording-panel select { max-width: 100%; font: inherit; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.recording-details { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.recording-details b { color: var(--text); }
.recording-files { padding-left: 20px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.recording-files:empty { display: none; }
#recordingStatus[data-mode="recording"], #recordingStatus[data-mode="error"] { color: #ffb2b2; }
#recordingStatus[data-mode="waiting"] { color: #ffe1a8; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
button, input { font: inherit; }
button, .link-button { -webkit-tap-highlight-color: transparent; }
a { color: #caffdf; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }

.app-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 44px; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 22px; }
.brand-row { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: #c9ced7; letter-spacing: .02em; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 18px rgba(255,255,255,.4); }
h1 { margin: 7px 0 0; font-size: clamp(30px, 5vw, 52px); line-height: 1; letter-spacing: -.04em; }

.status-pill { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 10px 14px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: #6f7783; }
.status-pill.online { color: #caffdf; border-color: rgba(49,215,124,.22); }
.status-pill.online span { background: var(--green); box-shadow: 0 0 14px rgba(49,215,124,.65); }
.status-pill.warning { color: #ffe1a8; border-color: rgba(241,184,75,.22); }
.status-pill.warning span { background: var(--amber); }

.video-card { position: relative; overflow: hidden; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.video-card video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.video-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 45%, rgba(25,28,34,.62), rgba(4,5,6,.96)); color: #c6ccd6; font-size: 15px; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.controls form { margin-left: auto; }
button, .link-button { border: 1px solid var(--border); border-radius: 13px; padding: 11px 15px; cursor: pointer; text-decoration: none; color: var(--text); background: var(--panel); transition: transform .15s ease, background .15s ease, border-color .15s ease; }
button:hover, .link-button:hover { transform: translateY(-1px); background: var(--panel-2); border-color: rgba(255,255,255,.16); }
button:disabled { opacity: .45; cursor: default; transform: none; }
.accent { background: var(--green); color: #06150c; font-weight: 750; }
.accent:hover { background: #55e493; }
.mic-toggle { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 14px; color: #cdd2db; cursor: pointer; }
.mic-toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.primary { width: 100%; background: #f5f7fa; color: #0a0b0d; font-weight: 750; border-color: transparent; }
.primary:hover { background: #fff; }
.secondary { background: var(--panel); }
.ghost { background: transparent; color: var(--muted); }
.hint { margin: 14px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.info-item { min-width: 0; border: 1px solid var(--border); border-radius: 15px; padding: 12px 14px; background: var(--panel); }
.info-item span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.info-item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }

.login-body { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); border: 1px solid var(--border); border-radius: 24px; padding: 28px; background: var(--panel); box-shadow: 0 35px 90px rgba(0,0,0,.35); }
.login-card h1 { font-size: 34px; margin-top: 18px; }
.muted { color: var(--muted); }
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-form label { display: grid; gap: 7px; color: #cdd2db; font-size: 13px; }
.login-form input { width: 100%; color: var(--text); background: #0b0d10; border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; outline: none; }
.login-form input:focus { border-color: rgba(255,255,255,.28); }
.error-box { margin-top: 14px; border: 1px solid rgba(255,90,90,.25); background: rgba(255,90,90,.08); color: #ffb2b2; border-radius: 12px; padding: 10px 12px; font-size: 13px; }

@media (max-width: 680px) {
  .app-shell { width: min(100% - 20px, 1100px); padding-top: 18px; }
  .topbar { align-items: center; flex-wrap: wrap; gap: 14px; }
  .status-pill { padding: 9px 11px; }
  .video-card { border-radius: 17px; aspect-ratio: 4/3; }
  .info-grid { grid-template-columns: 1fr; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; }
  .controls > * { width: 100%; }
  .controls form { margin-left: 0; }
  .controls button, .controls .link-button { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  button, .link-button { transition: none; }
}
