@font-face {
  font-family: 'NoeDisplay';
  src: url('assets/fonts/NoeDisplay-Bold.otf') format('opentype');
  font-weight: bold;
  font-display: swap;
}

@font-face {
  font-family: 'Thicccboi';
  src: url('assets/fonts/THICCCBOI-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Thicccboi';
  src: url('assets/fonts/THICCCBOI-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Thicccboi';
  src: url('assets/fonts/THICCCBOI-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #1a3a3f;
  --surface: #213f44;
  --surface-alt: #1e3539;
  --border: rgba(49, 191, 228, 0.15);
  --text: #e8e2d6;
  --text-dim: #8a9e9e;
  --accent: #31bfe4;
  --accent-hover: #28a0c0;
  --red: #e05252;
  --orange: #d29922;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Thicccboi', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  height: 96px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo { width: 64px; height: 64px; }

header h1 {
  font-family: 'NoeDisplay', Georgia, serif;
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
}

.version {
  font-family: 'Thicccboi', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 8px;
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Language switcher (DA / EN) ── */

.lang-switch {
  gap: 8px;
  font-family: 'Thicccboi', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lang-switch .lang-opt {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.lang-switch .lang-opt:hover { color: var(--text); }

.lang-switch .lang-sep {
  color: var(--text-dim);
  opacity: 0.45;
}

html[data-lang="da"] .lang-switch .lang-opt[data-lang-opt="da"],
html[data-lang="en"] .lang-switch .lang-opt[data-lang-opt="en"] {
  color: var(--accent);
  cursor: default;
}

nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover { color: var(--accent); }

.nav-prefs-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  height: 32px;
  width: 32px;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}

.nav-prefs-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Main ── */

main {
  max-width: 728px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 80px;

  display: flex;
  flex-direction: column;
  gap: 32px;
}

main.wide { max-width: 848px; }

/* ── Section headers ── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.section-count {
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Form fields ── */

.field { margin-bottom: 24px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  padding: 0 16px;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

input[type="text"]:focus { border-color: var(--accent); }
input[type="text"]::placeholder { color: var(--text-dim); opacity: 0.6; }

/* ── File drop ── */

.file-drop {
  width: 100%;
  padding: 40px 24px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.file-drop:hover,
.file-drop.dragover {
  border-color: var(--accent);
  background: rgba(49, 191, 228, 0.03);
}

.file-drop-icon {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.file-drop-hint {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.6;
  margin-top: 8px;
}

/* ── Film list ── */

.film-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.film-row {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 16px;
  height: 48px;
  gap: 8px;
}

.film-icon { font-size: 14px; opacity: 0.4; flex-shrink: 0; }

.film-info { flex: 1; min-width: 0; }

.film-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.film-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}

.film-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 8px;
  border-radius: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.film-remove:hover { color: var(--red); }

.btn-add-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-family: inherit;
  margin-top: 8px;
}

.btn-add-more:hover { border-color: var(--accent); color: var(--accent); }

/* ── Language chips ── */

.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  transition: border-color 0.2s, color 0.2s;
}

.lang-chip:hover { border-color: var(--accent); }

.lang-chip input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.lang-chip.checked {
  border-color: rgba(49, 191, 228, 0.4);
  color: var(--text);
}

/* ── Buttons ── */

.btn-primary {
  padding: 0 32px;
  height: 48px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--text-dim); cursor: not-allowed; }
.btn-primary.muted { background: var(--surface); color: var(--text-dim); opacity: 0.5; }

.btn-secondary {
  padding: 0 24px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-secondary:hover { border-color: var(--accent); }

.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 32px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.btn-small:hover { border-color: var(--accent); color: var(--accent); }

.btn-small.accent {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-small.accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-small.danger:hover { border-color: var(--red); color: var(--red); }

.btn-zip {
  min-width: 128px;
  text-align: center;
  display: inline-block;
}

/* ── Progress ── */

.progress-section {
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.progress-overall {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
}

.progress-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(49, 191, 228, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-films {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-film {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.progress-film-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-film-name { font-size: 13px; font-weight: 600; color: var(--text); }
.progress-film-status { font-size: 11px; color: var(--text-dim); }
.progress-film-status.active { color: var(--accent); }
.progress-film-status.done { color: var(--accent); opacity: 0.6; }

/* ── Results ── */

.results-film { margin-bottom: 24px; }

.results-film-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.results-film-header small {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 8px;
}

.result-row {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  gap: 10px;
}

.result-row:hover { border-color: rgba(49, 191, 228, 0.35); }

.result-lang { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.result-lang small { font-weight: 400; font-size: 12px; color: var(--text-dim); margin-left: 8px; }

.result-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.badge-source { background: rgba(49, 191, 228, 0.15); color: var(--accent); }
.badge-warning { background: rgba(210, 153, 34, 0.15); color: var(--orange); }

.result-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.download-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.download-link:hover { color: var(--text); }

.footer-actions { display: flex; gap: 12px; margin-top: 4px; }

/* ── View toggle (projects page) ── */

.view-toggle {
  position: relative;
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  height: 30px;
  width: 160px;
  flex-shrink: 0;
  align-items: center;
  margin-bottom: 12px;
}

.view-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 6px);
  width: calc(50% - 3px);
  background: var(--accent);
  border-radius: 4px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.view-toggle[data-active="language"] .view-slider { transform: translateX(100%); }

.view-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: inherit;
}

.view-btn.active { color: var(--bg); font-weight: 600; }

/* ── Project cards ── */

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.project-card:hover { border-color: rgba(49, 191, 228, 0.35); }

.project-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  cursor: pointer;
}

.project-info { flex: 1; min-width: 0; }
.project-name { font-size: 14px; font-weight: 600; color: var(--text); }
.project-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.status-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}

.status-complete { background: rgba(49, 191, 228, 0.15); color: var(--accent); }
.status-processing { background: rgba(210, 153, 34, 0.15); color: var(--orange); }
.status-empty { background: rgba(138, 158, 158, 0.1); color: var(--text-dim); }

.project-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.toggle-icon {
  color: var(--text-dim);
  font-size: 10px;
  flex-shrink: 0;
  transition: transform 0.2s;
  width: 14px;
}

.project-card.expanded > .project-header > .toggle-icon { transform: rotate(90deg); }

.project-body {
  display: none;
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.project-card.expanded > .project-body { display: block; }

.loading-detail {
  padding: 20px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* ── Film cards (nested) ── */

.film-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.film-card:hover { border-color: rgba(49, 191, 228, 0.3); }

.film-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
  cursor: pointer;
}

.film-card-icon {
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.2s;
  width: 12px;
}

.film-card.expanded > .film-header > .film-card-icon { transform: rotate(90deg); }

.film-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.film-languages {
  display: none;
  padding: 0 14px 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.film-card.expanded > .film-languages { display: block; }

/* ── Lang rows ── */

.lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(49, 191, 228, 0.07);
}

.lang-row:last-child { border-bottom: none; }

.lang-name { font-size: 12px; font-weight: 500; color: var(--text); }
.lang-name small { font-weight: 400; color: var(--text-dim); margin-left: 4px; }

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

.warning-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  margin-right: 8px;
}

/* ── Language group cards (By Language view) ── */

.lang-group-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.lang-group-card:hover { border-color: rgba(49, 191, 228, 0.3); }

.lang-group-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
  cursor: pointer;
}

.lang-group-icon {
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.2s;
  width: 12px;
}

.lang-group-card.expanded > .lang-group-header > .lang-group-icon { transform: rotate(90deg); }

.lang-group-info { flex: 1; min-width: 0; }
.lang-group-name { font-size: 13px; font-weight: 600; color: var(--text); }
.lang-group-name small { font-weight: 400; font-size: 12px; color: var(--text-dim); margin-left: 8px; }
.lang-group-meta { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.lang-group-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.lang-group-files {
  display: none;
  padding: 0 14px 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.lang-group-card.expanded > .lang-group-files { display: block; }

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(49, 191, 228, 0.07);
}

.file-row:last-child { border-bottom: none; }

.file-name { font-size: 12px; font-weight: 500; color: var(--text); }
.file-name small { font-weight: 400; color: var(--text-dim); margin-left: 4px; }
.file-actions { display: flex; align-items: center; gap: 8px; }

/* ── Delete dialog ── */

.dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.dialog-overlay.visible { display: flex; }

.dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 28px 22px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.dialog-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(224, 82, 82, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 18px;
  color: var(--red);
}

.dialog h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.dialog p { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-bottom: 20px; }
.dialog p strong { color: var(--text); }

.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }

.dialog-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}

.dialog-btn.cancel { background: transparent; color: var(--text-dim); }
.dialog-btn.cancel:hover { border-color: var(--accent); color: var(--text); }
.dialog-btn.confirm-delete { background: var(--red); color: #fff; border-color: var(--red); }
.dialog-btn.confirm-delete:hover { background: #c94444; border-color: #c94444; }

/* ── Processing notice ── */

.processing-notice {
  font-size: 12px;
  color: var(--orange);
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.processing-text {
  font-weight: 600;
  margin-bottom: 8px;
}
.processing-bar-track {
  height: 8px;
  background: rgba(210, 153, 34, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.processing-bar-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.processing-hint {
  font-size: 11px;
  opacity: 0.7;
}

/* ── SRT preview ── */

.srt-preview {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 420px;
  overflow-y: auto;
}

/* ── Video player dialog ── */

.player-dialog {
  max-width: 840px;
  width: 95%;
  padding: 0;
  overflow: hidden;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.player-header h3 { margin: 0; font-size: 14px; }

.player-header .dialog-btn {
  padding: 4px 10px;
  font-size: 18px;
  line-height: 1;
  border: none;
}

/* ── Video viewport ── */

.player-viewport {
  background: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.player-viewport video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Player spinner ── */

.player-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  pointer-events: none;
  z-index: 5;
  display: none;
  animation: playerSpin 2s linear infinite;
}

.player-spinner.visible { display: block; }

@keyframes playerSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Custom tooltips ── */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background: var(--accent);
  color: var(--bg);
  font-family: 'Thicccboi', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  padding: 8px 14px;
  border-radius: 6px;
  width: max-content;
  max-width: 320px;
  white-space: pre-line;
  text-align: center;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}

/* Persistent state — tooltip stays visible regardless of hover */
[data-tooltip].tooltip-persistent::after,
[data-tooltip].tooltip-persistent::before {
  opacity: 1 !important;
}
[data-tooltip].tooltip-persistent::after {
  transform: translateX(-50%) scale(1) !important;
}
/* Keep the controls bar fully visible while a persistent tooltip is active */
.player-controls:has(.tooltip-persistent) { opacity: 1; }

/* Disabled state — tooltip suppressed entirely (no hover, no persistent) */
[data-tooltip].tooltip-disabled::after,
[data-tooltip].tooltip-disabled::before {
  display: none !important;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

[data-tooltip]:hover::before {
  opacity: 1;
}

/* ── Ready overlay (dimmed video + play prompt) ── */

.player-ready-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
  transition: opacity 0.3s;
}

.player-ready-overlay.hidden {
  display: none;
}

.player-ready-text {
  font-family: 'Thicccboi', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  background: rgba(0, 0, 0, 0.5);
  padding: 14px 28px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

/* ── Bottom stack: edit hint + subtitle, always consistent gap ── */

.player-bottom-stack {
  position: absolute;
  bottom: var(--burn-margin-bottom, 40px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  pointer-events: none;
  z-index: 2;
  padding: 0 20px;
}

/* ── Subtitle overlay ── */

.player-subs-overlay {
  text-align: center;
  pointer-events: none;
  width: 100%;
}

.player-subs-overlay.clickable {
  pointer-events: auto;
  cursor: pointer;
}

.player-subs-overlay span {
  display: inline-block;
  background: rgba(0, 0, 0, var(--burn-bg-alpha, 0.75));
  color: #fff;
  font-size: var(--burn-font-size, 16px);
  line-height: 1.5;
  padding: var(--burn-padding, 4px) calc(var(--burn-padding, 4px) + 10px);
  border-radius: 4px;
  font-family: var(--burn-font-family, inherit);
}

.player-subs-overlay span.burn-preview-sample {
  opacity: 0.55;
  font-style: italic;
}

/* ── Edit hint button (above subtitle, consistent gap via flex) ── */

.player-edit-hint {
  z-index: 6;
  background: var(--accent);
  color: var(--bg);
  font-family: 'Thicccboi', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: editHintPulse 1.8s ease-in-out infinite;
  transition: transform 0.15s, background 0.15s;
}

.player-edit-hint:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.player-edit-hint.hidden { display: none; }

@keyframes editHintPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(49, 191, 228, 0.3); }
  50% { box-shadow: 0 4px 24px rgba(49, 191, 228, 0.6); }
}


/* ── Inline subtitle editing ── */

.inline-edit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.85);
  padding: 8px 12px;
  border-radius: 6px;
  width: 90%;
  max-width: 700px;
  margin: 0 auto;
}

.inline-edit-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  padding: 4px 10px;
  border-radius: 4px;
  resize: none;
  flex: 1;
  min-height: 52px;
}

.inline-edit-input:focus {
  outline: none;
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.15);
}

.inline-edit-update {
  flex-shrink: 0;
  align-self: center;
}

/* ── Custom controls bar ── */

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  opacity: 0.45;
  transition: opacity 0.25s;
}

.player-dialog:hover .player-controls,
.player-controls:hover { opacity: 1; }

.pc-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color 0.2s;
}

.pc-btn .pc-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
}

.pc-play { width: 32px; }
.pc-step-back, .pc-step-fwd { width: 28px; }

.pc-mute .pc-icon-muted { display: none; }
.pc-mute.muted .pc-icon-vol { display: none; }
.pc-mute.muted .pc-icon-muted { display: block; }

.pc-btn:hover { color: var(--text); }

.pc-time {
  font-size: 11px;
  color: var(--text-dim);
  min-width: 80px;
  font-variant-numeric: tabular-nums;
}

.pc-progress {
  flex: 1;
  height: 8px;
  background: rgba(49, 191, 228, 0.10);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pc-buffer-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: rgba(49, 191, 228, 0.25);
  border-radius: 4px;
}

.pc-progress-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.1s linear;
  z-index: 1;
}

.pc-volume {
  width: 60px;
  accent-color: var(--accent);
  cursor: pointer;
}

.pc-fullscreen { font-size: 14px; }

/* ── Subtitle picker ── */

.player-subtitle-picker {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.subs-chip.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.subs-chip.pending {
  opacity: 0.45;
  border-style: dashed;
  cursor: pointer;
}

.subs-chip.pending:hover {
  opacity: 0.85;
  border-color: var(--accent);
  color: var(--accent);
}

/* Loading state keeps the dashed pending border but animates it
   subtly — "marching ants" effect so the stiplede liner crawl
   around the chip at a gentle pace. No size change, no flashy spinner. */
.subs-chip.ready {
  border-color: rgba(49, 191, 228, 0.8);
  color: var(--accent);
  background: rgba(49, 191, 228, 0.08);
  animation: subsChipReadyPulse 1.8s ease-in-out infinite;
}

.subs-chip.ready:hover {
  background: rgba(49, 191, 228, 0.15);
}

@keyframes subsChipReadyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(49, 191, 228, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(49, 191, 228, 0); }
}

.subs-chip.pending.loading {
  opacity: 0.95;
  cursor: wait;
  border-style: solid;
  border-color: transparent;
  background-image:
    linear-gradient(90deg, var(--accent) 50%, transparent 50%),
    linear-gradient(90deg, var(--accent) 50%, transparent 50%),
    linear-gradient(0deg,  var(--accent) 50%, transparent 50%),
    linear-gradient(0deg,  var(--accent) 50%, transparent 50%);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-size: 10px 1.5px, 10px 1.5px, 1.5px 10px, 1.5px 10px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  animation: subsChipMarchingAnts 1.6s linear infinite;
}

@keyframes subsChipMarchingAnts {
  100% {
    background-position: 10px 0, -10px 100%, 0 -10px, 100% 10px;
  }
}

/* ── SRT buttons in subtitle picker ── */

.player-subtitle-picker .srt-view {
  margin-left: auto;
}

/* ── Burn-in options (font, size, placement, transparency, padding) ── */

.player-burn-options {
  padding: 6px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-burn-options.hidden { display: none; }

.burn-opt-preview-label {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.8;
  letter-spacing: 0.02em;
}

.burn-opt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 14px;
}

.burn-opt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--text);
}

.burn-opt-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.02em;
}

