/* Rushes compositions. Built only from Exopter design-system tokens
   (exopter_design_system.css, exopter_semantics.css); no local palette.
   Verdict colours follow the alerting standard: keep = nominal green,
   unsure = caution amber (recheck), discard = neutral graphite. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 var(--fs-body)/var(--lh-normal) var(--font-ui);
  color: var(--text-body);
  background: var(--surface-app);
}
a { color: var(--link); }
img, video { display: block; max-width: 100%; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6em; padding: 0 .35em; height: 1.6em;
  font: 600 var(--fs-xs)/1 var(--font-mono);
  color: var(--text-muted); background: var(--surface-panel);
  border: 1px solid var(--border-rule); border-bottom-width: 2px; border-radius: var(--radius-compact);
}
.mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.muted { color: var(--text-muted); }
.eyebrow { margin: 0 0 var(--sp-1); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.icon { flex: none; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---- Top bar ------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-6);
  height: 56px; padding: 0 var(--sp-5);
  background: var(--ex-carbon-950); color: var(--ex-vapor-50);
  border-bottom: 1px solid var(--ex-carbon-700);
}
.topbar__brand { display: inline-flex; align-items: center; gap: var(--sp-2); color: inherit; text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.topbar__mark { width: 14px; height: 14px; border-radius: 3px; background: linear-gradient(135deg, var(--ex-khaki-300), var(--ex-khaki-600)); box-shadow: 0 0 0 3px rgba(181,185,154,.15); }
.topbar__nav { display: flex; gap: var(--sp-1); flex: 1; }
.topbar__link { padding: 6px 12px; border-radius: var(--radius); color: var(--ex-line-300); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.topbar__link:hover { color: var(--ex-white); background: var(--ex-carbon-800); }
.topbar__link.is-current { color: var(--ex-white); background: var(--ex-carbon-800); box-shadow: inset 0 -2px 0 var(--ex-khaki-300); }

.usermenu { position: relative; }
.usermenu__trigger { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; list-style: none; padding: 4px 8px 4px 4px; border-radius: var(--radius-round); }
.usermenu__trigger::-webkit-details-marker { display: none; }
.usermenu__trigger:hover { background: var(--ex-carbon-800); }
.usermenu__name { font-size: var(--fs-sm); font-weight: 600; }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: var(--sp-4);
  background: var(--surface-card); color: var(--text-body); border: 1px solid var(--border-rule);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.usermenu__meta { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--avatar-tone-1); color: var(--ex-white);
  font: 700 11px/1 var(--font-ui); letter-spacing: .03em;
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--xs { width: 20px; height: 20px; font-size: 9px; }

/* ---- Flash and toasts ---------------------------------------------- */
.flash-stack { position: fixed; z-index: 40; top: 68px; left: 50%; transform: translateX(-50%); display: grid; gap: var(--sp-2); width: min(560px, calc(100vw - 32px)); }
.flash { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); box-shadow: var(--shadow-md); font-weight: 600; transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.flash--notice { background: var(--ex-carbon-900); color: var(--ex-vapor-50); }
.flash--alert { background: var(--ex-amber-100); color: var(--status-caution-text); border: 1px solid var(--state-caution); }
.is-leaving { opacity: 0; transform: translateY(-6px); }

/* ---- Sign-in ------------------------------------------------------- */
.auth { display: grid; place-items: center; padding: var(--sp-6); background: radial-gradient(ellipse at 70% 20%, var(--ex-carbon-800), var(--ex-carbon-950) 60%); }
.auth__card { width: min(420px, 100%); padding: var(--sp-8); background: var(--surface-card); border: 1px solid var(--border-rule); border-radius: var(--radius-lg); box-shadow: var(--ex-shadow-raised, var(--shadow-md)); }
.auth__brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; margin-bottom: var(--sp-8); color: var(--text-strong); }
.auth__title { margin: 0 0 var(--sp-2); font-size: var(--fs-h2); color: var(--text-strong); }
.auth__lead { margin: 0 0 var(--sp-6); color: var(--text-muted); }
.auth__hint { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--text-muted); text-align: center; }
.auth__dev { display: grid; gap: var(--sp-3); margin-top: var(--sp-6); padding-top: var(--sp-6); border-top: 1px dashed var(--border-rule); }
.auth .flash-stack { position: static; transform: none; width: auto; margin-bottom: var(--sp-4); }

