:root,
html[data-bs-theme="light"] {
  --app-bg: #F6FAF8;
  --body-text: #111827;
  --heading-text: #0f172a;
  --panel-bg: #ffffff;
  --panel-bg-strong: #ffffff;
  --surface: #ffffff;
  --surface-strong: #F6FAF8;
  --surface-muted: #eef6f2;
  --surface-rgb: 255, 255, 255;
  --border: #D7E6DF;
  --border-color: #D7E6DF;
  --panel-border: #D7E6DF;
  --panel-shadow: 0 12px 36px rgba(15, 23, 42, 0.07);
  --soft-text: rgba(15, 23, 42, 0.64);
  --muted-text: rgba(15, 23, 42, 0.48);
  --track-bg: #D7E6DF;
  --control-bg: #ffffff;
  --control-hover-bg: #F6FAF8;
  --control-border: #D7E6DF;
  --item-bg: #ffffff;
  --item-hover-bg: #F6FAF8;
  --active-bg: linear-gradient(145deg, rgba(215, 230, 223, 0.78), #ffffff);
  --video-bg: #111827;
  --empty-bg: #F6FAF8;
  --input-bg: #ffffff;
  --input-focus-bg: #ffffff;
  --accent: #2f7d62;
  --accent-strong: #225f4a;
  --accent-rgb: 47, 125, 98;
  --accent-soft: rgba(47, 125, 98, 0.18);
  --accent-contrast: #ffffff;
  --surface-elevated: #ffffff;
  --text: var(--body-text);
  --muted: var(--soft-text);
  --danger: #dc3545;
  --success: #16a36f;
  --radius-xl: 8px;
  --radius-lg: 6px;
  --radius-md: 5px;
}

html[data-bs-theme="dark"] {
  --app-bg: #0d1512;
  --body-text: #f3faf7;
  --heading-text: #ffffff;
  --panel-bg: rgba(18, 28, 24, 0.94);
  --panel-bg-strong: rgba(13, 21, 18, 0.98);
  --surface: rgba(18, 28, 24, 0.94);
  --surface-strong: rgba(13, 21, 18, 0.98);
  --surface-muted: rgba(31, 47, 41, 0.92);
  --surface-rgb: 18, 28, 24;
  --border: #31483f;
  --border-color: #31483f;
  --panel-border: #31483f;
  --panel-shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
  --soft-text: rgba(243, 250, 247, 0.68);
  --muted-text: rgba(243, 250, 247, 0.48);
  --track-bg: rgba(215, 230, 223, 0.18);
  --control-bg: rgba(246, 250, 248, 0.075);
  --control-hover-bg: rgba(246, 250, 248, 0.12);
  --control-border: #385448;
  --item-bg: rgba(246, 250, 248, 0.055);
  --item-hover-bg: rgba(246, 250, 248, 0.095);
  --active-bg: linear-gradient(145deg, rgba(130, 194, 166, 0.22), rgba(246, 250, 248, 0.065));
  --video-bg: #030806;
  --empty-bg: rgba(13, 21, 18, 0.94);
  --input-bg: rgba(6, 12, 10, 0.62);
  --input-focus-bg: rgba(6, 12, 10, 0.82);
  --accent: #9ed9c4;
  --accent-strong: #78c6aa;
  --accent-rgb: 158, 217, 196;
  --accent-soft: rgba(158, 217, 196, 0.2);
  --accent-contrast: #0d1512;
  --surface-elevated: var(--surface-muted);
  --text: var(--body-text);
  --muted: var(--soft-text);
  --danger: #ff6978;
  --success: #8ee7bf;
  --radius-xl: 8px;
  --radius-lg: 6px;
  --radius-md: 5px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--body-text);
  background: var(--app-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

html[data-bs-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(215, 230, 223, 0.08), transparent 34rem),
    var(--app-bg);
}

button,
textarea,
input,
select {
  font: inherit;
}

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-strong);
  --bs-btn-hover-border-color: var(--accent-strong);
  --bs-btn-active-bg: var(--accent-strong);
  --bs-btn-active-border-color: var(--accent-strong);
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
}

.btn-outline-primary {
  --bs-btn-color: var(--accent-strong);
  --bs-btn-border-color: rgba(var(--accent-rgb), 0.52);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent-strong);
  --bs-btn-active-border-color: var(--accent-strong);
}

html[data-bs-theme="dark"] .btn-outline-primary {
  --bs-btn-color: var(--accent);
}

.form-check-input:checked {
  border-color: var(--accent);
  background-color: var(--accent);
}

a {
  color: var(--accent-strong);
}

html[data-bs-theme="dark"] a {
  color: var(--accent);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) minmax(340px, 520px);
  gap: 14px;
  width: min(2400px, 100%);
  min-height: calc(100vh - 94px);
  margin: 0 auto;
  padding: 14px 14px 8px;
  transition: grid-template-columns 180ms ease;
}

.app-shell.video-list-collapsed {
  grid-template-columns: 64px minmax(0, 1fr) minmax(340px, 520px);
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}

html[data-bs-theme="dark"] .panel,
html[data-bs-theme="dark"] .settings-offcanvas,
html[data-bs-theme="dark"] .glass-modal,
html[data-bs-theme="dark"] .glass-toast {
  backdrop-filter: blur(24px);
}

.video-panel,
.comments-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 112px);
}

.video-panel {
  max-height: calc(100vh - 112px);
  min-height: 0;
  transition: width 180ms ease, min-width 180ms ease;
}

@media (min-width: 761px) {
  .video-panel {
    height: calc(100vh - 112px);
    max-height: calc(100vh - 112px);
    min-height: 0;
  }
}

.video-panel .panel-header,
.video-panel .list-toolbar {
  flex: 0 0 auto;
}

.video-panel-collapsed-rail {
  display: none;
}

.video-panel.collapsed {
  align-items: center;
}

.video-panel.collapsed .panel-header {
  justify-content: center;
  width: 100%;
  padding: 12px 6px 6px;
}

.video-panel.collapsed .panel-header > div:first-child,
.video-panel.collapsed .icon-actions button:not(#toggleVideoPanelBtn),
.video-panel.collapsed .list-toolbar,
.video-panel.collapsed .video-list {
  display: none !important;
}

.video-panel.collapsed .icon-actions {
  justify-content: center;
}

.video-panel.collapsed .video-panel-toggle {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

html[data-bs-theme="dark"] .video-panel.collapsed .video-panel-toggle {
  color: var(--accent);
}

.video-panel.collapsed .video-panel-collapsed-rail {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 10px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--soft-text);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  user-select: none;
}

.video-panel.collapsed .video-panel-collapsed-rail i {
  color: var(--accent-strong);
  font-size: 1rem;
}

html[data-bs-theme="dark"] .video-panel.collapsed .video-panel-collapsed-rail i {
  color: var(--accent);
}

.stage-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - 112px);
  padding: 18px;
}

.panel-header,
.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-header {
  padding: 16px 16px 10px;
}

.stage-header {
  padding-bottom: 16px;
}

.stage-heading-wrap {
  min-width: 0;
}

.eyebrow {
  color: var(--soft-text);
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.panel-title,
.stage-title,
.offcanvas-title {
  margin: 0;
  color: var(--heading-text);
  font-size: 1.15rem;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.stage-title {
  max-width: min(72vw, 1120px);
  overflow: hidden;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 2rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-subtitle {
  max-width: min(72vw, 1120px);
  margin-top: 4px;
  overflow: hidden;
  color: var(--soft-text);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--body-text);
  background: var(--control-bg);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.icon-btn:hover:not(:disabled),
.icon-btn:focus-visible:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: var(--control-hover-bg);
  transform: translateY(-1px);
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.icon-btn.danger:hover:not(:disabled),
.icon-btn.danger:focus-visible:not(:disabled) {
  border-color: rgba(220, 53, 69, 0.7);
  background: rgba(220, 53, 69, 0.12);
  color: var(--danger);
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 10px;
  color: var(--soft-text);
  font-size: 0.85rem;
}

.video-panel .list-toolbar #videoCount {
  flex: 1 1 120px;
  min-width: 0;
}

.video-sort-control,
.video-filter-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.video-sort-control label,
.video-filter-control label {
  margin: 0;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--soft-text);
}

.video-sort-control .form-select,
.video-filter-control .form-select {
  width: auto;
  min-width: 130px;
  max-width: 170px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  font-size: 0.78rem;
}

.video-list,
.comments-list {
  overflow: auto;
  padding: 0 10px 14px;
  scrollbar-color: rgba(var(--accent-rgb), 0.28) transparent;
  scrollbar-width: thin;
}

/* Dedicated, understated scrollbar for the left video library. */
.video-list {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 9px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 8px 16px 12px;
  scroll-padding: 12px;
  scrollbar-color: rgba(var(--accent-rgb), 0.42) rgba(var(--accent-rgb), 0.08);
  scrollbar-gutter: stable;
}

.video-list::-webkit-scrollbar {
  width: 10px;
}

.video-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.08), transparent);
  margin: 4px 0 12px;
}

.video-list::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.34);
  background-clip: content-box;
}

.video-list:hover::-webkit-scrollbar-thumb,
.video-list:focus-within::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.52);
  background-clip: content-box;
}

.video-list::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.66);
  background-clip: content-box;
}

html[data-bs-theme="dark"] .video-list {
  scrollbar-color: rgba(var(--accent-rgb), 0.48) rgba(255, 255, 255, 0.04);
}

html[data-bs-theme="dark"] .video-list::-webkit-scrollbar-track {
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.1), transparent);
}

html[data-bs-theme="dark"] .video-list::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.42);
  background-clip: content-box;
}

html[data-bs-theme="dark"] .video-list:hover::-webkit-scrollbar-thumb,
html[data-bs-theme="dark"] .video-list:focus-within::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.58);
  background-clip: content-box;
}

html[data-bs-theme="dark"] .video-list::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.72);
  background-clip: content-box;
}

.video-item {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  color: var(--body-text);
  text-align: left;
  background: var(--item-bg);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.video-item:hover,
.video-item:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: var(--item-hover-bg);
  transform: translateY(-1px);
}

.video-item.active {
  border-color: rgba(var(--accent-rgb), 0.85);
  background: var(--active-bg);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.12);
}

