/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }

/* web/styles.css
 *
 * Styles the custom control bar (Task 2) and the flag/chain icon overlay +
 * popups (Tasks 4/5) that main.js (Task 6) drives.
 *
 * Fullscreen note: controlBar.js calls requestFullscreen() on #player-container,
 * so #overlay-container and #popup-container -- both descendants of it -- stay
 * part of the fullscreen element's subtree. Positioning them absolutely
 * inside #player-container (position: relative) keeps them anchored over the
 * video and clickable whether or not the browser is currently in fullscreen.
 */

:root {
  /* Theme tokens: dark is the default, [data-theme="light"] overrides them.
     Colours drawn over the video (control bar, timeline marks, flag icon)
     stay the same in both themes. */
  color-scheme: dark;
  --nobs-bg: #0b0b0f;
  --nobs-surface: #16161c;
  --nobs-text: #f2f2f5;
  --nobs-muted: #9a9aa5;
  --nobs-neutral: #6b6b76; /* neutral UI chrome */
  --nobs-border: #2f2f3a;
  --nobs-border-strong: #3a3a46;
  --nobs-border-faint: #55555f;
  --nobs-hover: #1f1f27;
  --nobs-current: #23232d;
  --nobs-pressed: #2a2a33;
  --nobs-raised: #22222b;
  --nobs-raised-hover: #2e2e39;
  --nobs-input-bg: #0f0f14;
  --nobs-note-bg: #2a2a31;
  --nobs-note-border: #44444e;
  --nobs-chip-dash: #6d6d7a;
  --nobs-link: #8ab4ff;
  --nobs-line-faint: rgba(255, 255, 255, 0.04);
  --nobs-toggle-border: rgba(255, 255, 255, 0.15);
  --nobs-toggle-border-hover: rgba(255, 255, 255, 0.35);
  --nobs-toggle-on: rgba(255, 255, 255, 0.08);
  --nobs-now-line: rgba(255, 255, 255, 0.85);
  --nobs-shadow: rgba(0, 0, 0, 0.5);
  --nobs-on-flag: #0b0b0f; /* text on a coloured flag chip */
  --nobs-banner-bg: #2a2410;
  --nobs-banner-text: #f1dfa0;
  --nobs-white: #f4f4f6; /* white flag: no fact-check available */
  --nobs-white-edge: transparent; /* outline that keeps a white dot visible */
  --nobs-green: #2ecc71;
  --nobs-yellow: #f1c40f;
  --nobs-red: #e74c3c;
  --nobs-pending: #8b8e98; /* found, being checked: no verdict yet (same in both themes) */
  --nobs-accent: #b48cff; /* scoop stops of a commentator (not a flag colour) */
  --nobs-parody-bg: #ff3d7f; /* the «пародия» badge */
  --nobs-parody-text: #ffffff;
  --nobs-overlay-z: 2147483000; /* stays above the fullscreen element's own chrome */
}

:root[data-theme="light"] {
  color-scheme: light;
  --nobs-bg: #f4f4f7;
  --nobs-surface: #ffffff;
  --nobs-text: #17171c;
  --nobs-muted: #5c5c68;
  --nobs-neutral: #8a8a95;
  --nobs-border: #dcdce3;
  --nobs-border-strong: #c6c6cf;
  --nobs-border-faint: #b4b4bf;
  --nobs-hover: #eeeef3;
  --nobs-current: #e6eefc;
  --nobs-pressed: #e3e3ea;
  --nobs-raised: #ffffff;
  --nobs-raised-hover: #f0f0f5;
  --nobs-input-bg: #ffffff;
  --nobs-note-bg: #f0f0f4;
  --nobs-note-border: #d0d0d8;
  --nobs-chip-dash: #9a9aa6;
  --nobs-link: #1a5fd0;
  --nobs-line-faint: rgba(0, 0, 0, 0.06);
  --nobs-toggle-border: rgba(0, 0, 0, 0.18);
  --nobs-toggle-border-hover: rgba(0, 0, 0, 0.4);
  --nobs-toggle-on: rgba(0, 0, 0, 0.06);
  --nobs-now-line: rgba(23, 23, 28, 0.8);
  --nobs-shadow: rgba(20, 20, 40, 0.18);
  --nobs-banner-bg: #fff4cc;
  --nobs-banner-text: #5a4600;
  --nobs-white: #ffffff;
  --nobs-white-edge: #8f8f9b;
  --nobs-green: #22a85a;
  --nobs-yellow: #e0b000;
  --nobs-red: #d63c2e;
  --nobs-accent: #7a4fe0;
  --nobs-parody-bg: #d81b60;
  --nobs-parody-text: #ffffff;
}

/* Over the video (control bar, flag/processing overlay) the controls keep
   the dark palette in both themes. */
:root[data-theme="light"] .nobs-control-bar,
:root[data-theme="light"] .nobs-overlay {
  --nobs-surface: #16161c;
  --nobs-text: #f2f2f5;
  --nobs-muted: #9a9aa5;
  --nobs-neutral: #6b6b76;
  --nobs-white: #f4f4f6;
  --nobs-white-edge: transparent;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--nobs-bg);
  color: var(--nobs-text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

#player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

#player,
#player iframe {
  width: 100%;
  height: 100%;
}

/* Custom control bar (buildControlBar, Task 2) */
.nobs-control-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  z-index: 10;
}

.nobs-play-pause,
.nobs-mute,
.nobs-voice-toggle,
.nobs-fullscreen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--nobs-text);
  cursor: pointer;
  padding: 0;
}

.nobs-play-pause:hover,
.nobs-mute:hover,
.nobs-voice-toggle:hover,
.nobs-fullscreen:hover,
.nobs-play-pause:focus-visible,
.nobs-mute:focus-visible,
.nobs-voice-toggle:focus-visible,
.nobs-fullscreen:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

/* Flag narrator toggle (src/voice.js): dimmed when off, lit when on. */
.nobs-voice-toggle[hidden] {
  display: none;
}
.nobs-voice-toggle[aria-pressed="false"] {
  opacity: 0.55;
}
.nobs-voice-toggle[aria-disabled="true"] {
  opacity: 0.3;
  cursor: not-allowed;
}
.nobs-voice-toggle[aria-pressed="true"] {
  color: var(--nobs-yellow);
  background: rgba(255, 255, 255, 0.12);
}

/* The narrator's "pause" sign over the video (src/holdIcon.js): two bars in
   the colour of the flag being read, a "pressed" bounce in and out. */
.nobs-voice-hold {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.78;
  --nobs-hold-color: var(--nobs-white);
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.75)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}
.nobs-voice-hold[hidden] {
  display: none;
}
/* A soft dark disc behind the bars: keeps them readable on bright video and
   covers the YouTube player's own paused-state button underneath. */
.nobs-voice-hold::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 136px;
  height: 136px;
  margin: -68px 0 0 -68px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.6) 0 55%, rgba(0, 0, 0, 0) 72%);
  z-index: -1;
}
.nobs-voice-hold > span {
  width: 26px;
  height: 84px;
  border-radius: 6px;
  background: var(--nobs-hold-color);
  transition: background-color 180ms ease;
}
.nobs-voice-hold[data-flag="red"] { --nobs-hold-color: var(--nobs-red); }
.nobs-voice-hold[data-flag="yellow"] { --nobs-hold-color: var(--nobs-yellow); }
.nobs-voice-hold[data-flag="green"] { --nobs-hold-color: var(--nobs-green); }
.nobs-voice-hold[data-flag="white"] { --nobs-hold-color: var(--nobs-white); }
.nobs-voice-hold[data-flag="scoop"] { --nobs-hold-color: var(--nobs-accent); }
/* «📱 Яблогер · пародия» under the pause sign while a parody persona speaks. */
.nobs-voice-hold-caption {
  position: absolute;
  left: 50%;
  top: calc(50% + 74px);
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 10px;
  max-width: calc(100% - 32px);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 5;
}
.nobs-voice-hold-caption[hidden] {
  display: none;
}

/* The commentator menu, rising above the narrator button (commentatorMenu.js). */
.nobs-commentator-menu {
  position: absolute;
  right: 56px;
  bottom: 56px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-width: calc(100% - 16px);
  padding: 4px;
  border: 1px solid #2f2f3a;
  border-radius: 10px;
  background: #16161c;
  color: #f2f2f5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 14px;
}
.nobs-commentator-menu[hidden] {
  display: none;
}
.nobs-commentator-menu-title {
  margin: 4px 10px 6px;
  color: #9a9aa5;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nobs-commentator-item {
  display: grid;
  grid-template-columns: 16px 22px 1fr auto;
  align-items: center;
  column-gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid var(--nobs-persona-color, transparent);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.nobs-commentator-item:hover,
.nobs-commentator-item:focus-visible {
  background: #2a2a33;
  outline: none;
}
.nobs-commentator-item[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.nobs-commentator-note {
  grid-column: 3 / -1;
  color: #9a9aa5;
  font-size: 12px;
}
.nobs-commentator-check {
  color: var(--nobs-yellow);
}
.nobs-parody-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--nobs-parody-bg);
  color: var(--nobs-parody-text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  text-transform: lowercase;
}
.nobs-commentator-sep {
  height: 1px;
  margin: 4px 6px;
  background: #2f2f3a;
}
.nobs-commentator-manage {
  padding: 8px 10px;
  border-radius: 6px;
  color: #8ab4ff;
  text-decoration: none;
}
.nobs-commentator-manage:hover,
.nobs-commentator-manage:focus-visible {
  background: #2a2a33;
  outline: none;
}
.nobs-voice-hold.is-in {
  animation: nobs-hold-in 250ms ease-out both;
}
.nobs-voice-hold.is-out {
  animation: nobs-hold-out 250ms ease-in both;
}
@keyframes nobs-hold-in {
  0% { opacity: 0; transform: scale(1.25); }
  60% { opacity: 0.78; transform: scale(0.9); }
  100% { opacity: 0.78; transform: scale(1); }
}
@keyframes nobs-hold-out {
  0% { opacity: 0.78; transform: scale(1); }
  40% { opacity: 0.78; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.1); }
}
@keyframes nobs-hold-fade-in {
  from { opacity: 0; }
  to { opacity: 0.78; }
}
@keyframes nobs-hold-fade-out {
  from { opacity: 0.78; }
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nobs-voice-hold.is-in { animation: nobs-hold-fade-in 120ms linear both; }
  .nobs-voice-hold.is-out { animation: nobs-hold-fade-out 120ms linear both; }
  .nobs-voice-hold > span { transition: none; }
}

.nobs-seek-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.nobs-seek-bar {
  flex: 1;
  width: 100%;
}

/* Flag markers sit on the seek track; the gaps between them still reach
   the range input underneath (the layer itself ignores the pointer). */
.nobs-seek-markers {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0;
  pointer-events: none;
}

.nobs-seek-marker {
  position: absolute;
  top: -5px;
  height: 10px;
  min-width: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--nobs-white);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  pointer-events: auto;
}

.nobs-seek-marker[data-flag="green"] { background: var(--nobs-green); }
.nobs-seek-marker[data-flag="yellow"] { background: var(--nobs-yellow); }
.nobs-seek-marker[data-flag="red"] { background: var(--nobs-red); }
.nobs-seek-marker[data-flag="white"] { background: #b9b9c2; opacity: 0.75; }

.nobs-seek-marker:hover {
  top: -7px;
  height: 14px;
  z-index: 1;
}

/* Playback time next to the timeline. */
.nobs-time {
  flex: none;
  min-width: 84px;
  color: var(--nobs-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

/* Volume: an icon with a vertical slider that opens above it. */
.nobs-volume-wrap {
  position: relative;
  flex: none;
}
.nobs-volume-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 8px;
  background: rgba(20, 20, 26, 0.95);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.nobs-volume-pop[hidden] {
  display: none;
}
.nobs-volume {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 24px;
  height: 100px;
  margin: 0;
}
/* While the volume slider is open, the bar sits above the flag overlay. */
.nobs-control-bar:has(.nobs-volume-pop:not([hidden])) {
  z-index: calc(var(--nobs-overlay-z) + 1);
}

/* Flag/chain icon overlay (computeOverlayState, Task 4; wired in main.js) */
.nobs-overlay {
  position: absolute;
  right: 16px;
  bottom: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: var(--nobs-overlay-z);
  pointer-events: none;
}

.nobs-processing,
.nobs-failed {
  display: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--nobs-surface);
  color: var(--nobs-muted);
  font-size: 13px;
  pointer-events: auto;
}

.nobs-overlay[data-mode="processing"] .nobs-processing {
  display: inline-block;
}

.nobs-overlay[data-mode="failed"] .nobs-failed {
  display: inline-block;
  /* Long enough to hold the stored failure reason without covering the video. */
  max-width: min(60vw, 480px);
  border-radius: 12px;
}

.nobs-overlay[data-mode="processing"] .nobs-icon,
.nobs-overlay[data-mode="failed"] .nobs-icon {
  display: none;
}

.nobs-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--nobs-surface);
  background: var(--nobs-neutral);
  color: #111;
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
}

/* The flag icon's color reflects ONLY the active claim's own flag. A
 * relation (chain icon) never changes it. With no active claim
 * ([data-flag=""]) the flag icon is hidden -- never a leftover color from a
 * previously active claim -- so it can't be confused with the explicit
 * "white" flag (no fact-check available), which renders white. */