.burn-opt-value {
  font-variant-numeric: tabular-nums;
  color: var(--accent, #31bfe4);
  font-weight: 600;
}

.burn-opt select,
.burn-opt input[type="range"] {
  width: 100%;
  font-family: inherit;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 3px 6px;
  box-sizing: border-box;
}

.burn-opt input[type="range"] {
  padding: 0;
  accent-color: var(--accent, #31bfe4);
}

.burn-opt-hint {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.7;
  font-style: italic;
}

/* ── Burn-in row ── */
/* Placed directly below .player-subtitle-picker. Same horizontal padding
   so the button's right edge aligns with .srt-export above it. */

.player-burn-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 0 18px 10px;
  min-height: 32px;
}

.player-burn-row .hidden { display: none; }

.srt-burn.disabled,
.srt-burn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.srt-burn-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 320px;
  min-width: 220px;
}

.srt-burn-progress-bar {
  flex: 1 1 auto;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.srt-burn-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.srt-burn-progress-fill.indeterminate {
  width: 40% !important;
  animation: srtBurnIndeterminate 1.4s ease-in-out infinite;
}

@keyframes srtBurnIndeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.srt-burn-progress-label {
  font-size: 12px;
  color: var(--text-dim);
  min-width: 56px;
  text-align: right;
}

.srt-burn-cancel,
.srt-burn-dismiss,
.srt-burn-retry {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.srt-burn-cancel:hover,
.srt-burn-dismiss:hover,
.srt-burn-retry:hover {
  color: var(--text);
  border-color: var(--accent);
}

.srt-burn-done,
.srt-burn-error {
  display: flex;
  align-items: center;
  gap: 10px;
}

.srt-burn-download {
  text-decoration: none;
}

.srt-burn-error-msg {
  color: #e87a7a;
  font-size: 12px;
}

/* ── SRT Fullscreen Overlay ── */

.srt-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.srt-fullscreen-panel {
  background: var(--surface);
  border-radius: 8px;
  width: 90vw;
  max-width: 808px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.srt-fullscreen-header {
  margin-bottom: 16px;
}

.srt-fullscreen-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.srt-fullscreen-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.srt-fullscreen-chips .subs-chip.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.srt-fullscreen-cancel {
  background: transparent !important;
  color: var(--text-dim) !important;
  border: 1px solid var(--border) !important;
}

.srt-fullscreen-cancel:hover {
  border-color: var(--red) !important;
  color: var(--red) !important;
}

.srt-fullscreen-cancel.hidden { display: none; }

.srt-fullscreen-editor {
  flex: 1;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-family: 'Thicccboi', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
}

.srt-fullscreen-editor:focus {
  border-color: var(--accent);
}

.srt-fullscreen-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.srt-fullscreen-saved {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ── Change Log dialog ── */

.changelog-content {
  max-height: 400px;
  overflow-y: auto;
  margin: 12px 0;
}

.changelog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.changelog-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.changelog-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
  color: var(--text-dim);
}

.changelog-table .cl-original { color: var(--text-dim); }
.changelog-table .cl-edited { color: var(--accent); }
.changelog-table .cl-time { font-size: 11px; white-space: nowrap; }

.btn-changelog {
  color: var(--text-dim);
  border-color: var(--border);
  font-size: 11px;
}

/* ── Video drop zone ── */

.video-drop-zone {
  padding: 14px 16px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  margin: 0 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.video-drop-zone:hover,
.video-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(49, 191, 228, 0.03);
}

.video-drop-label {
  font-size: 12px;
  color: var(--text-dim);
}

.video-upload-progress { padding: 2px 0; }

.video-upload-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.video-upload-bar-track {
  height: 8px;
  background: rgba(49, 191, 228, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.video-upload-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.btn-play {
  background: rgba(49, 191, 228, 0.12) !important;
  color: var(--accent) !important;
  border-color: rgba(49, 191, 228, 0.3) !important;
}

.btn-play:hover {
  background: rgba(49, 191, 228, 0.2) !important;
  border-color: var(--accent) !important;
}

/* ── Preferences panel (projects page) ── */

.prefs-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 8px;
}

.prefs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.prefs-panel-header h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.prefs-panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.2s;
}

.prefs-panel-close:hover { color: var(--text); }

/* ── Preferences pane (index page) ── */

.prefs-header { cursor: pointer; }

.prefs-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 4px;
}

.prefs-header.open .prefs-toggle { transform: rotate(90deg); }

.prefs-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
  line-height: 1.4;
}

.prefs-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prefs-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prefs-lang-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  width: 110px;
  flex-shrink: 0;
}

