:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: light-dark(#eef2f0, #101614);
  color: light-dark(#17201d, #eff7f3);
  --surface: light-dark(#ffffff, #18211e);
  --surface-soft: light-dark(#e6eeea, #222d29);
  --text-muted: light-dark(#5e6c67, #9cacA6);
  --border: light-dark(#cad6d1, #33413c);
  --accent: light-dark(#146c4f, #65d5a8);
  --accent-strong: light-dark(#0e543d, #8ae3bd);
  --danger: light-dark(#9b2c2c, #ff9c9c);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: inherit; color: inherit; }
button, input { font: inherit; }
button { min-height: 44px; cursor: pointer; }
.shell { width: min(100%, 680px); margin: 0 auto; padding: 20px 16px 40px; }
.login-view { min-height: 80vh; display: grid; align-content: center; gap: 10px; max-width: 420px; margin: auto; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.7rem, 7vw, 2.3rem); margin-bottom: 8px; }
h2 { font-size: 1.05rem; margin-bottom: 0; }
.stack { display: grid; gap: 10px; margin-top: 18px; }
input[type="password"] { min-height: 48px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; background: var(--surface); color: inherit; }
.primary, .secondary, .icon-button { border: 0; border-radius: 12px; padding: 0 16px; }
.primary { background: var(--accent); color: #fff; font-weight: 650; }
.primary:hover { background: var(--accent-strong); }
.secondary, .icon-button { background: var(--surface-soft); color: inherit; }
.danger { color: var(--danger); }
.error { color: var(--danger); min-height: 1.4em; }
.topbar, .section-heading, .status-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { margin-bottom: 16px; }
.eyebrow { color: var(--accent); font-size: .72rem; letter-spacing: .14em; font-weight: 700; margin-bottom: 4px; }
.status-strip { background: var(--surface); padding: 13px 14px; border-radius: 14px; margin-bottom: 14px; font-size: .9rem; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #8b9692; margin-right: 7px; }
.status-dot.online { background: #22a56f; box-shadow: 0 0 0 4px color-mix(in srgb, #22a56f 18%, transparent); }
.camera-panel { position: relative; overflow: hidden; min-height: 420px; border-radius: 22px; background: #070a09; }
#cameraPreview { width: 100%; height: min(62vh, 560px); object-fit: cover; display: block; }
.camera-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; color: #dce7e2; }
.camera-controls { position: absolute; left: 0; right: 0; bottom: 0; min-height: 96px; display: flex; align-items: center; justify-content: space-around; padding: 16px; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.camera-controls .secondary { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(8px); }
.shutter { width: 68px; height: 68px; border-radius: 50%; border: 4px solid white; background: transparent; display: grid; place-items: center; padding: 0; }
.shutter span { width: 52px; height: 52px; border-radius: 50%; background: #fff; }
.shutter:active span { transform: scale(.9); }
.file-label { display: grid; place-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer; }
.file-label input { position: absolute; opacity: 0; pointer-events: none; }
.queue-panel { margin-top: 16px; background: var(--surface); padding: 16px; border-radius: 18px; }
.section-heading span, .empty-state { color: var(--text-muted); font-size: .88rem; }
.transfer-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.transfer-item { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 8px; background: var(--surface-soft); border-radius: 12px; }
.transfer-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; background: #111; }
.transfer-label { font-size: .9rem; }
.transfer-state { color: var(--text-muted); font-size: .8rem; }
.empty-state { margin: 14px 0 2px; }
dialog { width: min(calc(100% - 28px), 520px); border: 0; border-radius: 20px; padding: 0; background: var(--surface); color: inherit; }
dialog::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
.dialog-content { padding: 20px; display: grid; gap: 16px; }
.facts { display: grid; gap: 10px; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 20px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; text-align: right; }
.secret-output { overflow-wrap: anywhere; padding: 12px; border-radius: 10px; background: var(--surface-soft); user-select: all; }
@media (max-width: 440px) {
  .shell { padding: 14px 10px 28px; }
  .camera-panel { min-height: 58vh; border-radius: 18px; }
}
