:root { color-scheme: dark; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #e5edf7; background: #0c111b; }
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1240px; padding: 48px 28px; margin: auto; }
.badge { color: #65dbb3; font-size: 12px; font-weight: 700; letter-spacing: 2px; }
h1 { font-size: clamp(28px, 4vw, 42px); margin: 12px 0; letter-spacing: -1px; }
header p, .muted, .guide p, .guide li { color: #94a4ba; line-height: 1.65; }
header { margin-bottom: 30px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px; align-items: start; }
.viewer, .panel, .guide { background: #131c2a; border: 1px solid #253247; border-radius: 16px; overflow: hidden; }
.video { aspect-ratio: 16 / 10; background: #080d15; display: flex; align-items: center; justify-content: center; padding: 12px; }
#stream { width: 100%; height: 100%; object-fit: contain; }
[hidden] { display: none !important; }
#placeholder { text-align: center; max-width: 370px; color: #8191a8; padding: 24px; }
#placeholder h2 { color: #d2deed; }
.camera-icon { font-size: 64px; color: #4a647e; }
h2 { font-size: 18px; margin-top: 0; }
.status-bar { padding: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
#indicator { width: 8px; height: 8px; border-radius: 50%; background: #728098; flex-shrink: 0; }
#indicator[data-state="streaming"] { background: #65dbb3; }
#indicator[data-state="error"] { background: #ff9393; }
#indicator[data-state="connecting"] { background: #f2c777; }
.format { width: 100%; color: #7689a4; margin-left: 18px; font-size: 11px; }
.quality-control { max-width: 320px; margin: 0 0 20px; }
.toggle { display: flex; align-items: center; gap: 12px; }
.toggle input { width: auto; margin: 0; }
#admin-login button, #viewer-login button { margin-top: 20px; }
.table-scroll { overflow-x: auto; margin: 16px 0 28px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid #35465f; white-space: nowrap; }
th { color: #94a4ba; }
#watch-stats { margin-top: 24px; }
#history-page { align-self: center; white-space: nowrap; }
.panel { padding: 24px; }
.muted { font-size: 12px; }
label { display: block; font-size: 13px; font-weight: 500; margin: 18px 0 0; }
input, select { display: block; width: 100%; padding: 11px 12px; margin-top: 8px; border: 1px solid #35465f; border-radius: 8px; background: #0c1421; color: #e5edf7; font: inherit; }
input:focus, select:focus { outline: 2px solid #65dbb3; outline-offset: 1px; }
.fields { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; }
details { margin-top: 20px; font-size: 13px; }
summary { cursor: pointer; color: #94a4ba; }
.actions { display: flex; gap: 10px; margin-top: 24px; }
button { flex: 1; border: 1px solid #65dbb3; padding: 12px 8px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; background: #65dbb3; color: #0b2820; }
button.secondary { border-color: #35465f; background: transparent; color: #d2deed; }
button:disabled { opacity: .5; cursor: wait; }
#error { color: #ffaaaa; font-size: 13px; line-height: 1.6; }
.guide { padding: 24px; margin-top: 24px; font-size: 13px; }
.guide ol { padding-left: 20px; }
.guide li { margin: 12px 0; }
.guide strong { color: #d2deed; }
code { background: #253247; padding: 2px 5px; border-radius: 4px; }
@media (max-width: 850px) { .layout { grid-template-columns: 1fr; } main { padding: 28px 16px; } .video { aspect-ratio: 16 / 9; } }
.camera-page { background: radial-gradient(ellipse at 15% 0%, #182d40 0%, transparent 55%), #090f18; min-height: 100vh; }
.camera-page main { max-width: 1160px; padding-top: 44px; }
.camera-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.camera-header h1 { font-size: clamp(27px, 4vw, 36px); margin: 10px 0 8px; }
.camera-header p { margin: 0; font-size: 13px; }
.live-badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #294a44; background: #132b27; color: #8be2c4; border-radius: 30px; padding: 9px 12px; font-size: 10px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.live-badge span { width: 6px; height: 6px; border-radius: 50%; background: #65dbb3; }
.camera-page .viewer { background: #0e1724; border-color: #2a394b; border-radius: 18px; box-shadow: 0 24px 70px #0005; }
.viewer-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #253247; }
.viewer-title { font-size: 13px; font-weight: 600; color: #cad7e6; }
.camera-page .quality-control { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 12px; color: #8fa2b9; }
.camera-page .quality-control select { width: auto; margin: 0; padding: 8px 10px; font-size: 12px; background: #172438; }
.camera-page #player { background: #050910; min-height: 180px; }
.viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.viewer-footer .status-bar { padding: 0; flex-wrap: nowrap; font-size: 12px; color: #a4b5c9; }
.status-dot { width: 6px; height: 6px; background: #8fa2b9; border-radius: 50%; flex-shrink: 0; }
.viewer-actions { display: flex; gap: 8px; flex-shrink: 0; }
.viewer-actions button { flex: none; padding: 9px 12px; font-size: 12px; }
.camera-page button:hover:not(:disabled) { border-color: #65dbb3; }
.camera-page #viewer-login { margin-bottom: 20px; max-width: 420px; }
@media (max-width: 600px) {
  .camera-page main { padding: 24px 12px; }
  .camera-header { gap: 10px; }
  .live-badge { font-size: 9px; padding: 8px; letter-spacing: 0; }
  .viewer-toolbar { padding: 12px; }
  .viewer-title { display: none; }
  .camera-page .quality-control { width: 100%; justify-content: space-between; }
  .viewer-footer { padding: 12px; flex-wrap: wrap; }
  .viewer-actions { margin-left: auto; }
}