.nobs-overlay[data-flag=""] .nobs-flag-icon {
  display: none;
}

.nobs-overlay[data-flag="white"] .nobs-flag-icon {
  background: var(--nobs-white);
  border-color: var(--nobs-neutral);
}

.nobs-overlay[data-flag="green"] .nobs-flag-icon {
  background: var(--nobs-green);
}

.nobs-overlay[data-flag="yellow"] .nobs-flag-icon {
  background: var(--nobs-yellow);
}

.nobs-overlay[data-flag="red"] .nobs-flag-icon {
  background: var(--nobs-red);
}

.nobs-chain-icon {
  background: var(--nobs-surface);
  border-color: var(--nobs-muted);
  color: var(--nobs-text);
}

/* Popups (renderClaimPopup/renderRelationPopup, Task 5) */
.nobs-popup-container {
  position: absolute;
  inset: 0;
  z-index: calc(var(--nobs-overlay-z) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nobs-popup-container:empty {
  display: none;
}

.popup {
  pointer-events: auto;
  max-width: 420px;
  width: calc(100% - 48px);
  max-height: calc(100% - 24px); /* the popup lives inside the 16:9 player box */
  overflow-y: auto;
  background: var(--nobs-surface);
  color: var(--nobs-text);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 40px var(--nobs-shadow);
}

.popup[data-flag="green"] {
  border-left: 6px solid var(--nobs-green);
}

.popup[data-flag="yellow"] {
  border-left: 6px solid var(--nobs-yellow);
}

.popup[data-flag="red"] {
  border-left: 6px solid var(--nobs-red);
}

.popup[data-flag="white"] {
  border-left: 6px solid var(--nobs-white);
}

.claim-verdict {
  margin-top: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.popup[data-flag="green"] .claim-verdict { color: var(--nobs-green); }
.popup[data-flag="yellow"] .claim-verdict { color: var(--nobs-yellow); }
.popup[data-flag="red"] .claim-verdict { color: var(--nobs-red); }
.popup[data-flag="white"] .claim-verdict { color: var(--nobs-white); }

.relation-item > span {
  display: block;
}

.relation-type {
  font-weight: 600;
}

.relation-other {
  color: var(--nobs-muted);
  font-style: italic;
}

.relation-other-time {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.claim-sources,
.relation-list {
  padding-left: 18px;
}

.popup [data-action="close"] {
  margin-top: 12px;
  background: var(--nobs-neutral);
  color: var(--nobs-text);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}

/* Processing log panel (startProcessingLog, src/processingLog.js) */
#processing-log {
  margin-top: 12px;
}

.nobs-log {
  background: var(--nobs-surface);
  border-radius: 10px;
  border-left: 4px solid var(--nobs-neutral);
}

.nobs-log[data-state="running"],
.nobs-log[data-state="pending"] {
  border-left-color: var(--nobs-yellow);
}

.nobs-log[data-state="complete"] {
  border-left-color: var(--nobs-green);
}

.nobs-log[data-state="failed"] {
  border-left-color: var(--nobs-red);
}

.nobs-log-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.nobs-log-summary::-webkit-details-marker {
  display: none;
}

/* display:flex drops the native disclosure triangle; draw our own. */
.nobs-log-summary::before {
  content: "\25B8";
  color: var(--nobs-muted);
  transition: transform 0.15s;
}

.nobs-log[open] > .nobs-log-summary::before {
  transform: rotate(90deg);
}

.nobs-log-title {
  font-weight: 600;
  font-size: 14px;
}

.nobs-log-status {
  color: var(--nobs-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.nobs-log[data-state="failed"] .nobs-log-status {
  color: var(--nobs-red);
}

.nobs-log-list {
  margin: 0;
  padding: 0 14px 12px;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.5;
}

.nobs-log-row {
  display: grid;
  grid-template-columns: auto 72px 1fr;
  gap: 10px;
  padding: 2px 0;
  border-top: 1px solid var(--nobs-line-faint);
}

.nobs-log-time {
  color: var(--nobs-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.nobs-log-stage {
  color: var(--nobs-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding-top: 1px;
}

.nobs-log-message {
  overflow-wrap: anywhere;
}

.nobs-log-row[data-level="warn"] .nobs-log-message,
.nobs-log-row[data-level="warn"] .nobs-log-stage {
  color: var(--nobs-yellow);
}

.nobs-log-row[data-level="error"] .nobs-log-message,
.nobs-log-row[data-level="error"] .nobs-log-stage {
  color: var(--nobs-red);
  font-weight: 600;
}

@media (max-width: 560px) {
  .nobs-log-row {
    grid-template-columns: auto 1fr;
  }
  .nobs-log-message {
    grid-column: 1 / -1;
  }
}

/* ---- Home / submit page ---- */
.nobs-home {
  max-width: 640px;
  padding-top: 12vh;
}

.nobs-home h1 {
  margin: 0 0 4px;
  font-size: 40px;
  letter-spacing: 0.04em;
}

.nobs-tagline {
  margin: 0 0 24px;
  color: var(--nobs-muted);
}

#submit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nobs-upload {
  flex-basis: 100%;
  color: var(--nobs-muted);
  font-size: 14px;
}

.nobs-upload summary {
  cursor: pointer;
}

.nobs-upload label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 8px 12px 4px 0;
}

.nobs-upload input[type="text"] {
  padding: 4px 6px;
  border: 1px solid var(--nobs-border);
  border-radius: 6px;
  background: var(--nobs-surface);
  color: var(--nobs-text);
  font: inherit;
}

.nobs-upload small {
  display: block;
}

#url-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: var(--nobs-surface);
  color: var(--nobs-text);
  font: inherit;
}

#url-input:focus {
  outline: 2px solid var(--nobs-green);
  outline-offset: 1px;
}

#submit-form button,
#results button {
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--nobs-green);
  color: var(--nobs-on-flag);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#results button.nobs-secondary {
  margin-top: 12px;
  background: var(--nobs-surface);
  color: var(--nobs-text);
  border: 1px solid var(--nobs-border);
}

#results {
  margin-top: 20px;
}

.existing-run {
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--nobs-surface);
}

.existing-run a {
  color: var(--nobs-text);
  text-decoration: none;
}

.existing-run a:hover {
  text-decoration: underline;
}

#results .error {
  color: var(--nobs-red);
}

@media (max-width: 480px) {
  #submit-form {
    flex-direction: column;
  }
}

/* ---- Player page: library sidebar on the left ---- */
.nobs-layout {
  --nobs-left: 300px;
  --nobs-right: 440px;
  display: grid;
  grid-template-columns: var(--nobs-left) minmax(0, 1fr) var(--nobs-right);
  gap: 16px;
  /* Full page width: the sidebar hugs the left edge, the player takes the rest. */
  max-width: 2400px;
  margin: 0;
  padding-right: 16px;
  align-items: start;
}

/* On a wide page the video is capped so it and its controls fit the screen
   height; the claim list below still uses the full width. */
.nobs-layout #player-container:not(:fullscreen) {
  max-width: calc((100vh - 32px) * 16 / 9);
  margin: 0 auto;
}

.nobs-layout > main {
  max-width: none;
  margin: 0;
  min-width: 0;
}

.nobs-library {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 16px 0 16px 16px;
}

.nobs-library-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nobs-muted);
}

.nobs-library-new {
  color: var(--nobs-green);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}

.nobs-library-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nobs-library-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--nobs-text);
  text-decoration: none;
}

.nobs-library-item:hover {
  background: var(--nobs-surface);
}

.nobs-library-item[aria-current="page"] {
  background: var(--nobs-surface);
  border-color: var(--nobs-border);
  box-shadow: inset 3px 0 0 var(--nobs-green);
}

.nobs-library-thumb {
  flex: none;
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
}

.nobs-library-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nobs-library-title {
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nobs-library-meta {
  font-size: 11px;
  color: var(--nobs-muted);
}

.nobs-library-flags {
  display: flex;
  gap: 4px;
}

.nobs-library-flag {
  min-width: 20px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  color: var(--nobs-on-flag);
}

.nobs-library-flag-green { background: var(--nobs-green); }
.nobs-library-flag-yellow { background: var(--nobs-yellow); }
.nobs-library-flag-red { background: var(--nobs-red); color: #fff; }
.nobs-library-flag-white { background: var(--nobs-white); }

.nobs-library-empty {
  color: var(--nobs-muted);
  font-size: 13px;
}

/* Collapsed library (the default): a narrow rail with only the toggle. */
.nobs-layout:has(> .nobs-library[data-collapsed="true"]) {
  --nobs-left: 40px;
}
.nobs-layout:has(> .nobs-claims-panel[data-collapsed="true"]) {
  --nobs-right: 40px;
}

/* Claim list panel on the right: sticky, scrolls on its own. */
.nobs-claims-panel {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 0 0 16px;
  box-sizing: border-box;
}
/* The panel's button bar (download, list toggle) stays pinned at the top;
   the list header pins right under it. */
.nobs-claims-panel-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  padding: 16px 0 8px;
  background: var(--nobs-bg);
}
.nobs-claims-panel-bar {
  gap: 8px;
}
.nobs-claims-panel-bar .nobs-side-toggle {
  margin-right: 0;
}
/* Download menu: shown only while the panel is open. */
.nobs-export {
  position: relative;
}
.nobs-claims-panel[data-collapsed="true"] .nobs-export {
  display: none;
}
.nobs-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 4px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: var(--nobs-surface);
  box-shadow: 0 6px 20px var(--nobs-shadow);
}
.nobs-export-menu[hidden] {
  display: none;
}
.nobs-export-menu button {
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--nobs-text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.nobs-export-menu button:hover,
.nobs-export-menu button:focus-visible {
  background: var(--nobs-pressed);
}
.nobs-claims-panel[data-collapsed="true"] {
  overflow: visible;
}
.nobs-claims-panel .nobs-claims {
  margin-top: 0;
}
.nobs-claims-panel .nobs-claims-list {
  max-height: none;
}
#claim-list[hidden] {
  display: none;
}
.nobs-library[data-collapsed="true"] {
  padding: 16px 0 0 8px;
  overflow: visible;
}
.nobs-library[data-collapsed="true"] .nobs-library-label,
.nobs-library[data-collapsed="true"] .nobs-library-new {
  display: none;
}
.nobs-library-list[hidden] {
  display: none;
}
.nobs-library-heading .nobs-library-label {
  flex: 1;
}
.nobs-side-toggle {
  flex: none;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  padding: 0;
  border: 1px solid var(--nobs-toggle-border);
  border-radius: 6px;
  background: transparent;
  color: var(--nobs-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.nobs-side-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nobs-side-toggle[aria-expanded="true"] {
  color: inherit;
  background: var(--nobs-toggle-on);
}
.nobs-side-toggle:hover {
  color: inherit;
  border-color: var(--nobs-toggle-border-hover);
}

/* Narrow screens: the player first, the library below it. */
@media (max-width: 900px) {
  .nobs-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .nobs-layout,
  .nobs-layout:has(> .nobs-library[data-collapsed="true"]),
  .nobs-layout:has(> .nobs-claims-panel[data-collapsed="true"]) {
    grid-template-columns: minmax(0, 1fr);
  }
  .nobs-claims-panel {
    order: 1;
    position: static;
    max-height: none;
    padding: 0 16px;
  }
  .nobs-library {
    order: 2;
    position: static;
    max-height: none;
    padding: 0 16px 16px;
  }
}

/* ---- Processing log: time/cost/models line ---- */
.nobs-log-usage {
  margin-left: auto;
  padding-left: 12px;
  font-size: 12px;
  color: var(--nobs-muted);
  text-align: right;
}

/* ---- Claim popup: plain summary first, details on demand ---- */
.claim-summary {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.claim-details > summary {
  cursor: pointer;
  color: var(--nobs-muted);
  font-size: 13px;
  margin: 4px 0 8px;
}

.claim-details > summary:hover {
  color: var(--nobs-text);
}

/* ---- Quotes: who is quoted, the original, the assessment ---- */
.claim-quote-mark {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--nobs-muted);
}

.claim-quote-glyph {
  font-size: 16px;
  line-height: 1;
}

.claim-original-figure {
  margin: 4px 0 10px;
}

.claim-original {
  margin: 0;
  padding: 6px 10px;
  border-left: 3px solid var(--nobs-muted);
  font-style: italic;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.claim-original-source {
  margin-top: 4px;
  font-size: 12px;
  color: var(--nobs-muted);
}

.claim-original-source a {
  color: var(--nobs-link);
}

.claim-quote-assessment {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.5;
}

.claim-quote-label {
  color: var(--nobs-muted);
}

.claim-quote-context {
  font-size: 13px;
  line-height: 1.45;
}

/* ---- Claim list under the player ---- */
.nobs-claims {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--nobs-surface);
}

.nobs-claims-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.nobs-claims-title {
  margin: 0;
  font-size: 15px;
}

.nobs-claims-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nobs-claims-chip {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--nobs-border);
  background: transparent;
  color: var(--nobs-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.nobs-claims-chip[aria-pressed="true"] {
  background: var(--nobs-pressed);
  color: var(--nobs-text);
}

.nobs-claims-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
}

.nobs-claims-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--nobs-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nobs-claims-row:hover {
  background: var(--nobs-hover);
}

.nobs-claims-item[aria-current="true"] .nobs-claims-row {
  background: var(--nobs-current);
  box-shadow: inset 3px 0 0 var(--nobs-green);
}

.nobs-claims-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--nobs-white);
}

