@import url('/assets/base.css');

body { min-height: 100vh; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }

/* Boot */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot .mark { width: 34px; height: 35px; fill: var(--fg-5); animation: pulse 1.4s ease-in-out infinite; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 36px 48px; border-right: .5px solid var(--border-1);
  background: radial-gradient(ellipse 90% 60% at 20% 105%, rgba(151,71,255,.30), transparent 70%), linear-gradient(180deg, #170921, #241232);
}
.auth-art::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.auth-art > * { position: relative; }
.auth-wall { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 560px; padding: 8px; border-radius: 16px; background: rgba(10,0,18,.5); border: .5px solid var(--border-2); box-shadow: var(--shadow-lg); }
.auth-wall figure { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; }
.auth-wall img { width: 100%; height: 100%; object-fit: cover; }
.auth-wall figcaption { position: absolute; left: 9px; top: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: rgba(255,255,255,.88); text-shadow: 0 1px 2px #000; }
.auth-pitch h1 { max-width: 480px; font-size: clamp(32px, 3.4vw, 46px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.04; }
.auth-pitch p { margin-top: 14px; max-width: 420px; font-size: 16px; color: var(--fg-3); }
.auth-foot { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-4); }
.auth-main { display: flex; flex-direction: column; padding: 32px 48px; min-width: 0; }
.auth-top { display: flex; align-items: center; justify-content: flex-end; }
.auth-mobile-brand { display: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--fg-3); transition: color .15s; }
.back-link:hover { color: var(--fg-1); }
.auth-form { width: 100%; max-width: 400px; margin: auto; padding: 40px 0; display: flex; flex-direction: column; gap: 18px; }
.auth-form .chip { align-self: flex-start; }
.auth-form h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; }
.auth-form h2 + p { margin-top: 6px; color: var(--fg-3); }
.auth-form .btn-lg { width: 100%; margin-top: 2px; }
.auth-switch { font-size: 14px; color: var(--fg-3); text-align: center; }
.auth-switch button { font-weight: 600; color: var(--fg-1); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }
.auth-switch button:hover { text-decoration-color: var(--fg-1); }
.auth-disclosure { display: flex; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-1); border: .5px solid var(--border-1); font-size: 13px; line-height: 1.5; color: var(--fg-3); }
.auth-disclosure .i { width: 18px; height: 18px; color: var(--fg-4); margin-top: 1px; }

/* Shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  padding: 26px 14px 16px; border-right: .5px solid var(--border-1); background: var(--ink);
}
.sidebar > .brand { padding: 0 10px 24px; font-size: 19px; }
.sidebar > .brand .mark { width: 20px; height: 21px; }
.ws-card { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; background: var(--surface-1); border: .5px solid var(--border-1); }
.ws-avatar { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--ink-deep); background: var(--gold); }
.ws-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ws-text strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-text small { font-size: 12px; color: var(--fg-4); }
.nav-label { display: block; padding: 24px 12px 8px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-5); }
.side-nav button {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin-bottom: 2px; border-radius: 9px;
  font-size: 14.5px; color: var(--fg-3); text-align: left; transition: background .15s, color .15s;
}
.side-nav button .i { opacity: .8; }
.side-nav button:hover { background: var(--surface-2); color: var(--fg-1); }
.side-nav button.active { background: var(--surface-3); color: var(--fg-1); font-weight: 500; }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--fg-4); font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.env-card { padding: 12px 13px; border-radius: 12px; background: rgba(238,177,10,.05); border: .5px solid rgba(238,177,10,.22); }
.env-title { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; }
.env-card small { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--fg-4); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 12px 0 0 6px; border-top: .5px solid var(--border-1); }
.user-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; font-weight: 600; }
.user-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--fg-3); }

.main { min-width: 0; }
.mobile-bar, .tabbar { display: none; }
.content { max-width: 1240px; margin: 0 auto; padding: 40px 48px 64px; }

/* Page furniture */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.page-head h1 { margin-top: 6px; font-size: 34px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.page-sub { margin-top: 6px; font-size: 15px; color: var(--fg-3); }
.page-foot { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 12.5px; color: var(--fg-4); }
.alert:not(:empty) { margin-bottom: 18px; padding: 12px 14px; border-radius: 12px; background: rgba(223,83,83,.08); border: .5px solid rgba(223,83,83,.35); }
.panel { border-radius: 16px; background: var(--surface-1); border: .5px solid var(--border-1); }
.panel.pad { padding: 24px; }
.panel-title h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.panel-title p { margin-top: 4px; font-size: 13.5px; color: var(--fg-4); }
.fine { font-size: 13px; color: var(--fg-4); }

.banner { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 15px 18px; border-radius: 14px; background: linear-gradient(90deg, rgba(238,177,10,.08), rgba(238,177,10,.015)); border: .5px solid rgba(238,177,10,.25); }
.banner-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(238,177,10,.12); color: var(--yellow); }
.banner-text strong { font-size: 14.5px; font-weight: 600; }
.banner-text p { font-size: 13.5px; color: var(--fg-3); }
.banner .chip { margin-left: auto; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 18px 20px; border-radius: 14px; background: var(--surface-1); border: .5px solid var(--border-1); }
.stat-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--fg-3); }
.stat-label .i { width: 16px; height: 16px; opacity: .75; }
.stat strong { margin-top: 8px; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat strong small, .big small { margin-left: 4px; font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--fg-3); }
.stat > small { font-size: 12.5px; color: var(--fg-4); }
.meter { display: block; height: 5px; margin: 7px 0 3px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; width: 0; height: 100%; min-width: 2px; border-radius: inherit; background: var(--fg-1); transition: width .4s ease; }
.meter.warn > span { background: var(--yellow); }
.meter.full > span { background: var(--red); }

