/* fotoz — private timelapse catalogue. Dark by default (photos read best on a
   neutral dark ground); follows the OS when it asks for light. */

:root {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --raised: #242422;
  --sunken: #131312;
  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .18);
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --accent: #3987e5;
  --accent-2: #5598e7;
  --accent-wash: rgba(57, 135, 229, .16);
  --on-accent: #fff;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --crit-ink: #ff8a8a;
  --good-ink: #4ccb4c;
  --warn-ink: #fab219;
  --heat0: #262624;
  --heat1: #104281;
  --heat2: #1c5cab;
  --heat3: #3987e5;
  --heat4: #86b6ef;
  --photo-bg: #0a0a0a;
  --r: 10px;
  --r-s: 6px;
  --side: 236px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --page: #f3f3f0;
    --surface: #fcfcfb;
    --raised: #ffffff;
    --sunken: #ebebe6;
    --line: rgba(11, 11, 11, .10);
    --line-2: rgba(11, 11, 11, .18);
    --ink: #0b0b0b;
    --ink-2: #52514e;
    --muted: #6f6e69;
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --accent: #2a78d6;
    --accent-2: #256abf;
    --accent-wash: rgba(42, 120, 214, .12);
    --crit-ink: #b42323;
    --good-ink: #006300;
    --warn-ink: #8a5a00;
    --heat0: #e6e5df;
    --heat1: #b7d3f6;
    --heat2: #6da7ec;
    --heat3: #2a78d6;
    --heat4: #104281;
    --photo-bg: #1a1a19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .06);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 var(--font);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.break { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ok { color: var(--good-ink); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
html:not(.js) .js-only { display: none !important; }