.video-group.has-open-comments {
  border-color: rgba(255, 150, 31, 0.58);
  box-shadow: inset 4px 0 0 rgba(255, 150, 31, 0.86);
}

.video-group.has-open-comments.active {
  border-color: rgba(255, 150, 31, 0.86);
  box-shadow: inset 4px 0 0 rgba(255, 150, 31, 0.95), 0 10px 24px rgba(255, 150, 31, 0.12);
}

.video-item-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.video-item-title {
  display: -webkit-box;
  margin-bottom: 8px;
  overflow: hidden;
  font-weight: 720;
  line-height: 1.24;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-comment-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 26px;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--soft-text);
}

.video-comment-status-badge.has-open {
  border-color: rgba(255, 150, 31, 0.5);
  background: rgba(255, 150, 31, 0.16);
  color: #9a4f00;
}

.video-comment-status-badge.is-resolved {
  border-color: rgba(32, 165, 99, 0.42);
  background: rgba(32, 165, 99, 0.12);
  color: #16704a;
}

.video-comment-status-badge.is-empty {
  opacity: 0.58;
}

html[data-bs-theme="dark"] .video-comment-status-badge.has-open {
  color: #ffd49a;
}

html[data-bs-theme="dark"] .video-comment-status-badge.is-resolved {
  color: #a7efc9;
}

.video-comment-summary {
  font-weight: 700;
}

.video-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--soft-text);
  font-size: 0.78rem;
}

.video-group {
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  background: var(--item-bg);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.video-group:hover,
.video-group.active {
  border-color: rgba(var(--accent-rgb), 0.54);
}

.video-group.active {
  background: var(--active-bg);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.1);
}

.video-group .video-item {
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.video-group .video-item:hover,
.video-group .video-item:focus-visible,
.video-group .video-item.active {
  background: transparent;
  box-shadow: none;
}

.video-thumb-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--empty-bg);
}

.video-thumb-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  gap: 5px;
  color: var(--muted-text);
  font-size: 0.72rem;
  text-align: center;
}

.video-thumb-placeholder i {
  font-size: 1.35rem;
}

.video-item-main .video-item-title {
  margin-bottom: 8px;
}

.video-group .video-item-meta {
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
}

.video-group-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding: 0 12px 10px;
}

.update-video-btn,
.video-approve-btn {
  width: 100%;
  border-radius: var(--radius-md);
  font-weight: 720;
}

.video-approve-btn {
  border: 1px solid color-mix(in srgb, var(--accent-strong) 52%, var(--control-border));
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.08);
}

.video-approve-btn:hover,
.video-approve-btn:focus-visible {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.14);
}

.video-approve-btn.approved {
  border-color: var(--accent-strong);
  color: #fff;
  background: var(--accent-strong);
}

.video-approval-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.11);
  font-size: 0.74rem;
  font-weight: 840;
}

.video-versions {
  margin: 0 12px 12px;
  border-top: 1px solid var(--control-border);
  color: var(--soft-text);
}

.video-versions summary {
  cursor: pointer;
  padding: 9px 0 7px;
  font-size: 0.78rem;
  font-weight: 760;
  list-style-position: inside;
}

.video-version-list {
  display: grid;
  gap: 6px;
  padding-bottom: 2px;
}

.video-version-link {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  color: var(--body-text);
  text-align: left;
  background: var(--control-bg);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.video-version-link:hover,
.video-version-link:focus-visible,
.video-version-link.active {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: var(--control-hover-bg);
  transform: translateY(-1px);
}

.video-version-title {
  font-size: 0.82rem;
  font-weight: 740;
}

.video-version-meta {
  color: var(--soft-text);
  font-size: 0.72rem;
  line-height: 1.35;
}

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--soft-text);
  background: var(--control-bg);
  font-size: 0.82rem;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 14px rgba(22, 163, 111, 0.55);
}

.status-pill.busy .status-dot {
  background: var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.65);
}

.video-stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.video-frame {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 100%;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: var(--video-bg);
  aspect-ratio: 16 / 9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 36px rgba(0, 0, 0, 0.16);
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 32px;
  text-align: center;
  background: var(--empty-bg);
  transition: opacity 160ms ease, visibility 160ms ease;
}

.empty-state.hidden {
  visibility: hidden;
  opacity: 0;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: var(--radius-lg);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  font-size: 1.75rem;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--heading-text);
  font-size: 1.2rem;
  font-weight: 760;
}

.empty-state p {
  max-width: 360px;
  margin: 0 auto;
  color: var(--soft-text);
}

.transport-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  padding: 16px 0 12px;
}

.time-readout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 132px;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--body-text);
  background: var(--control-bg);
  font-variant-numeric: tabular-nums;
}

.muted-separator,
#durationTime {
  color: var(--soft-text);
}

.playback-rate-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 8px 6px 13px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--body-text);
  background: var(--control-bg);
  font-size: 0.84rem;
  font-weight: 720;
  white-space: nowrap;
}

.playback-rate-control .form-select {
  width: auto;
  min-width: 86px;
  padding-top: 4px;
  padding-bottom: 4px;
  border-color: transparent;
  border-radius: 999px;
  color: var(--body-text);
  background-color: var(--surface);
  font-weight: 760;
}

.playback-rate-control .form-select:focus {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 0.18rem rgba(var(--accent-rgb), 0.16);
}

.timeline-wrap {
  padding: 2px 0 14px;
}

.timeline-label-row {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 8px;
  color: var(--soft-text);
  font-size: 0.82rem;
}

.timeline {
  position: relative;
  padding: 12px 0;
  cursor: pointer;
  touch-action: none;
}

.timeline:focus-visible .timeline-track {
  outline: 2px solid rgba(var(--accent-rgb), 0.9);
  outline-offset: 6px;
}

.timeline-track {
  position: relative;
  height: 12px;
  overflow: visible;
  border-radius: 999px;
  background: var(--track-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.timeline-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), #9bbcff);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.3);
  transition: width 80ms linear;
}

.marker-layer {
  position: absolute;
  inset: -8px 0;
}

.marker {
  position: absolute;
  top: 50%;
  width: 17px;
  height: 26px;
  border: 2px solid rgba(9, 13, 24, 0.18);
  border-radius: 999px 999px 999px 0;
  background: var(--panel-bg-strong);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -52%) rotate(-45deg);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.marker::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent-strong);
  content: "";
  transform: translate(-50%, -50%);
}

.marker:hover,
.marker:focus-visible,
.marker.active {
  z-index: 2;
  background: #dce8ff;
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.16), 0 12px 24px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -56%) rotate(-45deg) scale(1.12);
}

.add-comment-btn {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  padding: 12px 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 999px;
  color: var(--body-text);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.14), var(--control-bg));
  font-weight: 720;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}

.add-comment-btn:hover:not(:disabled),
.add-comment-btn:focus-visible:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.8);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.22), var(--control-hover-bg));
  transform: translateY(-1px);
}

.add-comment-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.comment-plus {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent-strong);
}

.composer {
  width: min(860px, 100%);
  margin: 16px auto 0;
  padding: 15px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-xl);
  background: var(--item-bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.11);
  animation: softIn 170ms ease both;
}

.composer-topline,
.composer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.composer-topline {
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--soft-text);
  font-size: 0.88rem;
}

.composer-filename {
  max-width: 44%;
  overflow: hidden;
  color: var(--muted-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-control,
.form-select {
  border-color: var(--control-border);
  border-radius: var(--radius-lg);
  background-color: var(--input-bg);
  color: var(--body-text);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--accent-rgb), 0.7);
  background-color: var(--input-focus-bg);
  box-shadow: 0 0 0 0.25rem rgba(var(--accent-rgb), 0.16);
  color: var(--body-text);
}

.form-control::placeholder {
  color: var(--muted-text);
}

.composer-preview {
  position: relative;
  width: 112px;
  margin-top: 12px;
}

.composer-preview img {
  width: 112px;
  height: 78px;
  object-fit: cover;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
}

.composer-preview .icon-btn {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 30px;
  height: 30px;
  background: var(--panel-bg-strong);
}

.composer-actions {
  margin-top: 14px;
}

.spacer {
  flex: 1;
}

.comments-panel .panel-header {
  flex: 0 0 auto;
}

.comments-panel-header {
  padding-bottom: 8px;
}

.comment-total {
  display: inline-flex;
  min-width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent-strong);
  font-weight: 800;
}


.comment-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 8px;
  color: var(--soft-text);
  font-size: 0.82rem;
}

.comment-filter-label {
  flex: 0 0 auto;
  font-weight: 700;
}

.comment-filter-buttons {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--control-bg);
}

.comment-filter-btn {
  min-height: 30px;
  padding: 4px 11px;
  border: 0;
  border-radius: 999px;
  color: var(--soft-text);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.comment-filter-btn:hover,
.comment-filter-btn:focus-visible {
  color: var(--heading-text);
  background: rgba(var(--accent-rgb), 0.08);
}

.comment-filter-btn.active {
  color: #ffffff;
  background: var(--accent-strong);
}

.comment-sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 12px;
  color: var(--soft-text);
  font-size: 0.82rem;
}

.comment-sort-row label {
  flex: 0 0 auto;
  font-weight: 700;
}

.comment-sort-row .form-select {
  width: 168px;
  min-height: 34px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.82rem;
}

.comments-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.comment-card {
  position: relative;
  padding: 13px 42px 10px 13px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  background: var(--item-bg);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  animation: softIn 170ms ease both;
}

.comment-card:hover,
.comment-card:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: var(--item-hover-bg);
  transform: translateY(-1px);
}


.comment-card.done {
  border-color: color-mix(in srgb, var(--accent-strong) 42%, var(--control-border));
  background: color-mix(in srgb, var(--accent-strong) 7%, var(--item-bg));
}

.comment-card.done .comment-body {
  opacity: 0.86;
}

.comment-card-actions {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.comment-status-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--soft-text);
  background: var(--control-bg);
  font-size: 0.78rem;
  font-weight: 850;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.comment-status-toggle:hover,
.comment-status-toggle:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.58);
  color: var(--heading-text);
  background: rgba(var(--accent-rgb), 0.09);
  transform: translateY(-1px);
}

