:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #1d2330; --muted: #677084; --line: #e2e5eb;
  --accent: #1f6feb; --ok: #1a7f37; --warn: #b35900; --danger: #c62828; --track: #e7eaf0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #10141b; --card: #19202a; --text: #e8ebf0; --muted: #98a2b3; --line: #2a3240;
    --accent: #4c8dff; --ok: #3fb950; --warn: #e3963e; --danger: #ff6b6b; --track: #2a3240; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, "Segoe UI", Tahoma, sans-serif; }
[hidden] { display: none !important; }
header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
header h1 { font-size: 18px; margin: 0; flex: 1; }
main { max-width: 980px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 820px) { main { grid-template-columns: 3fr 2fr; } .wide { grid-column: 1 / -1; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.banner { padding: 12px 16px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 15%, var(--card)); color: var(--text); border: 1px solid var(--warn); }
.camera { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.camera img { width: 100%; height: 100%; object-fit: contain; }
.camera .note { position: absolute; color: #ccd; font-size: 14px; padding: 8px; text-align: center; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--danger); }
.file { color: var(--muted); overflow-wrap: anywhere; margin: 4px 0 12px; }
.bar { height: 12px; background: var(--track); border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.fact { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.fact .k { color: var(--muted); font-size: 13px; }
.fact .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
button { font: inherit; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 12px; cursor: pointer; min-height: 48px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { background: none; border: none; color: var(--accent); padding: 6px 8px; min-height: 0; }
.msg { min-height: 24px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.msg.bad { color: var(--danger); }
.updated { color: var(--muted); font-size: 13px; margin-top: 10px; }
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.login input { width: 100%; font: inherit; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin: 8px 0 12px; }
.login button { width: 100%; }