/* ---- shell ---- */
.navtoggle { position: absolute; opacity: 0; pointer-events: none; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 30;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 14px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.logo { width: 26px; height: 26px; color: var(--accent); flex: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--r-s);
  color: var(--ink-2); font-size: 14px;
}
.nav-item:hover { background: var(--raised); color: var(--ink); text-decoration: none; }
.nav-item.on { background: var(--accent-wash); color: var(--ink); font-weight: 600; }
.nav-group > summary, .nav-sub > summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 7px 10px; border-radius: var(--r-s);
  display: flex; align-items: center; gap: 6px;
}
.nav-group > summary { margin-top: 10px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.nav-sub > summary { color: var(--ink); font-size: 14px; font-weight: 500; }
.nav-group > summary::-webkit-details-marker, .nav-sub > summary::-webkit-details-marker { display: none; }
.nav-group > summary::before, .nav-sub > summary::before {
  content: ""; width: 6px; height: 6px; flex: none;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px;
}
.nav-group[open] > summary::before, .nav-sub[open] > summary::before { transform: rotate(45deg); }
.nav-group > summary:hover, .nav-sub > summary:hover { background: var(--raised); }
.nav-sub { margin-left: 4px; }
.nav-sub .nav-item { padding-left: 26px; }
.nav-empty { padding: 4px 10px; color: var(--muted); font-size: 13px; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side-foot form { margin: 0; }
.linkbtn { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; }
.ver { padding: 6px 10px 0; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.online { background: var(--good); box-shadow: 0 0 0 3px rgba(12, 163, 12, .2); }
.dot.offline { background: var(--crit); }
.dot.revoked { background: var(--muted); }

.shell { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 28px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; width: 36px; height: 36px; border-radius: var(--r-s); align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn:hover { background: var(--raised); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a { color: var(--ink-2); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--muted); }
.scrim { display: none; }
.main { padding: 22px 28px 64px; width: 100%; max-width: 1480px; }

.flash {
  margin: 14px 28px 0; padding: 10px 14px; border-radius: var(--r-s);
  background: rgba(12, 163, 12, .12); border: 1px solid rgba(12, 163, 12, .35); color: var(--ink);
}
.flash.err { background: rgba(208, 59, 59, .12); border-color: rgba(208, 59, 59, .45); }
.main .flash, .login .flash { margin: 0 0 14px; }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .navtoggle:checked ~ .side { transform: none; }
  .navtoggle:checked ~ .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .5); }
  .shell { margin-left: 0; }
  .menu-btn { display: flex; }
  .top { padding: 0 12px; }
  .main { padding: 16px 16px 56px; }
  .flash { margin: 12px 16px 0; }
}

/* ---- type, cards, buttons ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.h1 { font-size: 26px; line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.h1 .muted { font-weight: 400; }
.h2 { font-size: 17px; margin: 0; font-weight: 650; }
.h2 a { color: inherit; }
.h3 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
.sect { margin: 28px 0 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; margin-bottom: 18px;
}
.card.flat { margin: 0; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border-radius: var(--r-s);
  background: var(--raised); color: var(--ink); border: 1px solid var(--line-2);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.off { opacity: .4; cursor: default; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--raised); border-color: var(--line); }
.btn.on { background: var(--accent-wash); border-color: var(--accent); }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.btn.danger { color: var(--crit-ink); }
.btn.danger:hover { border-color: var(--crit); }
.btn.wide { width: 100%; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.field input, .field select, .inline-form select {
  min-height: 38px; padding: 7px 10px; border-radius: var(--r-s);
  background: var(--sunken); border: 1px solid var(--line-2); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-wash); }
.help { font-size: 12px; color: var(--muted); }
.form { max-width: 460px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 2px 4px 2px 0; }
.inline-form select { min-height: 30px; padding: 3px 8px; font-size: 13px; }

.badge {
  display: inline-block; padding: 1px 7px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap;
  background: var(--raised); color: var(--ink-2); border: 1px solid var(--line-2);
}
.b-dark { background: #2b2b44; color: #c9c9ff; border-color: #44446a; }
.b-bright { background: #4a3d12; color: #ffe08a; border-color: #6e5a17; }
.b-flat { background: #3a2f2a; color: #f2c3ad; border-color: #5c4537; }
.b-blurry, .b-unreadable { background: #4a1f1f; color: #ffb3b3; border-color: #6e2e2e; }
.b-skip { background: var(--crit); color: #fff; border-color: var(--crit); }
.b-keep { background: rgba(12, 163, 12, .18); color: var(--good-ink); border-color: rgba(12, 163, 12, .5); }
.b-warn { background: rgba(250, 178, 25, .16); color: var(--warn-ink); border-color: rgba(250, 178, 25, .45); }
@media (prefers-color-scheme: light) {
  .b-dark { background: #e7e7fb; color: #3a3a8a; border-color: #c4c4ee; }
  .b-bright { background: #fff3cc; color: #6b4e00; border-color: #f0d888; }
  .b-flat { background: #f7e6dc; color: #6b3a22; border-color: #e8c7b4; }
  .b-blurry, .b-unreadable { background: #fbe1e1; color: #8a1f1f; border-color: #f0bcbc; }
}
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.online { color: var(--good-ink); border-color: rgba(12, 163, 12, .45); }
.pill.offline { color: var(--crit-ink); border-color: rgba(208, 59, 59, .5); }
.pill.revoked { color: var(--muted); }

.segs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--sunken); border: 1px solid var(--line); border-radius: 9px; }
.seg { padding: 5px 12px; border-radius: 6px; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.seg:hover { background: var(--raised); color: var(--ink); text-decoration: none; }
.seg.on { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line-2); }
.seg .n { color: var(--muted); font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---- tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr 1fr; gap: 8px; } .tile { padding: 12px; } .tile-v { font-size: 22px; } .tile-v small { display: block; font-size: 12.5px; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile-l { font-size: 13px; color: var(--ink-2); }
.tile-v { font-size: 26px; font-weight: 650; line-height: 1.25; }
.tile-v small { font-size: 14px; font-weight: 400; color: var(--muted); }
.tile-s { font-size: 12.5px; color: var(--muted); }
.bar { display: block; width: 100%; height: 6px; margin-top: 10px; }
.bar-bg { fill: var(--grid); }
.bar-fg { fill: var(--accent); }
.bar.low .bar-fg { fill: var(--crit); }

/* ---- overview hero ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 18px;
}
.hero-img { background: var(--photo-bg); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-info { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.hero-when { margin: 0; color: var(--ink-2); }
.hero-when b { color: var(--ink); font-size: 18px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.facts.wide { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 16px; }
.facts div { min-width: 0; }
.facts .span2 { grid-column: span 2; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.camlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.camlist li { display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }

/* ---- year ---- */
.latest {
  display: flex; align-items: center; gap: 14px; padding: 8px; padding-right: 16px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink);
}
.latest:hover { border-color: var(--line-2); text-decoration: none; }
.latest img { width: 96px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-s); background: var(--photo-bg); }
.latest-go { margin-left: auto; color: var(--accent-2); white-space: nowrap; }
.heat-wrap { display: flex; gap: 6px; overflow-x: auto; padding: 18px 2px 4px; }
.heat-days { display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; font-size: 10.5px; color: var(--muted); line-height: 13px; padding-top: 0; }
.heat { display: flex; gap: 3px; }
.heat-col { display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; position: relative; }
.heat-m { position: absolute; top: -17px; left: 0; font-size: 11px; color: var(--muted); white-space: nowrap; }
.hc { width: 13px; height: 13px; border-radius: 3px; display: block; background: var(--heat0); }
.hc.out { background: transparent; }
.hc.fut { opacity: .45; }
.hc.l1 { background: var(--heat1); }
.hc.l2 { background: var(--heat2); }
.hc.l3 { background: var(--heat3); }
.hc.l4 { background: var(--heat4); }
.hc.miss { box-shadow: inset 0 0 0 1.5px var(--crit); }
a.hc:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend .hc { display: inline-block; }
.legend-gap { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.month-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); }
.month-card:hover { border-color: var(--accent); text-decoration: none; }
.month-card.off { background: transparent; border-style: dashed; color: var(--muted); }
.mc-img { aspect-ratio: 4 / 3; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; }
.month-card.off .mc-img { background: transparent; font-size: 13px; }
.mc-img img { width: 100%; height: 100%; object-fit: cover; }
.mc-t { padding: 8px 10px; display: flex; flex-direction: column; }
.mc-t span { font-size: 12.5px; color: var(--muted); }