.comment-status-toggle.done {
  color: #ffffff;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.comment-status-toggle:not(.done) {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent-strong) 42%, var(--control-border));
}

.comment-card.active {
  border-color: rgba(var(--accent-rgb), 0.9);
  background: var(--active-bg);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.13);
}

.comment-card .delete-comment {
  position: absolute;
  top: 9px;
  right: 8px;
  width: 30px;
  height: 30px;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.comment-author-date,
.comment-entry-meta,
.reviewer-summary-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.comment-date {
  color: var(--soft-text);
  font-size: 0.78rem;
}

.user-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.comment-body {
  margin: 0;
  color: var(--body-text);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-thumb {
  display: block;
  width: 116px;
  height: 78px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  background: var(--control-bg);
}

.comment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 170ms ease;
}

.comment-thumb:hover img,
.comment-thumb:focus-visible img {
  transform: scale(1.05);
}

.comment-entries {
  display: grid;
  gap: 10px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--control-border);
}

.comment-entry {
  padding: 10px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent-strong) 5%, transparent);
}

.comment-entry-meta {
  margin-bottom: 7px;
  color: var(--soft-text);
  font-size: 0.78rem;
}

.comment-entry .user-avatar {
  width: 25px;
  height: 25px;
  font-size: 0.68rem;
}

.comment-entry p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
}

.comment-action-btn {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--control-bg);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.comment-action-btn:hover,
.comment-action-btn:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.1);
  transform: translateY(-1px);
}

.comment-action-btn.muted {
  color: var(--muted-text);
  opacity: 0.78;
}

.comment-add-followup-btn {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.comment-add-followup-btn:hover,
.comment-add-followup-btn:focus-visible {
  color: #ffffff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.empty-list {
  display: grid;
  min-height: 160px;
  place-content: center;
  padding: 22px;
  border: 1px dashed var(--control-border);
  border-radius: var(--radius-lg);
  color: var(--soft-text);
  text-align: center;
}

.empty-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--heading-text);
}

.legal-footer {
  width: min(1800px, calc(100% - 28px));
  margin: 0 auto 18px;
  padding: 12px 18px 4px;
  color: var(--soft-text);
  font-size: clamp(0.84rem, 0.78rem + 0.2vw, 1rem);
  line-height: 1.55;
  text-align: center;
}

.legal-footer p {
  margin: 0 auto;
  max-width: 1500px;
}

.floating-menu-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1040;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  box-shadow: 0 16px 36px rgba(var(--accent-rgb), 0.3);
  font-size: 1.55rem;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.floating-menu-btn:hover,
.floating-menu-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(var(--accent-rgb), 0.4);
}

.settings-offcanvas {
  width: min(440px, 100vw);
  border-left: 1px solid var(--panel-border);
  color: var(--body-text);
  background: var(--panel-bg-strong);
}

.settings-offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--panel-border);
}

.settings-offcanvas .offcanvas-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-card {
  padding: 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-xl);
  background: var(--item-bg);
}

.menu-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.menu-card-head h3,
.identity-card h3 {
  margin: 0;
  color: var(--heading-text);
  font-size: 1rem;
  font-weight: 760;
}

.menu-card-head i {
  color: var(--accent-strong);
  font-size: 1.15rem;
}

.menu-switch {
  margin-bottom: 6px;
}

.menu-help,
.identity-subtitle {
  margin: 0 0 12px;
  color: var(--soft-text);
  font-size: 0.86rem;
  line-height: 1.45;
}

.small-label {
  color: var(--soft-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.compact-group .form-control,
.compact-group .btn {
  min-height: 40px;
}

.reviewer-summary {
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  color: var(--soft-text);
  background: var(--control-bg);
}

.reviewer-summary-row {
  color: var(--body-text);
  font-weight: 740;
}

.reviewer-summary-note {
  margin-top: 8px;
  color: var(--muted-text);
  font-size: 0.78rem;
  line-height: 1.35;
}

.identity-modal-dialog {
  max-width: min(1100px, calc(100vw - 2rem));
}

.identity-modal-content {
  overflow: hidden;
}

.identity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.identity-card {
  padding: 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-xl);
  background: var(--item-bg);
}

.identity-card h3 {
  margin-bottom: 12px;
}

.identity-notice {
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
}

.known-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.known-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  color: var(--body-text);
  text-align: left;
  background: var(--control-bg);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.known-user-btn:hover,
.known-user-btn:focus-visible,
.known-user-btn.selected {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: var(--control-hover-bg);
  transform: translateY(-1px);
}

.known-user-btn.selected {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

.known-user-text {
  display: grid;
  min-width: 0;
}

.known-user-text strong,
.known-user-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.known-user-text span {
  color: var(--muted-text);
  font-size: 0.78rem;
}

.known-users-empty {
  display: grid;
  min-height: 120px;
  place-content: center;
  padding: 18px;
  border: 1px dashed var(--control-border);
  border-radius: var(--radius-lg);
  color: var(--soft-text);
  text-align: center;
}

.identity-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.toast-stack {
  padding-bottom: 82px !important;
}

.glass-modal,
.glass-toast {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  color: var(--body-text);
  background: var(--panel-bg-strong);
  box-shadow: 0 22px 76px rgba(0, 0, 0, 0.2);
}

.image-modal-content .modal-body {
  display: grid;
  min-height: 240px;
  place-items: center;
}

#imageModalImg {
  max-width: 100%;
  max-height: min(76vh, 820px);
  border-radius: var(--radius-xl);
  object-fit: contain;
}

.btn {
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

@keyframes softIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 1900px) {
  .app-shell {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) minmax(420px, 580px);
  }

  .app-shell.video-list-collapsed {
    grid-template-columns: 64px minmax(0, 1fr) minmax(420px, 580px);
  }

  .stage-panel {
    padding: 22px;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .app-shell.video-list-collapsed {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .comments-panel {
    grid-column: 1 / -1;
    min-height: 380px;
  }

  .comments-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-content: start;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .app-shell.video-list-collapsed {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .stage-panel {
    order: 1;
    min-height: auto;
    padding: 14px;
  }

  .video-panel {
    order: 2;
    height: auto;
    max-height: min(70vh, 560px);
    min-height: 330px;
  }

  .video-panel.collapsed {
    max-height: 56px;
    min-height: 56px;
  }

  .video-panel.collapsed .video-panel-collapsed-rail {
    display: none;
  }

  .comments-panel {
    order: 3;
    min-height: 330px;
  }

  .panel-header,
  .stage-header {
    align-items: flex-start;
    padding: 14px 14px 10px;
  }

  .stage-header {
    padding: 0 0 14px;
  }

  .stage-title,
  .workspace-subtitle {
    max-width: 100%;
    white-space: normal;
  }

  .status-pill {
    display: none;
  }

  .transport-bar {
    flex-wrap: wrap;
  }

  .playback-rate-control {
    flex: 1 1 220px;
    justify-content: center;
  }

  .composer-actions,
  .identity-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .composer-actions .spacer {
    display: none;
  }

  .composer-actions .btn,
  .identity-actions .btn {
    flex: 1 1 auto;
  }


  .comment-filter-row,
  .comment-sort-row {
    align-items: stretch;
    flex-direction: column;
  }

  .comment-filter-buttons {
    width: 100%;
  }

  .comment-filter-btn {
    flex: 1 1 0;
  }

  .comment-sort-row .form-select {
    width: 100%;
  }

  .comments-list {
    display: flex;
  }

  .identity-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-footer {
    width: calc(100% - 20px);
    margin-bottom: 86px;
  }

  .floating-menu-btn {
    right: 16px;
    bottom: 16px;
  }
}

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

/* Compact rich-text editor for comments */
.rich-toolbar,
.rich-editor {
  display: none;
}

html.rich-text-ready .rich-toolbar,
html.rich-text-ready .rich-editor {
  display: block;
}

html.rich-text-ready .rich-text-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.rich-toolbar.ql-toolbar.ql-snow {
  border: 1px solid var(--control-border);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--input-bg);
  color: var(--body-text);
}

.rich-toolbar.ql-toolbar.ql-snow .ql-picker,
.rich-toolbar.ql-toolbar.ql-snow .ql-stroke {
  color: var(--body-text);
  stroke: currentColor;
}

.rich-toolbar.ql-toolbar.ql-snow .ql-fill {
  fill: currentColor;
}

.rich-editor.ql-container.ql-snow {
  min-height: 122px;
  border: 1px solid var(--control-border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--input-bg);
  color: var(--body-text);
  font: inherit;
}

.rich-editor.ql-container.ql-snow:focus-within {
  border-color: rgba(var(--accent-rgb), 0.7);
  box-shadow: 0 0 0 0.25rem rgba(var(--accent-rgb), 0.16);
}

.rich-editor .ql-editor {
  min-height: 120px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
}

.rich-editor-modal.ql-container.ql-snow,
.rich-editor-modal .ql-editor {
  min-height: 170px;
}

.rich-text-content {
  color: var(--body-text);
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rich-text-content p,
.rich-text-content ul,
.rich-text-content ol {
  margin: 0 0 0.55rem;
}

.rich-text-content p:last-child,
.rich-text-content ul:last-child,
.rich-text-content ol:last-child {
  margin-bottom: 0;
}

.rich-text-content ul,
.rich-text-content ol {
  padding-left: 1.25rem;
}

.rich-text-content a {
  color: var(--accent-strong);
  font-weight: 650;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

html[data-bs-theme="dark"] .rich-text-content a {
  color: var(--accent);
}

.rich-text-content span[style*="background-color"] {
  border-radius: 0.2rem;
  padding: 0 0.16rem;
}

.comment-body.rich-text-content {
  margin: 0;
  white-space: normal;
}

.comment-entry-body.rich-text-content {
  font-size: 0.92rem;
}


.rich-toolbar.ql-toolbar.ql-snow button:hover,
.rich-toolbar.ql-toolbar.ql-snow button:focus,
.rich-toolbar.ql-toolbar.ql-snow button.ql-active,
.rich-toolbar.ql-toolbar.ql-snow .ql-picker-label:hover,
.rich-toolbar.ql-toolbar.ql-snow .ql-picker-label.ql-active,
.rich-toolbar.ql-toolbar.ql-snow .ql-picker-item:hover,
.rich-toolbar.ql-toolbar.ql-snow .ql-picker-item.ql-selected {
  color: var(--accent-strong);
}

.rich-toolbar.ql-toolbar.ql-snow button:hover .ql-stroke,
.rich-toolbar.ql-toolbar.ql-snow button:focus .ql-stroke,
.rich-toolbar.ql-toolbar.ql-snow button.ql-active .ql-stroke,
.rich-toolbar.ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke,
.rich-toolbar.ql-toolbar.ql-snow .ql-picker-label.ql-active .ql-stroke {
  stroke: var(--accent-strong);
}

.rich-toolbar.ql-toolbar.ql-snow button:hover .ql-fill,
.rich-toolbar.ql-toolbar.ql-snow button:focus .ql-fill,
.rich-toolbar.ql-toolbar.ql-snow button.ql-active .ql-fill,
.rich-toolbar.ql-toolbar.ql-snow .ql-picker-label:hover .ql-fill,
.rich-toolbar.ql-toolbar.ql-snow .ql-picker-label.ql-active .ql-fill {
  fill: var(--accent-strong);
}

html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-options {
  border-color: var(--control-border);
  background: var(--panel-bg-strong);
}

html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button:hover,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button:focus,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button.ql-active,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-label:hover,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-label.ql-active,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-item:hover,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-item.ql-selected {
  color: var(--accent);
}

html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button:hover .ql-stroke,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button:focus .ql-stroke,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button.ql-active .ql-stroke,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-label.ql-active .ql-stroke {
  stroke: var(--accent);
}

html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button:hover .ql-fill,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button:focus .ql-fill,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow button.ql-active .ql-fill,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-label:hover .ql-fill,
html[data-bs-theme="dark"] .rich-toolbar.ql-toolbar.ql-snow .ql-picker-label.ql-active .ql-fill {
  fill: var(--accent);
}

/* Usability refinements: cleaner composer, scrollable rich text, drawing overlay and video download */
.drawing-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  touch-action: none;
  pointer-events: none;
}

.drawing-canvas.is-editing {
  cursor: crosshair;
  pointer-events: auto;
}

.drawing-canvas[hidden] {
  display: none !important;
}

.comment-point-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.comment-point-layer[hidden] {
  display: none !important;
}

.comment-point-marker {
  position: absolute;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--comment-point-color, var(--accent));
  border-radius: 999px;
  background: color-mix(in srgb, var(--comment-point-color, var(--accent)) 24%, transparent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--comment-point-color, var(--accent)) 38%, transparent), 0 8px 22px rgba(0, 0, 0, 0.24);
  animation: commentPointPulse 1.35s ease-out infinite;
}

.comment-point-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: var(--comment-point-color, var(--accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--comment-point-color, var(--accent)) 58%, transparent);
}