.prefs-lang-label small {
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 4px;
}

.prefs-email {
  flex: 1;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.prefs-email:focus { border-color: var(--accent); }
.prefs-email::placeholder { color: var(--text-dim); opacity: 0.5; }

.prefs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.prefs-saved {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ── Review link button ── */

.btn-review-link {
  background: rgba(49, 191, 228, 0.08) !important;
  color: var(--accent) !important;
  border-color: rgba(49, 191, 228, 0.25) !important;
}

.btn-review-link:hover {
  background: rgba(49, 191, 228, 0.15) !important;
  border-color: var(--accent) !important;
}

/* ── Empty state ── */

.empty-state {
  text-align: center;
  padding: 60px 0;
  color: var(--text-dim);
  font-size: 14px;
}

.empty-state a { color: var(--accent); text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

/* ── Utility ── */

.hidden { display: none !important; }

/* ── Card fade-in ── */

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

.card-fade-in {
  animation: cardFadeIn 0.3s ease both;
}

/* ── Future functionality ── */

.future {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ── Review page ── */

.review-lang-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.review-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-film-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.review-film-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.review-film-selector select {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.review-film-selector select:focus { border-color: var(--accent); }

.review-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.review-player .player-controls { opacity: 1; }

@media (max-width: 640px) {
  header { padding: 12px 16px; }
  main { padding: 16px; }
  .project-header { flex-wrap: wrap; }
}

/* ──────────────────────────────────────────────────────────────
   Demo Page Styles
   ────────────────────────────────────────────────────────────── */

.demo-main {
  max-width: 1196px;
  margin: 0 auto;
  padding: 64px 32px;
  text-align: center;
}

#demo-upload {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
}

#demo-progress {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
}

#demo-player {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

#demo-player #player-container {
  width: 100%;
}

.demo-headline {
  font-family: 'NoeDisplay', Georgia, serif;
  font-size: 32px;
  font-weight: bold;
  color: var(--text);
  text-align: center;
  margin-bottom: 16px;
  line-height: 40px;
  white-space: pre-line;
}

.demo-subline {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 48px;
  line-height: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Drop zone */
.demo-dropzones {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.demo-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 480px;
  min-height: 200px;
  padding: 24px 32px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.demo-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.demo-drop-title {
  font-family: 'NoeDisplay', Georgia, serif;
  font-size: 24px;
  font-weight: bold;
  color: var(--text);
  line-height: 1.2;
}

.demo-drop-subnote {
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.8;
  line-height: 1.5;
  max-width: 380px;
  margin-top: 4px;
}

.demo-drop:hover,
.demo-drop.dragover {
  border-color: var(--accent);
  background: rgba(49, 191, 228, 0.03);
}

.demo-drop.has-file {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(49, 191, 228, 0.04);
}

.demo-drop.checking {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(49, 191, 228, 0.06);
  cursor: wait;
}

.demo-drop.checking .demo-drop-title {
  color: var(--accent);
}

.demo-drop-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(49, 191, 228, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: demo-spin 0.8s linear infinite;
  margin-top: 8px;
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

.demo-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.demo-drop-icon {
  font-size: 40px;
  opacity: 0.4;
  line-height: 1;
}

.demo-drop-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
  max-width: 400px;
}

.demo-drop-hint {
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.6;
}

.demo-drop-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.demo-file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}

.demo-file-size {
  font-size: 12px;
  color: var(--text-dim);
}

/* Sample video card */
.demo-sample-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.demo-sample-label {
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.8;
}

.demo-arrow-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  margin: 0;
  color: var(--accent);
}

.demo-arrow {
  width: 90px;
  height: 90px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

/* Sample preview modal */
.sample-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 90px;
}

.sample-preview-overlay.visible {
  display: flex;
}

.sample-preview-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  background: #000;
}

.sample-preview-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}

