:root {
  color-scheme: dark;
  --bg: #050a12;
  --panel: #0b1422;
  --panel-2: #101d2e;
  --line: rgba(148, 177, 212, 0.16);
  --text: #f4f8ff;
  --muted: #92a6bd;
  --blue: #1da1ff;
  --blue-2: #5fc4ff;
  --green: #37d69b;
  --red: #ff6577;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: radial-gradient(circle at 75% 0%, #0b2642 0, transparent 36rem), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { color: var(--blue-2); font-size: .72rem; font-weight: 800; letter-spacing: .18em; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(420px, .65fr); }
.login-brand { position: relative; min-height: 100vh; overflow: hidden; display: grid; place-items: center; padding: 6vw; background: linear-gradient(145deg, rgba(4, 13, 24, .97), rgba(6, 32, 55, .91)); }
.brand-grid { position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(73, 170, 235, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(73, 170, 235, .18) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(135deg, #000, transparent 75%); }
.brand-copy { position: relative; z-index: 1; width: min(680px, 100%); }
.brand-copy img { width: min(340px, 72%); margin-bottom: 4rem; }
.brand-copy h1 { margin: 1rem 0 1.25rem; font-size: clamp(2.8rem, 5.5vw, 5.7rem); line-height: .98; letter-spacing: -.055em; }
.brand-copy h1 em { color: var(--blue-2); font-style: normal; }
.brand-copy > p { max-width: 620px; color: #b5c6d9; font-size: 1.08rem; line-height: 1.7; }
.trust-row { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; color: #9fb4ca; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.trust-row i, .policy-chip i { display: inline-block; width: 8px; height: 8px; margin-right: .45rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(55, 214, 155, .1); }
.login-panel { min-height: 100vh; padding: 3rem; display: flex; flex-direction: column; justify-content: center; background: rgba(5, 10, 18, .88); backdrop-filter: blur(18px); }
.login-card { width: min(440px, 100%); margin: auto; }
.mobile-logo { display: none; width: 220px; margin-bottom: 2rem; }
.login-card h2 { margin: .65rem 0 .55rem; font-size: 2.2rem; letter-spacing: -.035em; }
.login-card > p { color: var(--muted); line-height: 1.55; margin: 0 0 2rem; }
.login-card label { display: grid; gap: .55rem; margin: 1rem 0; color: #cfdae7; font-size: .82rem; font-weight: 700; }
.login-card input, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #09121f; color: var(--text); padding: .9rem 1rem; outline: none; }
.login-card input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 161, 255, .12); }
.login-panel footer { width: min(440px, 100%); margin: 2rem auto 0; color: #63778e; font-size: .74rem; text-align: center; }
.button { min-height: 42px; border: 1px solid var(--line); border-radius: 11px; padding: .72rem 1rem; background: #101b2b; color: var(--text); font-weight: 750; }
.button:hover { border-color: rgba(95, 196, 255, .5); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button.primary { border-color: transparent; background: linear-gradient(135deg, #087ed3, #19a6ff); box-shadow: 0 10px 30px rgba(4, 139, 228, .22); }
.button.quiet { background: rgba(11, 25, 42, .75); }
.button.wide { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 1.35rem; }
.text-button { width: 100%; border: 0; background: none; color: var(--blue-2); padding: 1.1rem; }
.form-error { min-height: 1.25rem; color: #ff91a0; font-size: .84rem; }
.form-message { min-height: 1.25rem; color: var(--green); font-size: .84rem; }

.view-app { min-height: 100vh; display: flex; flex-direction: column; }
.app-header { min-height: 82px; padding: 1rem clamp(1.1rem, 4vw, 4rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); background: rgba(5, 12, 21, .92); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; }
.app-brand { display: flex; align-items: center; gap: 1.25rem; min-width: 0; }
.app-brand img { width: 150px; }
.app-brand div, .account-copy { display: grid; gap: .18rem; min-width: 0; }
.app-brand span, .account-copy span { color: var(--muted); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.app-brand b, .account-copy b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-actions { display: flex; align-items: center; gap: 1rem; }
.account-copy { text-align: right; }
main { width: min(1500px, 100%); margin: 0 auto; flex: 1; padding: clamp(1.5rem, 4vw, 4rem); }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.page-head h1 { font-size: clamp(2.2rem, 4vw, 4rem); letter-spacing: -.05em; margin: .5rem 0 .4rem; }
.page-head p { color: var(--muted); margin: 0; }
.head-actions { display: flex; align-items: center; gap: .75rem; }
.head-actions select { min-width: 180px; }
.policy-chip { white-space: nowrap; border: 1px solid rgba(55, 214, 155, .22); border-radius: 999px; background: rgba(55, 214, 155, .07); color: #9ee8ce; padding: .68rem .9rem; font-size: .76rem; font-weight: 800; }
.notice { margin: 0 0 1.25rem; padding: .9rem 1rem; border: 1px solid rgba(95, 196, 255, .25); border-radius: 12px; background: rgba(29, 161, 255, .08); color: #acdfff; }
.camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.camera-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(155deg, rgba(15, 29, 46, .96), rgba(7, 15, 26, .98)); box-shadow: 0 16px 50px rgba(0, 0, 0, .18); }
.camera-image { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 35%, #173854, #060b13 72%); }
.camera-image img { width: 100%; height: 100%; object-fit: cover; }
.camera-placeholder { display: grid; place-items: center; gap: .5rem; color: #6f879e; }
.camera-placeholder span { font-size: 2.5rem; }
.camera-id, .camera-state { position: absolute; top: .75rem; padding: .38rem .55rem; border-radius: 7px; background: rgba(3, 9, 15, .78); backdrop-filter: blur(8px); font-size: .65rem; font-weight: 800; letter-spacing: .08em; }
.camera-id { left: .75rem; color: #c8d7e8; }
.camera-state { right: .75rem; color: var(--green); }
.camera-state.offline { color: #ff93a0; }
.camera-body { padding: 1.15rem; }
.camera-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.camera-title h2 { margin: 0; font-size: 1.08rem; }
.camera-body p { min-height: 2.6em; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.camera-meta { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: 1rem; }
.camera-meta small { color: #748aa1; }
.empty { grid-column: 1 / -1; min-height: 280px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 1.15rem; margin-bottom: .4rem; }
.app-footer { padding: 1.2rem clamp(1.1rem, 4vw, 4rem); display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); color: #63778e; font-size: .74rem; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(0, 5, 10, .82); backdrop-filter: blur(12px); }
.modal-card { width: min(980px, 100%); overflow: hidden; border: 1px solid rgba(95, 196, 255, .22); border-radius: 20px; background: #09131f; box-shadow: var(--shadow); }
.modal-head, .preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.3rem; }
.modal-head h2 { margin: .25rem 0 0; }
.modal-head p, .preview-footer span { color: var(--muted); margin: .2rem 0 0; font-size: .8rem; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #101c2c; color: white; font-size: 1.4rem; }
.preview-scene { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; background: #02060a; }
.preview-scene img { width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { display: grid; place-items: center; gap: .65rem; color: #7890a8; }
.preview-placeholder span { font-size: 3.5rem; }
.status-badge, .countdown { position: absolute; top: 1rem; border-radius: 9px; background: rgba(1, 7, 12, .78); backdrop-filter: blur(8px); font-weight: 850; }
.status-badge { left: 1rem; padding: .5rem .7rem; color: var(--green); font-size: .68rem; letter-spacing: .1em; }
.countdown { right: 1rem; min-width: 48px; padding: .45rem .65rem; text-align: center; color: white; font-size: 1.2rem; }
.preview-footer div { display: grid; gap: .25rem; }
.toast { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 200; max-width: 420px; border: 1px solid rgba(95, 196, 255, .3); border-radius: 12px; background: #101e2f; box-shadow: var(--shadow); padding: .9rem 1.1rem; color: #ddecfa; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 2rem 1.25rem; }
  .mobile-logo { display: block; }
  .page-head { align-items: stretch; flex-direction: column; }
  .head-actions { flex-wrap: wrap; }
  .policy-chip { width: 100%; }
  .head-actions select { flex: 1; }
}

@media (max-width: 620px) {
  .app-header { align-items: flex-start; }
  .app-brand img { width: 118px; }
  .app-brand div { display: none; }
  .account-copy { max-width: 130px; }
  .account-actions { gap: .5rem; }
  .button { min-height: 44px; }
  main { padding: 1.4rem 1rem 2rem; }
  .camera-grid { grid-template-columns: 1fr; }
  .head-actions select, .head-actions .button { width: 100%; flex: 1 0 100%; }
  .app-footer { flex-direction: column; }
  .modal { padding: 0; align-items: end; }
  .modal-card { border-radius: 18px 18px 0 0; }
  .preview-footer { align-items: stretch; flex-direction: column; }
}