.nobs-claims-dot[data-flag="green"] { background: var(--nobs-green); }
.nobs-claims-dot[data-flag="yellow"] { background: var(--nobs-yellow); }
.nobs-claims-dot[data-flag="red"] { background: var(--nobs-red); }

/* Coloured dot at the start of a verdict filter chip. "Not supported" is a
   white dot; "not checked" a hollow ring (no verdict at all). */
.nobs-chip-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 0;
  background: var(--nobs-white);
}
.nobs-chip-dot[data-verdict="green"] { background: var(--nobs-green); }
.nobs-chip-dot[data-verdict="yellow"] { background: var(--nobs-yellow); }
.nobs-chip-dot[data-verdict="red"] { background: var(--nobs-red); }
.nobs-chip-dot[data-verdict="white"] {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--nobs-white);
}

.nobs-claims-time {
  flex: none;
  min-width: 42px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--nobs-muted);
}

.nobs-claims-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nobs-claims-text {
  font-size: 14px;
  line-height: 1.35;
}

.nobs-claims-quote {
  font-size: 12px;
  color: var(--nobs-muted);
}

.nobs-claims-summary {
  font-size: 12px;
  color: var(--nobs-muted);
  line-height: 1.35;
}

.nobs-claims-empty {
  color: var(--nobs-muted);
  font-size: 13px;
}

/* Close stays reachable while a long popup scrolls. */
.popup > button[data-action="close"] {
  position: sticky;
  bottom: -20px;
  margin-top: 8px;
}

.claim-sources a {
  color: var(--nobs-link);
}

/* ---- Presentation tags: "how it's phrased" (outlined, never flag colours) ---- */
.claim-tags {
  margin: 8px 0 6px;
}

.claim-tags-heading {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--nobs-muted);
  text-transform: none;
}

.tag-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.tag-item {
  display: contents;
}

.tag-chip {
  padding: 2px 9px;
  border: 1px dashed var(--nobs-chip-dash);
  border-radius: 999px;
  background: transparent;
  color: var(--nobs-text);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.tag-chip[aria-expanded="true"] {
  border-style: solid;
  background: var(--nobs-current);
}

.tag-chip-small {
  display: inline-block;
  padding: 0 7px;
  font-size: 11px;
  color: var(--nobs-muted);
  cursor: default;
}

.tag-more {
  margin-left: 4px;
  font-size: 11px;
  color: var(--nobs-muted);
}

.nobs-claims-tags {
  display: block;
  margin-top: 3px;
}

.tag-panel {
  flex-basis: 100%;
  margin: 2px 0 4px;
  padding: 6px 8px;
  border-left: 2px solid var(--nobs-border-strong);
  font-size: 13px;
}

.tag-literature {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--nobs-muted);
}

.tag-evidence {
  margin: 0 0 4px;
  font-style: italic;
}

.tag-explanation {
  margin: 0;
}

.tag-seek {
  padding: 0 5px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--nobs-muted);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.tag-seek:hover,
.tag-chip:hover {
  color: var(--nobs-text);
  border-color: var(--nobs-muted);
}

.tag-disclaimer {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--nobs-muted);
}

.verdict-reasons {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
}

.verdict-reason-label {
  color: var(--nobs-muted);
}

.nobs-tag-filters {
  margin-top: 6px;
  align-items: center;
}

.nobs-tag-filter-label {
  font-size: 12px;
  color: var(--nobs-muted);
}

.nobs-tag-filter {
  border-style: dashed;
}

.nobs-claims-disclaimer {
  flex-basis: 100%;
}

.nobs-tags-running {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--nobs-muted);
}

/* Timeline: tag marks outside any flag (diamonds above the track) and
   ad-insert segments (hatched band under the track). */
.nobs-seek-tagmarks {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0;
  pointer-events: none;
}

.nobs-seek-tagmark {
  position: absolute;
  top: -15px;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  padding: 0;
  border: 1px solid #c9c9d2;
  background: var(--nobs-bg);
  transform: rotate(45deg);
  cursor: pointer;
  pointer-events: auto;
}

.nobs-seek-tagmark:hover {
  background: #c9c9d2;
  z-index: 2;
}

.nobs-seek-segment {
  position: absolute;
  top: 7px;
  height: 4px;
  min-width: 4px;
  padding: 0;
  border: 0;
  background: repeating-linear-gradient(45deg, #8a8a96 0 3px, transparent 3px 6px);
  cursor: pointer;
  pointer-events: auto;
}

.nobs-seek-segment:hover {
  height: 6px;
}

/* A SponsorBlock-only segment nobody has voted for: fainter. */
.nobs-seek-segment[data-source="sponsorblock_unconfirmed"] {
  opacity: 0.45;
}

/* ---- Settings: gear in the analyses panel, modal dialog ---- */
.nobs-library-heading .nobs-settings-button {
  margin: 0 0 0 8px;
}
/* Collapsed rail: the gear sits under the library toggle. */
.nobs-library[data-collapsed="true"] .nobs-library-heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.nobs-library[data-collapsed="true"] .nobs-settings-button {
  margin: 0;
}
.nobs-settings {
  width: min(420px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--nobs-border);
  border-radius: 12px;
  background: var(--nobs-surface);
  color: var(--nobs-text);
}
.nobs-settings::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.nobs-settings h2 {
  margin: 0 0 16px;
  font-size: 17px;
}
.nobs-settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.nobs-settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nobs-settings-row input {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 6px;
  background: var(--nobs-input-bg);
  color: var(--nobs-text);
  font: inherit;
}
.nobs-settings-field[hidden] {
  display: none;
}
.nobs-settings-persona > .nobs-settings-field {
  margin-bottom: 0;
}
.nobs-settings-link {
  color: var(--nobs-link);
  font-size: 13px;
}
.nobs-settings small {
  color: var(--nobs-muted);
  font-size: 12px;
}
.nobs-settings-close {
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--nobs-pressed);
  color: var(--nobs-text);
  font: inherit;
  cursor: pointer;
}

/* ---- Static public demo (scripts/build_demo.py) ---- */
.nobs-demo-banner {
  margin: 0;
  padding: 8px 16px;
  background: var(--nobs-banner-bg);
  color: var(--nobs-banner-text);
  font-size: 13px;
  line-height: 1.4;
}
/* In the top bar: a quiet note centred between the logo and the account. */
.nobs-topbar .nobs-demo-banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(640px, calc(100% - 360px));
  padding: 0;
  background: none;
  color: var(--nobs-text-muted, var(--nobs-text));
  opacity: 0.7;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.nobs-topbar { position: relative; }
@media (max-width: 900px) {
  /* Narrow: a flex item in the free space, never over the logo or buttons. */
  .nobs-topbar .nobs-demo-banner {
    position: static;
    transform: none;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin: 0 8px;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .nobs-topbar .nobs-demo-banner ~ .nobs-account-menu,
  .nobs-topbar .nobs-demo-banner ~ .nobs-lang-switch { margin-left: 0; }
}
[data-demo="1"] .nobs-library-new {
  display: none;
}

/* "Possible" presentation tags (the automatic check was not sure): pale,
   dashed, prefixed «возможно:» -- chips, verdict reasons, list rows, tag
   filters and timeline marks. */
.tag-chip[data-tier="possible"],
.nobs-tag-filter[data-tier="possible"] {
  opacity: 0.55;
  border-style: dashed;
  border-color: var(--nobs-border-faint);
  font-style: italic;
}

.tag-chip[data-tier="possible"]:hover,
.tag-chip[data-tier="possible"][aria-expanded="true"] {
  opacity: 0.85;
}

.verdict-reason[data-tier="possible"] {
  opacity: 0.6;
  padding-left: 6px;
  border-left: 1px dashed var(--nobs-border-faint);
}

.nobs-seek-tagmark[data-tier="possible"] {
  opacity: 0.5;
  border-style: dashed;
}

/* «Личное мнение» / "Personal opinion": a neutral note, not a technique --
   a quiet grey chip (no dashed "possible" look, no prefix). */
.tag-chip[data-tier="note"] {
  border: 1px solid var(--nobs-note-border);
  background: var(--nobs-note-bg);
  color: var(--nobs-muted);
}

.nobs-seek-tagmark[data-tier="note"] {
  opacity: 0.45;
  filter: grayscale(1);
}

/* The speaker's own later qualification of a tag («Дальше — оговорка автора»). */
.tag-qualifier {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--nobs-muted);
}

.tag-qualifier-label {
  font-weight: 600;
}

.nobs-settings-check .nobs-settings-row {
  align-items: center;
  gap: 8px;
}

/* In the right panel the list's header (title, filters, disclaimer) stays
   pinned at the top while the claims scroll under it. */
.nobs-claims-panel .nobs-claims-header {
  position: sticky;
  /* Right under the pinned button bar (16 + 28 + 8 px). */
  top: 52px;
  z-index: 3;
  margin: -12px -12px 8px;
  padding: 12px 12px 8px;
  background: var(--nobs-surface);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 6px 8px -6px var(--nobs-shadow);
}

/* "Now" line between findings: a thin white line laid over the gap
   (absolutely positioned, so rows never move) with a small play icon. */
.nobs-claims-now {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 0;
  border-top: 1.5px solid var(--nobs-now-line);
  pointer-events: none;
  z-index: 1;
}
.nobs-claims-now[hidden] {
  display: none;
}
.nobs-claims-now-icon {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--nobs-text);
  color: var(--nobs-bg);
  pointer-events: auto;
}

/* "Back to top": pinned to the bottom left of the scrolling claims panel. */
.nobs-to-top {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: 8px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 50%;
  background: var(--nobs-raised);
  color: var(--nobs-text);
  box-shadow: 0 4px 12px var(--nobs-shadow);
  cursor: pointer;
}
.nobs-to-top[hidden] {
  display: none;
}
.nobs-to-top:hover {
  background: var(--nobs-raised-hover);
}

/* The checked statement is shown in quotation marks (popup, claim list):
   «…» in Russian, “…” otherwise. */
.claim-popup .claim-text,
.nobs-claims-text {
  quotes: "\201C" "\201D";
}
.claim-popup:lang(ru) .claim-text,
.nobs-claims:lang(ru) .nobs-claims-text {
  quotes: "\00AB" "\00BB";
}
.claim-popup .claim-text::before,
.nobs-claims-text::before {
  content: open-quote;
}
.claim-popup .claim-text::after,
.nobs-claims-text::after {
  content: close-quote;
}

/* White flag/verdict dots and chips keep an outline on a light page. */
.nobs-claims-dot[data-flag="white"],
.nobs-chip-dot[data-verdict="insufficient"],
.nobs-library-flag-white {
  box-shadow: inset 0 0 0 1px var(--nobs-white-edge);
}

.nobs-settings-select {
  width: fit-content;
  min-width: 180px;
  padding: 6px 8px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 6px;
  background: var(--nobs-input-bg);
  color: var(--nobs-text);
  font: inherit;
}

/* ---- Claims about a discussed video (nobs.refs): «В обсуждаемом видео» ---- */
.claim-ref {
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid var(--nobs-link);
  background: color-mix(in srgb, var(--nobs-link) 7%, transparent);
  font-size: 13px;
}

.claim-ref-heading {
  margin: 0 0 2px;
  font-weight: 600;
}

.claim-ref-kind,
.claim-ref-title,
.claim-ref-probable {
  margin: 0 0 4px;
  color: var(--nobs-muted);
}

.claim-ref-words {
  margin: 4px 0;
  padding: 4px 8px;
  border-left: 2px solid var(--nobs-muted);
  font-style: italic;
  overflow-wrap: anywhere;
}

.claim-ref-link a,
.claim-ref-run {
  color: var(--nobs-link);
}

.claim-ref-chip {
  display: inline-block;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--nobs-muted);
}

