:root {
  color-scheme: dark;
  --bg: #0b1120;
  --panel: #121d32;
  --border: #263652;
  --text: #e5edf8;
  --muted: #9cabc1;
  --blue: #3b82f6;
  --red: #fb7185;
  --green: #34d399;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at top left, #14294a, transparent 60%), var(--bg);
  color: var(--text);
  font:
    14px system-ui,
    sans-serif;
  min-height: 100vh;
}
.app {
  max-width: 1450px;
  margin: auto;
  padding: 24px;
}
header,
.toolbar,
.row,
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
header {
  margin-bottom: 24px;
}
h1 {
  font-size: 23px;
  margin: 0;
}
h2 {
  font-size: 17px;
  margin: 0 0 16px;
}
.muted,
small {
  color: var(--muted);
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  min-width: 0;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 20px;
}
.toolbar {
  justify-content: flex-start;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
button,
.button {
  border: 1px solid var(--border);
  background: #192940;
  color: var(--text);
  padding: 9px 13px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  border-color: var(--blue);
}
button.active,
.primary {
  background: #2563eb;
}
.danger {
  background: #84243a;
}
input,
select {
  background: #0b1425;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  font: inherit;
  max-width: 100%;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 15px 0;
}
video,
iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 12px;
}
summary {
  cursor: pointer;
  padding: 3px 0;
}
details[open] summary {
  margin-bottom: 16px;
}
.list {
  max-height: 440px;
  overflow: auto;
  margin-top: 15px;
}
.recording {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  margin-bottom: 6px;
  word-break: break-word;
}
.recording span {
  min-width: 0;
}
.log {
  padding: 12px;
  border-left: 3px solid var(--blue);
  margin: 8px 0;
  background: #0c1628;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.log.error {
  border-color: var(--red);
}
.log.success {
  border-color: var(--green);
}
.log small {
  display: block;
  margin-bottom: 4px;
}
.notice {
  padding: 12px;
  border-radius: 9px;
  margin: 12px 0;
  background: #152b48;
  overflow-wrap: anywhere;
}
.notice.error {
  color: #fecdd3;
  background: #491c2b;
}
[hidden] {
  display: none !important;
}
table {
  width: 100%;
  border-collapse: collapse;
}
td,
th {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table-wrap {
  overflow: auto;
}
.login {
  max-width: 420px;
  margin: 10vh auto;
  padding: 20px;
}
.login input,
.login button {
  width: 100%;
  margin-top: 8px;
}
.login label {
  margin-top: 15px;
}
a {
  color: #93c5fd;
}
.heading {
  margin-bottom: 16px;
}
.empty {
  padding: 25px;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 500px) {
  .app {
    padding: 12px;
  }
  .card {
    padding: 14px;
  }
  .recording {
    font-size: 12px;
  }
}
.live-view {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #020617;
}

.live-view iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.live-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: radial-gradient(circle at center, #15253e 0%, #081120 65%);
}

.live-placeholder-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: #647b9d;
  font-size: 24px;
}
/* Компактный блок Live */
.live-view {
  width: 100%;
  max-width: 960px;
  max-height: 55vh;
  aspect-ratio: 16 / 9;
  margin-inline: auto;
}

.live-view iframe {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.live-placeholder {
  height: 100%;
}