/* Library */
.panel-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: .5px solid var(--border-1); }
.tabs { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(0,0,0,.22); border: .5px solid var(--border-1); }
.tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--fg-3); transition: background .15s, color .15s; }
.tabs button b { font-weight: 600; color: var(--fg-5); font-variant-numeric: tabular-nums; }
.tabs button:hover { color: var(--fg-1); }
.tabs button.active { background: var(--surface-3); color: var(--fg-1); }
.tabs button.active b { color: var(--fg-3); }
.filters { display: flex; gap: 8px; }
.search { position: relative; display: block; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--fg-4); pointer-events: none; }
.search .input { width: 250px; min-height: 36px; padding-left: 36px; }
.filters select.input { width: 180px; min-height: 36px; }

.rec-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rec-table th { padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-4); border-bottom: .5px solid var(--border-1); }
.rec-table td { padding: 12px 16px; border-bottom: .5px solid var(--border-1); font-size: 14px; vertical-align: middle; }
.rec-table tbody tr { cursor: pointer; transition: background .12s; }
.rec-table tbody tr:hover { background: var(--surface-2); }
.rec-table tbody tr:last-child td { border-bottom: 0; }
.col-camera { width: 17%; }
.col-status { width: 206px; }
.col-ret { width: 15%; }
.col-added { width: 118px; }
.col-go { width: 48px; color: var(--fg-5); }
.rec-table td small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--fg-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main { display: block; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rec-text { min-width: 0; display: flex; flex-direction: column; }
.rec-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 14.5px; font-weight: 600; color: var(--fg-1); }
.rec-name:hover { text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }

.thumb {
  position: relative; flex: none; width: 104px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center; color: var(--fg-5);
  background: radial-gradient(ellipse at 30% 20%, rgba(151,71,255,.16), transparent 60%), linear-gradient(135deg, #2a1d38, #120819);
  border: .5px solid var(--border-1);
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-dur { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 4px; background: rgba(10,0,18,.8); font-size: 11px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.osd-tag { position: absolute; left: 8px; bottom: 8px; z-index: 1; padding: 2px 6px; border-radius: 4px; background: rgba(10,0,18,.8); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: #fff; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 60px 24px; text-align: center; }
.empty-art { width: 60px; height: 60px; margin-bottom: 8px; border-radius: 16px; display: grid; place-items: center; background: rgba(151,71,255,.08); border: 1px dashed rgba(151,71,255,.5); color: var(--purple-soft); }
.empty h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.empty p { max-width: 420px; font-size: 14.5px; color: var(--fg-3); }
.empty .btn { margin-top: 10px; }

.onboard { padding: 28px; }
.onboard-head h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.onboard-head p { margin-top: 4px; font-size: 14px; color: var(--fg-3); }
.onboard ol { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.onboard li { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px; background: var(--surface-1); border: .5px solid var(--border-1); }
.onboard li.current { border-color: rgba(151,71,255,.6); background: rgba(151,71,255,.06); }
.onboard .ob-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px; font-size: 12px; font-weight: 700; border: 1px solid var(--border-2); color: var(--fg-3); }
.onboard li.done .ob-num { background: var(--fg-1); color: var(--ink); border: 0; }
.onboard li.current .ob-num { border-color: var(--purple); color: var(--purple-soft); }
.onboard h3 { font-size: 15px; font-weight: 600; }
.onboard li p { flex: 1; font-size: 13.5px; color: var(--fg-3); }
.onboard li .btn { align-self: flex-start; margin-top: 8px; }

/* Cameras */
.camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.camera-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--surface-1); border: .5px solid var(--border-1); }
.camera-card .thumb { width: 100%; border: 0; border-bottom: .5px solid var(--border-1); border-radius: 0; }
.camera-card .thumb > .i { width: 30px; height: 30px; }
.camera-body { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 16px 18px 18px; }
.camera-body h3 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.camera-site { display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--fg-3); }
.camera-site .i { opacity: .7; }
.camera-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; padding: 12px 0; border-top: .5px solid var(--border-1); border-bottom: .5px solid var(--border-1); }
.camera-stats dt { font-size: 11.5px; color: var(--fg-4); }
.camera-stats dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.camera-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.camera-add {
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: 16px; border: 1.5px dashed rgba(151,71,255,.45); background: rgba(151,71,255,.035); color: var(--fg-1);
  transition: background .15s, border-color .15s;
}
.camera-add:hover { background: rgba(151,71,255,.08); border-color: rgba(151,71,255,.8); }
.camera-add .add-icon { width: 44px; height: 44px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center; background: rgba(151,71,255,.15); color: var(--purple-soft); }
.camera-add strong { font-size: 15px; font-weight: 600; }
.camera-add small { font-size: 13px; color: var(--fg-4); }
.integration {
  margin-top: 18px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: center; padding: 26px 28px;
  border-radius: 16px; border: 1px dashed rgba(151,71,255,.4); background: linear-gradient(135deg, rgba(151,71,255,.07), transparent 60%);
}
.integration h2 { margin-top: 12px; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.integration p { margin-top: 6px; font-size: 14px; color: var(--fg-3); max-width: 480px; }
.spec { margin: 0; padding: 4px 16px; border-radius: 12px; background: rgba(0,0,0,.25); border: .5px solid var(--border-1); }
.spec div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: .5px solid var(--border-1); font-size: 13.5px; }
.spec div:last-child { border-bottom: 0; }
.spec dt { color: var(--fg-4); }
.spec dd { margin: 0; color: var(--fg-2); text-align: right; }
.spec-status { display: flex; align-items: center; gap: 8px; }