.claim-ref-chip[data-flag="green"] { border-color: #2e9e4f; }
.claim-ref-chip[data-flag="yellow"] { border-color: #e2b419; }
.claim-ref-chip[data-flag="red"] { border-color: #d64545; }

/* ---- Right panel tabs: «Утверждения» / «Скупы» (src/scoopList.js) ---- */
.nobs-panel-tabs {
  display: flex;
  order: -1;
  gap: 4px;
  margin-right: auto;
}
.nobs-panel-tabs[hidden],
.nobs-claims-panel[data-collapsed="true"] .nobs-panel-tabs {
  display: none;
}
.nobs-panel-tab {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--nobs-toggle-border);
  border-radius: 6px;
  background: transparent;
  color: var(--nobs-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.nobs-panel-tab:hover {
  border-color: var(--nobs-toggle-border-hover);
  color: var(--nobs-text);
}
.nobs-panel-tab[aria-selected="true"] {
  background: var(--nobs-toggle-on);
  color: var(--nobs-text);
  border-color: var(--nobs-toggle-border-hover);
}
.nobs-panel-tab-count {
  margin-left: 6px;
  color: var(--nobs-muted);
  font-variant-numeric: tabular-nums;
}
#claims-panel-content[hidden],
#scoop-list[hidden] {
  display: none;
}

/* Scoop accent: neutral blue-violet, deliberately not a verdict colour. */
:root {
  --nobs-scoop-accent: #8f8cff;
  --nobs-scoop-track: rgba(255, 255, 255, 0.08);
  --nobs-scoop-card: #1b1b22;
  --nobs-scoop-now: rgba(143, 140, 255, 0.55);
}
:root[data-theme="light"] {
  --nobs-scoop-accent: #4f4bd6;
  --nobs-scoop-track: rgba(0, 0, 0, 0.08);
  --nobs-scoop-card: #f7f7fb;
  --nobs-scoop-now: rgba(79, 75, 214, 0.45);
}

.nobs-scoops {
  padding: 12px;
  border-radius: 8px;
  background: var(--nobs-surface);
}
.nobs-claims-panel .nobs-scoops-header {
  position: sticky;
  top: 52px;
  z-index: 3;
  margin: -12px -12px 8px;
  padding: 12px 12px 8px;
  background: var(--nobs-surface);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 6px 8px -6px var(--nobs-shadow);
}
.nobs-scoops-header .nobs-claims-title {
  margin-bottom: 4px;
}
.nobs-scoops-intro,
.nobs-scoops-note,
.nobs-scoops-disclaimer,
.nobs-scoops-totals {
  margin: 0 0 6px;
  color: var(--nobs-muted);
  font-size: 12px;
  line-height: 1.4;
}
.nobs-scoops-state {
  padding: 8px 0;
}
.nobs-scoops-none,
.nobs-scoops-running,
.nobs-scoops-failed {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.nobs-scoops-passes {
  margin: 0;
  padding-left: 18px;
  color: var(--nobs-muted);
  font-size: 12px;
}
.nobs-scoops-action,
.nobs-scoops-link {
  padding: 5px 12px;
  border: 1px solid var(--nobs-scoop-accent);
  border-radius: 6px;
  background: transparent;
  color: var(--nobs-scoop-accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.nobs-scoops-link {
  border: 0;
  padding: 0;
  text-decoration: underline;
  font-size: 12px;
}
.nobs-scoops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nobs-scoop {
  padding: 10px 12px;
  border: 1px solid var(--nobs-border);
  border-left: 3px solid var(--nobs-scoop-accent);
  border-radius: 8px;
  background: var(--nobs-scoop-card);
}
.nobs-scoop[data-hypothesis="true"] {
  border-left-style: dashed;
}
.nobs-scoop[data-now="true"] {
  box-shadow: 0 0 0 1px var(--nobs-scoop-now);
}
.nobs-scoop-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.nobs-scoop-title {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}
.nobs-scoop-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  line-height: 1.1;
}
.nobs-scoop-total-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--nobs-scoop-accent);
  font-variant-numeric: tabular-nums;
}
.nobs-scoop-total-of {
  font-size: 11px;
  color: var(--nobs-muted);
}
.nobs-scoop-band {
  margin-top: 2px;
  font-size: 11px;
  color: var(--nobs-muted);
}
.nobs-scoop-text {
  margin: 6px 0 8px;
  font-size: 14px;
  line-height: 1.45;
}
.nobs-scoop-bars {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}
.nobs-scoop-bar {
  display: grid;
  grid-template-columns: 104px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--nobs-muted);
}
.nobs-scoop-bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--nobs-scoop-track);
  overflow: hidden;
}
.nobs-scoop-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--nobs-scoop-accent);
}
.nobs-scoop-bar-num {
  text-align: right;
  color: var(--nobs-text);
  font-variant-numeric: tabular-nums;
}
.nobs-scoop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.nobs-scoop-chip {
  padding: 1px 8px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 999px;
  font-size: 11px;
  color: var(--nobs-muted);
}
.nobs-scoop-type[data-primary="true"] {
  background: var(--nobs-pressed);
  color: var(--nobs-text);
}
.nobs-scoop-confidence {
  border-color: var(--nobs-scoop-accent);
  color: var(--nobs-scoop-accent);
  cursor: help;
}
.nobs-scoop-confidence[data-level="low"] {
  border-style: dashed;
  opacity: 0.75;
}
.nobs-scoop-confidence[data-level="high"] {
  border-width: 2px;
  padding: 0 7px;
}
.nobs-scoop-status {
  font-style: italic;
}
.nobs-scoop-anchors {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nobs-scoop-anchor {
  font-size: 12px;
  line-height: 1.4;
  color: var(--nobs-muted);
}
.nobs-scoop-anchor-seek,
.nobs-scoop-anchor-link {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 2px 4px;
  margin-left: -4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--nobs-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nobs-scoop-anchor-seek:hover,
.nobs-scoop-anchor-link:hover {
  background: var(--nobs-hover);
}
.nobs-scoop-anchor-seek[aria-current="true"] {
  background: var(--nobs-current);
}
.nobs-scoop-anchor-time {
  flex: none;
  color: var(--nobs-scoop-accent);
  font-variant-numeric: tabular-nums;
}
.nobs-scoop-anchor[data-video="source"] .nobs-scoop-anchor-link {
  color: var(--nobs-muted);
}
.nobs-scoop-anchor-source {
  margin-left: 4px;
  font-size: 11px;
  font-style: italic;
}
.nobs-scoop-anchor-run {
  font-size: 11px;
  color: var(--nobs-link);
}
.nobs-scoop-details > summary,
.nobs-scoops-fold > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--nobs-link);
}
.nobs-scoops-fold {
  margin-top: 12px;
}
.nobs-scoops-fold > summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--nobs-text);
}
.nobs-scoop-step {
  margin-top: 8px;
}
.nobs-scoop-step h4 {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nobs-scoop-accent);
}
.nobs-scoop-step p,
.nobs-scoop-step li {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
}
.nobs-scoop-step ul {
  margin: 0;
  padding-left: 16px;
}
.nobs-scoop-sublabel {
  color: var(--nobs-muted);
  font-weight: 600;
}
.nobs-scoop-verdicts {
  list-style: none;
  padding-left: 0 !important;
}
.nobs-scoop-verdicts li {
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.nobs-scoop-verdict {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.nobs-scoop-verdict {
  cursor: pointer;
}
button.nobs-scoop-verdict:hover {
  text-decoration: underline;
}
.nobs-scoop-stat-count {
  color: var(--nobs-text);
  font-variant-numeric: tabular-nums;
}
.nobs-scoops-foot {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--nobs-border);
}
.nobs-scoop-anchor[data-video="source"] {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 4px;
}
.nobs-scoop-anchor[data-video="source"] .nobs-scoop-anchor-source {
  margin-left: 46px;
}

/* Share: public single-video link, next to download (src/share.js). */
.nobs-share {
  position: relative;
}
.nobs-claims-panel[data-collapsed="true"] .nobs-share {
  display: none;
}
.nobs-share-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  width: min(360px, 80vw);
  padding: 12px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: var(--nobs-surface);
  color: var(--nobs-text);
  box-shadow: 0 6px 20px var(--nobs-shadow);
}
.nobs-share-pop[hidden] {
  display: none;
}
.nobs-share-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.nobs-share-row {
  display: flex;
  gap: 6px;
}
.nobs-share-url {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--nobs-border);
  border-radius: 6px;
  background: var(--nobs-bg, transparent);
  color: var(--nobs-text);
  font: inherit;
  font-size: 13px;
}
.nobs-share-copy {
  padding: 6px 10px;
  border: 1px solid var(--nobs-border);
  border-radius: 6px;
  background: var(--nobs-pressed);
  color: var(--nobs-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.nobs-share-note {
  display: block;
  margin-top: 8px;
  color: var(--nobs-muted, var(--nobs-text));
  font-size: 12px;
  opacity: 0.8;
}
/* `?solo=1`: a shared single-video page, no library column. */
:root[data-solo="1"] .nobs-layout {
  grid-template-columns: minmax(0, 1fr) var(--nobs-right);
}
:root[data-solo="1"] .nobs-library {
  display: none;
}

/* Flag filters on the collapsed right panel: a column of coloured circles.
   Selected = filled with the flag's colour; not selected = coloured outline
   over a muted fill. Shown only while the panel is collapsed. */
.nobs-rail-filters {
  display: none;
}
.nobs-claims-panel[data-collapsed="true"] .nobs-rail-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.nobs-rail-flag {
  --rail-c: var(--nobs-muted);
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--rail-c);
  background: color-mix(in srgb, var(--rail-c) 22%, transparent);
  opacity: 0.75;
  cursor: pointer;
  transition: background 120ms ease, opacity 120ms ease, transform 120ms ease;
}
.nobs-rail-flag:hover,
.nobs-rail-flag:focus-visible {
  opacity: 1;
  transform: scale(1.12);
}
.nobs-rail-flag[aria-pressed="true"] {
  background: var(--rail-c);
  opacity: 1;
}
.nobs-rail-flag[data-verdict="green"] { --rail-c: var(--nobs-green); }
.nobs-rail-flag[data-verdict="yellow"] { --rail-c: var(--nobs-yellow); }
.nobs-rail-flag[data-verdict="red"] { --rail-c: var(--nobs-red); }
.nobs-rail-flag[data-verdict="insufficient"] { --rail-c: var(--nobs-white); }
/* "Not checked": a dark grey circle with a light outline (selected: a
   slightly lighter grey, fully opaque). */
.nobs-rail-flag[data-verdict="white"] {
  --rail-c: var(--nobs-white);
  background: #2e3036;
}
.nobs-rail-flag[data-verdict="white"][aria-pressed="true"] {
  background: #5a5e68;
}
.nobs-rail-flag[data-verdict="insufficient"] {
  border-style: dashed;
}

/* Brand bar with the «Skeptium» logo, top left of the player page. */
.nobs-topbar {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  background: var(--nobs-bg);
  border-bottom: 1px solid var(--nobs-border);
}
.nobs-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--nobs-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.nobs-logo-ai {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--nobs-red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transform: translateY(-2px);
}
/* The brand word ends with a small footnote asterisk: «Skeptium*». */
.nobs-logo-word::after {
  content: "*";
  display: inline-block;
  margin-left: -1px;
  font-size: 0.95em;
  font-weight: 800;
  vertical-align: 0.3em;
  line-height: 0;
  text-decoration: none;
}
/* No underline on hover; keyboard focus still gets a visible ring. */
.nobs-logo:hover {
  text-decoration: none;
}
.nobs-logo:focus-visible {
  outline: 2px solid var(--nobs-muted);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Progressive delivery (spec 2026-11-17 §4.5): claims of a run still
   being analysed. Grey means only "found, being checked" -- never a verdict. */

/* Timeline markers: pending = hollow grey with a pulse; checking = grey
   with a sweeping arc; done = its flag colour (fades over 300 ms); failed =
   grey «?»; a revised verdict = a short ring pulse. */
.nobs-seek-marker {
  transition: background-color 300ms ease, opacity 300ms ease, box-shadow 300ms ease;
}
.nobs-seek-marker[data-state="pending"] {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--nobs-pending), 0 0 0 1px rgba(0, 0, 0, 0.55);
  animation: nobs-marker-pending 1.6s ease-in-out infinite;
}
.nobs-seek-marker[data-state="checking"] {
  background: linear-gradient(90deg, var(--nobs-pending) 0%, #c9cbd2 50%, var(--nobs-pending) 100%);
  background-size: 200% 100%;
  animation: nobs-marker-checking 1.2s linear infinite;
}
.nobs-seek-marker[data-state="failed"] {
  background: var(--nobs-pending);
  opacity: 0.7;
}
.nobs-seek-marker[data-state="failed"]::after {
  content: "?";
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  color: var(--nobs-pending);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.nobs-seek-marker.is-revised {
  animation: nobs-marker-revised 900ms ease-out 2;
}
@keyframes nobs-marker-pending {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes nobs-marker-checking {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}
@keyframes nobs-marker-revised {
  0% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(255, 255, 255, 0.9); }
  100% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 0 8px rgba(255, 255, 255, 0); }
}

/* Frontier bands on the seek track, under the flags: light = claims found
   so far, darker = fully checked spans, hatched = not analysed yet. */
.nobs-seek-frontier {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  pointer-events: none;
}
.nobs-seek-frontier > div {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
}
.nobs-frontier-extracted { background: rgba(255, 255, 255, 0.22); }
.nobs-frontier-verified { background: rgba(255, 255, 255, 0.5); }
.nobs-frontier-ahead {
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.14) 0 3px, transparent 3px 6px);
}

/* The flag icon over the video for a claim being checked / a failed check. */
.nobs-overlay[data-flag="pending"] .nobs-flag-icon {
  background: var(--nobs-pending);
  animation: nobs-marker-pending 1.6s ease-in-out infinite;
}
.nobs-overlay[data-flag="failed"] .nobs-flag-icon {
  background: var(--nobs-pending);
  opacity: 0.7;
}
.popup[data-state="pending"],
.popup[data-state="checking"],
.popup[data-state="failed"] {
  border-color: var(--nobs-pending);
}
.popup[data-state="pending"] .claim-verdict,
.popup[data-state="checking"] .claim-verdict,
.popup[data-state="failed"] .claim-verdict {
  color: var(--nobs-pending);
}
.claim-revised {
  margin: 2px 0 6px;
  font-size: 12px;
  color: var(--nobs-muted);
  font-style: italic;
}
/* The specialist's second opinion (shadow; never changes the flag). */
.claim-specialist {
  margin: 8px 0 4px;
  padding: 6px 8px;
  border-left: 3px solid var(--nobs-border-strong, var(--nobs-muted));
  font-size: 12px;
}
.claim-specialist[data-agrees="false"] {
  border-left-color: var(--nobs-yellow);
}
.claim-specialist summary {
  cursor: pointer;
  font-weight: 600;
}
.claim-specialist-note,
.claim-specialist-meta {
  color: var(--nobs-muted);
  margin: 4px 0;
}
.claim-specialist-disagreement {
  margin: 4px 0;
  font-style: italic;
}
.claim-specialist-sources {
  margin: 4px 0 0;
  padding-left: 16px;
}