/* ---- Library ------------------------------------------------------- */
.library { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.library__tree { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; padding: var(--sp-4) var(--sp-3); border-right: 1px solid var(--border-rule); background: var(--surface-card); }
.tree__all, .tree__campaign-name, .tree__day, .tree__camera {
  display: flex; align-items: center; gap: var(--sp-2); position: relative;
  padding: 7px 10px; border-radius: var(--radius); color: var(--text-body); text-decoration: none; font-size: var(--fs-sm);
}
.tree__all { font-weight: 600; margin-bottom: var(--sp-3); }
.tree__campaign { margin-bottom: var(--sp-3); }
.tree__campaign-name { font-weight: 700; color: var(--text-strong); }
.tree__days, .tree__cameras { list-style: none; margin: 0; padding: 0 0 0 var(--sp-3); }
.tree__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree__count { font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tree__bar { position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--state-ready) var(--done), var(--border-rule) var(--done)); opacity: .8; }
:is(.tree__all, .tree__campaign-name, .tree__day, .tree__camera):hover { background: var(--surface-hover); }
:is(.tree__all, .tree__campaign-name, .tree__day, .tree__camera).is-current { background: var(--surface-selected); box-shadow: inset 3px 0 0 var(--selection-marker); font-weight: 600; }

.library__main { padding: var(--sp-6) var(--sp-8) var(--sp-12); min-width: 0; }
.library__header { display: flex; align-items: end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.library__title { margin: 0; font-size: var(--fs-h1); line-height: var(--lh-tight); color: var(--text-strong); }
.library__count { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); }

.triage-cta {
  display: flex; align-items: center; gap: var(--sp-6); margin-bottom: var(--sp-5);
  padding: var(--sp-5) var(--sp-6); border-radius: var(--radius-lg);
  background: var(--ex-carbon-900); color: var(--ex-vapor-50);
  box-shadow: var(--shadow-md);
}
.triage-cta__body { flex: 1; min-width: 0; }
.triage-cta__title { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-1); font-size: var(--fs-h3); color: var(--ex-white); }
.triage-cta__text { margin: 0 0 var(--sp-4); color: var(--ex-line-300); max-width: 62ch; }
.triage-cta__text strong { color: var(--ex-white); }
.triage-cta__button { flex: none; }
.triage-cta--done .triage-cta__title .icon { color: var(--ex-hud-green); }
.triage-cta .exds-btn--primary { background: var(--ex-vapor-50); color: var(--ex-carbon-950); border-color: var(--ex-vapor-50); }
.triage-cta .exds-btn--primary:hover { background: var(--ex-white); }