/* Retention */
.policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.policy {
  position: relative; display: flex; flex-direction: column; padding: 18px; border-radius: 14px; cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--border-1); transition: border-color .15s, background .15s, box-shadow .15s;
}
.policy input { position: absolute; opacity: 0; pointer-events: none; }
.policy:hover { border-color: var(--border-2); }
.policy:has(input:checked) { border-color: rgba(151,71,255,.9); background: rgba(151,71,255,.08); box-shadow: 0 0 0 3px rgba(151,71,255,.14); }
.policy:has(input:focus-visible) { outline: 2px solid var(--purple); outline-offset: 3px; }
.policy-num { height: 42px; display: flex; align-items: center; font-size: 38px; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.policy-num .i { width: 42px; height: 42px; }
.policy-unit { font-size: 14px; font-weight: 600; color: var(--fg-2); }
.policy-desc { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--fg-4); }
.policy-check { position: absolute; top: 14px; right: 14px; color: var(--purple-soft); opacity: 0; transition: opacity .15s; }
.policy:has(input:checked) .policy-check { opacity: 1; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 18px; border-top: .5px solid var(--border-1); }
.form-foot p { font-size: 13px; color: var(--fg-4); }
.form-foot p.dirty { color: var(--fg-2); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.breakdown { margin-top: 16px; }
.bd-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 132px; align-items: center; gap: 14px; padding: 10px 0; border-top: .5px solid var(--border-1); font-size: 14px; }
.bd-row:first-child { border-top: 0; }
.bd-label { font-weight: 600; color: var(--fg-2); }
.bd-value { text-align: right; color: var(--fg-3); font-variant-numeric: tabular-nums; font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--purple-soft)); transition: width .4s ease; }
.next { margin-top: 16px; display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.2); border: .5px solid var(--border-1); }
.next .thumb { width: 96px; }
.next strong { display: block; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.next small { display: block; font-size: 13px; color: var(--fg-3); }
.next .when { color: var(--fg-1); font-weight: 600; }
.quiet-note { margin-top: 16px; padding: 16px; border-radius: 12px; border: 1px dashed var(--border-2); font-size: 14px; color: var(--fg-3); text-align: center; }

/* Usage */
.usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.usage-card { display: flex; flex-direction: column; }
.big { display: block; margin-top: 14px; font-size: 44px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.usage-card > small { margin-top: 4px; font-size: 13px; color: var(--fg-4); }
.usage-card p { margin-top: 14px; font-size: 14px; line-height: 1.55; color: var(--fg-3); }
.meter-lg { height: 8px; margin-top: 16px; }
.explainer { margin-top: 16px; }
.equation-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0 18px; }
.eq-pill { padding: 10px 16px; border-radius: 10px; background: var(--surface-2); border: .5px solid var(--border-1); font-size: 15px; font-weight: 600; }
.eq-result { background: rgba(253,175,6,.1); border-color: rgba(253,175,6,.35); color: var(--gold); }
.eq-op { font-size: 18px; color: var(--fg-5); }

/* Dialogs */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; overflow: auto;
  color: var(--fg-1); background: var(--ink-2); border: .5px solid var(--border-2); border-radius: 20px; box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(5,0,10,.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dialog[open] { animation: dialogIn .2s ease-out; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.dialog > form { display: flex; flex-direction: column; gap: 18px; padding: 24px; }
.dialog-sm { width: min(440px, calc(100vw - 32px)); }
.dialog-xl { width: min(1100px, calc(100vw - 32px)); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dialog-head h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; }
.dialog-head p { margin-top: 4px; font-size: 14px; color: var(--fg-3); }
.dialog-head .icon-btn { margin: -6px -8px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

.seg-control { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 3px; padding: 3px; border-radius: 11px; background: rgba(0,0,0,.25); border: .5px solid var(--border-1); }
.seg-control label { position: relative; }
.seg-control label[hidden], .policy[hidden] { display: none; }
.seg-control input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-control span { display: block; padding: 8px 4px; border-radius: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--fg-3); white-space: nowrap; transition: background .15s, color .15s; }
.seg-control label:hover span { color: var(--fg-1); }
.seg-control input:checked + span { background: var(--fg-1); color: var(--ink); }
.seg-control input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 1px; }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 20px; text-align: center;
  border-radius: 14px; border: 1.5px dashed rgba(151,71,255,.5); background: rgba(151,71,255,.05); transition: background .15s, border-color .15s;
}
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--purple); background: rgba(151,71,255,.11); }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--purple); outline-offset: 3px; }
.dropzone:has(input:disabled) { opacity: .5; }
.drop-icon { width: 46px; height: 46px; margin-bottom: 8px; border-radius: 50%; display: grid; place-items: center; background: rgba(151,71,255,.16); color: var(--purple-soft); }
.dropzone strong { font-size: 15px; font-weight: 600; }
.dropzone u { color: var(--purple-soft); text-decoration-color: rgba(196,161,255,.5); text-underline-offset: 3px; }
.dropzone small { font-size: 12.5px; color: var(--fg-4); }
.upload-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 248px; overflow-y: auto; }
.upload-queue:empty { display: none; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-1); border: .5px solid var(--border-1); }
.q-item > .i { color: var(--fg-4); }
.q-text { flex: 1; min-width: 0; }
.q-text strong { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-text small { display: block; font-size: 12px; color: var(--fg-4); font-variant-numeric: tabular-nums; }
.q-bar { display: block; height: 3px; margin-top: 7px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.q-bar > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--fg-1); transition: width .2s; }
.q-item[data-state=done] .q-bar > span { width: 100%; background: var(--green); }
.q-item[data-state=done] > .i { color: var(--green); }
.q-item[data-state=error] { border-color: rgba(223,83,83,.45); }
.q-item[data-state=error] small, .q-item[data-state=error] > .i { color: #ff8a8a; }
.q-item[data-state=ready] .q-bar, .q-item[data-state=error] .q-bar { display: none; }

.rec-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr); }
.rec-media { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 20px; background: #07000c; border-right: .5px solid var(--border-1); }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--fg-4); font-size: 14px; }
.media-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.player-note { font-size: 12.5px; color: var(--fg-4); max-width: 460px; }
.media-foot .btn { flex: none; }
.rec-side { min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 22px 24px 24px; }
.rec-title { min-width: 0; }
.rec-camera { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--fg-3); }
.rec-camera .i { opacity: .7; }
.rec-title h2 { margin-top: 4px; overflow-wrap: anywhere; }
.lifecycle { list-style: none; margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-1); border: .5px solid var(--border-1); }
.lifecycle li { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding-bottom: 14px; }
.lifecycle li:last-child { padding-bottom: 0; }
.lifecycle li::before { content: ''; position: absolute; left: 11.5px; top: 26px; bottom: 2px; width: 1px; background: var(--border-1); }
.lifecycle li:last-child::before { display: none; }
.step-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--border-2); color: var(--fg-5); }
.lifecycle .done .step-icon { background: var(--fg-1); color: var(--ink); border: 0; }
.lifecycle .wait .step-icon { border: 1px solid rgba(238,177,10,.55); }
.lifecycle .fail .step-icon { background: rgba(223,83,83,.14); border: 1px solid rgba(223,83,83,.6); color: #ff8a8a; }
.lifecycle strong { display: block; font-size: 14px; font-weight: 600; line-height: 24px; }
.lifecycle small { display: block; margin-top: -2px; font-size: 12.5px; color: var(--fg-4); }
.lifecycle .wait small { color: var(--yellow); }
.lifecycle .fail small { color: #ff8a8a; }
.lifecycle .off strong { color: var(--fg-4); font-weight: 500; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 0; }
.meta-grid dt { font-size: 12px; color: var(--fg-4); }
.meta-grid dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.source { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: .5px solid var(--border-1); }
.source-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-head h3 { font-size: 14px; font-weight: 600; }
.source .meta-grid dd { font-variant-numeric: normal; }  /* Tabular figures space out hyphens in model numbers. */
.source-head .btn { margin: -6px -8px -6px 0; }
.source-more summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-1); border: .5px solid var(--border-1); font-size: 13px; color: var(--fg-3); cursor: pointer; list-style: none; }
.source-more summary::-webkit-details-marker { display: none; }
.source-more summary:hover { color: var(--fg-1); }
.source-more summary .i { flex: none; transition: transform .2s; }
.source-more[open] summary .i { transform: rotate(180deg); }
.tag-list { margin: 8px 0 0; }
.tag-list > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding: 8px 2px; border-bottom: .5px solid var(--border-1); font-size: 13px; }
.tag-list dt { font-family: var(--mono); font-size: 12px; color: var(--fg-3); overflow-wrap: anywhere; }
.tag-list dt span { display: block; margin-top: 1px; font-family: var(--font); font-size: 11px; color: var(--fg-5); }
.tag-list dd { margin: 0; overflow-wrap: anywhere; }
.tag-list .fine { padding: 8px 2px; }
.record-only { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.record-only:empty { display: none; }
.record-only .record-head { padding: 0 2px 2px; border: 0; font-size: 12px; font-weight: 600; color: var(--fg-4); }
.record-only li { padding: 8px 10px; border-radius: 8px; border: .5px dashed var(--border-2); }
.record-only strong { display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.record-only small { display: block; margin-top: 2px; font-size: 12px; color: var(--fg-4); }
.detail-retention { display: flex; flex-direction: column; gap: 16px; padding-top: 18px; border-top: .5px solid var(--border-1); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-delete { margin-left: auto; color: #ff8a8a; }
.btn-delete:hover { color: #ffb0b0; background: rgba(223,83,83,.1); }

.confirm { align-items: flex-start; }
.confirm-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(223,83,83,.12); color: #ff8a8a; }
.confirm h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.confirm p { margin-top: 6px; font-size: 14.5px; color: var(--fg-3); overflow-wrap: anywhere; }
.confirm .dialog-actions { align-self: stretch; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 12px; background: #2a1a36; border: .5px solid var(--border-2); box-shadow: var(--shadow-lg);
  font-size: 14px; animation: svRise .25s ease-out;
}
.toast:empty { display: none; }
.toast .i { color: var(--green); }
@keyframes svRise { from { opacity: 0; transform: translateX(-50%) translateY(6px); } }

/* Responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-added { display: none; }
  .policy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .rec-detail { grid-template-columns: 1fr; }
  .rec-media { border-right: 0; border-bottom: .5px solid var(--border-1); }
  .two-col, .usage-grid, .integration { grid-template-columns: 1fr; }
  .onboard ol { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-main { padding: 20px 20px 32px; }
  .auth-top { justify-content: space-between; }
  .auth-mobile-brand { display: inline-flex; }
  .auth-form { padding: 32px 0; }

  .shell { display: block; }
  .sidebar { display: none; }
  .mobile-bar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px 0 16px;
    background: rgba(16,1,27,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: .5px solid var(--border-1);
  }
  .mobile-bar .brand .mark { width: 22px; height: 23px; }
  .mobile-ws { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(16,1,27,.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: .5px solid var(--border-1);
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--fg-4); }
  .tabbar button.active { color: var(--fg-1); background: var(--surface-2); }
  .content { padding: 22px 16px calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .page-head { align-items: flex-start; margin-bottom: 20px; }
  .page-head h1 { font-size: 28px; }
  .page-sub { font-size: 14px; }
  .banner { flex-wrap: wrap; align-items: flex-start; }
  .banner-text { flex: 1; min-width: 0; }
  .banner .chip { display: none; }
  .stats { gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat strong { font-size: 24px; }
  .panel-toolbar { flex-direction: column; align-items: stretch; }
  .tabs button { flex: 1; justify-content: center; }
  .filters { flex-direction: column; }
  .search .input, .filters select.input { width: 100%; }
  .rec-table thead { display: none; }
  .rec-table, .rec-table tbody { display: block; }
  .rec-table tr { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; padding: 14px; border-bottom: .5px solid var(--border-1); }
  .rec-table tbody tr:last-child { border-bottom: 0; }
  .rec-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .rec-table td.rec-cell, .rec-main { display: contents; }
  .rec-table .thumb { grid-row: 1 / span 3; width: 96px; align-self: start; }
  .rec-text, .col-camera, .col-status, .col-ret { grid-column: 2; width: auto; }
  .rec-table .col-camera .cell-main, .rec-table .col-ret .cell-main { display: inline; font-size: 13px; }
  .rec-table .col-camera small, .rec-table .col-ret small { display: inline; margin-left: 6px; }
  .rec-table td.col-added, .rec-table td.col-go { display: none; }
  .policy { padding: 14px; }
  .policy-num { font-size: 30px; height: 36px; }
  .policy-num .i { width: 34px; height: 34px; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .bd-row { grid-template-columns: 88px minmax(0, 1fr); }
  .bd-value { grid-column: 1 / -1; text-align: left; margin-top: -6px; }
  .big { font-size: 36px; }

  .dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; }
  .dialog-sm { width: 100vw; }
  .dialog-xl { width: 100vw; }
  .dialog > form { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .rec-media { padding: 12px; }
  .media-foot { flex-direction: column; align-items: stretch; }
  .rec-side { padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); }
  .seg-control span { font-size: 12px; padding: 8px 2px; }
  .detail-actions .btn { flex: 1; }
  .btn-delete { margin-left: 0; }
}
.q-remove { width: 30px; height: 30px; }

/* Passkey sign-in, signup, invitations, recovery */
.auth-step { display: flex; flex-direction: column; gap: 18px; }
.auth-step.hidden { display: none; }
.auth-step h2 + p { margin-top: 6px; color: var(--fg-3); }
.auth-step .btn-lg .i { width: 20px; height: 20px; }
.auth-switch a { font-weight: 600; color: var(--fg-1); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }
.go-form { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: .5px solid var(--border-1); }
.go-form.hidden { display: none; }
.slug-input { display: flex; align-items: stretch; }
.field .slug-input input { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.slug-suffix { display: flex; align-items: center; padding: 0 12px; border: .5px solid var(--border-1); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface-1); font-size: 14px; color: var(--fg-4); white-space: nowrap; }
#slug-hint.ok { color: var(--green); }
#slug-hint.bad { color: var(--red); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.code-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: .3em; text-align: center; }
.passkey-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-1); border: .5px solid var(--border-1); }
.passkey-card strong { display: block; font-size: 14px; font-weight: 600; word-break: break-all; }
.passkey-card small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--fg-4); }
.passkey-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(151,71,255,.14); color: var(--purple-soft); }
.message-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--fg-2); }
.message-icon .i { width: 24px; height: 24px; }