/* Claim list: grey dot, «Проверяется» / «уточнено (было: …)» badges. */
.nobs-claims-dot[data-state="pending"],
.nobs-claims-dot[data-state="checking"] {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--nobs-pending);
  animation: nobs-marker-pending 1.6s ease-in-out infinite;
}
.nobs-claims-dot[data-state="failed"] { background: var(--nobs-pending); opacity: 0.7; }
.nobs-claims-dot { transition: background-color 300ms ease; }
.nobs-claims-item[data-state="pending"] .nobs-claims-text,
.nobs-claims-item[data-state="checking"] .nobs-claims-text {
  color: var(--nobs-muted);
}
.nobs-claims-state,
.nobs-claims-revised {
  display: inline-block;
  width: fit-content;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 16px;
  color: var(--nobs-muted);
  border: 1px solid var(--nobs-border-strong);
}
.nobs-claims-state { border-color: var(--nobs-pending); }
.nobs-claims-revised { font-style: italic; }
.nobs-chip-dot[data-verdict="pending"] {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--nobs-pending);
}
.nobs-chip-dot[data-verdict="failed"] { background: var(--nobs-pending); }
.nobs-rail-flag[data-verdict="pending"] { --rail-c: var(--nobs-pending); border-style: dotted; }
.nobs-rail-flag[data-verdict="failed"] { --rail-c: var(--nobs-pending); }

@media (prefers-reduced-motion: reduce) {
  .nobs-seek-marker[data-state="pending"],
  .nobs-seek-marker[data-state="checking"],
  .nobs-seek-marker.is-revised,
  .nobs-overlay[data-flag="pending"] .nobs-flag-icon,
  .nobs-claims-dot[data-state="pending"],
  .nobs-claims-dot[data-state="checking"] {
    animation: none;
  }
}


/* ---- Playback gate (src/playbackGate.js, progressive delivery step 5) ----
   «Готовим агента…»: a layer over the whole player (control bar included)
   while a new streaming run prepares its first chunk; inside
   #player-container, so it shows in fullscreen too. */
.nobs-gate {
  position: absolute;
  inset: 0;
  z-index: calc(var(--nobs-overlay-z) + 2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 8, 12, 0.88);
  color: #f2f2f5;
}
.nobs-gate[hidden] {
  display: none;
}
.nobs-gate-card {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nobs-gate-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.nobs-gate[data-ready="0"] .nobs-gate-title::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-radius: 50%;
  background: var(--nobs-pending);
  vertical-align: middle;
  animation: nobs-gate-pulse 1.2s ease-in-out infinite;
}
@keyframes nobs-gate-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.nobs-gate-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  color: #b9b9c3;
}
.nobs-gate-checklist li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.nobs-gate-checklist li.is-done {
  color: #f2f2f5;
}
.nobs-gate-check {
  width: 1em;
  flex: none;
  text-align: center;
  color: var(--nobs-pending);
}
.nobs-gate-checklist li.is-done .nobs-gate-check {
  color: var(--nobs-green);
}
.nobs-gate-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.nobs-gate-bar-fill {
  height: 100%;
  width: 3%;
  background: var(--nobs-pending);
  transition: width 0.5s linear;
}
.nobs-gate[data-ready="1"] .nobs-gate-bar-fill {
  background: var(--nobs-green);
}
.nobs-gate-meta {
  font-size: 0.85rem;
  color: #9a9aa5;
  font-variant-numeric: tabular-nums;
}
.nobs-gate-limit {
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--nobs-banner-bg);
  color: var(--nobs-banner-text);
}
.nobs-gate-limit[hidden] {
  display: none;
}
.nobs-gate-primary {
  align-self: flex-start;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f2f2f5;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.nobs-gate-primary:hover,
.nobs-gate-primary:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}
.nobs-gate-primary[aria-pressed="true"] {
  border-color: var(--nobs-pending);
  color: #c9cad2;
}
.nobs-gate[data-ready="1"] .nobs-gate-primary {
  background: #f2f2f5;
  color: #0b0b0f;
  border-color: #f2f2f5;
}
.nobs-gate-skip {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  color: #8ab4ff;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nobs-gate-skip[hidden] {
  display: none;
}

/* Auto-pause at the frontier: «Агент догоняет…» over the top of the video. */
.nobs-gate-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  z-index: calc(var(--nobs-overlay-z) + 1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(16, 16, 22, 0.92);
  color: #f2f2f5;
  font-size: 0.92rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
.nobs-gate-toast[hidden] {
  display: none;
}
.nobs-gate-toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nobs-pending);
  animation: nobs-gate-pulse 1.2s ease-in-out infinite;
}
.nobs-gate-toast[data-kind="throttled"]::before {
  background: var(--nobs-yellow);
}
/* A failed chunk played through: a note, nothing pending. */
.nobs-gate-toast[data-kind="failed"]::before {
  background: rgba(255, 255, 255, 0.45);
  animation: none;
}
.nobs-gate-toast-button {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: none;
  color: #f2f2f5;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.nobs-gate-toast-button:hover,
.nobs-gate-toast-button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}
@media (prefers-reduced-motion: reduce) {
  .nobs-gate-title::after,
  .nobs-gate-toast::before {
    animation: none;
  }
}

/* ---- Commentator management page (commentators.html, src/commentatorsPage.js) ---- */
.nobs-cm-page {
  margin: 0;
  padding: 0 16px 48px;
  background: var(--nobs-bg);
  color: var(--nobs-text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.nobs-cm-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0 8px;
}
.nobs-cm-header h1 {
  margin: 6px 0 8px;
  font-size: 24px;
}
.nobs-cm-back {
  color: var(--nobs-link);
  text-decoration: none;
  font-size: 14px;
}
.nobs-cm-lead {
  margin: 0;
  max-width: 70ch;
  color: var(--nobs-muted);
  line-height: 1.5;
}
#commentators {
  max-width: 1100px;
  margin: 0 auto;
}
.nobs-cm-demo {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--nobs-banner-bg);
  color: var(--nobs-banner-text);
}
.nobs-cm-status {
  min-height: 1.4em;
  margin: 8px 0;
  color: var(--nobs-muted);
  font-size: 14px;
}
.nobs-cm-status[data-kind="error"] {
  color: var(--nobs-red);
}
.nobs-cm-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 760px) {
  .nobs-cm-layout {
    grid-template-columns: 1fr;
  }
}
.nobs-cm-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.nobs-cm-list-head h2,
.nobs-cm-form h2 {
  margin: 0;
  font-size: 18px;
}
.nobs-cm-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 4px 10px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--nobs-border);
  border-left: 4px solid var(--nobs-persona-color, var(--nobs-border));
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-cm-card.is-off .nobs-cm-emoji,
.nobs-cm-card.is-off .nobs-cm-card-text {
  opacity: 0.5;
}
/* On/off switch on a commentator card (active in the system or not). */
.nobs-cm-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: start;
  min-height: 44px;
  cursor: pointer;
  color: var(--nobs-muted);
  font-size: 13px;
  user-select: none;
}
.nobs-cm-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.nobs-cm-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--nobs-border);
  transition: background 0.15s;
}
.nobs-cm-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.nobs-cm-switch input:checked + .nobs-cm-switch-track {
  background: var(--nobs-green);
}
.nobs-cm-switch input:checked + .nobs-cm-switch-track::after {
  transform: translateX(18px);
}
.nobs-cm-switch input:focus-visible + .nobs-cm-switch-track {
  outline: 2px solid var(--nobs-link);
  outline-offset: 2px;
}
.nobs-cm-switch input:disabled + .nobs-cm-switch-track {
  opacity: 0.5;
}
.nobs-cm-card[aria-current="true"] {
  outline: 2px solid var(--nobs-link);
  outline-offset: -1px;
}
.nobs-cm-emoji {
  font-size: 26px;
  line-height: 1.2;
}
.nobs-cm-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.nobs-cm-card-text code {
  color: var(--nobs-muted);
  font-size: 12px;
}
.nobs-cm-card-text small {
  color: var(--nobs-muted);
  line-height: 1.4;
}
.nobs-cm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.nobs-cm-badge {
  padding: 1px 7px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 999px;
  color: var(--nobs-muted);
  font-size: 11px;
}
.nobs-cm-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.nobs-cm-button {
  padding: 6px 12px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 6px;
  background: var(--nobs-raised);
  color: var(--nobs-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.nobs-cm-button:hover:not(:disabled) {
  background: var(--nobs-raised-hover);
}
.nobs-cm-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.nobs-cm-button.is-primary {
  border-color: var(--nobs-link);
  background: var(--nobs-link);
  color: var(--nobs-bg);
}
.nobs-cm-button.is-danger {
  color: var(--nobs-red);
}
.nobs-cm-editor {
  min-width: 0;
}
.nobs-cm-empty {
  padding: 24px;
  border: 1px dashed var(--nobs-border-strong);
  border-radius: 10px;
  color: var(--nobs-muted);
}
.nobs-cm-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nobs-cm-parody-note {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--nobs-note-bg);
  font-size: 14px;
}
.nobs-cm-parody-note[hidden] {
  display: none;
}
.nobs-cm-group {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-cm-group legend {
  padding: 0 6px;
  font-weight: 600;
}
.nobs-cm-q {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
}
.nobs-cm-q-label {
  font-size: 14px;
}
.nobs-cm-sub {
  margin: 4px 0 10px;
  font-size: 14px;
}
.nobs-cm-hint {
  color: var(--nobs-muted);
  font-size: 12px;
}
.nobs-cm-error {
  color: var(--nobs-red);
  font-size: 12px;
}
.nobs-cm-error:empty {
  display: none;
}
.nobs-cm-form input[type="text"],
.nobs-cm-form input[type="number"],
.nobs-cm-form textarea,
.nobs-cm-form select,
.nobs-cm-preview select,
.nobs-cm-preview input {
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 6px;
  background: var(--nobs-input-bg);
  color: var(--nobs-text);
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}
.nobs-cm-form textarea {
  width: 100%;
  resize: vertical;
}
.nobs-cm-form input:disabled,
.nobs-cm-form textarea:disabled,
.nobs-cm-form select:disabled {
  opacity: 0.8;
}
.nobs-cm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.nobs-cm-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}
.nobs-cm-small {
  width: 70px;
}
.nobs-cm-small-wide {
  width: 200px;
}
.nobs-cm-emoji-input {
  width: 56px;
  font-size: 20px;
  text-align: center;
}
.nobs-cm-emoji-quick {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
}
.nobs-cm-chip {
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  font-size: 18px;
  cursor: pointer;
}
.nobs-cm-chip:hover {
  border-color: var(--nobs-border-strong);
}
.nobs-cm-range {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nobs-cm-range input {
  flex: 1;
  max-width: 280px;
}
.nobs-cm-out {
  min-width: 10ch;
  color: var(--nobs-muted);
  font-size: 13px;
}
.nobs-cm-manners {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}
.nobs-cm-manner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.nobs-cm-manner:has(input:checked) {
  border-color: var(--nobs-link);
  background: var(--nobs-current);
}
.nobs-cm-opener-lang {
  margin-bottom: 8px;
}
.nobs-cm-opener-lang summary {
  cursor: pointer;
  margin-bottom: 8px;
}
.nobs-cm-rules {
  padding: 12px 14px;
  border: 1px solid var(--nobs-note-border);
  border-radius: 10px;
  background: var(--nobs-note-bg);
}
.nobs-cm-rules h3,
.nobs-cm-preview h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.nobs-cm-rules-text {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.nobs-cm-form-actions {
  display: flex;
  gap: 8px;
}
.nobs-cm-preview {
  padding: 12px 14px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-cm-preview-text {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--nobs-link);
  font-size: 15px;
}
.nobs-cm-preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  font-size: 13px;
}
.nobs-cm-guard.is-ok {
  color: var(--nobs-green);
}
.nobs-cm-guard.is-bad {
  color: var(--nobs-red);
}
.nobs-cm-spinner {
  color: var(--nobs-muted);
}

/* Compact scoop card: timecode · title · small score ring, then a few
   sentences. */
.nobs-scoop-compact {
  padding: 10px 12px;
}
.nobs-scoop-compact .nobs-scoop-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.nobs-scoop-compact .nobs-scoop-title {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}
.nobs-scoop-compact .nobs-scoop-text {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--nobs-muted);
}
.nobs-scoop-time {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--nobs-border);
  border-radius: 6px;
  background: transparent;
  color: var(--nobs-link);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.nobs-scoop-time:hover,
.nobs-scoop-time:focus-visible {
  background: var(--nobs-pressed);
}
.nobs-scoop-score {
  --score: 0;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(var(--nobs-yellow) calc(var(--score) * 1%), var(--nobs-border) 0);
}
.nobs-scoop-score-num {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--nobs-bg);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nobs-scoop-compact[data-hypothesis="true"] .nobs-scoop-score {
  opacity: 0.6;
}

/* ---- Public request page (request.html; the demo's index) and the codes page ---- */
.nobs-request {
  padding-top: 6vh;
  padding-left: 16px;
  padding-right: 16px;
  margin: 0 auto;
}
.nobs-request h2 {
  font-size: 18px;
  margin: 0 0 10px;
}
.nobs-request-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nobs-request-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--nobs-muted);
  font-size: 14px;
}
.nobs-request-field input,
.nobs-codes input,
.nobs-codes textarea {
  padding: 12px 14px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: var(--nobs-surface);
  color: var(--nobs-text);
  font: inherit;
  font-size: 16px;
  min-width: 0;
}
.nobs-request-field input:focus,
.nobs-codes input:focus {
  outline: 2px solid var(--nobs-green);
  outline-offset: 1px;
}
.nobs-request-form button,
.nobs-request-waiting button,
.nobs-codes button {
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--nobs-green);
  color: var(--nobs-on-flag);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.nobs-request-form button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.nobs-request-waiting button.nobs-secondary,