.progress { display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: var(--ex-carbon-700); max-width: 520px; }
.progress--thin { height: 4px; width: 160px; }
.progress__keep { background: var(--ex-nominal-500); }
.progress__unsure { background: var(--state-caution); }
.progress__discard { background: var(--ex-graphite-500); }
.progress__legend { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--ex-line-300); }
.progress__legend strong { color: var(--ex-white); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.filters__search { flex: 1 1 220px; max-width: 340px; color: var(--text-muted); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-panel); border-radius: var(--radius); border: 1px solid var(--border-rule); }
.segmented__item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: calc(var(--radius) - 2px); color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.segmented__item:hover { color: var(--text-strong); }
.segmented__item.is-current { background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-sm); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); }
.card { border-radius: var(--radius-lg); background: var(--surface-card); border: 1px solid var(--border-rule); overflow: hidden; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card__link { display: block; color: inherit; text-decoration: none; }
.card__media {
  position: relative; aspect-ratio: 16 / 9; background: var(--ex-carbon-900) center / cover no-repeat;
}
.card__media.is-scrubbing::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--scrub); background: var(--ex-khaki-300); }
.card__placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--sp-2); padding: var(--sp-3); color: var(--ex-graphite-400, var(--ex-line-300)); font-size: var(--fs-xs); text-align: center; }
.card__placeholder .icon { width: 22px; height: 22px; }
.card__duration, .card__moments {
  position: absolute; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 6px; background: rgba(7,11,13,.78); color: var(--ex-white);
  font: 600 var(--fs-xs)/1.4 var(--font-mono); font-variant-numeric: tabular-nums;
}
.card__duration { right: 8px; }
.card__moments { left: 8px; color: var(--ex-khaki-200); }
.card__body { display: grid; gap: 4px; padding: var(--sp-3); }
.card__name { font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
.card__meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-muted); }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.card--keep { box-shadow: inset 0 3px 0 var(--ex-nominal-500); }
.card--unsure { box-shadow: inset 0 3px 0 var(--state-caution); }
.card--discard .card__media { filter: grayscale(.8) brightness(.7); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-round); font-size: var(--fs-xs); font-weight: 700; line-height: 1.5; }
.pill--keep { background: var(--ex-state-ready-bg); color: var(--status-ready-text); }
.pill--unsure, .pill--caution { background: var(--ex-state-caution-bg); color: var(--status-caution-text); }
.pill--discard, .pill--pending { background: var(--surface-panel); color: var(--text-muted); }

.empty { padding: var(--sp-12) var(--sp-6); text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); }
.empty h2 { margin: 0 0 var(--sp-2); color: var(--text-strong); font-size: var(--fs-h3); }
.pager { display: flex; justify-content: center; margin-top: var(--sp-6); }