@keyframes commentPointPulse {
  0% {
    opacity: 0.96;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--comment-point-color, var(--accent)) 34%, transparent), 0 8px 22px rgba(0, 0, 0, 0.24);
  }
  70% {
    opacity: 0.72;
    box-shadow: 0 0 0 16px color-mix(in srgb, var(--comment-point-color, var(--accent)) 0%, transparent), 0 8px 22px rgba(0, 0, 0, 0.2);
  }
  100% {
    opacity: 0.96;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--comment-point-color, var(--accent)) 0%, transparent), 0 8px 22px rgba(0, 0, 0, 0.24);
  }
}

.drawing-toolbar {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 112px);
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(5, 10, 9, 0.62);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.drawing-toolbar[hidden] {
  display: none !important;
}

.drawing-tool-btn,
.drawing-color-label {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.drawing-tool-btn:hover:not(:disabled),
.drawing-tool-btn:focus-visible:not(:disabled),
.drawing-color-label:hover {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(var(--accent-rgb), 0.88);
  transform: translateY(-1px);
}

.drawing-tool-btn.active {
  border-color: rgba(255, 255, 255, 0.9);
  background: var(--accent);
}

.drawing-tool-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.drawing-save-btn {
  background: rgba(var(--accent-rgb), 0.85);
}

.drawing-color-input {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.video-corner-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(5, 10, 9, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.video-corner-btn:hover,
.video-corner-btn:focus-visible {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(var(--accent-rgb), 0.86);
  transform: translateY(-1px);
}

.video-corner-btn[hidden] {
  display: none !important;
}

.video-draw-btn {
  right: 62px;
}

.video-draw-btn.active {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(var(--accent-rgb), 0.9);
}

.composer {
  width: min(860px, 100%);
  padding: 0 0 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.composer-topline {
  padding: 0 2px;
}

.rich-toolbar.ql-toolbar.ql-snow {
  border-bottom: 0;
}

.rich-editor.ql-container.ql-snow {
  height: auto;
  min-height: 0;
  overflow: visible;
}

.rich-editor .ql-editor {
  height: clamp(140px, 24vh, 270px);
  min-height: 130px;
  max-height: 48vh;
  overflow-y: auto;
  resize: vertical;
  scrollbar-width: thin;
}

.rich-editor-modal .ql-editor {
  height: clamp(180px, 34vh, 380px);
  max-height: 58vh;
}

.composer-actions {
  padding: 0 2px;
}

.legal-footer {
  width: min(1500px, calc(100% - 28px));
  padding: 8px 14px 2px;
  font-size: clamp(0.72rem, 0.68rem + 0.12vw, 0.86rem);
  line-height: 1.42;
}

.legal-footer p {
  max-width: 1280px;
}

@media (max-width: 760px) {
  .video-corner-btn {
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
  }

  .video-draw-btn {
    right: 56px;
  }

  .drawing-toolbar {
    left: 10px;
    right: 98px;
    bottom: 10px;
    max-width: none;
    overflow-x: auto;
    border-radius: 22px;
    scrollbar-width: thin;
  }

  .drawing-tool-btn,
  .drawing-color-label {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
  }

  .rich-editor .ql-editor {
    height: 150px;
    max-height: 44vh;
  }

  .rich-editor-modal .ql-editor {
    height: 190px;
    max-height: 54vh;
  }
}

.access-modal-content {
  overflow: hidden;
}

.access-card,
.access-request-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
}

.access-card .form-control,
.access-request-card .form-control {
  min-height: 46px;
}

#accessWorkspaceName {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--body-text);
  font-weight: 700;
}

#workspaceCreateArea[hidden] {
  display: none !important;
}

.admin-projects-modal .modal-body {
  padding-top: 0;
}

.admin-create-card {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
}

.admin-credentials-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.4;
}

.admin-migration-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--muted-text);
  font-size: 0.88rem;
  line-height: 1.4;
}

.admin-migration-note i {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.admin-company-access-note,
.admin-company-subscription-help {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--muted-text);
  font-size: 0.86rem;
  line-height: 1.4;
}

.admin-company-access-note {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.08);
}

.admin-company-access-note i {
  color: #dc2626;
}

.admin-company-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-company-status-badge.is-blocked {
  border-color: rgba(220, 38, 38, 0.32);
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.admin-company-limit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 14px;
}

.admin-company-limit-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--muted-text);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}


.admin-limit-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.08);
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-project-form-new.is-limit-reached,
.admin-user-row-new.is-limit-reached {
  opacity: 0.78;
}

.admin-project-form-new.is-limit-reached input,
.admin-user-row-new.is-limit-reached input,
.admin-user-row-new.is-limit-reached select {
  cursor: not-allowed;
}

.admin-company-form .admin-company-subscription-help {
  flex: 1 1 100%;
  margin: 0;
}

.admin-create-card h3,
.admin-company-card h3,
.admin-project-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.admin-projects-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.admin-projects-list {
  display: grid;
  gap: 12px;
}

.admin-company-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--soft-shadow);
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.admin-company-card.just-created,
.admin-project-card.just-created {
  border-color: rgba(var(--accent-rgb), 0.65);
  transform: translateY(-1px);
}

.admin-company-head,
.admin-company-form,
.admin-company-actions {
  display: flex;
  gap: 12px;
}

.admin-company-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-company-form {
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-company-form .admin-field {
  flex: 1 1 180px;
}

.admin-company-form .admin-field:first-child {
  flex-basis: 260px;
}

.admin-company-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-company-projects {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.admin-company-projects-title {
  margin: 0;
  font-size: .9rem;
  font-weight: 800;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-project-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.admin-project-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.admin-project-badge {
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-project-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-project-form-new {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.05);
}

.admin-new-project-title {
  grid-column: 1 / -1;
  color: var(--accent-strong);
  font-weight: 800;
}

.admin-field-wide,
.admin-project-actions {
  grid-column: 1 / -1;
}

.admin-project-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-field .form-control,
.admin-field .form-select {
  min-height: 42px;
}

@media (max-width: 900px) {
  .admin-company-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-company-actions {
    justify-content: stretch;
  }

  .admin-company-actions .btn {
    flex: 1 1 auto;
  }

  .admin-project-form {
    grid-template-columns: 1fr;
  }

  .admin-project-head {
    flex-direction: column;
  }

  .admin-project-actions {
    justify-content: stretch;
  }

  .admin-project-actions .btn {
    flex: 1 1 auto;
  }
}

.notification-frequency-group {
  margin: .35rem 0 0;
  padding: 0;
  border: 0;
}

.notification-frequency-group legend {
  margin-bottom: .15rem;
}

.notification-frequency-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.notify-check {
  min-width: 0;
  margin-top: 0;
  padding: .62rem .58rem .62rem 2.05rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.notify-check .form-check-input {
  margin-top: .18rem;
  margin-left: -1.45rem;
}

.notify-check .form-check-label {
  color: var(--text-primary);
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .notification-frequency-options {
    grid-template-columns: 1fr;
  }
}

/* V2.0.11: administrator reviewer management and video list drag ordering */
.video-group {
  position: relative;
}

.video-drag-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: rgba(var(--surface-rgb), 0.88);
  color: var(--soft-text);
  cursor: grab;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
  transition: background 150ms ease, color 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.video-drag-handle:hover,
.video-drag-handle:focus-visible {
  color: var(--accent-strong);
  border-color: rgba(var(--accent-rgb), 0.55);
  transform: translateY(-1px);
}

.video-drag-handle:active {
  cursor: grabbing;
}

.video-group.dragging {
  opacity: 0.65;
  transform: scale(0.99);
  border-style: dashed;
}

.admin-users-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.admin-users-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-users-head h4 {
  margin: 0;
  font-size: .95rem;
  font-weight: 850;
}

.admin-users-list {
  display: grid;
  gap: 8px;
}

.admin-users-empty {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted-text);
  background: var(--surface-strong);
  font-size: .86rem;
}

.admin-user-row {
  display: grid;
  grid-template-columns: 38px repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.admin-user-row-new {
  margin-top: 10px;
  border-style: dashed;
}


.admin-company-admin-row {
  grid-template-columns: 38px repeat(4, minmax(0, 1fr));
}

.admin-user-avatar,
.admin-user-add-icon {
  align-self: center;
  justify-self: center;
}

.admin-user-add-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--control-border);
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.08);
}

.admin-notify-field,
.admin-invite-status,
.admin-user-actions {
  grid-column: 2 / -1;
}

.admin-notify-field {
  min-height: 38px;
  margin: 0;
  padding: .6rem .75rem;
  display: grid;
  gap: .3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: .82rem;
  color: var(--soft-text);
}

.admin-notify-field .form-select {
  min-height: 34px;
  font-size: .85rem;
}

.admin-invite-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-strong);
  font-size: .82rem;
  font-weight: 700;
}