.nobs-codes button.nobs-secondary {
  background: var(--nobs-surface);
  color: var(--nobs-text);
  border: 1px solid var(--nobs-border);
  margin-right: 8px;
}
.nobs-request-error {
  color: var(--nobs-red);
  margin: 14px 0 0;
}
.nobs-request-waiting {
  margin-top: 8px;
  padding: 18px;
  border-radius: 10px;
  background: var(--nobs-surface);
  border: 1px solid var(--nobs-border);
}
.nobs-request-video {
  color: var(--nobs-muted);
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.nobs-request-status {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
}
.nobs-request-elapsed,
.nobs-request-hint {
  color: var(--nobs-muted);
  font-size: 14px;
  margin: 0 0 12px;
}
.nobs-request-recent-wrap {
  margin-top: 36px;
}
.nobs-request-library {
  font-size: 14px;
  font-weight: 400;
  margin-left: 8px;
  color: var(--nobs-link);
  text-decoration: none;
}
.nobs-request-recent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.nobs-request-recent-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--nobs-text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.3;
}
.nobs-request-recent-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: var(--nobs-surface);
}
.nobs-request-recent-item:hover span {
  text-decoration: underline;
}

/* ---- Accounts (account.html, watch.html; src/accountPage.js, src/watchPage.js) ---- */
.nobs-account {
  padding-bottom: 48px;
}
.nobs-account h1 {
  font-size: 32px;
  margin-bottom: 16px;
}
.nobs-account-card {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 10px;
  background: var(--nobs-surface);
  border: 1px solid var(--nobs-border);
  min-width: 0;
}
.nobs-account-card .nobs-tagline {
  margin-bottom: 14px;
}
.nobs-account-card .nobs-effort {
  margin: 0;
}
.nobs-account button,
.nobs-account .nobs-account-open {
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--nobs-green);
  color: var(--nobs-on-flag);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.nobs-account button.nobs-secondary {
  background: var(--nobs-surface);
  color: var(--nobs-text);
  border: 1px solid var(--nobs-border);
  font-weight: 400;
}
.nobs-account button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.nobs-account-google {
  margin-top: 14px;
}
.nobs-account-who {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--nobs-muted);
  overflow-wrap: anywhere;
  min-width: 0;
}
.nobs-account-balance {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}
.nobs-account-note,
.nobs-account-sent {
  display: block;
  color: var(--nobs-muted);
  font-size: 14px;
  line-height: 1.4;
  margin: 6px 0 0;
}
.nobs-account-sent {
  color: var(--nobs-text);
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
.nobs-account-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.nobs-account-inline input,
.nobs-account-visibility-select {
  flex: 1 1 180px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: var(--nobs-input-bg);
  color: var(--nobs-text);
  font: inherit;
  font-size: 16px;
}
.nobs-account-visibility-select {
  flex: 0 1 auto;
  padding: 8px 10px;
  font-size: 14px;
}
.nobs-account-result,
.nobs-account-message {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}
.nobs-account-result[data-ok="0"] {
  color: var(--nobs-red);
}
.nobs-account-offline {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--nobs-banner-bg);
  color: var(--nobs-banner-text);
}
.nobs-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.nobs-account-videos {
  display: grid;
  gap: 12px;
}
.nobs-account-video {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}
.nobs-account-video img {
  flex: 0 0 120px;
  width: 120px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--nobs-bg);
}
.nobs-account-video-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.nobs-account-video-title {
  overflow-wrap: anywhere;
}
.nobs-account-video-status {
  color: var(--nobs-muted);
  font-size: 14px;
}
.nobs-account-video .nobs-account-actions button,
.nobs-account-video .nobs-account-open {
  padding: 6px 12px;
  font-size: 14px;
}
@media (max-width: 480px) {
  .nobs-account-video {
    flex-direction: column;
  }
  .nobs-account-video img {
    width: 100%;
    flex-basis: auto;
  }
  .nobs-account button,
  .nobs-account .nobs-account-open {
    min-height: 44px;
  }
  /* iOS Safari zooms into any form field under 16px on focus */
  .nobs-account-visibility-select {
    font-size: 16px;
  }
}
.nobs-library-request {
  color: var(--nobs-green);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}
.nobs-library[data-collapsed="true"] .nobs-library-request {
  display: none;
}

.nobs-codes {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}
.nobs-codes h1 {
  margin: 0 0 6px;
}
.nobs-codes section {
  margin-top: 24px;
}
.nobs-codes-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--nobs-muted);
}
.nobs-codes-totals b {
  color: var(--nobs-text);
  font-size: 20px;
  display: block;
}
.nobs-codes-create {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.nobs-codes-create label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--nobs-muted);
}
.nobs-codes-new {
  padding: 14px;
  border: 1px solid var(--nobs-green);
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-codes-new textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  font-size: 14px;
}
.nobs-codes-templates label,
.nobs-codes-template-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--nobs-muted);
}
.nobs-codes-templates input,
.nobs-codes-templates textarea,
.nobs-codes-templates select,
.nobs-codes-template-pick select {
  width: 100%;
  max-width: 640px;
  box-sizing: border-box;
}
.nobs-codes-templates textarea {
  max-width: none;
  min-height: 200px;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}
.nobs-codes select {
  padding: 10px 12px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: var(--nobs-surface);
  color: var(--nobs-text);
  font: inherit;
  font-size: 15px;
}
.nobs-codes-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nobs-codes-template-actions button.nobs-secondary {
  margin-right: 0;
}
.nobs-codes-template-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-surface);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}
.nobs-codes-new code {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.nobs-codes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.nobs-codes-table th,
.nobs-codes-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--nobs-border);
  vertical-align: top;
}
.nobs-codes-table button {
  padding: 4px 10px;
  font-size: 13px;
  margin: 0 4px 4px 0;
}
.nobs-codes-table a {
  color: var(--nobs-link);
}
.nobs-codes-uses {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--nobs-muted);
}
.nobs-codes-status-revoked,
.nobs-codes-status-used_up {
  color: var(--nobs-muted);
}
.nobs-codes-error {
  color: var(--nobs-red);
}
@media (max-width: 640px) {
  .nobs-codes-table thead {
    display: none;
  }
  .nobs-codes-table tr {
    display: block;
    border-bottom: 1px solid var(--nobs-border);
    padding: 8px 0;
  }
  .nobs-codes-table td {
    display: block;
    border: 0;
    padding: 2px 0;
  }
}

/* ==== Phones and tablets (src/mobile.js; emulation checks in
   data/deep-backup/mobile/check.mjs) ====
   Touch: 44 px targets, no double-tap zoom on the controls, bigger hit
   areas for the timeline markers and the flag circles. Phone layout: the
   video full width on top, the processing log, the claims panel as a
   full-width section (collapsed: the flag circles in a row with the toggle),
   the library behind a button in the top bar (a full-screen drawer when
   open), popups and the commentator menu as bottom sheets. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.nobs-control-bar button,
.nobs-seek-bar,
.nobs-icon,
.nobs-rail-flag,
.nobs-side-toggle,
.nobs-claims-chip,
.nobs-panel-tab,
.nobs-commentator-item,
.popup button {
  touch-action: manipulation;
}
/* A long press on the narrator button opens the commentator menu: no text
   selection or iOS callout on it. */
.nobs-voice-toggle {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* iPhone (no Fullscreen API for a div): the container fills the window. */
#player-container.nobs-pseudo-fs {
  position: fixed;
  inset: 0;
  z-index: calc(var(--nobs-overlay-z) - 10);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
  background: #000;
}
html.nobs-pseudo-fs-open,
html.nobs-pseudo-fs-open body {
  overflow: hidden;
}

@media (pointer: coarse) {
  .nobs-play-pause,
  .nobs-mute,
  .nobs-voice-toggle,
  .nobs-fullscreen {
    width: 44px;
    height: 44px;
  }
  .nobs-seek-bar {
    height: 32px;
    margin: 0;
  }
  /* A finger is wider than a 4 px marker: the hit area reaches 14 px above
     and below it (and 3 px to the sides). */
  .nobs-seek-marker::before,
  .nobs-seek-tagmark::before {
    content: "";
    position: absolute;
    left: -3px;
    right: -3px;
    top: -14px;
    bottom: -14px;
  }
  .nobs-icon {
    width: 44px;
    height: 44px;
  }
  .nobs-side-toggle {
    width: 44px;
    height: 44px;
  }
  .nobs-claims-chip {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
  }
  .nobs-panel-tab {
    height: 44px;
  }
  .nobs-commentator-item {
    min-height: 44px;
  }
  .nobs-export-menu button {
    min-height: 44px;
  }
  .popup [data-action="close"] {
    min-height: 44px;
    padding: 10px 20px;
  }
  .nobs-request-form button,
  .nobs-request-waiting button {
    min-height: 48px;
  }
  /* Flag circles: 30 px, the count inside (no hover title on a phone), a
     44 px hit area. */
  .nobs-rail-flag {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--nobs-text);
    font: 700 11px/1 system-ui, -apple-system, sans-serif;
  }
  .nobs-rail-flag::before {
    content: "";
    position: absolute;
    inset: -9px;
  }
  .nobs-rail-flag::after {
    content: attr(data-count);
  }
  .nobs-rail-flag:hover,
  .nobs-rail-flag:focus-visible {
    transform: none;
  }
}

/* ---- Phone layout: portrait up to 760 px, or a phone held sideways ---- */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .nobs-topbar {
    position: relative;
    height: 48px;
    padding: 0 12px;
  }
  .nobs-layout,
  .nobs-layout:has(> .nobs-library[data-collapsed="true"]),
  .nobs-layout:has(> .nobs-claims-panel[data-collapsed="true"]) {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
  }
  /* main's children (the player, the log) become items of the column. */
  .nobs-layout > main {
    display: contents;
  }
  .nobs-layout #player-container:not(:fullscreen):not(.nobs-pseudo-fs) {
    order: 0;
    width: 100%;
    max-width: calc((100vh - 48px) * 16 / 9);
    max-width: calc((100svh - 48px) * 16 / 9);
    margin: 0 auto;
  }
  #processing-log {
    order: 1;
    margin: 8px 12px 0;
  }
  .nobs-claims-panel,
  .nobs-claims-panel[data-collapsed="true"] {
    order: 2;
    position: static;
    max-height: none;
    padding: 0 12px 16px;
    overflow: visible;
  }
  .nobs-claims-panel-bar {
    padding: 8px 0;
    flex-wrap: wrap;
  }
  /* Collapsed: the flag circles in a row, the list toggle at the right. */
  .nobs-claims-panel[data-collapsed="true"] {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .nobs-claims-panel[data-collapsed="true"] .nobs-claims-panel-bar {
    order: 1;
    margin-left: auto;
    background: transparent;
  }
  .nobs-claims-panel[data-collapsed="true"] .nobs-rail-filters {
    order: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 18px;
    padding: 8px 8px;
  }
  /* The library: its button (and the gear) in the top bar; open, a
     full-screen drawer over the page. */
  .nobs-library,
  .nobs-library[data-collapsed="true"] {
    order: 3;
    position: absolute;
    top: 2px;
    right: 8px;
    max-height: none;
    padding: 0;
    overflow: visible;
    z-index: 50;
  }
  .nobs-library[data-collapsed="true"] .nobs-library-heading {
    flex-direction: row;
    align-items: center;
    margin: 0;
  }
  .nobs-library[data-collapsed="false"] {
    position: fixed;
    inset: 0;
    z-index: calc(var(--nobs-overlay-z) + 4);
    padding: 12px 16px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--nobs-bg);
  }
  /* Popups: a bottom sheet over a dimmed page; a tap on the dim closes it
     (src/popup.js). */
  .nobs-popup-container {
    position: fixed;
    inset: 0;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }
  .popup {
    width: 100%;
    max-width: 100vw;
    max-height: 75vh;
    max-height: 75svh;
    border-radius: 14px 14px 0 0;
    padding: 18px 16px 22px;
    overscroll-behavior: contain;
  }
  /* The commentator menu: a bottom sheet too (it does not fit above the
     button of a small video). */
  .nobs-commentator-menu {
    position: fixed;
    left: 0;
    right: 0 !important;
    bottom: 0 !important;
    z-index: calc(var(--nobs-overlay-z) + 3);
    min-width: 0;
    max-width: none;
    max-height: 70vh;
    max-height: 70svh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 14px 14px 0 0;
    padding: 6px 6px 14px;
  }
  /* «Готовим агента…» fits the small player (scrolls inside if needed). */
  .nobs-gate {
    padding: 10px;
    overflow-y: auto;
  }
  .nobs-gate-card {
    gap: 8px;
    margin: auto;
  }
  .nobs-gate-title {
    font-size: 1.1rem;
  }
  .nobs-gate-toast {
    top: 8px;
    font-size: 0.85rem;
  }
  .nobs-control-bar {
    gap: 6px;
    padding: 6px 8px;
  }
  .nobs-time {
    min-width: 0;
    font-size: 12px;
  }
}