/* ---- Review (dark surface) ------------------------------------------ */
.review-page { background: var(--ex-carbon-950); }
.review-page .topbar { display: none; }
.review {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto 1fr;
  grid-template-areas: "bar bar" "stage side"; height: 100vh; height: 100dvh;
}
.review__bar { grid-area: bar; display: flex; align-items: center; gap: var(--sp-4); height: 56px; padding: 0 var(--sp-4); border-bottom: 1px solid var(--border-rule); }
.review__back { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-body); text-decoration: none; font-weight: 600; padding: 6px 10px 6px 6px; border-radius: var(--radius); min-width: 0; }
.review__back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review__back:hover { background: var(--surface-hover); }
.review__progress { display: flex; align-items: center; gap: var(--sp-3); margin-left: auto; }
.review__progress-text { font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.review__progress-text strong { color: var(--text-strong); }
.review__nav { display: flex; gap: var(--sp-1); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent; color: var(--text-body);
  font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.icon-btn:hover { background: var(--surface-hover); border-color: var(--border-rule); }
.icon-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.icon-btn--lg { width: 48px; height: 48px; border-radius: 50%; background: var(--control-primary); color: var(--control-primary-text); }
.icon-btn--lg:hover { background: var(--control-primary-hover); }
.icon-btn--sm { min-width: 28px; height: 28px; padding: 0 4px; }
.is-pressed { transform: scale(.96); }

.review__stage { grid-area: stage; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.stage { flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden; background: #000; position: relative; }
.stage__video, .stage__photo { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.stage__photo { cursor: default; }
.stage__audio { width: 100%; padding: var(--sp-8); }
.stage__waveform { width: 100%; height: auto; opacity: .9; }
.stage__pending { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.stage__pending img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .35; filter: blur(2px); }
.stage__pending-text { position: relative; max-width: 420px; padding: var(--sp-6); text-align: center; color: var(--text-muted); background: rgba(7,11,13,.7); border-radius: var(--radius-lg); }
.stage__pending-text .icon { width: 28px; height: 28px; margin: 0 auto var(--sp-2); }
.stage__pending-text strong { color: var(--text-strong); }

.controls { padding: var(--sp-3) var(--sp-4) var(--sp-4); background: var(--surface-card); border-top: 1px solid var(--border-rule); }
.controls__row { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.controls__time { margin-left: var(--sp-2); font: 500 var(--fs-sm)/1 var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.controls__time span { color: var(--text-strong); }
.controls__end { display: flex; gap: 2px; margin-left: auto; }
.controls__speed { min-width: 44px; font-family: var(--font-mono); }
.controls__hint { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--status-live-text); }

.timeline { position: relative; height: 56px; border-radius: var(--radius); background: var(--ex-carbon-800); cursor: pointer; touch-action: none; overflow: visible; }
.timeline__strip { position: absolute; inset: 0; border-radius: inherit; background-size: 100% 100%; background-repeat: no-repeat; opacity: .55; }
.timeline__played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius) 0 0 var(--radius); background: linear-gradient(90deg, rgba(245,248,246,.05), rgba(245,248,246,.16)); pointer-events: none; }
.timeline__head { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ex-white); box-shadow: 0 0 0 1px rgba(7,11,13,.6); pointer-events: none; }
.timeline__head::before { content: ""; position: absolute; top: -4px; left: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--ex-white); }
.timeline__bands { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; pointer-events: none; }
.band { position: absolute; bottom: 0; height: 10px; border-radius: 3px 3px 0 0; background: var(--ex-khaki-300); box-shadow: 0 0 0 1px rgba(7,11,13,.5); }
.band--live { background: repeating-linear-gradient(135deg, var(--ex-khaki-300) 0 6px, var(--ex-khaki-600) 6px 12px); }
.timeline__hover { position: absolute; bottom: calc(100% + 10px); transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; pointer-events: none; z-index: 5; }
.timeline__thumb { width: 160px; aspect-ratio: 16 / 9; border-radius: var(--radius-compact); border: 1px solid var(--border-strong); background: #000 0 0 no-repeat; box-shadow: var(--shadow-md); }
.stage--portrait ~ .controls .timeline__thumb { width: 90px; aspect-ratio: 9 / 16; }
.timeline__hover-time { padding: 1px 6px; border-radius: 4px; background: var(--ex-carbon-950); color: var(--ex-white); font: 600 var(--fs-xs)/1.5 var(--font-mono); }

.mark-btn {
  display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: var(--sp-4);
  height: 40px; padding: 0 12px 0 14px; border-radius: var(--radius-round);
  border: 1px solid var(--ex-khaki-300); background: transparent; color: var(--ex-khaki-200);
  font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer; transition: background var(--dur-fast);
}
.mark-btn:hover { background: var(--surface-selected); }
.mark-btn kbd { color: var(--ex-khaki-200); background: transparent; border-color: rgba(181,185,154,.4); }
.mark-btn.is-recording { background: var(--ex-khaki-300); color: var(--ex-carbon-950); animation: ex-mark-breathe 1.6s var(--ease-in-out) infinite; }
.mark-btn.is-recording kbd { color: var(--ex-carbon-950); border-color: rgba(7,11,13,.3); }
@keyframes ex-mark-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(181,185,154,.5); } 50% { box-shadow: 0 0 0 6px rgba(181,185,154,0); } }

.review__side { grid-area: side; overflow-y: auto; padding: var(--sp-4); display: grid; align-content: start; gap: var(--sp-4); border-left: 1px solid var(--border-rule); background: var(--surface-app); }
.decide__title { margin: 0 0 var(--sp-3); font-size: var(--fs-h4, var(--fs-body)); color: var(--text-strong); }
.decide__buttons { display: grid; gap: var(--sp-2); }
.decide__form { margin: 0; }
.verdict-btn {
  width: 100%; display: flex; align-items: center; gap: var(--sp-3);
  min-height: 60px; padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-3);
  border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: var(--surface-card);
  color: var(--text-body); font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast);
}
.verdict-btn:hover { border-color: var(--text-muted); background: var(--surface-hover); }
.verdict-btn:active { transform: scale(.99); }
.verdict-btn__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; }
.verdict-btn__text { flex: 1; display: grid; gap: 2px; }
.verdict-btn__text strong { font-size: var(--fs-body); color: var(--text-strong); }
.verdict-btn__text small { font-size: var(--fs-xs); color: var(--text-muted); }
.verdict-btn--keep .verdict-btn__icon { background: var(--ex-state-ready-bg); color: var(--status-ready-text); }
.verdict-btn--unsure .verdict-btn__icon { background: var(--ex-state-caution-bg); color: var(--status-caution-text); }
.verdict-btn--discard .verdict-btn__icon { background: var(--surface-panel); color: var(--text-muted); }
.verdict-btn--keep.is-selected { border-color: var(--ex-nominal-500); background: rgba(31,184,79,.10); }
.verdict-btn--unsure.is-selected { border-color: var(--state-caution); background: var(--ex-state-caution-bg); }
.verdict-btn--discard.is-selected { border-color: var(--text-muted); background: var(--surface-panel); }
.verdict-btn--keep { border-color: rgba(31,184,79,.45); }
.decide__tip { display: flex; gap: var(--sp-2); margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.decide__tip .icon { margin-top: 3px; color: var(--ex-khaki-300); }
.decide__skip { display: inline-block; margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }

.panel { padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--surface-card); border: 1px solid var(--border-rule); }
.panel__title { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); font-size: var(--fs-sm); font-weight: 700; color: var(--text-strong); letter-spacing: .01em; }
.panel__count { padding: 0 7px; border-radius: var(--radius-round); background: var(--surface-selected); color: var(--status-live-text); font: 600 var(--fs-xs)/1.6 var(--font-mono); }
details.panel > summary { cursor: pointer; margin: 0; list-style: none; }
details.panel > summary::after { content: "+"; margin-left: auto; color: var(--text-muted); }
details.panel[open] > summary { margin-bottom: var(--sp-3); }
details.panel[open] > summary::after { content: "−"; }