.admin-user-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .admin-user-row {
    grid-template-columns: 38px 1fr;
  }

  .admin-user-row .admin-field,
  .admin-notify-field,
  .admin-invite-status,
  .admin-user-actions {
    grid-column: 2 / -1;
  }
}

@media (max-width: 640px) {
  .admin-users-head {
    flex-direction: column;
  }

  .admin-user-row {
    grid-template-columns: 1fr;
  }

  .admin-user-avatar,
  .admin-user-add-icon,
  .admin-user-row .admin-field,
  .admin-notify-field,
  .admin-invite-status,
  .admin-user-actions {
    grid-column: 1 / -1;
  }

  .admin-user-actions .btn {
    flex: 1 1 auto;
  }
}

/* V2.0.11: fullscreen video action, reviewer sort and readable rich-text lists */
.video-fullscreen-btn {
  right: 62px;
}

.video-draw-btn {
  right: 112px;
}

.video-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  background: #000000;
}

.video-frame:fullscreen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-frame:fullscreen .video-corner-btn {
  bottom: 18px;
}

.video-frame:fullscreen .video-download-btn {
  right: 18px;
}

.video-frame:fullscreen .video-fullscreen-btn {
  right: 68px;
}

.video-frame:fullscreen .video-draw-btn {
  right: 118px;
}

.video-frame:fullscreen .drawing-toolbar {
  top: 18px;
  left: 18px;
}

.comment-body,
.comment-entry p,
.rich-text-content,
.rich-text-content *,
.comment-entry-body {
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

.rich-text-content ul,
.rich-text-content ol,
.rich-text-content li,
.rich-text-content li::marker,
.rich-text-content .ql-ui::before {
  color: currentColor;
}

html[data-bs-theme="dark"] .rich-text-content,
html[data-bs-theme="dark"] .rich-text-content ul,
html[data-bs-theme="dark"] .rich-text-content ol,
html[data-bs-theme="dark"] .rich-text-content li,
html[data-bs-theme="dark"] .rich-text-content li::marker,
html[data-bs-theme="dark"] .rich-text-content .ql-ui::before {
  color: var(--body-text) !important;
}


/* V2.0.11: keep rich comment text inside cards and allow deleting own follow-up notes */
.comment-card,
.comment-entry,
.comment-body,
.comment-entry-body,
.rich-text-content {
  min-width: 0;
  max-width: 100%;
}

.comment-body,
.comment-entry p,
.rich-text-content,
.rich-text-content *,
.comment-entry-body {
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  word-break: normal !important;
  hyphens: none !important;
}

.rich-text-content a,
.rich-text-content span,
.rich-text-content strong,
.rich-text-content em,
.rich-text-content u,
.rich-text-content s {
  max-width: 100%;
}

.comment-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-bottom: 7px;
}

.comment-entry-head .comment-entry-meta {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.comment-entry-delete {
  display: inline-grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--control-border));
  border-radius: 999px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.82;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.comment-entry-delete:hover,
.comment-entry-delete:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}

/* Frame image request mode */
.frame-request-panel {
  border: 1px solid var(--border);
  background: var(--panel-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--panel-shadow);
  animation: softIn 160ms ease-out;
}

.frame-request-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.frame-request-head h3,
.frame-request-list-head h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading-text);
}

.frame-request-meta-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(150px, 0.65fr) minmax(190px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.frame-request-static {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  padding: 0 12px;
  color: var(--heading-text);
  font-weight: 700;
}

.frame-request-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 10px 0 8px;
}

.frame-request-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.frame-request-row {
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(86px, 0.28fr) minmax(220px, 1.2fr) auto;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.frame-request-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.frame-request-info {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.frame-request-info:hover .frame-request-time {
  color: var(--accent);
}

.frame-request-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--heading-text);
}

.frame-request-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--soft-text);
  overflow-wrap: anywhere;
}

.frame-request-figure-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.frame-request-figure {
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.frame-request-figure::placeholder {
  font-weight: 600;
}

.frame-request-note {
  min-height: 44px;
  resize: vertical;
  font-size: 0.88rem;
}

.frame-request-delete {
  align-self: center;
}

.frame-request-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.frame-request-actions .btn {
  white-space: nowrap;
}

.marker.frame-request-marker {
  width: 13px;
  height: 13px;
  cursor: grab;
  background: var(--accent);
  border-color: var(--panel-bg);
  border-radius: 4px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.marker.frame-request-marker.active {
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18), 0 8px 16px rgb(0 0 0 / 18%);
}

.marker.frame-request-marker.dragging {
  z-index: 4;
  cursor: grabbing;
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.22), 0 12px 24px rgb(0 0 0 / 24%);
  transform: translate(-50%, -50%) rotate(45deg) scale(1.22);
}

@media (max-width: 900px) {
  .frame-request-head,
  .frame-request-actions,
  .frame-request-list-head {
    flex-direction: column;
    align-items: stretch;
  }
  .frame-request-meta-grid,
  .frame-request-row {
    grid-template-columns: 1fr;
  }
  .frame-request-delete {
    justify-self: end;
  }
}

/* Video comparison screen */
.compare-screen {
  width: min(2400px, calc(100vw - 32px));
  margin: 16px auto 24px;
}

.compare-page {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  padding: 18px;
  min-height: calc(100vh - 32px);
}

.compare-header,
.compare-comments-head,
.compare-side-head,
.compare-transport,
.compare-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compare-header {
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.compare-header h2,
.compare-comments-head h3,
.compare-side-head h3 {
  margin: 0;
}

.compare-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .94rem;
}

.compare-header-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.compare-speed-control {
  min-width: 160px;
}

.compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.compare-side,
.compare-comments-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 14px;
}

.compare-side-badge,
.compare-comment-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-strong);
  font-weight: 800;
  font-size: .84rem;
}

.compare-video-frame {
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #020617;
  aspect-ratio: 16 / 9;
}

.compare-video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #020617;
}

.compare-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .72);
  font-weight: 700;
  text-align: center;
  padding: 18px;
}

.compare-empty[hidden] {
  display: none !important;
}

.compare-transport {
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
}

.compare-play-btn {
  min-width: 112px;
}

.compare-timeline {
  margin-top: 10px;
  cursor: pointer;
}

.compare-timeline .timeline-track {
  height: 14px;
}

.compare-marker.done {
  opacity: .55;
}

.compare-comments-panel {
  margin-top: 16px;
}

.compare-comments-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.compare-comments-list {
  display: grid;
  gap: 10px;
  max-height: min(38vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.compare-comment-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-bg);
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.compare-comment-row:hover,
.compare-comment-row:focus-visible,
.compare-comment-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
  outline: none;
}

.compare-comment-row.done {
  opacity: .78;
}

.compare-comment-meta,
.compare-comment-content,
.compare-comment-author,
.compare-comment-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.compare-comment-meta {
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.compare-comment-video-title {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}

.compare-comment-author {
  align-items: center;
  min-width: 64px;
  font-weight: 800;
  color: var(--body-text);
}

.compare-comment-body {
  min-width: 0;
  flex: 1;
}

.compare-comment-entries {
  margin-top: 10px;
  padding-left: 18px;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 8px;
}

.compare-comment-entry-author {
  min-width: 48px;
  color: var(--accent-strong);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .compare-screen {
    width: min(100vw - 20px, 2400px);
    margin-top: 10px;
  }
  .compare-page {
    padding: 12px;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .compare-comments-list {
    max-height: 48vh;
  }
}

/* Compatibility styles for the compact compare markup used by V2.0.21 */
.compare-screen > .compare-header {
  width: min(2400px, calc(100vw - 32px));
  margin: 16px auto 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  padding: 16px 18px;
}

.compare-screen > .compare-grid,
.compare-screen > .compare-comments-panel {
  width: min(2400px, calc(100vw - 32px));
  margin-left: auto;
  margin-right: auto;
}

.compare-video-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 14px;
}

.compare-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.compare-video-select {
  margin-bottom: 12px;
}

.compare-timeline-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: var(--track-bg);
  overflow: visible;
}

.compare-timeline-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
}

.compare-marker-layer {
  position: absolute;
  inset: 0;
}

.compare-marker-layer .marker {
  top: 50%;
  transform: translate(-50%, -50%);
}

@media (max-width: 1100px) {
  .compare-screen > .compare-header,
  .compare-screen > .compare-grid,
  .compare-screen > .compare-comments-panel {
    width: min(100vw - 20px, 2400px);
  }
}

/* Video comparison screen */
.compare-screen {
  width: min(2400px, calc(100vw - 24px));
  margin: 12px auto 18px;
  min-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.compare-screen[hidden] {
  display: none !important;
}

.compare-header,
.compare-video-card,
.compare-comments-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
}

.compare-title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  color: var(--text);
}

.compare-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.compare-video-card {
  padding: 14px;
  min-width: 0;
}

.compare-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.compare-card-head h3 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 720;
  color: var(--text);
  word-break: normal;
  overflow-wrap: anywhere;
}