.sample-preview-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.demo-sample-card {
  display: flex;
  flex-direction: row;
  width: 480px;
  height: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: grab;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  user-select: none;
  overflow: hidden;
}

.demo-sample-card:hover {
  border-color: var(--accent);
  background: rgba(49, 191, 228, 0.04);
  transform: translateY(-2px);
}

.demo-sample-card:active {
  cursor: grabbing;
}

.demo-sample-card.dragging {
  opacity: 0.5;
}

.demo-sample-thumb {
  position: relative;
  width: 240px;
  height: 160px;
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
}

.demo-sample-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.demo-sample-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(49, 191, 228, 0.9);
  border-radius: 50%;
  color: var(--bg);
  font-size: 20px;
  padding-left: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, background 0.2s;
}

.demo-sample-card:hover .demo-sample-play {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.08);
}

.demo-sample-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 16px 20px;
  gap: 6px;
}

.demo-sample-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.demo-sample-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.demo-sample-hint {
  margin-top: 10px;
  font-size: 11px;
  color: var(--accent);
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Action row */
.demo-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.demo-action .btn-primary {
  width: 100%;
  height: 56px;
  font-size: 15px;
}

.demo-action-hint {
  font-size: 13px;
  color: var(--text-dim);
  height: 24px;
}

/* Process step bars */
.demo-process-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  margin: 32px auto;
}