.moments__empty { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.moments__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.moment { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: var(--sp-2); }
.moment__time { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--radius-compact); border: 1px solid rgba(181,185,154,.35); background: var(--surface-selected); color: var(--ex-khaki-200); font: 600 var(--fs-xs)/1.4 var(--font-mono); cursor: pointer; white-space: nowrap; }
.moment__time:hover { border-color: var(--ex-khaki-300); }
.moment__note-form, .moment__delete-form { margin: 0; min-width: 0; }
.moment__note { width: 100%; height: 30px; padding: 0 8px; border-radius: var(--radius-compact); border: 1px solid transparent; background: transparent; color: var(--text-body); font: inherit; font-size: var(--fs-sm); }
.moment__note:hover { border-color: var(--border-rule); }
.moment__note:focus { outline: none; border-color: var(--focus-ring); background: var(--surface-sunken); }
.moment__note--readonly { display: block; line-height: 30px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moment__delete { color: var(--text-muted); opacity: 0; }
.moment:hover .moment__delete, .moment__delete:focus-visible { opacity: 1; }

.opinions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); font-size: var(--fs-sm); }
.opinions li { display: flex; align-items: center; gap: var(--sp-2); }
.opinions .pill { margin-left: auto; }

.info__list { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--sp-3); margin: 0; font-size: var(--fs-sm); }
.info__list dt { color: var(--text-muted); }
.info__list dd { margin: 0; color: var(--text-body); min-width: 0; overflow-wrap: anywhere; }
.info__path { font-size: var(--fs-xs); }