.compare-video-select {
  margin-bottom: 12px;
}

.compare-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050507;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #050507;
}

.compare-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
}

.compare-empty[hidden] {
  display: none !important;
}

.compare-transport {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.compare-timeline {
  margin-top: 12px;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.compare-timeline-track {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: var(--track-bg);
  border: 1px solid var(--border);
  overflow: visible;
}

.compare-timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  pointer-events: none;
}

.compare-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.compare-marker-layer .marker {
  pointer-events: auto;
}

.compare-side-comments-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.compare-side-comments-head {
  align-items: flex-start;
  margin-bottom: 10px;
}

.compare-side-comments-head h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  color: var(--text);
}

.compare-side-comments-list {
  max-height: min(42vh, 460px);
}

.compare-comments-panel {
  padding: 14px;
  flex: 1;
  min-height: 240px;
}

.compare-comments-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.compare-comments-head h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 750;
  color: var(--text);
}

.compare-comments-list {
  display: grid;
  gap: 10px;
  max-height: min(38vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.compare-comment-card {
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.compare-comment-card:hover,
.compare-comment-card:focus-visible,
.compare-comment-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.compare-comment-card.done {
  opacity: .72;
}

.compare-comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .86rem;
}

.compare-side-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  color: var(--accent-contrast);
  background: var(--accent);
}

.compare-side-badge.right {
  background: var(--accent-strong);
}

.compare-time-badge {
  border: 0;
}

.compare-comment-video-title {
  font-weight: 700;
  color: var(--text);
}

.compare-comment-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.compare-comment-body-wrap,
.compare-comment-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.compare-comment-initials,
.compare-comment-entry strong {
  color: var(--accent-strong);
  font-weight: 850;
}

.compare-comment-body,
.compare-comment-entry .rich-text-content {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.compare-comment-entries {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

[data-bs-theme="dark"] .compare-video-frame,
[data-bs-theme="dark"] .compare-video-frame video {
  background: #030607;
}

@media (max-width: 980px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .compare-header {
    flex-direction: column;
  }
  .compare-screen {
    width: min(100vw - 14px, 2400px);
    margin: 7px auto 14px;
  }
}

/* Legal footer links and modal pages added in V2.0.22 */
.legal-footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--soft-text);
}

.legal-footer-link {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.legal-footer-link:hover,
.legal-footer-link:focus-visible {
  color: var(--heading-text);
  outline: none;
}

.legal-copy {
  color: var(--body-text);
  font-size: 0.95rem;
  line-height: 1.62;
}

.legal-copy h3 {
  margin: 1.05rem 0 0.4rem;
  color: var(--heading-text);
  font-size: 1rem;
  font-weight: 800;
}

.legal-copy h3:first-of-type {
  margin-top: 0;
}

.legal-copy p {
  margin: 0 0 0.85rem;
}

.legal-copy a {
  color: var(--accent-strong);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.legal-updated {
  color: var(--soft-text);
  font-size: 0.82rem;
}

.legal-copy-de {
  display: none;
}

html[lang="de"] .legal-copy-en {
  display: none;
}

html[lang="de"] .legal-copy-de {
  display: block;
}

/* V2.0.26: collapsible video library sidebar */
.app-shell.video-panel-collapsed {
  grid-template-columns: 58px minmax(0, 1fr) minmax(340px, 520px);
}

.video-panel {
  transition: width 180ms ease, min-width 180ms ease, opacity 180ms ease;
}

@media (min-width: 761px) {
  .app-shell.video-panel-collapsed .video-panel {
    height: calc(100vh - 112px);
    max-height: calc(100vh - 112px);
  }
}

.sidebar-toggle-btn {
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--accent-strong);
}

html[data-bs-theme="dark"] .sidebar-toggle-btn {
  color: var(--accent);
}

.collapsed-video-label {
  display: none;
}

.app-shell.video-panel-collapsed .video-panel {
  align-items: center;
  min-width: 0;
}

.app-shell.video-panel-collapsed .video-panel-header {
  width: 100%;
  flex-direction: column;
  justify-content: flex-start;
  padding: 12px 8px 8px;
}

.app-shell.video-panel-collapsed .video-panel-title-wrap,
.app-shell.video-panel-collapsed .video-panel #addVideoBtn,
.app-shell.video-panel-collapsed .video-panel #deleteVideoBtn,
.app-shell.video-panel-collapsed .video-panel .list-toolbar,
.app-shell.video-panel-collapsed .video-panel .video-list {
  display: none;
}

.app-shell.video-panel-collapsed .video-panel .icon-actions {
  justify-content: center;
}

.app-shell.video-panel-collapsed .collapsed-video-label {
  display: block;
  margin-top: 10px;
  color: var(--soft-text);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  user-select: none;
}

@media (min-width: 1900px) {
  .app-shell.video-panel-collapsed {
    grid-template-columns: 64px minmax(0, 1fr) minmax(420px, 580px);
  }
}

@media (max-width: 1180px) {
  .app-shell.video-panel-collapsed {
    grid-template-columns: 58px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app-shell.video-panel-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell.video-panel-collapsed .video-panel {
    min-height: 58px;
  }

  .app-shell.video-panel-collapsed .video-panel-header {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 12px;
  }

  .app-shell.video-panel-collapsed .collapsed-video-label {
    display: none;
  }
}

/* V2.0.30: safe wrapping for the right comment list.
   This reverts the V2.0.27/V2.0.28 overrides that disturbed Quill list rendering.
   Text stays inside the cards, lists keep their bullets/numbers, and very long
   unspaced strings may break only when necessary to avoid overflow. */
.comments-list .comment-card,
.comments-list .comment-entry {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.comments-list .comment-body,
.comments-list .comment-entry-body,
.comments-list .rich-text-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  white-space: normal;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  hyphens: auto !important;
  -webkit-hyphens: auto !important;
}

/* Keep manual line breaks for legacy/plain-text comments. */
.comments-list .comment-body:not(.rich-text-content),
.comments-list .comment-entry-body:not(.rich-text-content) {
  white-space: pre-wrap;
}

/* Preserve Quill list layout. Do not hide overflow or force widths on list items. */
.comments-list .rich-text-content ul,
.comments-list .rich-text-content ol {
  display: block;
  margin: 0 0 0.55rem;
  padding-left: 1.35rem;
  list-style-position: outside;
  overflow: visible;
}

.comments-list .rich-text-content li {
  display: list-item;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;
  -webkit-hyphens: auto !important;
}

.comments-list .rich-text-content li::marker {
  color: currentColor;
}

/* Long URLs must not push the card wider. */
.comments-list .rich-text-content a,
.comments-list .comment-body a,
.comments-list .comment-entry-body a {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  hyphens: auto !important;
}

/* V2.0.31: friCue upload feedback and footer spacing */
.upload-status-wrap {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: min(280px, 32vw);
}

.upload-status-wrap .status-pill {
  justify-content: center;
}

.upload-progress {
  position: relative;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.10);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.upload-progress[hidden] {
  display: none !important;
}

.upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.72), rgba(var(--accent-rgb), 1));
  transition: width 0.18s ease;
}

.status-pill.busy .status-dot {
  animation: friCueStatusPulse 0.95s ease-in-out infinite;
}

@keyframes friCueStatusPulse {
  0%, 100% { transform: scale(0.82); opacity: 0.58; }
  50% { transform: scale(1.22); opacity: 1; }
}

.legal-footer {
  margin-bottom: 26px;
  padding-bottom: 10px;
}

@media (max-width: 760px) {
  .upload-status-wrap {
    width: 100%;
    min-width: 0;
  }
}

.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.unresolved-comments-list {
  display: grid;
  gap: 12px;
}

.unresolved-video-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--control-border) 80%, transparent);
  border-radius: calc(var(--radius-lg) + 2px);
  background: color-mix(in srgb, var(--item-bg) 78%, transparent);
}

.unresolved-video-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.unresolved-video-title-wrap {
  min-width: 0;
}

.unresolved-video-title {
  margin: 0;
  color: var(--heading-text);
  font-size: 1rem;
  font-weight: 850;
}

.unresolved-video-meta {
  margin: 4px 0 0;
  color: var(--soft-text);
  font-size: 0.82rem;
}

.unresolved-video-count {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-strong) 12%, transparent);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.unresolved-video-count.is-clear {
  background: color-mix(in srgb, #16a34a 12%, transparent);
  color: #15803d;
}

.unresolved-video-comments {
  display: grid;
  gap: 10px;
}

.unresolved-video-empty {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, #16a34a 7%, transparent);
  color: var(--soft-text);
  font-size: 0.9rem;
}

.unresolved-comment-card {
  padding: 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  background: var(--item-bg);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.unresolved-comment-card:hover,
.unresolved-comment-card:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: var(--item-hover-bg);
  transform: translateY(-1px);
  outline: none;
}

.unresolved-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.unresolved-comment-video-title {
  color: var(--heading-text);
  font-size: 0.95rem;
}

.unresolved-time-badge {
  border: 0;
}

.unresolved-comment-author {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--soft-text);
  font-size: 0.82rem;
}

.unresolved-comment-body,
.unresolved-comment-entry .rich-text-content {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.unresolved-comment-entries {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--control-border);
}

.unresolved-comment-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent-strong) 5%, transparent);
}

.unresolved-comment-entry strong {
  color: var(--accent-strong);
  font-weight: 850;
}

.unresolved-comment-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.unresolved-resolve-btn {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .modal-header-actions {
    align-self: flex-start;
  }

  .unresolved-video-header {
    align-items: stretch;
    flex-direction: column;
  }

  .unresolved-video-count {
    align-self: flex-start;
  }

  .unresolved-comment-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .unresolved-comment-footer > .btn,
  .unresolved-comment-footer > .comment-status-toggle {
    justify-content: center;
    width: 100%;
  }
}

/* User-selectable video library placement. */
.app-shell.video-list-position-bottom {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  grid-template-areas:
    "stage comments"
    "videos videos";
  align-items: start;
}

.app-shell.video-list-position-bottom .stage-panel {
  grid-area: stage;
}

.app-shell.video-list-position-bottom .comments-panel {
  grid-area: comments;
}