/* Portrait phone: the control bar under the video (the video stays
   uncovered), the timeline on its own row above the buttons. */
@media (max-width: 760px) and (orientation: portrait) {
  .nobs-layout #player-container:not(:fullscreen):not(.nobs-pseudo-fs) {
    aspect-ratio: auto;
    max-width: none;
  }
  #player-container:not(:fullscreen):not(.nobs-pseudo-fs) > #player {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  #player-container:not(:fullscreen):not(.nobs-pseudo-fs) .nobs-control-bar {
    position: relative;
    flex-wrap: wrap;
    row-gap: 0;
    padding: 2px 8px 4px;
    background: #000;
  }
  #player-container:not(:fullscreen):not(.nobs-pseudo-fs) .nobs-seek-wrap {
    order: -1;
    flex: 1 1 100%;
  }
  #player-container:not(:fullscreen):not(.nobs-pseudo-fs) .nobs-time {
    margin-right: auto;
    padding-left: 4px;
    font-size: 13px;
  }
  /* The flag / chain icons and the narrator's sign stay on the video. */
  #player-container:not(:fullscreen):not(.nobs-pseudo-fs) .nobs-overlay {
    top: calc(100vw * 9 / 16 - 54px);
    bottom: auto;
    right: 10px;
  }
  #player-container:not(:fullscreen):not(.nobs-pseudo-fs) .nobs-voice-hold {
    top: calc(100vw * 9 / 32);
  }
}
@media (pointer: coarse) {
  .nobs-commentator-manage {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  .nobs-rail-flag::before {
    inset: -10px;
  }
}

/* The public demo's note under the top bar: compact on a phone; held
   sideways, the video leaves room for it. */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .nobs-demo-banner {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.35;
  }
}
@media (pointer: coarse) and (max-height: 520px) {
  :root[data-demo="1"] .nobs-layout #player-container:not(:fullscreen):not(.nobs-pseudo-fs) {
    max-width: calc((100vh - 48px - 48px) * 16 / 9);
    max-width: calc((100svh - 48px - 48px) * 16 / 9);
  }
}

/* A one-time voice notice over the video (no voice for the language, a
   commentator without lines for this run). */
.nobs-voice-toast {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  z-index: calc(var(--nobs-overlay-z) + 1);
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(16, 16, 22, 0.94);
  color: #f2f2f5;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.nobs-voice-toast[hidden] {
  display: none;
}

/* Settings: «Проверить голос» and its status. */
.nobs-voice-test-button {
  align-self: flex-start;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--nobs-border-strong);
  border-radius: 8px;
  background: var(--nobs-input-bg);
  color: var(--nobs-text);
  font: inherit;
  cursor: pointer;
}
.nobs-voice-test-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--nobs-input-bg);
  color: var(--nobs-text);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.nobs-voice-test-status[hidden] {
  display: none;
}
@media (pointer: coarse) {
  .nobs-voice-test-button {
    min-height: 44px;
  }
}

/* ---- video frames (frames.js): thumbnail, «На экране», «С экрана» ---- */
.nobs-claims-frame {
  flex: 0 0 auto;
  width: 64px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  margin-left: auto;
  align-self: flex-start;
  opacity: 0.9;
}
.nobs-claims-onscreen {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--nobs-muted);
  font-style: italic;
}
.nobs-claims-screen,
.claim-screen-badge {
  display: inline-block;
  font-size: 11px;
  padding: 0 6px;
  margin-right: 6px;
  border-radius: 8px;
  border: 1px solid currentColor;
  color: var(--nobs-muted);
}
.claim-screen {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.4;
}
.claim-screen p {
  margin: 0;
}
.claim-frame {
  width: 160px;
  height: 90px;
  max-width: 40%;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
}
.claim-screen-text {
  font-style: italic;
}
.claim-screen-status {
  font-size: 12px;
  color: var(--nobs-muted);
}
.claim-speaker-role {
  font-size: 12px;
  color: var(--nobs-muted);
}
.nobs-seek-tagmark[data-kind="frame"] {
  opacity: 0.75;
}
@media (max-width: 480px) {
  .claim-screen {
    flex-direction: column;
  }
  .claim-frame {
    max-width: 100%;
  }
}

/* Effort modes (src/effort.js): the Light / Deep picker, badges, the «deeper version ready» notice. */
.nobs-effort {
  border: 1px solid var(--nobs-border, rgba(127, 127, 127, 0.35));
  border-radius: 8px;
  padding: 8px 12px;
  margin: 12px 0;
  display: grid;
  gap: 8px;
  text-align: left;
}
.nobs-effort legend {
  padding: 0 4px;
  font-size: 0.85em;
  opacity: 0.8;
}
.nobs-effort-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}
.nobs-effort-option input {
  margin-top: 4px;
}
.nobs-effort-text {
  display: grid;
  gap: 2px;
}
.nobs-effort-text small {
  opacity: 0.75;
  line-height: 1.3;
}
.nobs-effort-badge {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid currentColor;
  vertical-align: middle;
  opacity: 0.85;
  white-space: nowrap;
}
.nobs-effort-badge-deep {
  color: #7c9cff;
}
.nobs-effort-badge-upgrading {
  color: #e0a43a;
}
.nobs-effort-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: 12px;
  font-size: 0.9em;
  min-width: 0;
}
.nobs-effort-notice {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 0.85em;
  opacity: 0.9;
}
.nobs-effort-open {
  font: inherit;
  padding: 1px 8px;
  border-radius: 6px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .nobs-effort-notice > span:first-child {
    display: none;
  }
}

/* ---- The admin page (local app only, spec 2026-11-18-admin-design) ---- */
.nobs-admin-link {
  margin-left: 12px;
  padding: 3px 9px;
  border: 1px solid var(--nobs-border);
  border-radius: 6px;
  color: var(--nobs-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}
.nobs-admin-link:hover,
.nobs-admin-link:focus-visible {
  background: var(--nobs-hover);
}
.nobs-settings-admin {
  margin-top: 4px;
}
.nobs-admin {
  max-width: 1100px;
  margin: 0 auto;
}
.nobs-admin-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--nobs-border);
}
.nobs-admin-tab {
  flex: none;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--nobs-muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.nobs-admin-tab[aria-selected="true"] {
  color: var(--nobs-text);
  border-bottom-color: var(--nobs-red);
  font-weight: 600;
}
.nobs-admin-tab:focus-visible {
  outline: 2px solid var(--nobs-link);
  outline-offset: -2px;
}
.nobs-admin-desc {
  margin: 4px 0 10px;
  color: var(--nobs-muted);
  line-height: 1.45;
  font-size: 14px;
}
.nobs-admin-frame {
  display: block;
  width: 100%;
  height: calc(100dvh - 190px);
  min-height: 480px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: var(--nobs-bg);
}
.nobs-admin-group {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-admin-group h2 {
  margin: 0 0 8px;
  font-size: 17px;
}
.nobs-admin-setting {
  padding: 10px 0;
  border-top: 1px solid var(--nobs-border);
}
.nobs-admin-setting:first-of-type {
  border-top: 0;
}
.nobs-admin-setting-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.nobs-admin-key {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.nobs-admin-badge {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--nobs-border);
  color: var(--nobs-muted);
  font-size: 12px;
  white-space: nowrap;
}
.nobs-admin-src-admin {
  border-color: var(--nobs-link);
  color: var(--nobs-link);
}
.nobs-admin-src-env {
  color: var(--nobs-text);
}
.nobs-admin-restart {
  border-color: var(--nobs-yellow);
  color: var(--nobs-yellow);
}
.nobs-admin-setting .nobs-admin-desc {
  margin: 4px 0 6px;
}
.nobs-admin-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.nobs-admin-control select,
.nobs-admin-input {
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--nobs-border);
  border-radius: 6px;
  background: var(--nobs-bg);
  color: var(--nobs-text);
  font: inherit;
  font-size: 14px;
}
.nobs-admin-input[type="text"] {
  width: min(420px, 100%);
}
.nobs-admin-input[type="number"] {
  width: 120px;
}
.nobs-admin-control input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
.nobs-admin-value {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.nobs-admin-reset {
  padding: 5px 10px;
  border: 1px solid var(--nobs-border);
  border-radius: 6px;
  background: var(--nobs-raised);
  color: var(--nobs-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.nobs-admin-note {
  display: block;
  margin-top: 4px;
  color: var(--nobs-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.nobs-admin-status {
  display: block;
  min-height: 0;
  color: var(--nobs-muted);
  font-size: 12px;
}
.nobs-admin-status[data-kind="error"] {
  color: var(--nobs-red);
}
.nobs-admin-secrets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px 16px;
}
.nobs-admin-secrets li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.nobs-admin-secrets li[data-set="1"] .nobs-admin-badge {
  color: var(--nobs-green);
  border-color: var(--nobs-green);
}
.nobs-admin-queue {
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-admin-queue .nobs-settings-queue > span:first-child {
  font-weight: 600;
}
.nobs-admin-queue .nobs-settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}
.nobs-admin-queue .nobs-settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nobs-admin-queue input[type="number"] {
  width: 120px;
  padding: 6px 8px;
  border: 1px solid var(--nobs-border);
  border-radius: 6px;
  background: var(--nobs-bg);
  color: var(--nobs-text);
  font: inherit;
}
.nobs-admin-queue small {
  color: var(--nobs-muted);
}
.nobs-admin-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 20px;
}
.nobs-admin-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-admin-tile-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nobs-admin-tile-label {
  color: var(--nobs-muted);
  font-size: 12px;
}
.nobs-admin-bars {
  display: grid;
  gap: 6px;
}
.nobs-admin-bar {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.nobs-admin-bar-track {
  height: 10px;
  border-radius: 5px;
  background: var(--nobs-hover);
  overflow: hidden;
}
.nobs-admin-bar-fill {
  display: block;
  height: 100%;
  background: var(--nobs-neutral);
}
.nobs-admin-bar[data-flag="green"] .nobs-admin-bar-fill { background: var(--nobs-green); }
.nobs-admin-bar[data-flag="yellow"] .nobs-admin-bar-fill { background: var(--nobs-yellow); }
.nobs-admin-bar[data-flag="red"] .nobs-admin-bar-fill { background: var(--nobs-red); }
.nobs-admin-bar[data-flag="white"] .nobs-admin-bar-fill { background: var(--nobs-white); }
.nobs-admin-bar-n {
  font-variant-numeric: tabular-nums;
  color: var(--nobs-muted);
}
.nobs-admin-table-wrap {
  overflow-x: auto;
  margin: 6px 0 12px;
}
.nobs-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.nobs-admin-table th,
.nobs-admin-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--nobs-border);
  text-align: left;
  vertical-align: top;
}
.nobs-admin-table th {
  color: var(--nobs-muted);
  font-weight: 600;
}
.nobs-admin-table td {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .nobs-admin-link {
    margin-left: 8px;
    padding: 2px 7px;
    font-size: 12px;
  }
  .nobs-admin-group {
    padding: 12px;
  }
  .nobs-admin-frame {
    height: calc(100dvh - 160px);
    min-height: 420px;
  }
  /* Tables become cards: each cell on its own line with its column name. */
  .nobs-admin-table thead {
    display: none;
  }
  .nobs-admin-table tr {
    display: block;
    padding: 6px 0;
    border-bottom: 1px solid var(--nobs-border);
  }
  .nobs-admin-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .nobs-admin-table td::before {
    content: attr(data-label);
    color: var(--nobs-muted);
    text-align: left;
    flex: none;
  }
  .nobs-admin-bar {
    grid-template-columns: 70px 1fr auto;
  }
}

/* ---- admin tab «Сервер и очередь» (local app only) ---- */
.nobs-live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--nobs-muted);
}
.nobs-live-error:empty {
  display: none;
}
.nobs-live-block .nobs-admin-tiles {
  margin: 8px 0 12px;
}
.nobs-live-block .nobs-admin-tile {
  min-width: 0;
  background: var(--nobs-bg);
}
.nobs-live-block .nobs-admin-tile .nobs-admin-note {
  overflow-wrap: anywhere;
}
.nobs-live-checks {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.nobs-live-check {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}
.nobs-live-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--nobs-neutral);
  align-self: center;
}
.nobs-live-check[data-state="ok"] .nobs-live-dot { background: var(--nobs-green); }
.nobs-live-check[data-state="warn"] .nobs-live-dot { background: var(--nobs-red); }
.nobs-live-check[data-state="off"] .nobs-live-dot { background: var(--nobs-muted); }
.nobs-live-check[data-state="unknown"] .nobs-live-dot { background: var(--nobs-yellow); }
.nobs-live-check-name {
  font-weight: 600;
}
.nobs-live-check-text {
  color: var(--nobs-muted);
  overflow-wrap: anywhere;
  min-width: 0;
}
.nobs-live-card {
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-bg);
  min-width: 0;
}
.nobs-live-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.nobs-live-title {
  font-weight: 600;
  color: var(--nobs-link);
  overflow-wrap: anywhere;
  min-width: 0;
}
.nobs-live-run {
  flex: none;
  white-space: nowrap;
}
.nobs-live-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.nobs-live-badges .nobs-admin-badge {
  white-space: normal;
  overflow-wrap: anywhere;
}
.nobs-live-badges [data-effort="deep"] {
  border-color: var(--nobs-link);
  color: var(--nobs-link);
}
.nobs-live-label {
  color: var(--nobs-text);
}
.nobs-live-stage {
  margin: 4px 0 8px;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.nobs-live-stage-msg {
  color: var(--nobs-muted);
}
.nobs-live-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}
.nobs-live-progress {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--nobs-hover);
  overflow: hidden;
}
.nobs-live-progress-fill {
  display: block;
  height: 100%;
  background: var(--nobs-link);
  transition: width 0.4s ease;
}
.nobs-live-pct {
  flex: none;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.nobs-live-sub {
  margin: 14px 0 6px;
  font-size: 14px;
}
.nobs-live-post,
.nobs-live-queue {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.5;
}
.nobs-live-queue li,
.nobs-live-post li {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.nobs-live-queue .nobs-admin-badge {
  margin-left: 6px;
}
.nobs-live-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 8px;
}
.nobs-live-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--nobs-muted);
  min-width: 0;
}
.nobs-live-filter select {
  max-width: 180px;
}
.nobs-live-incoming td:nth-child(2) {
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .nobs-live-block .nobs-admin-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nobs-live-block .nobs-admin-tile-value {
    font-size: 18px;
  }
  .nobs-live-filter {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .nobs-live-filter select {
    max-width: 60%;
  }
}

/* ==== Playlists (spec 2026-11-18-playlists; local app only) ====
   Library folders (src/library.js): a folder entry, the «← Все разборы»
   row, the folder sub-heading and the pinned run's «в папке» line. */
.nobs-library-folders-link {
  color: var(--nobs-link);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  margin-right: 10px;
  white-space: nowrap;
}
.nobs-library-folders-link:hover {
  text-decoration: underline;
}
.nobs-library[data-collapsed="true"] .nobs-library-folders-link {
  display: none;
}
.nobs-library-folder {
  align-items: center;
}
.nobs-library-folder-icon {
  flex: none;
  width: 96px;
  height: 40px;
  padding: 7px 0;
  box-sizing: border-box;
  border-radius: 4px;
  background: var(--nobs-surface);
  color: var(--nobs-muted);
}
.nobs-library-folder:hover .nobs-library-folder-icon {
  color: var(--nobs-text);
}
.nobs-library-back {
  align-self: flex-start;
  padding: 6px 10px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: transparent;
  color: var(--nobs-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.nobs-library-back:hover,
.nobs-library-back:focus-visible {
  background: var(--nobs-hover);
}
.nobs-library-subheading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px 2px;
}
.nobs-library-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--nobs-text);
  overflow-wrap: anywhere;
}
.nobs-library-manage {
  font-size: 12px;
  color: var(--nobs-link);
  text-decoration: none;
}
.nobs-library-manage:hover {
  text-decoration: underline;
}
.nobs-library-in-folder {
  font-size: 11px;
  color: var(--nobs-muted);
  font-style: italic;
}