.process-step {
  opacity: 0.3;
  transition: opacity 0.3s;
}

.process-step.active,
.process-step.done {
  opacity: 1;
}

.process-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  min-height: 24px;
  line-height: 1.4;
}

.process-step.active .process-step-label {
  color: var(--accent);
}

.process-step.done .process-step-label {
  color: var(--accent);
  opacity: 0.7;
}

.process-step.done .process-step-label::before {
  content: '✓ ';
}

.process-step-bar {
  height: 8px;
  background: rgba(49, 191, 228, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.process-step-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.process-step.done .process-step-fill {
  width: 100%;
}

/* Progress note */
.demo-progress-note {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 24px;
}

/* Progress headline rotation — the h2 fades in/out while its text
   cycles through the processing messages. Non-rotating pages (state 1)
   are unaffected because they use the default .demo-headline rules. */

#progress-headline {
  transition: opacity 0.5s ease;
  opacity: 1;
}

#progress-headline.fading {
  opacity: 0;
}

#progress-headline.error {
  color: var(--red);
  font-size: 20px;
}

/* Per-language progress */
.demo-lang-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 480px;
  margin: 0 auto;
}

.lang-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 24px;
}

.lang-progress-name {
  font-size: 13px;
  color: var(--text-dim);
  width: 88px;
  text-align: right;
  flex-shrink: 0;
}