.undo {
  position: fixed; z-index: 30; left: 50%; bottom: var(--sp-6); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--sp-4); padding: 8px 8px 8px 16px;
  border-radius: var(--radius-round); background: var(--ex-vapor-50); color: var(--ex-carbon-950);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: var(--fs-sm);
  animation: ex-rise var(--dur) var(--ease-out);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.undo.is-leaving { transform: translate(-50%, 8px); }
.undo__form { margin: 0; }
.undo__button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-round); border: none; background: var(--ex-carbon-900); color: var(--ex-white); font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer; }
@keyframes ex-rise { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---- Onboarding ---------------------------------------------------- */
.onboarding { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--sp-4); background: rgba(7,11,13,.72); backdrop-filter: blur(4px); }
.onboarding__dialog { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: var(--sp-8); border-radius: var(--radius-lg); background: var(--surface-card); border: 1px solid var(--border-strong); box-shadow: 0 24px 60px rgba(0,0,0,.5); animation: ex-pop var(--dur-slow) var(--ease-out); }
@keyframes ex-pop { from { opacity: 0; transform: scale(.97) translateY(8px); } }
.onboarding__title { margin: 0 0 var(--sp-5); font-size: var(--fs-h3); line-height: var(--lh-snug); color: var(--text-strong); }
.onboarding__steps { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; gap: var(--sp-4); }
.onboarding__steps li { display: flex; gap: var(--sp-3); }
.onboarding__steps strong { color: var(--text-strong); }
.onboarding__steps p { margin: 2px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.onboarding__steps b { color: var(--text-body); }
.onboarding__num { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-selected); color: var(--ex-khaki-200); font: 700 var(--fs-sm)/1 var(--font-mono); border: 1px solid rgba(181,185,154,.4); }
.onboarding__keys { margin-bottom: var(--sp-4); font-size: var(--fs-sm); color: var(--text-muted); }
.onboarding__keys summary { cursor: pointer; color: var(--text-body); font-weight: 600; }
.onboarding__keys dl { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--sp-3); margin: var(--sp-3) 0 0; }
.onboarding__keys dd { margin: 0; }
.onboarding__reassure { margin: 0 0 var(--sp-5); padding: var(--sp-3); border-radius: var(--radius); background: var(--surface-panel); font-size: var(--fs-sm); color: var(--text-muted); }

/* ---- Finished ------------------------------------------------------ */
.finished { display: grid; place-items: center; min-height: calc(100vh - 56px); padding: var(--sp-6); }
.finished__card { width: min(520px, 100%); padding: var(--sp-10, var(--sp-8)); text-align: center; background: var(--surface-card); border: 1px solid var(--border-rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.finished__badge { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: var(--sp-4); border-radius: 50%; background: var(--ex-state-ready-bg); color: var(--status-ready-text); }
.finished h1 { margin: 0 0 var(--sp-1); font-size: var(--fs-h2); color: var(--text-strong); }
.finished__lead { margin: 0 0 var(--sp-6); color: var(--text-muted); }
.finished__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin: 0 0 var(--sp-6); }
.finished__stats div { padding: var(--sp-3); border-radius: var(--radius); background: var(--surface-panel); }
.finished__stats dt { font-size: var(--fs-xs); color: var(--text-muted); }
.finished__stats dd { margin: 0; font: 700 var(--fs-h2)/1.2 var(--font-mono); color: var(--text-strong); }
.finished__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }

/* ---- Admin --------------------------------------------------------- */
.page { max-width: 1040px; margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-12); display: grid; gap: var(--sp-5); }
.page__title { margin: 0; font-size: var(--fs-h1); color: var(--text-strong); }
.page__lead { margin: var(--sp-1) 0 0; color: var(--text-muted); }
.invite { display: grid; grid-template-columns: 1fr 1fr 200px auto; align-items: end; gap: var(--sp-3); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); padding: var(--sp-2); border-bottom: 1px solid var(--border-rule); }
.table td { padding: var(--sp-2); border-bottom: 1px solid var(--border-rule); vertical-align: middle; }
.table td .avatar { vertical-align: middle; margin-right: 6px; }
.table tr.is-inactive td { opacity: .55; }
.table__select { height: 32px; border-radius: var(--radius-compact); border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--text-body); font: inherit; padding: 0 8px; }
.inline-form { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-3); }
.stat { padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--surface-card); border: 1px solid var(--border-rule); display: grid; gap: 2px; }
.stat__value { font: 700 var(--fs-h2)/1.1 var(--font-mono); color: var(--text-strong); }
.stat__label { font-size: var(--fs-sm); color: var(--text-muted); }
.stat--ready .stat__value { color: var(--status-ready-text); }
.stat--retry .stat__value { color: var(--status-fault-text); }
.stat--unsupported .stat__value { color: var(--status-caution-text); }
.paths { margin: var(--sp-2) 0 var(--sp-4); padding-left: var(--sp-5); }
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.actions form { margin: 0; }
.status-fault { color: var(--status-fault-text); font-weight: 600; }

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 1100px) {
  .review { grid-template-columns: minmax(0, 1fr) 320px; }
  .mark-btn kbd, .controls__end .icon-btn:nth-child(-n+2) { display: none; }
}

@media (max-width: 860px) {
  .library { grid-template-columns: 1fr; }
  .library__tree { position: static; height: auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--border-rule); }
  .library__main { padding: var(--sp-4); }
  .triage-cta { flex-direction: column; align-items: stretch; }
  .triage-cta__button { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-3); }
  .usermenu__name { display: none; }
  .invite { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }

  .review { display: block; height: auto; }
  .review__bar { position: sticky; top: 0; z-index: 10; background: var(--surface-app); }
  .review__progress { display: none; }
  .review__nav { margin-left: auto; }
  .stage { height: auto; aspect-ratio: 16 / 9; max-height: 60vh; }
  .stage--portrait { aspect-ratio: auto; height: 60vh; }
  .controls__row { flex-wrap: wrap; }
  .mark-btn { order: 10; width: 100%; justify-content: center; margin: var(--sp-2) 0 0; height: 48px; }
  .review__side { border-left: 0; padding-bottom: var(--sp-12); }
  .verdict-btn { min-height: 56px; }
  .moment__delete { opacity: 1; }
  .undo { bottom: var(--sp-4); width: calc(100vw - 32px); justify-content: space-between; }
}

@media (pointer: coarse) {
  .icon-btn { min-width: 44px; height: 44px; }
  .timeline { height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

a.exds-btn, a.exds-btn:hover { text-decoration: none; }
.review-page .undo { top: 68px; bottom: auto; }
.review-page .undo.is-leaving { transform: translate(-50%, -8px); }

/* Mobile folder menu and admin links live in collapsible panels. */
.library__folders { display: none; }
.usermenu__links { display: none; }
@media (max-width: 860px) {
  .library__tree { display: none; }
  .library__folders { display: block; border-bottom: 1px solid var(--border-rule); background: var(--surface-card); }
  .library__folders-toggle { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); font-weight: 600; cursor: pointer; list-style: none; }
  .library__folders-toggle::-webkit-details-marker { display: none; }
  .library__folders-toggle::after { content: "+"; margin-left: auto; color: var(--text-muted); }
  .library__folders[open] .library__folders-toggle::after { content: "−"; }
  .library__folders-toggle span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .library__folders-tree { padding: 0 var(--sp-3) var(--sp-3); max-height: 55vh; overflow-y: auto; }
  .topbar { gap: var(--sp-3); padding: 0 var(--sp-4); }
  .topbar__nav .topbar__link:not(:first-child) { display: none; }
  .usermenu__links { display: grid; gap: 2px; margin-bottom: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border-rule); }
  .usermenu__links a { padding: 8px 4px; color: var(--text-body); text-decoration: none; font-weight: 600; }
  .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filters__search { max-width: none; }
}