/* Sidebar account entry */
button.user-email { text-align: left; }
button.user-email:hover { color: var(--fg-1); }
.mobile-avatar { cursor: pointer; }

/* People */
.people-table tbody tr { cursor: default; }
.people-table tbody tr:hover { background: transparent; }
.people-table .col-user { width: 14%; }
.people-table .col-role { width: 128px; }
.people-table .col-status { width: 250px; }
.people-table .col-actions { width: 168px; }
.people-table td.col-status small { margin-top: 5px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .user-avatar { width: 34px; height: 34px; font-size: 13px; }
.you { display: inline !important; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); font-size: 11px !important; color: var(--fg-3) !important; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
select.input-sm { height: 34px; padding: 0 30px 0 10px; font-size: 13px; }
.seg-control.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Account */
.account-grid { margin-top: 0; }
#profile-form .field { margin: 18px 0; }
.passkey-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.passkey-list li { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 12px; background: var(--surface-1); border: .5px solid var(--border-1); }
.passkey-list .rec-text { flex: 1; }
.passkey-list small { font-size: 12.5px; color: var(--fg-4); }
.passkey-list .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.verified { display: inline-flex; vertical-align: -3px; color: var(--green); }
.plan-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }

@media (max-width: 860px) {
  .field-row { grid-template-columns: 1fr; }
  .people-table tr { grid-template-columns: minmax(0, 1fr) auto; }
  .people-table td:first-child { grid-column: 1 / -1; }
  .people-table td.col-user { display: none; }
  .people-table td.col-role, .people-table td.col-status { grid-column: 1; width: auto; }
  .people-table td.col-actions { grid-column: 2; grid-row: 2 / span 2; align-self: center; width: auto; }
  .people-table td.col-status .chip { display: inline-flex; }
  .people-table td.col-status small { display: inline; margin-left: 8px; }
  .plan-card { flex-direction: column; align-items: flex-start; }
}

