:root {
  --bg: #0f1419;
  --card: #1a2332;
  --text: #e7ecf3;
  --muted: #8b9bb4;
  --accent: #3d8bfd;
  --ok: #3dd68c;
  --warn: #f0b429;
  --border: #2a3548;
  font-family: system-ui, "Segoe UI", sans-serif;
  color-scheme: dark;
  --card-min: 320px;
}
html { font-size: clamp(15px, calc(11px + 0.35vw), 18px); }   /* grows a little on big monitors, never below 15px */

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: 100%; max-width: 22rem; }
.login-box h1 { margin-top: 0; font-size: 1.2rem; }
.login-box label { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }
.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.login-box button.primary { width: 100%; margin-top: 1rem; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.bar h1 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.bar-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-left: auto; }

button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #243044;
  color: var(--text);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
button.primary { background: var(--accent); border-color: #2a6fd6; color: #fff; }
button.ok { background: #1e4d3a; border-color: #2d6b52; color: var(--ok); }
button.warn { background: #4a3a18; border-color: #6b5420; color: var(--warn); }

.chk { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 0.35rem; }

.panel {
  max-width: 32rem;
  margin: 2rem auto;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.panel input {
  width: 100%;
  margin: 0.5rem 0 1rem;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }       /* wins over later display rules (the search bar showed up in the folder view) */

.status { padding: 0.5rem 1.25rem; color: var(--muted); font-size: 0.9rem; min-height: 1.5rem; white-space: pre-line; }

.queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
  gap: 1rem;
  padding: 1rem clamp(0.6rem, 1.5vw, 2rem) 2rem;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-select-wrap {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 3;
  margin: 0;
  padding: 0.2rem 0.35rem;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  cursor: pointer;
}
.card-select-wrap input { width: 1.1rem; height: 1.1rem; cursor: pointer; vertical-align: middle; }
.card.card-selected { box-shadow: inset 0 0 0 2px var(--accent, #5b9bd5); }
.card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: #000;
}
.card-body { padding: 0.75rem 1rem 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.path { font-size: 0.8rem; word-break: break-all; color: var(--muted); }
.meta { font-size: 0.85rem; }
.caption { font-size: 0.9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #243044;
  border: 1px solid var(--border);
}
button.tag.removable {
  font: inherit;
  color: inherit;
  line-height: 1.2;
}
button.tag.removable:hover { border-color: var(--warn); }
.tag.blocked { opacity: 0.5; text-decoration: line-through; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
a.download-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #1a2332;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}
a.download-link:hover { border-color: var(--accent); }
button.download-link {
  font: inherit;
  cursor: pointer;
}
button.download-link:disabled { opacity: 0.6; cursor: wait; }
.card.transfer-active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(56, 139, 253, 0.35);
}
.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.actions.review-actions { border-top: 1px solid var(--border); margin-top: 0.35rem; }
.caption-edit {
  width: 100%;
  min-height: 7.5rem;
  font-size: 0.85rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  line-height: 1.4;
}
.browse-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: #121820;
  font-size: 0.9rem;
}
.browse-bar label { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
  margin-top: 0.35rem;
}
.search-bar input[type="search"],
.search-bar input[type="text"] {
  min-width: 12rem;
  padding: 0.35rem 0.5rem;
}
.browse-bar select {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.folder-nav { flex: 1 1 100%; }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.breadcrumb button.link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0.15rem 0.25rem;
  text-decoration: underline;
}
.breadcrumb .sep { color: var(--muted); }
.status-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #243044;
  color: var(--muted);
}
.status-badge.review { color: var(--warn); }
.status-badge.tagged { color: var(--ok); }
.status-badge.blurred_review { color: var(--warn); }
.status-badge.blurred_ok { color: var(--ok); }
.blur-note.blur-warn { color: var(--warn); }
.blur-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.blur-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.blur-settings.hidden { display: none; }
.blur-custom-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.blur-custom-panel.hidden { display: none; }
.blur-parts { display: inline-flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.blur-part { font-size: 0.8rem; }
.blur-range-val { min-width: 2.5rem; color: var(--muted); font-size: 0.8rem; }
.blur-env-note { font-size: 0.75rem; max-width: 100%; }
img.blur-preview-img { outline: 2px solid var(--accent); }
img.card-thumb-zoom { cursor: zoom-in; }
.media-lightbox {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(5, 8, 12, 0.96);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1rem 1rem;
}
.media-lightbox img {
  max-width: min(100%, 96vw);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
}
.media-lightbox-close {
  position: fixed; top: 0.75rem; right: 1rem; z-index: 46;
}
.card-video { margin: 0.35rem 0 0.5rem; }
.card-video summary { cursor: pointer; font-weight: 600; }
.card-video video {
  display: block; width: 100%; max-height: min(50vh, 480px);
  margin-top: 0.35rem; background: #000; border-radius: 4px;
}
button.danger { color: #ffb4b4; }
button.blur-busy { opacity: 0.7; cursor: progress; }
.job-panel {
  margin: 0 1.25rem 0.5rem;
  padding: 0.6rem 0.85rem;
  background: #1e2838;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.job-panel.hidden { display: none; }
.job-panel strong { color: var(--text); }
.job-panel .job-current { margin-top: 0.35rem; color: var(--accent); }
.job-panel .job-err { margin-top: 0.35rem; color: var(--danger, #e55); }
.job-panel .job-hint { margin: 0.4rem 0 0; font-size: 0.8rem; }
.job-path-list {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
  max-height: 10rem;
  overflow-y: auto;
  font-size: 0.78rem;
  line-height: 1.35;
}
.job-path-list .job-path-done { color: var(--ok); text-decoration: line-through; }
.job-path-list .job-path-active { color: var(--accent); font-weight: 600; }
.job-path-list .job-path-pending { color: var(--muted); }
.job-path-list .job-path-more { color: var(--muted); list-style: none; margin-left: -1.2rem; }
.browse-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.35rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.browse-pager.hidden { display: none; }
.browse-pager .pager-info { color: var(--muted); margin-right: 0.5rem; }
#browsePagerBottom {
  margin: 1rem 0 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hint);
}
#tagFolderBtn { font-size: 0.85rem; margin-left: 0.5rem; }
.card.ki-queued {
  outline: 3px dashed #f0b429;
  outline-offset: 2px;
  box-shadow: 0 0 14px rgba(240, 180, 41, 0.55);
}
.card.ki-busy {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 16px rgba(61, 139, 253, 0.55);
  animation: ki-pulse-blue 1.1s ease-in-out infinite;
}
.card.tg-sending {
  outline: 3px solid #2dd4bf;
  outline-offset: 2px;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.45);
  animation: tg-pulse 1.2s ease-in-out infinite;
}
@keyframes tg-pulse {
  50% { box-shadow: 0 0 22px rgba(45, 212, 191, 0.7); }
}
.tg-state {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  pointer-events: none;
  text-align: center;
  background: rgba(15, 23, 42, 0.88);
  color: #2dd4bf;
  border: 1px solid #2dd4bf;
}
.tg-state.hidden { display: none; }
button.tg-busy {
  background: #0d9488;
  border-color: #0f766e;
  color: #fff;
  cursor: wait;
}
button.tg-err {
  background: var(--bad, #c0392b);
  border-color: #922b21;
  color: #fff;
}
@keyframes ki-pulse-blue {
  50% { box-shadow: 0 0 22px rgba(61, 139, 253, 0.75); }
}
.ki-state {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  pointer-events: none;
}
.ki-state.hidden { display: none; }
.ki-state.is-queued {
  background: #f0b429;
  color: #1a1200;
}
.ki-state.is-running {
  background: var(--accent);
  color: #fff;
}
button.ki-queued {
  font-size: 0.78rem;
  font-weight: 600;
  background: #f0b429;
  border-color: #c89410;
  color: #1a1200;
}
button.ki-busy {
  cursor: wait;
  font-weight: 600;
  background: var(--accent);
  border-color: #2a6fd6;
  color: #fff;
}
.card.save-pending { outline: 2px dashed var(--muted); }
.card.action-ok { outline: 2px solid var(--ok); box-shadow: 0 0 10px rgba(61, 214, 140, 0.35); }
button.btn-busy { opacity: 0.9; cursor: wait; }
button.action-ok-btn {
  background: #1e6b4a;
  border-color: var(--ok);
  color: #fff;
  font-weight: 600;
}
#tagFolderBtn.ki-busy { background: var(--accent); color: #fff; }
.tag-editor { display: flex; flex-direction: column; gap: 0.4rem; }
.tag.removable { cursor: pointer; }
.add-tag { display: flex; gap: 0.35rem; }
.add-tag input {
  flex: 1;
  padding: 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
}
.tag-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-height: 6rem;
  overflow-y: auto;
}
.tag-pick-list button.tag-pick {
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  background: #1a2838;
  border-color: var(--accent);
  color: var(--accent);
}
.tag-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

.br-tools-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  width: 100%;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}
.br-tools-label {
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 9rem;
}
.br-region-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  max-width: 36rem;
}
.br-region-row select { max-width: 8rem; }

/* ---- review of a video blur (timeline + corrections) ---- */
body.br-open { overflow: hidden; }
.br-overlay { position: fixed; inset: 0; background: rgba(5, 8, 12, 0.97); z-index: 50; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.br-box { max-width: 2400px; margin: 0 auto; padding: 0.75rem clamp(0.6rem, 1.5vw, 2rem) 3rem; }
.br-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; position: sticky; top: 0; background: var(--bg); padding: 0.5rem 0; z-index: 2; }
.br-title { font-weight: 600; overflow-wrap: anywhere; }
.br-msg { margin: 0.4rem 0; }
.br-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; font-size: 0.8rem; margin: 0.4rem 0; }
.br-leg::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.3rem; vertical-align: -1px; background: var(--seg); }
.br-sure { --seg: var(--ok); } .br-unsure { --seg: var(--warn); } .br-dropped { --seg: #ff6b6b; } .br-person { --seg: #b48ead; } .br-none { --seg: #55627a; }
.br-barwrap { position: sticky; top: 3rem; z-index: 1; background: var(--bg); padding: 0.3rem 0 0.4rem; margin: 0 0 0.5rem; }
.br-bar { display: flex; gap: 2px; height: clamp(1.8rem, 3.6vh, 2.8rem); margin: 0.3rem 0 0.4rem; position: relative; }
.br-pos { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px #000, 0 0 4px 1px rgba(0,0,0,0.6); border-radius: 1px; pointer-events: none; z-index: 1; }
.br-pos::before { content: ""; position: absolute; top: -6px; left: -4px; border: 5px solid transparent; border-top: 6px solid #fff; border-bottom: 0; filter: drop-shadow(0 0 1px #000); }
.br-seg { flex: 1 1 0; min-width: 4px; padding: 0; border: 2px solid transparent; border-radius: 3px; background: var(--seg); cursor: pointer; }
.br-seg.sel { border-color: #fff; }
.br-seg.edited { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.35) 0 4px, transparent 4px 8px); }
.br-panel, .br-draw, .br-edits { background: var(--card); border-radius: 6px; padding: 0.7rem 0.8rem; margin: 0.6rem 0; }
.br-panel h3, .br-edits h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.br-film { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 14vw, 260px), 1fr)); gap: 0.5rem; margin: 0.5rem 0; }
.br-cell { padding: 0; border: 2px solid transparent; background: #0b0f14; border-radius: 4px; text-align: left; cursor: pointer; }
.br-cell.sel { border-color: var(--accent); }
.br-cap { display: block; font-size: 0.72rem; color: var(--muted); padding: 0.15rem 0.3rem; }
.br-stage { position: relative; width: min(100%, calc(var(--br-h, 60vh) * var(--ar, 1.5))); margin-inline: auto; background: #000; overflow: hidden; }   /* never taller than --br-h of the window (the size choice in the header) */
.br-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.br-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.br-shape { fill: rgba(255, 150, 30, 0.45); stroke: #ffae42; stroke-width: 0.004; vector-effect: non-scaling-stroke; }
.br-drawing { cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.br-draw-rect { fill: rgba(255, 150, 30, 0.35); stroke: #ffae42; stroke-width: 2; vector-effect: non-scaling-stroke; }
.br-draw-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.5rem 0; }
.br-pane { flex: 1 1 min(100%, 460px); min-width: 0; }
.br-range { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin: 0.5rem 0; font-size: 0.85rem; }
.br-num { width: 5.5rem; }
.br-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.br-edit { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.25rem 0; border-top: 1px solid rgba(255,255,255,0.06); font-size: 0.85rem; }
.br-foot { position: sticky; bottom: 0; background: var(--bg); padding: 0.6rem 0; align-items: center; z-index: 1; }
@media (max-width: 600px) { .br-box { padding: 0.5rem 0.6rem 3rem; } .br-film { grid-template-columns: repeat(2, 1fr); } }

/* ---- photo brush ---- */
.br-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; margin: 0.5rem 0; }
.br-tools button.sel { border-color: var(--accent); background: rgba(61, 139, 253, 0.2); }
.br-photo { touch-action: none; }
.br-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

.br-track-result { margin: 0.5rem 0; }
.br-track-result .br-cell { cursor: default; }

.br-fx { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.br-fx input[type=range] { width: 8rem; }

/* range markers and feedback in the review */
.br-cell { position: relative; }
.br-cell.out-range { opacity: 0.4; }
.br-badge { position: absolute; top: 4px; padding: 1px 6px; border-radius: 3px; font-size: 0.7rem; font-weight: 700; color: #04130a; z-index: 2; }
.br-badge-start { left: 4px; background: var(--ok); }
.br-badge-end { right: 4px; background: #ff6b6b; color: #230808; }
.br-badge-start + .br-badge-end { top: 24px; }
.br-range-sum { display: block; font-size: 0.8rem; color: var(--muted); margin: 0.1rem 0 0.4rem; }
.br-here { margin: 0.5rem 0 0; padding: 0.45rem 0.6rem; border-radius: 4px; background: rgba(61, 214, 140, 0.12); border: 1px solid rgba(61, 214, 140, 0.4); font-size: 0.9rem; }
.br-here.blur-warn { background: rgba(240, 180, 41, 0.12); border-color: rgba(240, 180, 41, 0.55); }
.br-msg { position: sticky; top: 2.9rem; z-index: 2; background: var(--bg); padding: 0.3rem 0; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.br-player { background: var(--card); border-radius: 6px; padding: 0.5rem 0.8rem; margin: 0.6rem 0; }
.br-player summary { cursor: pointer; font-weight: 600; }
.br-player video { display: block; width: 100%; max-height: 70vh; margin: 0.5rem auto; background: #000; border-radius: 4px; }
.br-turn { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0.6rem 0 0.3rem; }
.br-turn input[type=range] { width: 9rem; }
.br-why { color: var(--text); }
.br-range-note { margin: 0 0 0.5rem; }
.br-edit-info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.br-edit-info details { font-size: 0.8rem; color: var(--muted); }
.br-fvmarks { position: absolute; left: 0; right: 0; bottom: -7px; height: 4px; pointer-events: none; }
.br-fvmarks span { position: absolute; top: 0; bottom: 0; min-width: 2px; background: #ffd54a; border-radius: 1px; }
.br-track-off { margin-left: 0.4rem; font-size: 0.8rem; padding: 0.1rem 0.5rem; }
.br-orig { pointer-events: none; }
.br-orig polygon { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.br-ednav { margin-top: 0.4rem; }
.br-fvstatus { margin: 0.35rem 0 0.1rem; }
.br-fvnote { margin: 0.1rem 0 0.4rem; min-height: 1.2em; }
.br-edacts { margin: 0.6rem 0; }
.br-transfer { background: var(--card); border-radius: 6px; padding: 0.4rem 0.8rem; margin: 0.6rem 0; }
.br-transfer summary { cursor: pointer; font-weight: 600; }
.br-edit-info .br-stage { width: min(360px, 100%); margin-top: 0.3rem; }
.br-draw { outline: none; }
.br-draw-rect.sel { fill: rgba(255, 150, 30, 0.5); stroke: #fff; stroke-width: 2; }
.br-hd-line { stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.br-handles { position: absolute; inset: 0; pointer-events: none; }
.br-hd { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #fff; border: 2px solid #ff9a1f; border-radius: 3px; pointer-events: auto; cursor: pointer; touch-action: none; }
.br-hd[data-h=n], .br-hd[data-h=s] { cursor: ns-resize; } .br-hd[data-h=e], .br-hd[data-h=w] { cursor: ew-resize; }
.br-hd[data-h=nw], .br-hd[data-h=se] { cursor: nwse-resize; } .br-hd[data-h=ne], .br-hd[data-h=sw] { cursor: nesw-resize; }
.br-hd-rot { border-radius: 50%; background: #ff9a1f; border-color: #fff; cursor: grab; }
@media (pointer: coarse) { .br-hd { width: 26px; height: 26px; margin: -13px 0 0 -13px; } }
.br-shape-no { position: absolute; transform: translate(-50%, -50%); font-size: 0.8rem; font-weight: 700; color: #fff; background: rgba(0,0,0,0.55); border-radius: 50%; min-width: 1.3em; text-align: center; pointer-events: none; }
.br-shape-no.sel { background: #ff9a1f; color: #000; }
.br-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.5rem 0; }
.br-tools .on { outline: 2px solid var(--accent); }
.br-chips { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.br-chip { padding: 0.15rem 0.5rem; font-size: 0.8rem; }
.br-chip.sel { border-color: #ff9a1f; background: rgba(255,150,30,0.25); }
.br-shapebar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: 0.4rem 0; }
.br-track-one { margin: 0.4rem 0; } .br-track-one h4 { margin: 0 0 0.2rem; font-size: 0.9rem; }
.br-edit-btns { display: inline-flex; gap: 0.4rem; flex-shrink: 0; }

/* ---- sales release ---- */
.status-badge.sell-ready { background: #14452f; color: var(--ok); }
.status-badge.sell-hold { background: #4a1f1f; color: #ffb4b4; }
.card.sell-ready { box-shadow: inset 0 0 0 2px var(--ok); }
.card.sell-hold { box-shadow: inset 0 0 0 2px #c0392b; }
.release-actions { display: contents; }
.release-bar { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.release-bar.hidden { display: none; }

/* ---- responsive layout ---- */
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
/* the bars stay in view on a desktop (not on a phone, where they would eat the screen) */
@media (min-width: 900px) and (min-height: 700px) { .chrome { position: sticky; top: 0; z-index: 20; } }
.chrome { background: var(--bg); }
.browse-bar { align-items: end; }
.browse-bar label { flex-wrap: wrap; }
/* review: work on the left, corrections on the right */
.br-layout { display: block; }
.br-side { min-width: 0; }
@media (min-width: 1250px) {
  .br-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(20rem, 26vw, 34rem); gap: 0 1.25rem; align-items: start; }
  .br-side { position: sticky; top: calc(var(--br-stack, 4.6rem) + 0.4rem); max-height: calc(100vh - var(--br-stack, 4.6rem) - 1.2rem); overflow-y: auto; display: flex; flex-direction: column; }
  .br-side .br-edits { margin-top: 0; flex: 1 1 auto; overflow-y: auto; }
  .br-side .br-foot { flex: 0 0 auto; }
}
/* phones and tablets: bigger touch targets, one column */
@media (pointer: coarse) {
  button, select, input[type=number], input[type=search], input[type=text] { min-height: 2.6rem; }
  .br-edit button, .br-chip { min-height: 2.4rem; }
}
@media (max-width: 700px) {
  .bar { padding: 0.6rem 0.75rem; gap: 0.5rem; }
  .bar-actions { margin-left: 0; width: 100%; }
  .browse-bar { padding: 0.5rem 0.75rem; gap: 0.5rem 0.75rem; }
  .browse-bar > label, .search-bar > label { flex: 1 1 100%; }
  .browse-bar select, .search-bar input { width: 100%; min-width: 0; }
  .status, .job-panel, .browse-pager { padding-left: 0.75rem; padding-right: 0.75rem; margin-left: 0; margin-right: 0; }
  .actions button { flex: 1 1 calc(50% - 0.5rem); }
  .br-pane { flex-basis: 100%; }
  .br-turn input[type=range] { width: 100%; }
  .br-tools button, .br-shapebar > * { flex: 1 1 auto; }
}
/* toolbar: label above the control, one tidy row that wraps */
.browse-bar { gap: 0.6rem 1.1rem; padding: 0.6rem clamp(0.6rem, 1.5vw, 2rem); }
.browse-bar > label:not(.chk), .search-bar > label:not(.chk) { flex-direction: column; align-items: flex-start; gap: 0.15rem; font-size: 0.78rem; }
.browse-bar > label:not(.chk) select, .search-bar > label:not(.chk) input { font-size: 0.9rem; }
.folder-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; padding-top: 0.4rem; border-top: 1px solid var(--border); }
.release-bar { padding: 0.2rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; }
.release-bar .muted-hint { font-size: 0.8rem; }
.bar { padding-inline: clamp(0.6rem, 1.5vw, 2rem); }
.job-panel, .browse-pager, .status, .blur-settings { padding-inline: clamp(0.6rem, 1.5vw, 2rem); }
.job-panel { margin-inline: clamp(0.6rem, 1.5vw, 2rem); }

/* ---- navigation: tabs, one toolbar, «Aktionen» menu, sticky action bar ---- */
/* flex body so the footer sticks to the bottom of short pages */
body { display: flex; flex-direction: column; min-height: 100vh; }
body > * { min-width: 0; }
/* tabs */
.bar h1 { font-size: 1.05rem; padding-block: 0.7rem; }
.tabs { display: flex; gap: 0.25rem; align-self: stretch; }
.tab {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0 0.9rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; color: var(--muted); font-size: 0.95rem; font-weight: 500; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; border-bottom-color: var(--accent); }
.badge { padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 600; }
/* breadcrumb row: fills the width, Aktionen on the right */
.folder-nav { justify-content: space-between; padding-top: 0; border-top: 0; }
/* spacer pushes Dichte/Pro Seite to the right */
.spacer { flex: 1 1 auto; }
/* «Aktionen» dropdown menu */
.menu { position: relative; }
.menu > summary {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: #243044; color: var(--text); font-size: 0.9rem;
  cursor: pointer; list-style: none; user-select: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after {
  content: "";
  width: 0.4rem; height: 0.4rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.menu[open] > summary { border-color: var(--accent); background: #2f3f5a; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 30;
  width: min(26rem, 92vw); max-height: calc(100vh - 8rem); overflow-y: auto;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem;
  padding: 0.85rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.menu-panel hr { width: 100%; margin: 0.1rem 0; border: 0; border-top: 1px solid var(--border); }
.menu-panel #tagFolderBtn { margin-left: 0; font-size: 0.9rem; }
.menu-panel .blur-settings { width: 100%; padding: 0; border: 0; flex-direction: column; align-items: flex-start; }
/* upload button in menu */
#browseUploadWrap { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
/* sticky action bar at the bottom */
.action-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.6rem clamp(0.6rem, 1.5vw, 2rem);
  border-top: 1px solid var(--border); background: var(--card);
  margin-top: auto;
}
.action-bar .release-bar,
.action-bar .selection-bar { display: contents; }
.action-bar #selectionCount { order: 0; margin-right: 0.5rem; }
.action-bar #batchRunBtn { order: 2; padding: 0.55rem 1.2rem; font-weight: 600; }
.action-bar #releaseStats { order: 0; flex: 1 1 12rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-bar .push-opt { order: 1; margin-left: auto; }
.action-bar #releasePageBtn { order: 2; padding: 0.55rem 1.2rem; font-weight: 600; }
@media (min-width: 900px) and (min-height: 700px) {
  .action-bar { position: sticky; bottom: 0; z-index: 15; }
  /* prevent sticky footer from covering the bottom page navigation */
  #browsePagerBottom { padding-bottom: 4rem; }
}
@media (max-width: 700px) {
  .tabs { order: 3; flex: 1 1 100%; overflow-x: auto; }
  .tab { padding-block: 0.6rem; }
  .action-bar #releaseStats { white-space: normal; }
  .menu-panel { position: fixed; left: 0.6rem; right: 0.6rem; top: auto; width: auto; }
}

/* ---- folder sidebar (Ordner view) ---- */
.layout { flex: 1 1 auto; display: flex; align-items: flex-start; }
.content { flex: 1 1 0; min-width: 0; align-self: stretch; }
.sidebar { flex: 0 0 16.5rem; width: 16.5rem; box-sizing: border-box; align-self: flex-start; padding: 0.9rem 0.5rem 1.2rem; overflow-y: auto; background: #0f151e; }
.sidebar:not(.hidden) + .content { border-left: 1px solid var(--border); }
.sidebar-title { padding: 0 0.6rem 0.5rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; min-width: 0; }
.folder-tree-btn { display: none; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 1rem; }
.tree-row { display: flex; align-items: center; border-radius: 6px; }
.tree-row:hover { background: #17202d; }
.tree-row.active, .tree-row.active:hover { background: #1c2a40; }
.tree-toggle { flex: 0 0 1.5rem; height: 1.9rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--muted); }
.tree-toggle:not(.leaf)::before { content: ""; width: 0.38rem; height: 0.38rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.12s; }
.tree-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.tree-name { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.4rem; background: none; border: 0; color: #b6c2d0; font-size: 0.88rem; text-align: left; }
.tree-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-name::before {
  content: ""; flex: 0 0 1rem; height: 1rem; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tree-row.active .tree-name { color: #fff; font-weight: 600; }
@media (min-width: 900px) and (min-height: 700px) {
  /* stays beside the cards while they scroll; scrolls on its own when the tree is long */
  .sidebar { position: sticky; top: var(--chrome-h, 0px); max-height: calc(100vh - var(--chrome-h, 0px) - var(--bar-h, 0px)); }
}
@media (max-width: 899px) {
  /* narrow: the tree is a panel above the cards, opened with the «Ordner» button */
  .layout { flex-direction: column; align-items: stretch; }
  .sidebar { display: none; flex-basis: auto; width: auto; max-height: 55vh; border-bottom: 1px solid var(--border); }
  .sidebar.open { display: block; }
  .sidebar:not(.hidden) + .content { border-left: 0; }
  .folder-tree-btn { display: inline-flex; }
}

/* «Aktionen» and «Face-Blur» sit together on the right of the breadcrumb row; the blur panel has room for its sliders */
.folder-nav #actionsMenu { margin-left: auto; }
.browse-bar > #blurMenu { flex-shrink: 0; align-self: center; order: 1; }
.menu-panel-wide { width: min(46rem, 94vw); }
/* wide Face-Blur panel: anchor to the right of the button (toolbar slot is on the right) */
#blurMenu .menu-panel-wide {
  right: 0;
  left: auto;
  max-width: min(46rem, calc(100vw - 1.2rem));
}
.blur-range { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---- Review tab: overview of the folders with waiting reviews + one-folder work bar ---- */
.review-bar { flex: 1 1 100%; }
.review-tools, .review-work { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.review-search { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; font-size: 0.78rem; color: var(--muted); }
.review-search input { min-width: 14rem; padding: 0.35rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.9rem; }
.review-folder { font-size: 1rem; overflow-wrap: anywhere; }
.review-work .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.review-work .seg button { border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.review-work .seg button[aria-pressed="true"] { background: #243247; color: #fff; font-weight: 500; }
.review-work #reviewNext { margin-left: auto; }
@keyframes review-pulse { 50% { box-shadow: 0 0 0 4px rgba(61, 139, 253, 0.35); } }
#reviewNext.pulse { animation: review-pulse 1.4s ease-in-out 3; }
.review-overview { padding: 0 clamp(0.6rem, 1.5vw, 2rem) 2rem; }
.review-table { width: 100%; max-width: 60rem; border-collapse: collapse; font-size: 0.92rem; }
.review-table th, .review-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.review-table th.num, .review-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.review-table th button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.review-table th[aria-sort="ascending"] button::after { content: " ▲"; font-size: 0.7em; }
.review-table th[aria-sort="descending"] button::after { content: " ▼"; font-size: 0.7em; }
.review-table th[aria-sort]:not([aria-sort="none"]) button { color: var(--text); }
.review-table tbody tr:hover { background: #17202d; }
.review-table td.zero { color: var(--muted); }
button.link.review-open { background: none; border: 0; padding: 0.1rem 0.25rem; color: var(--accent); text-decoration: underline; font-size: inherit; }
button.link.review-path { text-align: left; overflow-wrap: anywhere; }
.review-empty { padding: 1rem 0.75rem; color: var(--ok); }
@media (max-width: 700px) {
  .review-table th:nth-child(4), .review-table td:nth-child(4) { display: none; }
  .review-work #reviewNext { margin-left: 0; }
}

/* photo review: one check box per detected face */
.br-faces-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; }
.br-face { padding: 0.15rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-variant-numeric: tabular-nums; }
.br-face.off { color: var(--muted); border-style: dashed; }

/* ---- Bild für Bild (jedes einzelne Bild eines Videos ansehen) ---- */
.br-fv { background: var(--card); border-radius: 6px; padding: 0.5rem 0.8rem; margin: 0.6rem 0; }
.br-fv summary { cursor: pointer; font-weight: 600; }
.br-fv:focus { outline: none; }
.br-fvnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.5rem 0 0.2rem; }
.br-fvnav button { min-width: 2.6rem; min-height: 2.4rem; }
.br-fvin { width: 6.5rem; min-height: 2.4rem; text-align: center; }
.br-fvslider { width: 100%; margin: 0.4rem 0 0.2rem; }
.br-fvstrip { position: relative; display: flex; gap: 1px; height: 1.1rem; border-radius: 3px; overflow: visible; cursor: pointer; margin: 0.2rem 0 0.5rem; }
.br-fvseg { display: block; min-width: 2px; background: var(--seg); }
.br-fvhead { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px #000; pointer-events: none; }
.br-fvopts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: 0.3rem 0; }
.br-fvgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0.6rem; margin: 0.5rem 0; }
.br-fvcell { margin: 0; min-width: 0; }
.br-size { margin-left: auto; margin-right: 0.8rem; font-size: 0.85rem; white-space: nowrap; }
.br-fvover { position: absolute; inset: 0; pointer-events: none; }
.fv-det { position: absolute; box-sizing: border-box; border: 2px solid #4fc3f7; border-radius: 2px; }
.fv-det i { position: absolute; left: -2px; top: 100%; font-style: normal; font-size: 0.7rem; line-height: 1; padding: 1px 3px; background: #4fc3f7; color: #000; white-space: nowrap; }
.fv-dropped { border-color: #ff6b6b; border-style: dashed; } .fv-dropped i { background: #ff6b6b; }
.fv-head { border-color: #b48ead; border-style: dotted; } .fv-head i { background: #b48ead; }
.br-fvline { margin: 0.3rem 0; }
.br-fvdets { margin: 0.2rem 0 0.4rem 1.1rem; padding: 0; font-size: 0.85rem; }
.br-fvdets li.fv-dropped { color: #ff9b9b; } .br-fvdets li.fv-head { color: #cdb0dd; }
.br-vstep { margin: 0.3rem 0; align-items: center; }
@media (max-width: 700px) { .br-fvnav button { flex: 1 1 auto; } }
.br-fvnav button.br-fvarrow { min-width: 3.2rem; font-size: 1.1rem; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.br-pickable { cursor: pointer; pointer-events: all; }
.br-picked { fill: rgba(255, 150, 30, 0.6); stroke: #fff; stroke-width: 2; }
.br-fvedit { margin: 0.4rem 0; align-items: center; }

/* ---- status filter (several criteria) ---- */
.facet-slot { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
@media (min-width: 701px) { .facet-menu > .menu-panel { left: 0; right: auto; } }      /* opens to the right: the summary sits left of the «Filter aktiv» text */
.facet-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }
.facet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.35rem 0; }
.facet-label { min-width: 7.5rem; font-weight: 600; font-size: 0.85rem; }
.facet-chip { border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.85rem; }
.facet-chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.facet-active { font-size: 0.85rem; background: #2f3f5a; border-radius: 6px; padding: 0.1rem 0.2rem 0.1rem 0.5rem; }
.facet-active button { padding: 0 0.4rem; margin-left: 0.2rem; }

/* duplicates: badge on a card, link in the actions menu */
.dup-badge { display: inline-block; margin-left: 0.4rem; padding: 0 0.45rem; border-radius: 999px; background: #b07a00; color: #fff; font-size: 0.75rem; text-decoration: none; }
.menu-link { display: block; padding: 0.35rem 0.1rem; }

/* sound of a blur copy: choice in the settings bar and the «Ton» card of the review */
.blur-audio { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-left: 0.6rem; }
.blur-audio-detail { display: inline-flex; align-items: center; gap: 0.3rem; }
.br-audio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.35rem 0; }
.br-audio audio { width: 100%; margin-top: 0.3rem; }

/* Dubletten-Seite (vorher Inline-<style>; die CSP erlaubt kein Inline-CSS) */
.dupes { max-width: 70rem; margin: 0 auto; padding: 1rem 16px 3rem; }
.dupes form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.8rem 0; }
.dupe-group { background: var(--card); border-radius: 6px; padding: 0.6rem 0.8rem; margin: 0.7rem 0; }
.dupe-group h2 { margin: 0 0 0.4rem; font-size: 1rem; }
.dupe-group table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.dupe-group td { padding: 0.2rem 0.4rem; border-top: 1px solid rgba(128, 128, 128, 0.25); overflow-wrap: anywhere; vertical-align: top; }
.dupe-thumb { width: 4.6rem; }
.dupe-thumb img { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 4px; display: block; background: rgba(128, 128, 128, 0.15); }
.facet-sha1-row .facet-sha1-input { min-width: 12rem; max-width: 18rem; }
.facet-sha1-row button { margin-left: 0.25rem; }
.dupe-keep { white-space: nowrap; }
.dupe-row.is-keep .dupe-keep { color: var(--ok, #3ddc84); font-weight: 600; }
.dupe-keep label { cursor: pointer; }
.dupe-warn { color: var(--warn, #e0a030); font-size: 0.85rem; }
.dupe-tag { font-size: 0.8rem; opacity: 0.85; white-space: nowrap; }
.dupe-row.is-keep td { background: rgba(61, 220, 132, 0.07); }
.dupe-note { min-height: 1.2em; }
.dupe-pager { display: flex; gap: 0.8rem; align-items: center; margin: 1rem 0; }
.inline-form { display: inline; }

/* Seite «Sicherheit» */
.bar-link { color: inherit; text-decoration: none; padding: 0.35rem 0.7rem; border-radius: 6px; background: rgba(128, 128, 128, 0.18); }
.bar-link:hover { background: rgba(128, 128, 128, 0.3); }
.sec { max-width: 40rem; margin: 0 auto; padding: 1rem 16px 3rem; }
.sec-box { margin: 1rem 0; padding: 0.8rem 1rem; }
.sec-box h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.sec-box form { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.6rem 0; }
.sec-box label { display: flex; flex-direction: column; gap: 0.25rem; }
.sec-box code { word-break: break-all; font-size: 1.05rem; letter-spacing: 0.05em; }
.sec-qr { background: #fff; padding: 6px; border-radius: 6px; max-width: 100%; height: auto; }
.sec-msg { min-height: 1.2em; margin: 0; }
.sec-ok { color: var(--ok, #3ddc84); }
.sec-bad { color: var(--danger, #ff6b6b); }

.login-or { display: flex; align-items: center; gap: 0.6rem; margin: 1rem 0 0.2rem; color: var(--muted); font-size: 0.8rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--border, #444); }
.pk-list { list-style: none; margin: 0.4rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pk-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border, #444); border-radius: 6px; }
.pk-list .pk-name { font-weight: 600; }
.pk-list .pk-meta { color: var(--muted); font-size: 0.82rem; flex: 1 1 12rem; }

/* roles: the server refuses what a role may not do (admin_roles); these only hide the buttons that would end in a refusal */
body[data-role="viewer"] #browseUploadWrap, body[data-role="viewer"] #batchRunBtn { display: none !important; }
body[data-role="viewer"] #batchReleaseReady, body[data-role="editor"] #batchReleaseReady,
body[data-role="viewer"] #releasePageBtn, body[data-role="editor"] #releasePageBtn,
body[data-role="viewer"] #mediaReleaseWrap, body[data-role="editor"] #mediaReleaseWrap { display: none !important; }
.setup-banner { border: 1px solid var(--warn, #e0a800); background: rgba(224, 168, 0, 0.12); padding: 0.6rem 0.8rem; border-radius: 6px; margin: 0.8rem 0; }
.users-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.users-table th, .users-table td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border, #444); vertical-align: top; }
.users-table .u-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.users-table .u-off { opacity: 0.55; }
.new-password { display: block; font-size: 1.15rem; letter-spacing: 0.04em; padding: 0.5rem; background: #000; color: #fff; border-radius: 6px; user-select: all; word-break: break-all; }
.sec-page-wide { max-width: 64rem; }
.sec-page-wide .sec-box { width: auto; max-width: none; box-sizing: border-box; }
#uTableWrap { overflow-x: auto; }