.lang-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(49, 191, 228, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.lang-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.lang-progress-status {
  font-size: 12px;
  width: 24px;
  flex-shrink: 0;
  text-align: center;
}

.lang-progress-row.waiting .lang-progress-name { opacity: 0.4; }
.lang-progress-row.active .lang-progress-name { color: var(--accent); }
.lang-progress-row.done .lang-progress-name { color: var(--accent); opacity: 0.7; }
.lang-progress-row.done .lang-progress-fill { width: 100%; }

/* Player restart */
.demo-restart-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.demo-restart-row .btn-secondary {
  opacity: 0.3;
  transition: opacity 0.2s;
}

.demo-restart-row .btn-secondary:hover {
  opacity: 1;
}

/* ── Note box ──
   Shared by the upload screen and the player screen: the quiet explanatory
   panel that sits last on each. One class, one set of rules — the only
   per-screen difference is the heading, which only the upload box has.
   Dimmed at rest so it never competes with what is above it, lit on hover.
   The dimming lives behind @media (hover: hover) so touch devices — where
   nothing can ever trigger the hover state — get the box fully lit,
   permanently. */

.demo-note {
  width: 100%;
  max-width: 640px;
  margin: 32px auto 0;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  /* Body copy — left-aligned reads calmer than the centred treatment the
     rest of the demo page uses for single lines. */
  text-align: left;
}

.demo-note h3 {
  font-family: 'NoeDisplay', Georgia, serif;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
}

.demo-note p + p { margin-top: 12px; }

@media (hover: hover) {
  .demo-note {
    opacity: 0.6;
    color: var(--text-dim);
    background: var(--surface-alt);
    transition: opacity 0.25s ease, color 0.25s ease,
                background 0.25s ease, border-color 0.25s ease;
  }

  .demo-note h3 { color: inherit; transition: color 0.25s ease; }

  .demo-note:hover {
    opacity: 1;
    color: var(--text);
    background: var(--surface);
    border-color: rgba(49, 191, 228, 0.35);
  }
}

/* The upload box closes a taller screen — give it a little more air. */
.demo-upload-note { margin-top: 48px; }

/* Responsive */
@media (max-width: 600px) {
  .demo-dropzones { grid-template-columns: 1fr; }
  .demo-action { flex-direction: column; align-items: flex-start; }
}

/* Demo is frozen-EOL: keep burn-in wiring intact (backend + JS) so the app
   stays coherent, but hide its UI surface. The full burn-in flow lives in
   the sibling burnin app at /demo/srt-burn-in/. */
.demo-eol-hidden,
.player-burn-options {
  display: none !important;
}