.app-shell.video-list-position-bottom .video-panel {
  grid-area: videos;
  height: auto;
  min-height: 0;
  max-height: none;
}

.app-shell.video-list-position-bottom.video-panel-collapsed {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
}

.app-shell.video-list-position-bottom .video-panel-header {
  padding: 14px 16px 8px;
}

.app-shell.video-list-position-bottom .video-panel .list-toolbar {
  padding: 0 16px 8px;
}

.app-shell.video-list-position-bottom .video-panel .video-list {
  display: flex !important;
  min-height: 196px;
  max-height: 270px;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 4px 12px 14px;
  scroll-padding: 12px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(var(--accent-rgb), 0.42) rgba(var(--accent-rgb), 0.08);
  scrollbar-gutter: auto;
}

.app-shell.video-list-position-bottom .video-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.app-shell.video-list-position-bottom .video-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.08), transparent);
  margin: 0 12px 3px;
}

.app-shell.video-list-position-bottom .video-list::-webkit-scrollbar-thumb {
  min-width: 42px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.34);
  background-clip: content-box;
}

.app-shell.video-list-position-bottom .video-group {
  flex: 0 0 clamp(212px, 22vw, 300px);
  max-width: 300px;
  scroll-snap-align: start;
}

.app-shell.video-list-position-bottom .video-group.dragging {
  opacity: 0.68;
  transform: translateY(-2px);
}

.app-shell.video-list-position-bottom .video-group .video-item {
  padding: 10px;
}

.app-shell.video-list-position-bottom .video-thumb-wrap {
  margin-bottom: 8px;
}

.app-shell.video-list-position-bottom .video-item-title {
  margin-bottom: 6px;
  -webkit-line-clamp: 2;
}

.app-shell.video-list-position-bottom .video-group .video-item-meta {
  gap: 2px;
  font-size: 0.72rem;
}

.app-shell.video-list-position-bottom .video-group-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 10px 10px;
}

.app-shell.video-list-position-bottom .video-group-actions .btn {
  min-height: 32px;
  padding: 0.3rem 0.4rem;
  font-size: 0.74rem;
}

.app-shell.video-list-position-bottom .video-versions {
  max-height: 88px;
  margin: 0 10px 10px;
  overflow: auto;
  scrollbar-width: thin;
}

.app-shell.video-list-position-bottom .video-versions summary {
  padding: 7px 0 5px;
}

.app-shell.video-list-position-bottom .video-panel #toggleVideoPanelBtn,
.app-shell.video-list-position-bottom .collapsed-video-label {
  display: none !important;
}

.app-shell.video-list-position-bottom.video-panel-collapsed .video-panel {
  align-items: stretch;
}

.app-shell.video-list-position-bottom.video-panel-collapsed .video-panel-header {
  width: auto;
  flex-direction: row;
  justify-content: space-between;
  padding: 14px 16px 8px;
}

.app-shell.video-list-position-bottom.video-panel-collapsed .video-panel-title-wrap,
.app-shell.video-list-position-bottom.video-panel-collapsed .video-panel #addVideoBtn,
.app-shell.video-list-position-bottom.video-panel-collapsed .video-panel #deleteVideoBtn,
.app-shell.video-list-position-bottom.video-panel-collapsed .video-panel .list-toolbar,
.app-shell.video-list-position-bottom.video-panel-collapsed .video-panel .video-list {
  display: flex !important;
}

.app-shell.video-list-position-bottom.video-panel-collapsed .video-panel-title-wrap {
  display: block !important;
}

@media (max-width: 1180px) {
  .app-shell.video-list-position-bottom,
  .app-shell.video-list-position-bottom.video-panel-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "stage"
      "videos"
      "comments";
  }

  .app-shell.video-list-position-bottom .comments-panel {
    min-height: 380px;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .app-shell.video-list-position-bottom .stage-panel {
    order: 1;
  }

  .app-shell.video-list-position-bottom .video-panel {
    order: 2;
    min-height: 260px;
    max-height: none;
  }

  .app-shell.video-list-position-bottom .comments-panel {
    order: 3;
  }

  .app-shell.video-list-position-bottom .video-panel .video-list {
    min-height: 178px;
    max-height: 230px;
  }

  .app-shell.video-list-position-bottom .video-group {
    flex-basis: min(76vw, 280px);
  }
}

/* Compact horizontal card shape for the bottom video-list layout. */
.app-shell.video-list-position-bottom .video-panel .video-list {
  min-height: 170px;
  max-height: 235px;
}

.app-shell.video-list-position-bottom .video-group {
  flex-basis: clamp(280px, 24vw, 380px);
  max-width: 380px;
}

.app-shell.video-list-position-bottom .video-group .video-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  column-gap: 10px;
  padding: 10px;
}

.app-shell.video-list-position-bottom .video-thumb-wrap {
  grid-row: 1 / 3;
  width: 96px;
  aspect-ratio: 16 / 9;
  margin-bottom: 0;
}

.app-shell.video-list-position-bottom .video-item-title-row,
.app-shell.video-list-position-bottom .video-item-title,
.app-shell.video-list-position-bottom .video-group .video-item-meta {
  grid-column: 2;
}

.app-shell.video-list-position-bottom .video-group .video-item-meta {
  max-height: 72px;
  overflow: hidden;
}

.app-shell.video-list-position-bottom .video-comment-status-badge {
  min-width: 26px;
  min-height: 23px;
  padding: 2px 6px;
  font-size: 0.68rem;
}

@media (max-width: 760px) {
  .app-shell.video-list-position-bottom .video-panel .video-list {
    min-height: 168px;
    max-height: 230px;
  }

  .app-shell.video-list-position-bottom .video-group {
    flex-basis: min(86vw, 340px);
  }
}

/* V2.0.69: OR Sequence Builder / CombiPlayer layout toggle. */
.sequence-screen {
  width: min(2600px, 100%);
  min-height: calc(100vh - 94px);
  margin: 0 auto;
  padding: 14px;
}

.sequence-header,
.sequence-toolbar,
.sequence-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}

.sequence-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  margin-bottom: 14px;
}

.sequence-title {
  margin: 0;
  color: var(--heading-text);
  font-size: clamp(1.35rem, 1.6vw, 1.9rem);
  font-weight: 750;
}

.sequence-subtitle,
.sequence-card-help {
  margin: 0;
  color: var(--soft-text);
}

.sequence-header-actions,
.sequence-toolbar-actions,
.sequence-player-controls,
.sequence-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sequence-toolbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(240px, 1fr) minmax(150px, 190px) minmax(160px, 210px) auto;
  align-items: end;
  gap: 12px;
  overflow: visible;
  padding: 14px;
  margin-bottom: 14px;
}

.sequence-toolbar:focus-within {
  z-index: 2200;
}

.sequence-toolbar-field {
  display: grid;
  gap: 5px;
  color: var(--soft-text);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sequence-name-field {
  min-width: 0;
}

.sequence-picker-field {
  position: relative;
  z-index: 60;
  min-height: 58px;
}

.sequence-picker-field:focus-within {
  z-index: 2600;
}

.sequence-overlay-field {
  min-width: 0;
}

.sequence-overlay-toggle {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 0;
  padding: 0.42rem 0.65rem 0.42rem 2.6rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--control-bg);
  text-transform: none;
  letter-spacing: normal;
}

.sequence-overlay-toggle .form-check-label {
  color: var(--body-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.sequence-select-control {
  position: relative;
  z-index: 2;
}

.sequence-select-control.sequence-select-expanded {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 38px);
  z-index: 2800;
  min-height: 0;
  height: auto;
  max-height: min(360px, calc(100vh - 170px));
  overflow-y: auto;
  border-color: rgba(var(--accent-rgb), 0.55);
  background-color: var(--control-bg);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

html[data-bs-theme="dark"] .sequence-select-control.sequence-select-expanded {
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.52);
}

.sequence-select-control.sequence-select-expanded option {
  padding: 0.45rem 0.65rem;
  color: var(--body-text);
  background: var(--control-bg);
}

.sequence-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: clamp(190px, 14vw, 240px) clamp(230px, 17vw, 310px) minmax(560px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.sequence-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.sequence-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 7px;
}

.sequence-card-head h3 {
  margin: 0;
  color: var(--heading-text);
  font-size: 1.05rem;
  font-weight: 750;
}

.sequence-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  min-height: 1.65rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.1);
  font-size: 0.78rem;
  font-weight: 800;
}

html[data-bs-theme="dark"] .sequence-count-pill {
  color: var(--accent);
}

.sequence-card-help {
  padding: 0 14px 10px;
  font-size: 0.82rem;
}

.sequence-library-sort-row {
  display: grid;
  gap: 5px;
  padding: 0 14px 10px;
  color: var(--soft-text);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.sequence-library-sort-row .form-select {
  min-height: 34px;
  color: var(--body-text);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: normal;
  text-transform: none;
}

.sequence-available-list,
.sequence-items-list {
  display: flex;
  flex: 1 1 auto;
  min-height: 360px;
  max-height: calc(100vh - 310px);
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 0 10px 12px;
  scrollbar-color: rgba(var(--accent-rgb), 0.42) rgba(var(--accent-rgb), 0.08);
  scrollbar-width: thin;
}

.sequence-items-list.drop-ready {
  outline: 2px dashed rgba(var(--accent-rgb), 0.38);
  outline-offset: -8px;
  background: rgba(var(--accent-rgb), 0.04);
}

.sequence-video-card,
.sequence-item {
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  color: var(--body-text);
  background: var(--item-bg);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.sequence-video-card {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  cursor: grab;
}

.sequence-video-card:hover,
.sequence-video-card:focus-visible,
.sequence-item:hover,
.sequence-item.active {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: var(--item-hover-bg);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.sequence-video-card.dragging,
.sequence-item.dragging {
  opacity: 0.62;
  transform: scale(0.985);
}

.sequence-video-card .video-thumb-wrap {
  width: 64px;
  aspect-ratio: 16 / 9;
  margin: 0;
}

.sequence-video-card-body,
.sequence-item-body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.sequence-video-card-body strong,
.sequence-item-body strong {
  overflow: hidden;
  color: var(--heading-text);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequence-video-card-body span,
.sequence-item-body span {
  overflow: hidden;
  color: var(--soft-text);
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequence-add-btn,
.sequence-icon-btn,
.sequence-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--control-bg);
}

.sequence-add-btn:hover,
.sequence-icon-btn:hover,
.sequence-drag-handle:hover {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: var(--control-hover-bg);
}

.sequence-icon-btn.danger {
  color: var(--danger);
}

.sequence-add-btn:disabled,
.sequence-icon-btn:disabled,
.sequence-drag-handle:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.sequence-item {
  grid-template-columns: 30px 34px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
}

.sequence-item-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.12);
  font-size: 0.74rem;
  font-weight: 800;
}

.sequence-video-frame {
  position: relative;
  margin: 0 16px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--video-bg);
  aspect-ratio: 16 / 9;
}

