:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-muted: #f8f8f9;
  --surface-sunken: #e9e9ec;
  --border: #dcdce1;
  --border-strong: #c4c4cc;
  --text: #1c1c21;
  --text-muted: #62626d;
  --accent: #c0352b;
  --accent-hover: #a12a21;
  --accent-soft: #fbe9e7;
  --accent-contrast: #ffffff;
  --success: #227346;
  --success-soft: #e3f3e9;
  --warning: #8a5a00;
  --warning-soft: #fdf1d8;
  --danger: #b3261e;
  --danger-soft: #fbe7e5;
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --shadow-small: 0 1px 2px rgb(20 20 28 / 8%), 0 1px 3px rgb(20 20 28 / 6%);
  --shadow-large: 0 10px 30px rgb(20 20 28 / 14%), 0 2px 6px rgb(20 20 28 / 8%);
  --radius: 10px;
  --radius-small: 6px;
  --header-height: 60px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --surface: #1d1d21;
    --surface-muted: #24242a;
    --surface-sunken: #0f0f12;
    --border: #34343c;
    --border-strong: #4a4a54;
    --text: #ececf0;
    --text-muted: #a3a3ae;
    --accent: #ff7a6e;
    --accent-hover: #ff958b;
    --accent-soft: #3a201e;
    --accent-contrast: #1b0d0b;
    --success: #6cc493;
    --success-soft: #1d3326;
    --warning: #f0c060;
    --warning-soft: #362a12;
    --danger: #ff8a80;
    --danger-soft: #3b2120;
    --shadow-small: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-large: 0 10px 30px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

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

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

[hidden] {
  display: none !important;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.boot-note {
  margin: 30vh auto 0;
  text-align: center;
  color: var(--text-muted);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.button:hover {
  border-color: var(--text-muted);
  background: var(--surface-muted);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.button--primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button--danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.button--danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.button--primary.button--danger-solid {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.button--primary.button--danger-solid:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 85%, #000000);
}

.button--quiet {
  border-color: transparent;
  background: transparent;
}

.button--quiet:hover {
  background: var(--surface-sunken);
  border-color: transparent;
}

.button--small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}

.button--discord {
  min-height: 46px;
  padding: 10px 22px;
  border-color: var(--discord);
  background: var(--discord);
  color: #ffffff;
  font-size: 16px;
}

.button--discord:hover {
  border-color: var(--discord-hover);
  background: var(--discord-hover);
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Header */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
}

.main-nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-small);
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
}

.main-nav a:hover {
  background: var(--surface-sunken);
  color: var(--text);
}

.main-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* What the server is doing, e.g. "Lädt Transkripte · 3 offen". */
.activity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 4px 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

.activity--paused {
  background: var(--warning-soft);
  color: var(--warning);
}

.activity--paused::before {
  background: var(--warning);
  animation: none;
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-sunken);
  object-fit: cover;
}

.user-name {
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* Phones get the navigation on a row of its own: with an avatar and the admin's user link,
   one row no longer fits 360 px. */
@media (max-width: 520px) {
  :root {
    --header-height: 96px;
  }

  .app-header {
    flex-wrap: wrap;
    align-content: center;
    row-gap: 6px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    margin-right: 0;
  }

  .user-menu {
    margin-left: auto;
  }

  .main-nav .icon,
  .logout-button span {
    display: none;
  }

  .main-nav {
    gap: 0;
  }
}

@media (max-width: 760px) {
  .app-header {
    gap: 10px;
    padding: 0 12px;
  }

  .brand span,
  .user-name,
  .activity {
    display: none;
  }

  .main-nav a {
    padding: 7px 8px;
  }

  .app-main {
    padding: 16px 16px 48px;
  }
}

/* Login */

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 36px 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-large);
  text-align: center;
}

.login-panel img {
  width: 72px;
  height: 72px;
}

.login-panel h1 {
  margin: 10px 0 4px;
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.login-panel p {
  margin: 0 0 24px;
  color: var(--text-muted);
}

.login-panel .login-error {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: var(--radius-small);
  background: var(--danger-soft);
  color: var(--danger);
}

/* Page heads and toolbars */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 20px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-sunken);
}

.segmented a,
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.segmented a:hover,
.segmented button:hover {
  color: var(--text);
}

.segmented [aria-current="true"],
.segmented [aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-small);
}

.segmented-count {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}

.search-field {
  flex: 1 1 220px;
  max-width: 340px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 15;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-large);
}

.menu-panel a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-small);
  color: var(--text);
  text-decoration: none;
}

.menu-panel a:hover {
  background: var(--surface-sunken);
}

.menu-panel small {
  display: block;
  color: var(--text-muted);
}

.empty-note {
  padding: 40px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
}

.panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

@media (max-width: 520px) {
  .panel {
    padding: 16px;
  }
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 650;
}

.field-tag {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.field-tag--required {
  color: var(--accent);
}

.field-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.input:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  outline-offset: 0;
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-weight: 600;
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* API page */

.api-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  max-width: 980px;
}

.endpoint-list code {
  overflow-wrap: anywhere;
}

.api-page h2 {
  margin: 0 0 10px;
  font-size: 19px;
}

.api-page p {
  margin: 0 0 10px;
}

.api-page pre.code + p {
  margin-top: 16px;
}

.api-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

pre.code {
  margin: 10px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: #1b1b20;
  color: #e8e8ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.endpoint-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.endpoint-list li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.method {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.table-scroll {
  overflow-x: auto;
}

.property-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.property-table th,
.property-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.property-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Dialog and toasts */

.dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-large);
}

.dialog::backdrop {
  background: rgb(12 12 16 / 45%);
}

.dialog-body {
  padding: 22px 22px 8px;
}

.dialog-body h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.dialog-body p {
  margin: 0;
  color: var(--text-muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px 22px;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 11px 16px;
  border-radius: var(--radius);
  background: #26262c;
  color: #f4f4f6;
  box-shadow: var(--shadow-large);
  font-weight: 600;
  animation: toast-in 160ms ease-out;
}

.toast--error {
  background: var(--danger);
  color: #ffffff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

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

/* Not approved */

.login-panel .login-avatar {
  border-radius: 50%;
  background: var(--surface-sunken);
  object-fit: cover;
}

.login-panel .login-account-id {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Users page */

.users-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  max-width: 980px;
}

.users-page h2 {
  margin: 0 0 10px;
  font-size: 19px;
}

.users-page p {
  margin: 0 0 10px;
}

.user-approve-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.user-approve-form .input {
  flex: 1 1 220px;
  width: auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.users-page .field-error {
  margin: 8px 0 0;
}

.user-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.user-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.user-row:first-child {
  border-top: 0;
}

.user-row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-sunken);
  object-fit: cover;
}

.user-row-avatar--empty {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
}

.user-row-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  overflow-wrap: anywhere;
}

.user-row-handle {
  color: var(--text-muted);
  font-size: 14px;
}

.user-row-badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.users-page .user-row-facts {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.user-list-empty {
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .user-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .user-row-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* Adding videos and playlists */

.add-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.add-form .input {
  flex: 1 1 260px;
  width: auto;
  min-width: 0;
}

.source-select {
  width: auto;
  max-width: 100%;
  min-height: 38px;
  padding: 6px 10px;
}

.problem-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: -6px 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: var(--text);
}

.problem-bar p {
  flex: 1 1 320px;
  margin: 0;
  font-size: 14px;
}

.more-button {
  display: flex;
  margin: 18px auto 0;
}

/* Video list */

.video-list,
.playlist-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.video-row,
.playlist-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.video-row--no_transcript {
  border-left: 4px solid var(--warning);
}

.video-row--failed {
  border-left: 4px solid var(--danger);
}

.video-thumb,
.playlist-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-small);
  background: var(--surface-sunken);
}

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

.video-duration {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgb(0 0 0 / 78%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
  line-height: 18px;
}

.video-row-main,
.playlist-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-row-title,
.playlist-row-title a:first-child {
  color: var(--text);
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.video-row-title:hover,
.playlist-row-title a:first-child:hover {
  color: var(--accent);
  text-decoration: underline;
}

.video-row-meta,
.playlist-row-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.video-row-problem,
.playlist-row-error {
  margin: 2px 0 0;
  color: var(--danger);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.video-row--no_transcript .video-row-problem {
  color: var(--warning);
}

.video-row-actions,
.playlist-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.status-badge--ready {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge--running {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-badge--running::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}

.status-badge--no_transcript {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge--failed {
  background: var(--danger-soft);
  color: var(--danger);
}

@media (max-width: 620px) {
  .video-row,
  .playlist-row {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 4px 12px;
    padding: 10px;
  }

  .video-row-actions,
  .playlist-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Playlists */

.playlist-thumb-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-muted);
}

.playlist-thumb-empty .icon {
  width: 32px;
  height: 32px;
}

.playlist-row-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.icon-link {
  display: inline-flex;
  color: var(--text-muted);
}

.icon-link:hover {
  color: var(--accent);
}

.icon-link .icon {
  width: 16px;
  height: 16px;
}

.count-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0;
}

.count-chips:empty {
  display: none;
}

.count-chip {
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.count-chip--ready {
  background: var(--success-soft);
  color: var(--success);
}

.count-chip--problem {
  background: var(--danger-soft);
  color: var(--danger);
}

.count-chip--waiting {
  background: var(--surface-sunken);
  color: var(--text-muted);
}

/* One video */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.video-head {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 20px 24px;
  align-items: start;
  margin-bottom: 22px;
}

.video-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.video-head-details {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.video-facts {
  margin: 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.video-head-status {
  margin-top: 4px;
}

.problem-note {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-small);
  background: var(--danger-soft);
  color: var(--danger);
  overflow-wrap: anywhere;
}

.video-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

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

  .video-head h1 {
    font-size: 21px;
  }
}

/* Transcript */

.transcript-panel {
  margin-bottom: 18px;
}

.transcript-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.transcript-panel h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.transcript-label {
  margin: 0;
  font-weight: 650;
}

.transcript-counts,
.transcript-empty,
.transcript-search-note {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.transcript-search-note {
  margin: -8px 0 12px;
}

.transcript-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.transcript-toolbar {
  margin-bottom: 14px;
}

.transcript-lines {
  display: grid;
  gap: 2px;
  max-width: 78ch;
}

.transcript-lines--paragraphs {
  gap: 14px;
}

.transcript-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.transcript-time {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.9;
  text-align: right;
  text-decoration: none;
}

.transcript-time:hover {
  color: var(--accent);
  text-decoration: underline;
}

.transcript-line mark {
  border-radius: 3px;
  background: var(--warning-soft);
  color: inherit;
  box-shadow: 0 0 0 1px var(--warning);
}

@media (max-width: 520px) {
  .transcript-line {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
  }
}

.tracks-panel summary {
  font-weight: 650;
  cursor: pointer;
}

.tracks-panel p {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.track-list {
  margin: 10px 0 0;
  padding-left: 20px;
}