/* «Доработать до Deep» at the top of the right panel (local app only). */
.nobs-deep-upgrade {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-deep-upgrade-button {
  align-self: flex-start;
  padding: 8px 14px;
  border: 1px solid #7c9cff;
  border-radius: 8px;
  background: transparent;
  color: #7c9cff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.nobs-deep-upgrade-button:hover:not(:disabled),
.nobs-deep-upgrade-button:focus-visible {
  background: var(--nobs-hover);
}
.nobs-deep-upgrade-button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.nobs-deep-upgrade-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--nobs-muted);
}
.nobs-deep-upgrade-status {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #e0a43a;
}
.nobs-deep-upgrade-error {
  margin: 0;
  font-size: 13px;
  color: var(--nobs-red);
}

/* The owner's playlists page (local app only). */
.nobs-playlists {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  box-sizing: border-box;
}
.nobs-playlists h1 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.nobs-playlists section {
  margin-top: 24px;
}
.nobs-playlists a {
  color: var(--nobs-link);
}
.nobs-playlists input[type="text"],
.nobs-playlists textarea {
  padding: 10px 12px;
  border: 1px solid var(--nobs-border);
  border-radius: 8px;
  background: var(--nobs-surface);
  color: var(--nobs-text);
  font: inherit;
  font-size: 16px;
  min-width: 0;
  width: 100%;
  max-width: 720px;
  box-sizing: border-box;
}
.nobs-playlists textarea {
  max-width: none;
  min-height: 110px;
  line-height: 1.4;
  resize: vertical;
}
.nobs-playlists input:focus,
.nobs-playlists textarea:focus {
  outline: 2px solid var(--nobs-green);
  outline-offset: 1px;
}
.nobs-playlists button {
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--nobs-green);
  color: var(--nobs-on-flag);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.nobs-playlists button.nobs-secondary {
  background: var(--nobs-surface);
  color: var(--nobs-text);
  border: 1px solid var(--nobs-border);
}
.nobs-playlists button.nobs-secondary:hover:not(:disabled) {
  background: var(--nobs-hover);
}
.nobs-playlists button:disabled {
  opacity: 0.5;
  cursor: default;
}
.nobs-playlists button.nobs-playlists-danger {
  color: var(--nobs-red);
}
.nobs-playlists-create {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nobs-playlists-add {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-surface);
}
.nobs-playlists-add[hidden] {
  display: none;
}
.nobs-playlists-add textarea {
  background: var(--nobs-input-bg);
}
.nobs-playlists-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--nobs-muted);
  min-width: 0;
}
.nobs-playlists-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.nobs-playlists-hint {
  margin: 0;
  color: var(--nobs-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.nobs-playlists-queue {
  margin: 0 0 12px;
  color: var(--nobs-muted);
  font-size: 14px;
}
.nobs-playlists-import {
  margin: 12px 0 0;
  font-size: 14px;
}
.nobs-playlists-import:empty,
.nobs-playlists-toast:empty,
.nobs-playlists-error:empty {
  display: none;
}
.nobs-playlists-error {
  color: var(--nobs-red);
  overflow-wrap: anywhere;
}
.nobs-playlists-toast {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--nobs-green);
  background: var(--nobs-surface);
  font-size: 14px;
}
.nobs-playlists-back {
  display: inline-block;
  margin: 0 0 12px;
  font-size: 14px;
  text-decoration: none;
}
.nobs-playlists-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 0 0 4px;
}
.nobs-playlists-header h1 {
  margin: 0;
}
.nobs-playlists-header .nobs-playlists-field {
  flex: 1 1 320px;
}
.nobs-playlists-header + .nobs-playlists-hint {
  margin: 0 0 12px;
}
.nobs-playlists-selection {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin: 16px 0 0;
  padding: 10px 0;
  background: var(--nobs-bg);
  border-bottom: 1px solid var(--nobs-border);
}
.nobs-playlists-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  color: var(--nobs-muted);
  font-size: 14px;
}
.nobs-playlists button.nobs-playlists-pick {
  padding: 2px 4px;
  background: none;
  color: var(--nobs-link);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nobs-playlists-count {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.nobs-playlists-table-wrap {
  max-width: 100%;
}
.nobs-playlists-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.nobs-playlists-table th,
.nobs-playlists-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--nobs-border);
  vertical-align: middle;
}
.nobs-playlists-table th {
  color: var(--nobs-muted);
  font-weight: 600;
  font-size: 12px;
}
.nobs-playlists-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--nobs-green);
}
.nobs-playlists-thumb {
  display: block;
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
}
.nobs-playlists-title {
  min-width: 180px;
  overflow-wrap: anywhere;
}
.nobs-playlists-title a {
  color: var(--nobs-text);
  text-decoration: none;
}
.nobs-playlists-title a:hover {
  text-decoration: underline;
}
.nobs-playlists-duration {
  white-space: nowrap;
}
.nobs-playlists-long {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid #e0a43a;
  color: #e0a43a;
  font-size: 11px;
}
.nobs-playlists-state {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--nobs-border);
  color: var(--nobs-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.nobs-playlists-state-light {
  color: var(--nobs-green);
  border-color: currentColor;
}
.nobs-playlists-state-deep {
  color: #7c9cff;
  border-color: currentColor;
}
.nobs-playlists-state-queued {
  color: var(--nobs-text);
  border-style: dashed;
}
.nobs-playlists-state-running {
  color: #e0a43a;
  border-color: currentColor;
}
.nobs-playlists-state-failed {
  color: var(--nobs-red);
  border-color: currentColor;
  cursor: help;
}
.nobs-playlists-item-actions > * {
  display: inline-block;
  margin: 2px 6px 2px 0;
  vertical-align: middle;
}
.nobs-playlists-table .nobs-playlists-item-actions button {
  padding: 4px 10px;
  font-size: 13px;
}
.nobs-playlists-open {
  font-size: 13px;
  font-weight: 600;
  margin-right: 4px;
}
@media (max-width: 760px) {
  .nobs-playlists {
    padding: 16px 16px 48px;
  }
  .nobs-playlists-table thead {
    display: none;
  }
  .nobs-playlists-table,
  .nobs-playlists-table tbody {
    display: block;
  }
  .nobs-playlists-table tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--nobs-border);
  }
  .nobs-playlists-table td {
    display: block;
    padding: 3px 0;
    border: 0;
  }
  .nobs-playlists-table td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--nobs-muted);
    font-size: 12px;
  }
  .nobs-playlists-items tr {
    display: grid;
    grid-template-columns: 28px 96px minmax(0, 1fr);
    gap: 4px 10px;
    align-items: start;
  }
  .nobs-playlists-items td {
    grid-column: 3;
  }
  .nobs-playlists-items td.nobs-playlists-check {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .nobs-playlists-items td.nobs-playlists-thumb-cell {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .nobs-playlists-items td.nobs-playlists-title {
    grid-row: 1;
    min-width: 0;
  }
  .nobs-playlists-items td.nobs-playlists-item-actions {
    grid-column: 1 / -1;
    padding-top: 6px;
  }
  .nobs-playlists-items td[colspan] {
    grid-column: 1 / -1;
  }
  .nobs-playlists-selection {
    gap: 6px 12px;
  }
}
@media (max-width: 420px) {
  .nobs-playlists-items tr {
    grid-template-columns: 28px 72px minmax(0, 1fr);
  }
  .nobs-playlists-thumb {
    width: 72px;
    height: 40px;
  }
}

/* Site footer (home page): product name and the privacy policy link. */
.nobs-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  padding: 24px 16px 32px;
  font-size: 13px;
  opacity: 0.75;
}
.nobs-footer a { color: inherit; }
.nobs-privacy { max-width: 760px; line-height: 1.55; }
.nobs-privacy h2 { margin-top: 28px; font-size: 18px; }

/* Account corner of the top bar (src/accountMenu.js): «Войти» or the
   user's picture with a menu. */
.nobs-account-menu {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.nobs-account-login {
  padding: 4px 12px;
  border: 1px solid var(--nobs-border);
  border-radius: 999px;
  color: var(--nobs-text);
  font-size: 13px;
  text-decoration: none;
}
.nobs-account-login:hover { border-color: var(--nobs-text); }
.nobs-account-avatar {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--nobs-border);
  border-radius: 50%;
  overflow: hidden;
  background: var(--nobs-surface, #2a2a30);
  color: var(--nobs-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nobs-account-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nobs-account-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--nobs-border);
  border-radius: 10px;
  background: var(--nobs-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}
.nobs-account-dropdown-who {
  padding: 6px 10px 8px;
  font-size: 12px;
  opacity: 0.7;
  border-bottom: 1px solid var(--nobs-border);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nobs-account-dropdown a,
.nobs-account-dropdown button {
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--nobs-text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nobs-account-dropdown a:hover,
.nobs-account-dropdown button:hover { background: var(--nobs-border); }

/* «For nerds» (src/nerdToggle.js): a quiet link-like button that shows the
   finished run's processing log. */
.nobs-nerd-toggle {
  align-self: flex-start;
  margin: 8px 0 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--nobs-text);
  opacity: 0.4;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.nobs-nerd-toggle:hover { opacity: 0.8; text-decoration: underline; }

/* Interface language switch of the top bar (src/uiLang.js): RU / EN. */
.nobs-lang-switch {
  margin-left: auto;
  display: inline-flex;
  border: 1px solid var(--nobs-border);
  border-radius: 999px;
  overflow: hidden;
}
.nobs-lang-switch button {
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: var(--nobs-text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.55;
  cursor: pointer;
}
.nobs-lang-switch button[aria-pressed="true"] {
  background: var(--nobs-border);
  opacity: 1;
  cursor: default;
}
.nobs-lang-switch button:hover { opacity: 1; }
.nobs-lang-switch ~ .nobs-account-menu { margin-left: 10px; }
