:root {
  color-scheme: dark;
  --bg: #0c1118;
  --panel: #141c25;
  --panel-2: #1a2530;
  --line: #2a3947;
  --text: #edf2f6;
  --muted: #9dafbd;
  --accent: #f3b75f;
  --accent-2: #f07562;
  --good: #55cf9a;
  --bad: #f07178;
  --shadow: 0 18px 55px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 0%, rgba(37, 69, 87, .45), transparent 34rem),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}
button, select, input { font: inherit; }
button { cursor: pointer; }
.topbar {
  height: 96px;
  padding: 18px clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 24, .8);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.035em; }
h3 { margin-bottom: 6px; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.privacy { color: var(--muted); display: flex; gap: 8px; align-items: center; }
.privacy span { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 14px var(--good); }
main { max-width: 1500px; margin: auto; padding: 30px clamp(20px, 4vw, 64px) 80px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 18px; border: 1px solid var(--line); background: rgba(20, 28, 37, .84); border-radius: 15px; }
.stat strong { display: block; font-size: 27px; letter-spacing: -.04em; }
.stat span { color: var(--muted); }
.progress-note { margin-top: 14px; padding: 16px 18px; border: 1px solid #5a482c; background: rgba(243, 183, 95, .08); border-radius: 13px; }
.progress-note strong { color: var(--accent); }
.progress-track { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #27313a; }
.progress-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--good)); }
.tabs { margin: 28px 0 34px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.tab { color: var(--muted); background: none; border: 0; padding: 11px 16px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-color: var(--accent); }
.view { display: none; }
.view.active { display: block; }
.section-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 24px; }
.section-heading p:not(.eyebrow) { color: var(--muted); max-width: 720px; margin-bottom: 0; }
.controls { display: flex; gap: 12px; align-items: end; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
select, input {
  color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 12px; min-width: 145px;
}
.button { border: 0; border-radius: 9px; padding: 10px 14px; color: #20170b; background: var(--accent); font-weight: 750; }
.button.secondary { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.button.good { background: var(--good); color: #081b13; }
.button.bad { background: transparent; border: 1px solid var(--bad); color: var(--bad); }
.button.small { padding: 7px 10px; font-size: 13px; }
.button.wide { width: 100%; margin-top: 18px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; }
.group-card { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; overflow: hidden; transition: transform .15s, border-color .15s; }
.group-card:hover { transform: translateY(-2px); border-color: #536a7d; }
.mosaic { height: 210px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: #080b10; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.mosaic img:first-child:last-child { grid-column: 1 / 3; grid-row: 1 / 3; }
.mosaic img:first-child:nth-last-child(2) { grid-row: 1 / 3; }
.card-body { padding: 14px; }
.card-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.card-title h3 { margin: 0; }
.counts { color: var(--muted); font-size: 13px; margin: 5px 0 12px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin: 10px 0; }
.tag-editor input { min-width: 0; width: 100%; }
.badge { display: inline-block; padding: 3px 8px; color: var(--accent); background: rgba(243, 183, 95, .12); border-radius: 20px; font-size: 12px; }
.drawer { position: fixed; top: 0; right: 0; width: min(680px, 94vw); height: 100vh; z-index: 30; overflow: auto; padding: 28px; background: #111922; border-left: 1px solid var(--line); transform: translateX(102%); transition: transform .2s ease; box-shadow: var(--shadow); }
.drawer.open { transform: translateX(0); }
.scrim { display: none; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .62); }
.scrim.open { display: block; }
.icon-button { color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 50%; font-size: 25px; line-height: 1; }
.drawer > .icon-button { position: sticky; top: 0; float: right; z-index: 2; }
.track { margin: 18px 0; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.track-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.track-head p { color: var(--muted); word-break: break-word; font-size: 13px; }
.occurrences { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
.occurrence { position: relative; border-radius: 10px; overflow: hidden; background: #090d12; min-height: 110px; }
.occurrence img { width: 100%; height: 110px; object-fit: cover; display: block; }
.occurrence time { position: absolute; left: 5px; bottom: 5px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.72); font-size: 11px; }
.occurrence button { position: absolute; right: 5px; top: 5px; border: 0; border-radius: 50%; background: rgba(0,0,0,.7); color: white; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.review-card { overflow: hidden; border: 1px solid var(--line); background: var(--panel); border-radius: 15px; }
.review-card img { width: 100%; height: 205px; object-fit: cover; display: block; }
.review-card .card-body p { color: var(--muted); word-break: break-word; }
.review-card.confirmed { border-color: var(--good); }
.review-card.rejected { opacity: .65; border-color: var(--bad); }
.status-panel { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.status-item { padding: 20px; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; }
.status-item strong { display: block; font-size: 30px; }
.empty { padding: 50px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 15px; }
dialog { width: min(1000px, 94vw); border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.78); }
dialog .icon-button { float: right; margin-bottom: 8px; }
dialog video { width: 100%; max-height: 72vh; background: black; }
dialog p { color: var(--muted); word-break: break-word; margin: 8px 0 0; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 120px); padding: 10px 16px; border-radius: 9px; background: var(--text); color: var(--bg); transition: transform .2s; }
.toast.show { transform: translate(-50%, 0); }
.connection-panel { max-width: 850px; padding: 24px; border: 1px solid var(--line); background: var(--panel); border-radius: 15px; }
.connection-panel input { width: min(420px, 100%); }
.connection-panel .controls { flex-wrap: wrap; }
.connection-note { color: var(--muted); margin: 20px 0 0; }
.connection-panel a.button { text-decoration: none; }
.button:disabled { opacity: .55; cursor: wait; }
[hidden] { display: none !important; }
.tagging-panel { margin-top: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; margin: 16px 0; }
.checkbox-label input { min-width: 0; width: auto; }
.tagging-folders { margin: 16px 0; }
.tagging-folders summary { cursor: pointer; color: var(--muted); }
.tagging-table { max-height: 350px; overflow: auto; margin: 14px 0; }
.tagging-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tagging-table th, .tagging-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .section-heading { display: block; }
  .controls { margin-top: 16px; }
  .privacy { font-size: 12px; }
}
[hidden] { display: none !important; }
html[data-session="booting"] #private-reviewer,
html[data-session="signed-out"] #private-reviewer,
html[data-session="booting"] .local-only,
html[data-session="signed-out"] .local-only,
html[data-session="authenticated"] .local-only,
html[data-session="local"] .hosted-only { display: none; }
.session-panel { max-width: 640px; margin: 64px auto; padding: 24px; }
.session-panel .button { margin: 8px 8px 0 0; }
.worker-panel { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.worker-panel p { line-height: 1.6; overflow-wrap: anywhere; }
.worker-controls { flex-wrap: wrap; gap: 10px; }
.worker-actual { font-size: 1.2rem; font-weight: 700; }
#worker-ack { border-left: 3px solid var(--accent); padding-left: 16px; }
#worker-guidance { white-space: pre-line; }
#worker-counts dd { margin: 6px 0 0; font-size: 1.8rem; font-weight: 700; }
.worker-blocks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.worker-block { padding: 16px; border: 1px solid var(--accent); border-radius: 10px; }
.worker-block h4 { margin-top: 0; }
.worker-panel button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