.sequence-player-card .sequence-video-frame {
  min-height: min(58vh, 720px);
}

.sequence-video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--video-bg);
}

.sequence-video-overlay {
  position: absolute;
  top: clamp(10px, 1.5vw, 22px);
  left: clamp(10px, 1.5vw, 22px);
  z-index: 3;
  display: grid;
  gap: 4px;
  max-width: min(46%, 560px);
  max-height: 58%;
  margin: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(6, 12, 24, 0.38);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  list-style: none;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.sequence-video-overlay[hidden] {
  display: none;
}

.sequence-video-overlay li {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  align-items: baseline;
  gap: 7px;
  padding: 4px 7px;
  border-radius: 9px;
  font-size: clamp(0.68rem, 0.72vw, 0.86rem);
  line-height: 1.18;
}

.sequence-video-overlay li.active {
  color: #fff;
  background: rgba(var(--accent-rgb), 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

.sequence-video-overlay li.ellipsis {
  color: rgba(255, 255, 255, 0.66);
  font-style: italic;
}

.sequence-video-overlay-number {
  font-weight: 850;
  opacity: 0.86;
}

.sequence-video-overlay-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequence-empty-player {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 24px;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  background: radial-gradient(circle at center, rgba(var(--accent-rgb), 0.18), transparent 60%), var(--video-bg);
}

.sequence-empty-player i {
  font-size: 2rem;
}

.sequence-player-controls {
  justify-content: center;
  padding: 14px 16px 10px;
}

.sequence-time-panel {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.sequence-time-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.sequence-time-panel span {
  color: var(--soft-text);
  font-size: 0.8rem;
}

.sequence-time-panel strong {
  min-width: 0;
  overflow: hidden;
  color: var(--heading-text);
  font-size: 0.88rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequence-drop-empty {
  border: 1px dashed rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.05);
}

/* Detailed columns restores the wider V2.0.56 clip-list layout for better readability. */
.sequence-screen.sequence-layout-detailed {
  width: min(2400px, 100%);
}

.sequence-screen.sequence-layout-detailed .sequence-grid {
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.05fr) minmax(420px, 1.35fr);
  gap: 14px;
}

.sequence-screen.sequence-layout-detailed .sequence-card-head {
  padding: 16px 16px 8px;
}

.sequence-screen.sequence-layout-detailed .sequence-card-help {
  padding: 0 16px 12px;
  font-size: 0.88rem;
}

.sequence-screen.sequence-layout-detailed .sequence-library-sort-row {
  padding: 0 16px 12px;
}

.sequence-screen.sequence-layout-detailed .sequence-available-list,
.sequence-screen.sequence-layout-detailed .sequence-items-list {
  gap: 10px;
  padding: 0 12px 14px;
}

.sequence-screen.sequence-layout-detailed .sequence-video-card {
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px;
}

.sequence-screen.sequence-layout-detailed .sequence-video-card .video-thumb-wrap {
  width: 92px;
}

.sequence-screen.sequence-layout-detailed .sequence-video-card-body strong,
.sequence-screen.sequence-layout-detailed .sequence-item-body strong {
  font-size: 0.9rem;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sequence-screen.sequence-layout-detailed .sequence-video-card-body span,
.sequence-screen.sequence-layout-detailed .sequence-item-body span {
  font-size: 0.78rem;
}

.sequence-screen.sequence-layout-detailed .sequence-add-btn,
.sequence-screen.sequence-layout-detailed .sequence-icon-btn,
.sequence-screen.sequence-layout-detailed .sequence-drag-handle {
  width: 34px;
  height: 34px;
}

.sequence-screen.sequence-layout-detailed .sequence-item {
  grid-template-columns: 34px 38px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
}

.sequence-screen.sequence-layout-detailed .sequence-item-number {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

@media (max-width: 1320px) {
  .sequence-screen.sequence-layout-detailed .sequence-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr);
  }

  .sequence-screen.sequence-layout-detailed .sequence-player-card {
    grid-column: 1 / -1;
  }

  .sequence-screen.sequence-layout-detailed .sequence-available-list,
  .sequence-screen.sequence-layout-detailed .sequence-items-list {
    max-height: 420px;
  }
}

@media (max-width: 1180px) {
  .sequence-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  }

  .sequence-toolbar-actions {
    grid-column: 1 / -1;
  }

  .sequence-grid {
    grid-template-columns: minmax(220px, 0.86fr) minmax(260px, 1fr);
  }

  .sequence-player-card {
    grid-column: 1 / -1;
  }

  .sequence-available-list,
  .sequence-items-list {
    max-height: 420px;
  }
}

@media (max-width: 860px) {
  .sequence-header,
  .sequence-toolbar {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .sequence-toolbar {
    display: grid;
  }

  .sequence-header-actions,
  .sequence-toolbar-actions {
    width: 100%;
  }

  .sequence-header-actions .btn,
  .sequence-toolbar-actions .btn {
    flex: 1 1 180px;
  }

  .sequence-grid {
    grid-template-columns: 1fr;
  }

  .sequence-available-list,
  .sequence-items-list {
    min-height: 240px;
    max-height: none;
  }

  .sequence-video-card,
  .sequence-item {
    grid-template-columns: 72px minmax(0, 1fr) auto;
  }

  .sequence-video-card .video-thumb-wrap {
    width: 72px;
  }

  .sequence-player-card .sequence-video-frame {
    min-height: 0;
  }

  .sequence-item {
    grid-template-columns: 32px 34px minmax(0, 1fr);
  }

  .sequence-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}


@media (max-width: 860px) {
  .sequence-screen.sequence-layout-detailed .sequence-grid {
    grid-template-columns: 1fr;
  }

  .sequence-screen.sequence-layout-detailed .sequence-available-list,
  .sequence-screen.sequence-layout-detailed .sequence-items-list {
    min-height: 240px;
    max-height: none;
  }

  .sequence-screen.sequence-layout-detailed .sequence-video-card,
  .sequence-screen.sequence-layout-detailed .sequence-item {
    grid-template-columns: 72px minmax(0, 1fr) auto;
  }

  .sequence-screen.sequence-layout-detailed .sequence-video-card .video-thumb-wrap {
    width: 72px;
  }

  .sequence-screen.sequence-layout-detailed .sequence-item {
    grid-template-columns: 32px 34px minmax(0, 1fr);
  }

  .sequence-screen.sequence-layout-detailed .sequence-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* V2.0.69: OR Sequence MP4 export modal and progress UI. */
.sequence-export-modal .modal-body {
  display: grid;
  gap: 14px;
}

.sequence-export-progress {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.sequence-export-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--heading-text);
}

.sequence-export-progress-head span {
  color: var(--accent-strong);
  font-weight: 850;
}

.sequence-export-progress .progress {
  height: 0.8rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  overflow: hidden;
}

.sequence-export-progress .progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 320ms ease;
}

.sequence-export-result {
  display: grid;
  gap: 10px;
}

.sequence-export-result video {
  display: block;
  width: 100%;
  max-height: min(68vh, 760px);
  border-radius: var(--radius-lg);
  background: var(--video-bg);
}

/* V2.0.69: keep the source video library fully readable while frame image requests are open. */
.app-shell.frame-request-active {
  align-items: stretch;
}

.app-shell.frame-request-active .video-panel {
  align-self: stretch;
  height: calc(100vh - 112px);
  min-height: 0;
  max-height: calc(100vh - 112px);
}

.app-shell.frame-request-active .video-panel .video-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

@media (max-width: 760px) {
  .app-shell.frame-request-active .video-panel {
    height: auto;
    min-height: 330px;
    max-height: min(70vh, 560px);
  }
}

/* V2.0.69: visible unresolved-comment status and filters in the video library. */

/* V2.0.69: compact, paginated project activity log. */
.activity-log-modal .modal-body {
  display: grid;
  gap: 14px;
}

.activity-log-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(180px, 1fr) minmax(220px, 1.3fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.activity-log-controls .admin-field {
  margin: 0;
}

.activity-log-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.activity-log-retention-note {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.82rem;
}

.activity-log-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 680px);
  min-height: 180px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.45) transparent;
}

.activity-log-list::-webkit-scrollbar {
  width: 8px;
}

.activity-log-list::-webkit-scrollbar-track {
  background: transparent;
}

.activity-log-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.35);
}

.activity-log-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  background: rgba(var(--surface-rgb), 0.82);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.activity-log-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
}

.activity-log-body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.activity-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.activity-log-head strong {
  color: var(--heading-text);
  font-size: 0.95rem;
}

.activity-log-head span {
  color: var(--muted-text);
  font-size: 0.78rem;
  white-space: nowrap;
}

.activity-log-summary {
  margin: 0;
  color: var(--body-text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.activity-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.activity-log-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--soft-text);
  background: var(--surface-muted);
  border: 1px solid var(--control-border);
  font-size: 0.74rem;
  line-height: 1.2;
}

.activity-log-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-log-details {
  margin-top: 2px;
  color: var(--muted-text);
  font-size: 0.78rem;
}

.activity-log-details summary {
  cursor: pointer;
  width: fit-content;
  color: var(--accent-strong);
  font-weight: 700;
}

.activity-log-details pre {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--control-border);
  background: var(--surface-muted);
  color: var(--soft-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.activity-log-footer {
  display: flex;
  justify-content: center;
}

@media (max-width: 1060px) {
  .activity-log-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-log-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .activity-log-controls {
    grid-template-columns: 1fr;
  }

  .activity-log-entry {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
  }

  .activity-log-icon {
    width: 32px;
    height: 32px;
  }
}
