/* app.logrrr.com: console layout. Brand tokens and fonts come from /brand/css.
   Ported from the design team's console mockup (app.css), sign-in and shell parts. */

:root { --sidebar-w: 220px; --topbar-h: 56px; }

/* ---------- Utilities ---------- */
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: default; }
.note { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }
.err { color: var(--danger); font-size: 13px; margin: 12px 0 0; }
code.inline {
  font-family: var(--mono); font-size: 12.5px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 2px; padding: 1px 5px; color: var(--text);
}
p a, .note a, .auth-links a { color: var(--text); }

/* ---------- Form fields ---------- */
input[type=email], input[type=password], input[type=text], input[type=url], select {
  font-family: var(--mono); background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px; width: 100%;
}
input::placeholder { color: var(--text-faint); }
label.field-label {
  display: block; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
  margin: 14px 0 6px;
}
form > label.field-label:first-of-type { margin-top: 0; }

/* ---------- Notices ---------- */
.notice {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--series-2);
  border-radius: var(--radius); padding: 10px 14px; color: var(--text); font-size: 13.5px; margin-bottom: 16px;
}
.notice-success { border-left-color: var(--success); }

/* ---------- Sign-in screens ---------- */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-lockup-link { display: block; }
.auth-lockup { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto 22px; }
.auth-sub { text-align: center; color: var(--text-faint); font-size: 13px; margin-bottom: 24px; font-family: var(--mono); }
.auth-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.auth-title { font-size: 18px; margin-bottom: 12px; }
.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.auth-links { margin: 18px 0 0; font-size: 13px; text-align: center; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--text-faint); }
.auth-foot a { color: var(--text-dim); text-decoration: none; }

/* ---------- App shell ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto;
}
.sidebar .brand { display: block; padding: 0 8px 20px; }
.sidebar .brand img { display: block; height: auto; width: 140px; }
.navgroup { margin-bottom: 18px; }
.navgroup-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--text-faint);
  padding: 0 8px 8px; text-transform: uppercase;
}
.sidenav a {
  display: block; padding: 9px 10px; border-radius: var(--radius); color: var(--text-dim);
  text-decoration: none; font-size: 13.5px; border-left: 2px solid transparent; margin-bottom: 2px;
}
.sidenav a:hover { background: var(--panel-2); color: var(--text); }
.sidenav a.active { background: var(--accent-soft); color: var(--text); border-left-color: var(--accent); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.org-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.org-plan { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: -8px; }
.switcher label.field-label { margin-top: 0; }
.switcher select { padding: 7px 10px; font-size: 12.5px; }

.mainarea { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  height: var(--topbar-h); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 0 24px; position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.topbar h1 { font-size: 16px; }
.topbar-right { font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 24px; max-width: 980px; }
.narrow { max-width: 480px; }

/* ---------- Banners (account status, confirm email, set password) ---------- */
.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  border-bottom: 1px solid var(--border); background: var(--panel); font-size: 13.5px;
}
.banner-text { flex: 1; color: var(--text-dim); }
.banner-text b { color: var(--text); }
.banner-text a { color: var(--text); }
.banner-icon {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-family: var(--mono); font-weight: 600; font-size: 12px; color: var(--bg);
}
.banner-action { flex-shrink: 0; margin: 0; }
.banner-danger { border-left: 3px solid var(--danger); }
.banner-danger .banner-icon { background: var(--danger); }
.banner-warning { border-left: 3px solid var(--warning); }
.banner-warning .banner-icon { background: var(--warning); }
.banner-info { border-left: 3px solid var(--series-2); }
.banner-info .banner-icon { background: var(--series-2); }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel h2 { font-size: 15px; }

/* ---------- Setup checklist ---------- */
.status-line { display: flex; gap: 14px; align-items: flex-start; }
.status-line h2 { margin-bottom: 4px; }
.status-dot { flex-shrink: 0; width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.status-dot.ok { background: var(--success); }
.status-dot.waiting { background: var(--warning); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status-dot.waiting { animation: none; } }

.steps { list-style: none; counter-reset: step; margin: 0 0 14px; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 16px 40px; }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: 12px; color: var(--accent); border: 1px solid var(--accent-dim);
  border-radius: var(--radius); padding: 2px 5px;
}
.steps h3 { font-size: 14px; margin-bottom: 4px; }
.steps p { font-size: 13.5px; margin-bottom: 0; }