/* ---- month calendar ---- */
.cal { padding: 12px; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 12px; color: var(--muted); padding: 0 4px 6px; }
.cal-week { margin-bottom: 6px; }
.cal-day { border-radius: var(--r-s); background: var(--sunken); min-width: 0; }
.cal-day.out { background: transparent; }
.cal-day.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-day.future { opacity: .5; }
.cal-link { display: flex; flex-direction: column; padding: 6px; height: 100%; color: var(--ink); position: relative; }
a.cal-link:hover { background: var(--raised); border-radius: var(--r-s); text-decoration: none; }
.cal-n { font-size: 13px; font-weight: 600; line-height: 1; margin-bottom: 6px; }
.cal-c { position: absolute; top: 6px; right: 7px; font-size: 11px; color: var(--muted); }
.cal-img { aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: var(--grid); display: block; }
.cal-day.missing .cal-img { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(208, 59, 59, .18) 6px 8px); }
.cal-img img { width: 100%; height: 100%; object-fit: cover; }
.cal-img:empty { background: transparent; }
.cal-day.missing .cal-img:empty { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(208, 59, 59, .18) 6px 8px); }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px; margin-top: 6px; height: 4px; }
.hours i { background: var(--grid); border-radius: 1px; }
.hours i.h1 { background: var(--accent); }
.hours i.h2 { background: var(--crit); }
.hours.sample { display: inline-grid; grid-template-columns: 14px; height: 6px; margin: 0 2px 0 10px; vertical-align: middle; }
@media (max-width: 640px) {
  .cal { padding: 6px; }
  .cal-head, .cal-week { gap: 3px; }
  .cal-link { padding: 3px; }
  .cal-c { display: none; }
  .cal-n { font-size: 11px; margin-bottom: 3px; }
}

