/* allskyhub web UI: mobile first, no build step. Only classes: the CSP forbids inline styles.
   Dark by default (the sky is dark and so are observers' eyes at night). */

:root {
  --bg: #0b1020; --surface: #131a2e; --surface-2: #1a2340; --line: #26304f;
  --text: #e6e9f2; --text-2: #a3abc4; --accent: #7aa2f7; --accent-ink: #0b1020;
  --ok: #73daca; --warn: #e0af68; --danger: #f7768e;
  --radius: 16px;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fb; --surface: #ffffff; --surface-2: #eef1f8; --line: #d8deeb;
    --text: #141a2c; --text-2: #4b5470; --accent: #2f5bd3; --accent-ink: #ffffff;
    --ok: #0f7b6c; --warn: #9a6a12; --danger: #c0283f;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); }
main { max-width: 44rem; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 20px; }
main > * { min-width: 0; }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.3px; }
h2 { font-size: 18px; }
p { margin: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }

.appbar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line);
          background: var(--bg); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); text-decoration: none;
         font-weight: 700; font-size: 19px; }
.appbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.muted { color: var(--text-2); font-size: .94em; }
.stack { display: grid; gap: 14px; }
.inline { display: inline; }
.card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
        display: grid; gap: 12px; }
.empty { text-align: center; padding: 32px 18px; }

label { display: grid; gap: 6px; font-weight: 600; }
input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
        background: var(--surface-2); color: var(--text); font: inherit; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
                  border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit;
                  font-weight: 700; text-decoration: none; cursor: pointer; }
button.link { min-height: 44px; padding: 0 8px; background: none; color: var(--accent); font-weight: 600; }

.msg { padding: 12px 16px; border-radius: 12px; }
.msg.error { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.msg.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

.auth { max-width: 26rem; width: 100%; margin: 0 auto; display: grid; gap: 18px; }
.app-foot { text-align: center; color: var(--text-2); font-size: 13px; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.button.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.warn { color: var(--warn); }
.badge { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
         background: var(--surface-2); color: var(--text-2); }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, monospace; font-size: 22px; letter-spacing: 3px; text-transform: uppercase; }

.cams { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
@media (min-width: 40rem) { .cams { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
a.card.cam { color: var(--text); text-decoration: none; }
a.card.cam:hover { border-color: var(--accent); }
.cam img, .live img, .sky-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block;
                               background: radial-gradient(circle, #1a2340 0%, #05070f 70%); }
.cam-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.live { margin: 0; display: grid; gap: 8px; }
.live img { object-fit: contain; background: #000; }

.card.danger { border-style: dashed; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }

/* Public start page */
.hero { display: grid; gap: 16px; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.1; }
.lead { font-size: 18px; color: var(--text-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.features { display: grid; gap: 14px; }
@media (min-width: 40rem) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Imprint and privacy policy */
.legal p + p { margin-top: 8px; }
.todo { color: var(--warn); font-weight: 600; }
.todo::before { content: "⚠ "; }