/* ---------- Key/value rows with copy buttons ---------- */
.kv {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px;
}
.kv .kv-inner { overflow: hidden; min-width: 0; }
.kv .kv-label { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-bottom: 4px; }
.kv .kv-value { font-family: var(--mono); font-size: 13.5px; color: var(--accent); word-break: break-all; }
.kv .kv-meta { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.copybtn {
  flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 10px; cursor: pointer;
}
.copybtn:hover { color: var(--text); }

/* ---------- More utilities ---------- */
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }
.break { word-break: break-all; }
.strong { color: var(--text); font-weight: 600; }
.warn-text { color: var(--warning); font-size: 12px; margin-top: 4px; }
.notice-danger { border-left-color: var(--danger); }
.notice-warn { border-left-color: var(--warning); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(233, 80, 77, 0.12); }
.linklike {
  background: none; border: none; padding: 0; cursor: pointer; text-decoration: none;
  font-family: var(--mono); font-size: 12.5px; color: var(--series-2); margin-left: 12px;
}
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: var(--danger); }
.email-blocked { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.inline-form-plain { display: inline; margin: 0; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.panel-accent { border-color: var(--accent-dim); }
.panel-danger { border-color: var(--danger); }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
input[type=date], input[type=time] {
  font-family: var(--mono); background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text); padding: 9px 10px; border-radius: var(--radius); font-size: 13px; width: 100%;
}
input[readonly], input:disabled { color: var(--text-faint); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th {
  text-align: left; padding: 9px 10px; color: var(--text-faint); font-family: var(--mono);
  font-size: 11.5px; font-weight: 500; border-bottom: 1px solid var(--border);
}
table.plain td { padding: 10px; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); vertical-align: top; }
table.plain tr:last-child td { border-bottom: none; }
.inline-rename { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline-rename input[type=text] { max-width: 240px; padding: 6px 9px; font-size: 12.5px; }
.inline-rename select { width: auto; padding: 6px 9px; font-size: 12.5px; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 11px; font-family: var(--mono); margin-top: 4px; }
.pill.owner { background: rgba(255, 87, 22, 0.12); color: var(--accent); }
.pill.admin { background: rgba(80, 142, 253, 0.12); color: var(--series-2); }
.pill.billing { background: rgba(228, 174, 26, 0.12); color: var(--warning); }
.pill.tech { background: rgba(15, 170, 144, 0.12); color: var(--series-3); }
.pill.viewer { background: var(--panel-2); color: var(--text-faint); border: 1px solid var(--border); }

/* ---------- Settings tabs ---------- */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tabbtn {
  font-family: var(--mono); font-size: 13px; color: var(--text-faint); text-decoration: none;
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabbtn:hover { color: var(--text-dim); }
.tabbtn.active { color: var(--text); border-bottom-color: var(--accent); }
.create-key { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }

/* ---------- Activity ---------- */
.filters { display: grid; grid-template-columns: 1fr 1.3fr 1fr 1fr auto auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters-check { padding-bottom: 10px; }
.filters-buttons { display: flex; gap: 8px; }
.activity-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.activity-rows {
  list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.activity-row { background: var(--panel); display: flex; align-items: center; gap: 16px; padding: 8px 16px 8px 8px; text-decoration: none; }
.activity-row:hover { background: var(--panel-2); }
.activity-row.is-hidden { opacity: .6; }
.activity-thumb {
  width: 112px; height: 63px; border-radius: 2px; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, #1a2032, #0b101c);
}
.activity-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.activity-plate { font-family: var(--mono); font-weight: 600; font-size: 15px; color: var(--text); letter-spacing: 0.5px; min-width: 110px; }
.activity-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-dim); min-width: 0; }
.activity-meta .time { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.activity-conf { font-family: var(--mono); font-size: 12.5px; margin-left: auto; white-space: nowrap; color: var(--text-dim); }
.activity-conf.conf-high { color: var(--success); }
.activity-conf.conf-mid { color: var(--warning); }
.pager { display: flex; gap: 10px; justify-content: flex-end; }
.emptystate { text-align: center; padding: 40px 20px; }

/* ---------- Event page ---------- */
.event-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.event-picture { display: block; width: 100%; height: auto; border-radius: var(--radius); background: #0b101c; }
.event-picture.empty { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 13px; }
.event-video { display: block; width: 100%; margin-top: 10px; border-radius: var(--radius); background: #000; }
details > summary { list-style: none; display: inline-flex; }
details > summary::-webkit-details-marker { display: none; }
.plate-chip-lg {
  display: inline-block; background: rgba(6, 10, 20, 0.82); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 3px;
  padding: 7px 14px; font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--bone); letter-spacing: 1px;
}
dl.facts { margin: 16px 0 0; display: flex; flex-direction: column; gap: 9px; }
dl.facts > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; }
dl.facts dt { color: var(--text-faint); margin: 0; }
dl.facts dd { margin: 0; color: var(--text-dim); text-align: right; }
.event-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Error pages (no session) ---------- */
.center-card {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px 16px; text-align: center;
}

/* ---------- Phones and small tablets: the sidebar sits above the page ---------- */
@media (max-width: 1000px) {
  .sidebar { position: static; width: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 14px 16px; }
  .sidebar .brand { padding: 0 0 12px; }
  .navgroup { display: inline-block; vertical-align: top; margin: 0 18px 10px 0; }
  .navgroup-label { padding-left: 0; }
  .sidenav a { display: inline-block; }
  .sidebar-foot { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-foot form { flex: 1 1 160px; }
  .org-plan { margin-top: 0; }
  .mainarea { margin-left: 0; }
  .topbar { position: static; padding: 0 16px; }
  .content { padding: 16px; }
  .banner { padding: 12px 16px; flex-wrap: wrap; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters-buttons { grid-column: 1 / -1; }
  .create-key { grid-template-columns: 1fr; }
  .event-layout { grid-template-columns: 1fr; }
  .activity-row { gap: 10px; flex-wrap: wrap; }
  .activity-thumb { width: 96px; height: 54px; }
  .activity-conf { margin-left: 0; }
  .inline-rename input[type=text] { max-width: none; }
}

/* Acknowledgment checkboxes (Setup) */
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); margin: 10px 0 0; cursor: pointer; }
.checkline input { margin-top: 3px; flex: none; width: auto; }
.mono { font-family: var(--mono); }

/* ==========================================================================
   Billing, locations, emails and the access log (0.5.0)
   ========================================================================== */
.mt-0 { margin-top: 0; }
.ml-14 { margin-left: 14px; }
input[type=number], textarea {
  font-family: var(--mono); background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px; width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
.inline-rename input[type=number] { max-width: 140px; padding: 6px 9px; font-size: 12.5px; }
.field-row { display: grid; grid-template-columns: 1.4fr 0.8fr 0.9fr; gap: 12px; }
.choice-list { border: none; padding: 0; margin: 14px 0 6px; }
legend.field-label, div.field-label {
  display: block; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin: 14px 0 6px;
}
table.plain th.right, table.plain td.right { text-align: right; }
.choice-list legend { padding: 0; }
.plain-list { margin: 0 0 12px; padding-left: 18px; color: var(--text-dim); font-size: 13.5px; }
.plain-list li { margin-bottom: 4px; }
.plain-list.numbered { list-style: decimal; }

/* Overview */
.billing-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.billing-grid > .panel { margin-bottom: 20px; }
table.plain tfoot td { border-top: 1px solid var(--border); border-bottom: none; color: var(--text-dim); }
table.plain tr.total-row td { color: var(--text); font-weight: 600; }
table.plain tr.group-row td { color: var(--text); font-weight: 600; padding-top: 16px; background: var(--panel-2); }
.status { font-family: var(--mono); font-size: 12px; }
.status-paid { color: var(--success); }
.status-open { color: var(--text); }
.status-past_due, .status-uncollectible { color: var(--danger); }
.status-void { color: var(--text-faint); text-decoration: line-through; }
.pill.ok-pill { background: rgba(65, 186, 93, 0.12); color: var(--success); }

/* Free-plan usage meter (widths are classes: the CSP allows no inline styles) */
.meter { height: 8px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--series-2); }
.meter-fill.meter-warn { background: var(--warning); }
.w-0 { width: 0%; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }

/* Upgrade steps */
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; counter-reset: st; flex-wrap: wrap; }
.stepper li {
  counter-increment: st; font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
}
.stepper li::before { content: counter(st) ". "; }
.stepper li.current { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.stepper li.done { color: var(--text-dim); }
.stepper li.done::before { content: "\2713  "; color: var(--success); }

/* Card entry (Stripe's frame sits inside this box) */
.stripe-field {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
}

/* Cameras */
.limit-strip { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 12px 18px; }
.limit-strip > div { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.limit-strip .kv-label { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.limit-strip .btn { margin-left: auto; }
tr.is-off td { opacity: .75; }
.status-on { color: var(--success); font-family: var(--mono); font-size: 12px; }
.status-off { color: var(--text-faint); font-family: var(--mono); font-size: 12px; }
td .linklike:first-of-type { margin-left: 10px; }

/* Usage charts */
.chart-panel .panel-head { margin-bottom: 8px; }
.chart-box { position: relative; height: 220px; }
.chart-numbers { margin-top: 10px; }
.chart-numbers > summary { font-family: var(--mono); font-size: 12px; color: var(--series-2); cursor: pointer; }
.chart-numbers[open] > summary { margin-bottom: 8px; }
.chart-numbers table { max-width: 360px; }

/* Email history and the access log */
.filters-emails, .filters-log { grid-template-columns: 1.4fr 1fr 1fr 0.9fr 0.9fr auto; }
.filters-log { grid-template-columns: 1.4fr 1fr 0.9fr 0.9fr auto; }
.email-text {
  white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  color: var(--text-dim); background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin: 0 0 12px; max-height: 70vh; overflow: auto;
}

/* Invoice */
.invoice-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.invoice-logo { display: block; margin-bottom: 6px; }
.invoice-meta { text-align: right; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px; }
.print-only { display: none; }

@media (max-width: 1000px) {
  .billing-grid, .invoice-parties { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .filters-emails, .filters-log { grid-template-columns: 1fr 1fr; }
  .limit-strip .btn { margin-left: 0; }
}

/* Printing an invoice (no PDF invoices: customers print or save this page) */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; font-size: 12px; }
  .sidebar, .topbar, .banner, .no-print, .screen-only, .notice { display: none !important; }
  .print-only { display: block; }
  .mainarea { margin: 0; }
  .content { padding: 0; max-width: none; }
  .panel { background: #fff; border: none; padding: 0; }
  .invoice h2, .invoice h3, .invoice .strong, table.plain tr.total-row td { color: #000; }
  p, .note, table.plain td, table.plain th, dl.facts dt, dl.facts dd, .field-label { color: #222; }
  table.plain th { border-bottom: 1px solid #999; }
  table.plain td { border-bottom: 1px solid #ddd; }
  table.plain tr.group-row td { background: #f2f2f2; color: #000; }
  table.plain tfoot td { border-top: 1px solid #999; }
  a { color: #000; text-decoration: none; }
  .status, .status-open, .status-paid, .status-past_due { color: #000; font-weight: 600; }
  .invoice a, p a, .note a { color: #000 !important; }
  table.plain tfoot td { color: #222; }
}

/* 0.5.4: billing_051's state law lines on the purchase screens and invoices. */
.state-law .state-law-why { display: inline; margin-left: 6px; }
.state-law .state-law-why > summary { font-size: 12px; color: var(--text-faint); cursor: pointer; text-decoration: underline; }
.state-law .state-law-why[open] { display: block; margin-top: 4px; }

/* 0.5.4: live Activity updates (activity-live.js). */
.live-status { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.live-status .note { margin-top: 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.live-status.is-paused .live-dot { background: var(--text-faint); }
.live-more { margin-bottom: 12px; }
.activity-rows > li.is-new > .activity-row { background: var(--accent-soft); transition: background-color 1.2s ease; }
.activity-rows > li.is-new.is-settled > .activity-row { background: var(--panel); }
.new-events-notice {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; padding: 8px 14px; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.new-events-notice:hover, .new-events-notice:focus-visible { filter: brightness(1.1); color: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
@media (prefers-reduced-motion: reduce) { .activity-rows > li.is-new > .activity-row { transition: none; } }
@media print { .live-status, .new-events-notice, .live-more { display: none !important; } }
.activity-rows[hidden], .live-status[hidden], .new-events-notice[hidden], .live-more[hidden], .live-status .btn[hidden] { display: none; }
@media (max-width: 720px) {
  .activity-toolbar { flex-wrap: wrap; }
  .live-status { order: 3; width: 100%; margin-left: 0; }
}

/* 0.5.5: state law status (design's app/locations.html). */
.legal-pill { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 11px; font-family: var(--mono); }
.legal-pill.legal-ok { background: rgba(65, 186, 93, 0.12); color: var(--success); }
.legal-pill.legal-blocked { background: rgba(229, 72, 77, 0.14); color: var(--danger); }
.legal-pill.legal-pending-attestation, .legal-pill.legal-pending-policy, .legal-pill.legal-pending-state { background: rgba(228, 174, 26, 0.12); color: var(--warning); }
.legal-pill.legal-unsupported { background: var(--panel-2); color: var(--text-faint); border: 1px solid var(--border); }
.legal-line { margin-top: 4px; }
.legal-warn { color: var(--warning); }
.legal-danger { color: var(--danger); }
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rule-list li { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.rule-list li:first-child { border-top: 0; padding-top: 0; }
.rule-code { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.purpose-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.purpose-choice:first-of-type { border-top: 0; }
.purpose-choice input { margin-top: 4px; }
.purpose-conditions { display: block; margin-top: 4px; }

/* State law warning before a save (console 0.5.6) */
.legal-warning + .legal-warning { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.legal-warning-head { margin-bottom: 8px; }
.legal-warning-head .legal-pill { margin-right: 6px; vertical-align: 1px; }
.legal-rule-text { border-left: 2px solid var(--border); padding-left: 12px; color: var(--text); white-space: pre-line; }

/* ---------- 0.5.12: event page gallery and raw data ---------- */
.gallery-stage .event-video { margin-top: 0; }
.gallery-strip { list-style: none; margin: 12px 0 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; }
.gallery-thumb {
  display: flex; flex-direction: column; gap: 4px; width: 112px; text-decoration: none; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; background: var(--panel-2);
}
.gallery-thumb:hover { border-color: var(--text-faint); }
.gallery-thumb.is-active { border-color: var(--accent); }
.gallery-thumb-img { position: relative; display: block; height: 58px; border-radius: 2px; overflow: hidden; background: linear-gradient(135deg, #1a2032, #0b101c); }
.gallery-thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; background: rgba(0, 0, 0, 0.35);
}
.gallery-label { font-family: var(--mono); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.raw-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.raw-pre {
  max-height: 480px; overflow: auto; margin: 0; padding: 12px; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--text); white-space: pre;
}
.raw-pre[hidden], [data-raw-status][hidden] { display: none; }
a.plate-link { text-decoration: none; }
a.plate-link:hover { border-color: var(--accent); }

/* 0.5.12: Activity rows link the plate to its plate page. The row's own link covers the row
   (activity-row-link), and the plate link sits above it, since links can't be nested. */
.activity-row { position: relative; }
.activity-row-link { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.activity-row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.activity-plate a { position: relative; z-index: 1; color: inherit; text-decoration: none; }
.activity-plate a:hover, .activity-plate a:focus-visible { text-decoration: underline; }
@media print { .gallery-strip { display: none !important; } }

/* 0.5.12: plate page */
.plate-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .plate-layout { grid-template-columns: 1fr; } }

/* 0.5.12: Settings → Data */
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
label.block-check { display: flex; align-items: flex-start; margin: 8px 0; }
label.block-check input { margin-top: 3px; }

/* ---------- 0.5.12: Live view (its own thin bar, no menu) ---------- */
.live-body { background: var(--bg); }
.live-shell { height: 100vh; display: flex; flex-direction: column; }
.live-bar {
  display: flex; align-items: center; gap: 14px; padding: 6px 12px; border-bottom: 1px solid var(--border);
  background: var(--panel); flex-wrap: wrap;
}
.live-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); text-decoration: none; font-size: 13px; }
.live-back img { display: block; height: 22px; width: auto; }
.live-title { font-size: 14px; margin: 0; font-weight: 600; }
.live-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live-controls select { width: auto; padding: 5px 8px; font-size: 12.5px; }
.live-state { margin: 0 0 0 auto; white-space: nowrap; }
.live-shell.is-offline .live-state { color: var(--warning); }
.live-shell.is-stopped .live-state a { color: var(--danger); }
/* The grid fills the screen below the bar: N columns by N rows, whatever the screen's shape. */
.live-grid { flex: 1; min-height: 0; display: grid; gap: 6px; padding: 6px; }
.live-grid.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.live-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
.live-grid.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); }
.live-tile {
  position: relative; display: block; min-height: 0; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(135deg, #1a2032, #0b101c); text-decoration: none; color: #fff;
}
.live-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.live-media, .live-media img, .live-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.live-caption {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 18px 10px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.78)); font-size: 12px;
}
.live-plate { font-family: var(--mono); font-weight: 600; font-size: 15px; letter-spacing: 0.5px; }
.live-where { opacity: 0.85; }
.live-when { font-family: var(--mono); opacity: 0.75; margin-left: auto; }
.live-empty { text-align: center; padding: 40px 16px; }
.live-empty[hidden], .live-controls [hidden] { display: none; }
.live-noscript { margin: 16px; }
@media (max-width: 720px) {
  .live-shell { height: auto; min-height: 100vh; }
  .live-grid.grid-2, .live-grid.grid-3, .live-grid.grid-4 { grid-template-columns: 1fr; grid-template-rows: none; }
  .live-tile { aspect-ratio: 16 / 9; }
  .live-state { margin-left: 0; width: 100%; }
}

/* ---------- 0.5.13 ---------- */
/* Activity's filters: a time beside each date (0.5.13); the two rows are 0.5.14's, below. */
.date-time { display: flex; gap: 6px; }
.date-time input[type=date] { flex: 1 1 auto; min-width: 0; }
.date-time input[type=time] { flex: 0 0 96px; width: 96px; }

/* Event page: the Seen, Camera and Location values link to Activity. */
.facts a.fact-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.facts a.fact-link:hover, .facts a.fact-link:focus-visible { text-decoration-color: var(--accent); }

/* Raw data: one button per JSON file in a row, one viewer under them. */
.raw-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.raw-tab[aria-expanded=true] { border-color: var(--accent); color: var(--text); }
.raw-viewer { margin-top: 10px; }
.raw-viewer[hidden], .raw-viewer [hidden] { display: none; }
.raw-viewer .raw-actions { align-items: center; }
.json-key { color: var(--series-2); }
.json-str { color: var(--series-3); }
.json-num { color: var(--warning); }
.json-bool { color: var(--series-4); }
.json-null { color: var(--text-faint); font-style: italic; }
@media print { .raw-tabs, .raw-viewer { display: none !important; } }

/* Settings > Team: the Edit form for a person's name and role. */
.team-edit { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: end; }
.team-edit .inline-actions { margin-top: 0; }
@media (max-width: 900px) { .team-edit { grid-template-columns: 1fr; } }

/* ---------- 0.5.14 ---------- */
/* Activity's filters in two rows (Andy, 2026-10-09): Plate, Camera, Location; then From, To,
   Show hidden and the buttons. On a phone every field takes the full width, one under another. */
.filters.filters-activity { display: block; }
.filters-activity .filters-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filters-activity .filters-row + .filters-row { margin-top: 12px; }
.filters-activity .filters-row > div { flex: 1 1 160px; min-width: 0; }
.filters-activity .filters-row > .filters-when { flex: 1 1 250px; }
.filters-activity .filters-row > .filters-check, .filters-activity .filters-row > .filters-buttons { flex: 0 0 auto; }
@media (max-width: 720px) {
  .filters-activity .filters-row { flex-direction: column; align-items: stretch; }
  .filters-activity .filters-row > div, .filters-activity .filters-row > .filters-when { flex: 0 0 auto; }
  .filters-activity .filters-check { padding-bottom: 0; }
}

/* Plan & billing: the billing address and contacts sections (moved from /billing/contacts). */
.d-block { display: block; }
.billing-section { scroll-margin-top: 72px; }
#contact-form { scroll-margin-top: 72px; }