.sub-head { margin: 20px 0 8px; font-size: 14px; font-weight: 650; }
.steps { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; color: var(--fg-3); }
#ftp-body { display: grid; gap: 18px; }
#ftp-security { margin-top: 12px; }
#ftp-form textarea { min-height: 76px; font-family: var(--mono); font-size: 12.5px; resize: vertical; }
#ftp-secret dd { word-break: break-all; user-select: all; }

/* Billing */
.seg-control.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-control input:disabled + span { opacity: .4; cursor: not-allowed; }
.banner-red { background: linear-gradient(90deg, rgba(240,82,82,.10), rgba(240,82,82,.02)); }
.banner-red .banner-icon { background: rgba(240,82,82,.14); color: var(--red, #f05252); }
.banner .btn { margin-left: auto; flex: none; }
#billing-body { display: grid; gap: 18px; }
.plan-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 4px 0 18px; }
.plan-pick .stat-label { display: block; margin-bottom: 8px; }
.plan-prices { display: grid; gap: 8px; }
.plan-price { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-1); border: .5px solid var(--border-1); }
.plan-price strong { display: block; font-size: 14.5px; }
.plan-price small { color: var(--fg-4); font-size: 12.5px; }
.plan-price .amount { text-align: right; font-variant-numeric: tabular-nums; }
.plan-price .amount strong { font-size: 16px; }
.plan-notes { margin: 16px 0 0; }
.plan-promo { margin-top: 16px; }
#billing-promo-form .field { margin-top: 12px; }
#billing-estimate { margin-top: 14px; }
#billing-estimate table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
#billing-estimate td, #billing-estimate th { padding: 8px 0; border-bottom: .5px solid var(--border-1); text-align: left; font-weight: 400; }
#billing-estimate td:last-child, #billing-estimate th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
#billing-estimate tfoot th, #billing-estimate tfoot td { border-bottom: 0; font-weight: 600; }
@media (max-width: 860px) { .plan-pick { grid-template-columns: 1fr; } }