/* ---- scrubber (day + month) ---- */
.scrub { margin-bottom: 18px; }
.stage {
  position: relative; display: block; background: var(--photo-bg); border-radius: var(--r); overflow: hidden;
  aspect-ratio: 4 / 3; max-height: calc(100vh - 290px); width: 100%; margin: 0 auto;
}
.stage img { width: 100%; height: 100%; object-fit: contain; }
.stage-label {
  position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 99px;
  background: rgba(0, 0, 0, .62); color: #fff; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.stage-label .badge { margin-left: 6px; }
.track {
  position: relative; height: 46px; margin: 10px 0 4px; cursor: pointer; touch-action: none; user-select: none;
  border-radius: var(--r-s);
}
.track:focus-visible { outline-offset: 0; }
.track-rail { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 3px; background: var(--grid); }
.track .tick { position: absolute; top: 12px; width: 2px; height: 10px; margin-left: -1px; border-radius: 1px; background: var(--accent); opacity: .75; }
.track .tick.flag { background: var(--warn); }
.track .tick.skip { background: var(--muted); opacity: .5; }
.track .lbl { position: absolute; top: 28px; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.track .knob {
  position: absolute; top: 7px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 2px var(--page), 0 1px 4px rgba(0, 0, 0, .5); pointer-events: none;
}
.track.drag .knob { transform: scale(1.15); }
.scrub-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hint { font-size: 13px; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 12px 2px 6px; scroll-snap-type: x proximity; }
.strip-i { flex: none; width: 104px; color: var(--ink-2); font-size: 12px; text-align: center; scroll-snap-align: center; }
.strip-i img { width: 104px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; background: var(--photo-bg); outline: 2px solid transparent; outline-offset: 1px; }
.strip-i:hover { text-decoration: none; color: var(--ink); }
.strip-i.on img { outline-color: var(--accent); }
.strip-i.on { color: var(--ink); font-weight: 600; }
.strip-i.flagged img { box-shadow: inset 0 0 0 2px var(--warn); }
@media (max-width: 640px) { .stage { max-height: none; } .strip-i, .strip-i img { width: 84px; } }

/* ---- review grid ---- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filters input[type=date] { min-height: 36px; padding: 5px 8px; border-radius: var(--r-s); background: var(--sunken); border: 1px solid var(--line-2); color: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.autoskip { padding: 12px 18px; }
.autoskip > summary { cursor: pointer; }
.autoskip-form { margin-top: 10px; }
.autoskip-form p { margin: 0 0 10px; font-size: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.grid { --tw: 150px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tw), 1fr)); gap: 6px; }
.grid.size-s { --tw: 104px; gap: 4px; }
.grid.size-l { --tw: 230px; gap: 8px; }
.grid-day { grid-column: 1 / -1; margin: 14px 0 2px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.grid-day:first-child { margin-top: 0; }
.ph {
  position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden;
  background: var(--photo-bg); cursor: pointer; outline: 2px solid transparent; outline-offset: -2px;
}
.ph input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: opacity .1s; }
.ph.flagged { outline-color: var(--warn); }
.ph.skipped img { opacity: .32; }
.ph.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.ph.sel::after {
  content: "✓"; position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.ph:focus-within { outline-color: var(--ink); }
.ph-time { position: absolute; left: 6px; bottom: 5px; font-size: 11.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); font-variant-numeric: tabular-nums; }
.ph-badges { position: absolute; right: 5px; bottom: 5px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 70%; }
.ph-badges .badge { font-size: 10.5px; line-height: 15px; padding: 0 5px; }
.size-s .ph-badges .badge { font-size: 0; width: 9px; height: 9px; padding: 0; }
.size-s .ph-time { font-size: 10px; }
.ph-open {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transition: opacity .1s;
}
.ph-open svg { width: 14px; height: 14px; }
.ph:hover .ph-open, .ph-open:focus-visible { opacity: 1; }
@media (hover: none) { .ph-open { opacity: .85; } }
.actionbar {
  position: sticky; bottom: 12px; z-index: 10; margin-top: 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--r);
  background: var(--raised); border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.actionbar .spacer { flex: 1; }
.selcount { font-weight: 600; margin-right: 6px; }
.js .actionbar:not(.show) .btn[name=action] { opacity: .4; pointer-events: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 20px 0; }

/* ---- photo viewer ---- */
body.full .side, body.full .top, body.full .scrim, body.full .navtoggle { display: none; }
body.full .shell { margin: 0; }
body.full .main { padding: 0; max-width: none; }
body.full .flash { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 50; margin: 0; }
.viewer {
  position: fixed; inset: 0; display: flex; flex-direction: column; background: #0b0b0b; color: #f0efec; color-scheme: dark;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --raised: #242422; --sunken: #131312;
  --line: rgba(255, 255, 255, .10); --line-2: rgba(255, 255, 255, .18);
  --good-ink: #4ccb4c; --crit-ink: #ff8a8a; --warn-ink: #fab219; --accent: #3987e5; --accent-2: #5598e7;
}
.viewer .b-dark { background: #2b2b44; color: #c9c9ff; border-color: #44446a; }
.viewer .b-bright { background: #4a3d12; color: #ffe08a; border-color: #6e5a17; }
.viewer .b-flat { background: #3a2f2a; color: #f2c3ad; border-color: #5c4537; }
.viewer .b-blurry, .viewer .b-unreadable { background: #4a1f1f; color: #ffb3b3; border-color: #6e2e2e; }
.viewer .btn.ghost { color: #f0efec; }
.viewer .btn.ghost:hover { background: #242422; border-color: rgba(255, 255, 255, .1); }
.vbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: #141413; flex-wrap: wrap; }
.vtitle { display: flex; align-items: baseline; gap: 10px; min-width: 0; margin-right: auto; }
.vtitle b { font-size: 18px; font-variant-numeric: tabular-nums; }
.vtitle span { color: #a9a89f; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vctl { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.vsep { width: 1px; height: 22px; background: rgba(255, 255, 255, .12); margin: 0 6px; }
.zoomlvl { min-width: 46px; text-align: center; font-size: 13px; color: #a9a89f; font-variant-numeric: tabular-nums; }
.vbody { flex: 1; display: flex; min-height: 0; }
.vcanvas { position: relative; flex: 1; overflow: hidden; background: #0b0b0b; touch-action: none; }
.vcanvas img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.vcanvas.zoomable { cursor: zoom-in; }
.vcanvas.zoomable.zoomed { cursor: grab; }
.vcanvas.zoomable.panning { cursor: grabbing; }
.vcanvas.zoomable img { position: absolute; left: 0; top: 0; max-width: none; width: auto; height: auto; object-fit: fill; transform-origin: 0 0; }
.vhint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 5px 12px; border-radius: 99px; background: rgba(0, 0, 0, .6); color: #ddd; font-size: 12.5px; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
.vhint.gone { opacity: 0; }
.vinfo { width: 320px; flex: none; overflow-y: auto; border-left: 1px solid rgba(255, 255, 255, .08); background: #141413; padding: 4px 18px 24px; }
.vinfo.hidden { display: none; }
.vsec { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.vsec:last-child { border-bottom: 0; }
.vh { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #898781; margin: 0 0 10px; font-weight: 600; }
.vinfo .btn { background: #242422; color: #f0efec; border-color: rgba(255, 255, 255, .18); }
.vinfo .btn.on { background: rgba(57, 135, 229, .2); border-color: #3987e5; }
.vinfo .btn.ghost { background: transparent; border-color: transparent; }
.state { margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flags { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; color: #a9a89f; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: #898781; }
.kv dd { margin: 0; min-width: 0; }
.card .kv dt { color: var(--muted); }
.touch-only { display: none; }
@media (hover: none) { .touch-only { display: inline; } .mouse-only { display: none; } }
@media (max-width: 760px) {
  .vbar { flex-wrap: nowrap; gap: 2px; padding: 6px; }
  .vctl { flex-wrap: nowrap; }
  .vctl [data-zoom], .vctl .zoomlvl, .vctl .vsep { display: none; }
  .vbar .btn { padding: 6px 9px; }
  .vtitle b { font-size: 16px; }
  .vinfo { position: absolute; inset: auto 0 0 0; width: auto; max-height: 55%; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .1); z-index: 5; }
  .vbody { position: relative; }
  .vtitle span { display: none; }
}

/* ---- health ---- */
.onpage { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.onpage a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); font-size: 13px; }
.onpage a:hover { color: var(--ink); text-decoration: none; border-color: var(--muted); }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 18px; scroll-margin-top: 110px; }
.section > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 16px 20px; }
.section > summary::-webkit-details-marker { display: none; }
.section > summary::before {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s;
}
.section[open] > summary::before { transform: rotate(45deg); }
.section[open] > summary { border-bottom: 1px solid var(--line); }
.section-body { padding: 18px 20px 20px; }
.section-body > .btnrow { margin-bottom: 16px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; margin-bottom: 18px; }
.chart-card { margin: 0; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 8px; min-width: 0; }
.chart-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.chart-t { font-weight: 600; font-size: 14px; }
.chart-note { font-size: 12px; color: var(--muted); }
.chart-now { margin-left: auto; font-size: 15px; font-weight: 600; white-space: nowrap; }
.chart { height: 168px; position: relative; }
.chart svg { display: block; overflow: visible; }
.chart-table summary { font-size: 12px; color: var(--muted); cursor: pointer; padding: 4px 0; }
.chart-table table { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chart-table td { padding: 3px 8px; }
.table-scroll { max-height: 260px; overflow: auto; }
.section .table-scroll { max-height: 320px; }
.events td { padding: 6px 8px; font-size: 13.5px; }
.events td:first-child { width: 1%; padding-right: 18px; }
.tip {
  position: fixed; z-index: 100; pointer-events: none; padding: 6px 10px; border-radius: 8px;
  background: var(--raised); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 12.5px; line-height: 1.35; display: none; white-space: nowrap;
}
.tip b { display: block; font-size: 14px; }
.tip span { color: var(--muted); }

/* svg chart marks */
.ch-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.ch-axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.ch-lbl { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-band { fill: var(--accent); opacity: .12; }
.ch-dot { fill: var(--accent); stroke: var(--sunken); stroke-width: 2; }
.ch-bar { fill: var(--accent); }
.ch-bar.hot { fill: var(--accent-2); }
.ch-gap { fill: var(--crit); }
.ch-ref { stroke-width: 1; stroke-dasharray: 4 3; }
.ch-ref.warn { stroke: var(--warn); }
.ch-ref.crit { stroke: var(--crit); }
.ch-reflbl { font-size: 10.5px; font-family: var(--font); fill: var(--muted); }
.ch-cross { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.ch-hit { fill: transparent; }

/* ---- cameras ---- */
.list td { vertical-align: middle; }
.list.compact td, .list.compact th { padding: 6px 8px; }
.pairing { border-color: var(--accent); background: linear-gradient(var(--accent-wash), var(--accent-wash)), var(--surface); }
.codebox { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 10px; }
.codebox code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--r-s); background: var(--sunken); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.addproj { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.addproj > summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }

/* ---- login / error ---- */
body.bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 360px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 26px 24px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 22px; }
.login-brand .logo { width: 34px; height: 34px; }
.error-card { max-width: 520px; }
img.broken { opacity: .3; }

/* ---- recordings, bin, versions ---- */
.rec-active { border-color: rgba(12, 163, 12, .45); }
.rec-active .camlist { margin: 4px 0 16px; }
.rec-active .edit { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.rec-active .edit > summary, .replace > summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.capture-status { margin: 10px 0 0; }
.radios { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.radios legend { padding: 0; margin-bottom: 6px; }
.radios .check { flex-wrap: wrap; color: var(--ink); }
.radios input[type=time] { width: 7.5em; }
.radios select, .radios input[type=time], .row2 input {
  min-height: 32px; padding: 3px 8px; border-radius: var(--r-s); background: var(--sunken); border: 1px solid var(--line-2); color: var(--ink);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-rec { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.versions { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.versions li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13.5px; }
.versions form { margin: 0; }
.replace-form { display: flex; flex-direction: column; gap: 8px; }
.replace-form input[type=file] { font-size: 13px; color: var(--ink-2); }
.confirm-box { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.confirm-box input { width: 70px; min-height: 30px; padding: 3px 6px; border-radius: var(--r-s); background: var(--sunken); border: 1px solid var(--line-2); color: var(--ink); }

/* ---- videos & downloads ---- */
.builder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; align-items: start; margin-bottom: 18px; }
.builder-grid > .card { margin: 0; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; margin-right: 6px; vertical-align: 2px; }
.builder .h2 { margin-bottom: 14px; }
.builder .sub { margin: -2px 0 6px 26px; display: flex; flex-direction: column; gap: 6px; }
.builder .sub[hidden], .builder [data-when][hidden] { display: none; }
.builder .check { color: var(--ink); }
.builder select, .builder input[type=date], .builder input[name=times], .builder input[name=name] {
  min-height: 34px; padding: 4px 8px; border-radius: var(--r-s); background: var(--sunken); border: 1px solid var(--line-2); color: var(--ink);
}
.pair { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.quick { margin: -4px 0 14px; }
.summary .plan p { margin: 0 0 6px; }
.plan { min-height: 64px; transition: opacity .15s; }
.plan.stale { opacity: .55; }
.plan-lead { font-size: 18px; }
.warn-text { color: var(--warn-ink); }
.err-text { color: var(--crit-ink); }
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px; margin: 12px 0; }
.sample { position: relative; display: block; color: #fff; }
.sample img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--photo-bg); }
.sample span { position: absolute; left: 4px; bottom: 3px; font-size: 10px; text-shadow: 0 1px 2px #000; }
.frame-preview { width: 100%; border-radius: var(--r-s); margin: 4px 0 12px; background: var(--photo-bg); }
.zip { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.zip .btnrow { margin: 6px 0; }
.renders td { vertical-align: middle; }
.renders .status { min-width: 180px; }
progress { width: 140px; height: 8px; vertical-align: middle; accent-color: var(--accent); }
.player { background: var(--photo-bg); border-radius: var(--r); overflow: hidden; margin-bottom: 18px; display: flex; justify-content: center; }
.player video, .player img { width: 100%; max-height: calc(100vh - 220px); display: block; object-fit: contain; }
.shares { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.shares li.dead { opacity: .55; }
.shares .codebox { margin-top: 6px; align-items: center; }
.shares .codebox form { margin: 0; }
.wm-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.2fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.wm-grid > .card { margin: 0; }
@media (max-width: 900px) { .wm-grid { grid-template-columns: 1fr; } }
.wm-preview { position: sticky; top: 70px; }
.wm-preview img { width: 100%; border-radius: var(--r-s); background: var(--photo-bg); margin: 10px 0; }
.wm-form textarea { min-height: 60px; padding: 8px 10px; border-radius: var(--r-s); background: var(--sunken); border: 1px solid var(--line-2); color: var(--ink); font: inherit; resize: vertical; }
.wm-form input[type=range] { accent-color: var(--accent); }
.wm-form input[type=color] { width: 60px; height: 36px; padding: 2px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--sunken); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font: 12px var(--mono); padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
/* public share page: always dark, it's for watching */
body.bare:has(main.share) { background: #0b0b0b; color: #f0efec; color-scheme: dark; }
body.bare:has(main.share) .btn { background: #242422; color: #f0efec; border-color: rgba(255, 255, 255, .18); }
.share { width: 100%; max-width: 1100px; text-align: center; }
.share-title { font-size: 22px; font-weight: 600; margin: 0 0 14px; }
.share-media { background: #000; border-radius: 12px; overflow: hidden; }
.share-media video, .share-media img { width: 100%; max-height: 80vh; display: block; object-fit: contain; }
.share-foot { color: var(--muted); font-size: 12px; margin-top: 18px; }
.radios input[type=file] { display: block; max-width: 100%; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.archive { scroll-margin-top: 70px; margin-bottom: 18px; }
