body {
  font-family: var(--font-sans);
}

td.right,
.num-cell,
.audio-channels-cell {
  font-family: var(--font-sans);
}

:root {
  --font-sans: Inter, system-ui, sans-serif;
  --font-mono: Inter, system-ui, sans-serif;


  --bg: #f1f3f6;

  --panel: #ffffff;

  --toolbar-bg: rgba(234, 239, 246, 0.6);

  --toolbar-top-bg: rgba(248, 250, 255, 0.66);

  --toolbar-top-tint: rgba(125, 100, 170, 0.1);

  --toolbar-top-tint-end: rgba(125, 100, 170, 0);

  --data-bg: rgba(242, 246, 251, 0.72);

  --progress-bg: #e5eaf0;

  --text: #1f2933;

  --muted: #6b7280;
  --muted-rgb: 107, 114, 128;

  --border: #d8dee5;

  --accent: #f0bbfd;

  --accent-rgb: 240, 187, 253;

  --match-ok: #16a34a;

  --match-warn: #b45309;

  --match-bad: #dc2626;

  --match-future: #7c3aed;

  --match-nodisk: #0891b2;
  --match-ok-rgb: 22, 163, 74;
  --match-warn-rgb: 180, 83, 9;
  --match-future-rgb: 124, 58, 237;
  --match-nodisk-rgb: 8, 145, 178;

  --match-ok-bg: #e4f5eb;

  --match-warn-bg: #fff1dc;

  --match-future-bg: #f1eaff;

  --match-nodisk-bg: #dff6fb;

  --match-muted-bg: #eef2f6;

  --info-banner-bg: rgba(59, 130, 246, 0.12);

  --info-banner-border: rgba(59, 130, 246, 0.35);

  --info-banner-text: #1d4ed8;

  --mismatch-bg: #fff7ed;

  --row-hover: #dde3ea;

  --row-refresh-pending: #d4d9df;

  --title-refresh-size: 16px;

  --title-refresh-gap: 6px;

  --title-refresh-gutter: calc(var(--title-refresh-size) + var(--title-refresh-gap));

  --title-expand-size: 16px;

  --title-expand-gap: 6px;

  --title-expand-gutter: calc(var(--title-expand-size) + var(--title-expand-gap));

  --title-col-width: clamp(16ch, 20vw, 48ch);
  --path-col-width: clamp(14ch, 18vw, 42ch);

  --row-refresh-icon: rgba(15, 23, 42, 0.55);

  --row-refresh-icon-hover: rgba(15, 23, 42, 0.9);

  --row-expand-icon: rgba(15, 23, 42, 0.6);

  --row-expand-icon-hover: rgba(15, 23, 42, 0.95);

  --series-expand-bg: rgba(255, 255, 255, 0.7);

  --series-expand-border: rgba(31, 41, 51, 0.08);

  --series-episode-hover: rgba(31, 41, 51, 0.05);

  --series-episode-grid-base: minmax(120px, 18vw) 80px 100px 140px 120px 120px 120px 110px 150px;
  --series-episode-grid-extras: minmax(120px, 18vw) 80px 100px 140px 120px 120px 120px 110px 150px 150px 110px 90px 90px 120px 150px 180px 90px 120px;
  --series-episode-grid-current: var(--series-episode-grid-base);

  --col-divider-color: rgba(31, 41, 51, 0.08);
  --chip-divider-color: rgba(31, 41, 51, 0.35);

  --match-pill-min-width: 150px;

  --audio-codec-width: 140px;

  --row-focus: rgba(59, 130, 246, 0.28);

  --status-complete-flash-bg: rgba(34, 197, 94, 0.52);
  --status-complete-flash-peak: 0.95;
  --status-complete-flash-mid: 0.82;
  --status-complete-flash-low: 0.68;

  --row-refresh-success-strong: rgba(16, 140, 70, 0.38);
  --row-refresh-success-mid: rgba(16, 140, 70, 0.3);
  --row-refresh-success-low: rgba(16, 140, 70, 0.24);

  --motion-fast: 0.2s;

  --motion-medium: 0.4s;

  --motion-slow: 0.6s;

  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);

  --page-bg: radial-gradient(2000px 1050px at 20% -8%, rgba(74, 163, 255, 0.22), transparent 60%),

    radial-gradient(2000px 1120px at 95% 10%, rgba(16, 185, 129, 0.22), transparent 58%),

    var(--bg);

  --panel-surface: linear-gradient(180deg, rgba(248, 250, 255, 0.98), rgba(234, 239, 246, 0.94));

  --panel-surface-strong: linear-gradient(180deg, rgba(250, 252, 255, 0.99), rgba(238, 242, 249, 0.96));

  --panel-surface-soft: linear-gradient(180deg, rgba(248, 250, 255, 0.68), rgba(234, 239, 246, 0.58));

  --glass-blur: 10px;
  --glass-surface: linear-gradient(180deg, rgba(248, 250, 255, 0.36), rgba(234, 239, 246, 0.24));
  --glass-surface-strong: linear-gradient(180deg, rgba(252, 254, 255, 0.52), rgba(243, 246, 252, 0.4));
  --column-panel-surface: linear-gradient(180deg, rgba(252, 254, 255, 0.22), rgba(243, 246, 252, 0.14));
  --filter-select-surface: linear-gradient(180deg, rgba(252, 254, 255, 0.9), rgba(243, 246, 252, 0.86));
  --filter-select-menu-fallback: linear-gradient(180deg, rgba(252, 254, 255, 0.92), rgba(243, 246, 252, 0.88));
  --filter-select-menu: linear-gradient(180deg, rgba(252, 254, 255, 0.62), rgba(243, 246, 252, 0.54));

  --filter-input-bg: rgba(255, 255, 255, 0.6);
  --input-focus-border: rgba(255, 255, 255, 0.72);
  --input-focus-glow: rgba(96, 165, 250, 0.22);
  --input-focus-sheen: rgba(255, 255, 255, 0.28);

  --button-bg: var(--panel-surface);

  --panel-header: rgba(255, 255, 255, 0.7);

  --panel-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);

  --table-header-bg: rgba(230, 236, 245, 0.92);

  --table-header-height: calc(0.95em * 1.2 + 16px);

}



html[data-theme="dark"] {

  --bg: #1e1e1e;

  --panel: #252526;

  --toolbar-bg: rgba(18, 20, 24, 0.48);

  --toolbar-top-bg: rgba(24, 26, 30, 0.62);

  --toolbar-top-tint: rgba(125, 100, 170, 0);

  --toolbar-top-tint-end: rgba(125, 100, 170, 0);

  --data-bg: rgba(30, 32, 34, 0.78);

  --progress-bg: #252526;

  --text: #e5e7ebe8;

  --muted: #9ca3af;
  --muted-rgb: 156, 163, 175;

  --border: #2f2f2f;

  --chip-border-hover: #dadada;

  --accent: #dadada;

  --accent-rgb: 36, 201, 251;

  --match-ok: #4ade80;

  --match-warn: #fbbf24;

  --match-future: #c4b5fd;

  --match-nodisk: #67e8f9;
  --match-ok-rgb: 74, 222, 128;
  --match-warn-rgb: 251, 191, 36;
  --match-future-rgb: 196, 181, 253;
  --match-nodisk-rgb: 103, 232, 249;

  --match-ok-bg: #1c3b2a;

  --match-warn-bg: #3b2a12;

  --match-future-bg: #2d1b4b;

  --match-nodisk-bg: #0b2f36;

  --match-muted-bg: #2f2f2f;

  --info-banner-bg: rgba(59, 130, 246, 0.2);

  --info-banner-border: rgba(59, 130, 246, 0.4);

  --info-banner-text: #93c5fd;

  --mismatch-bg: #2f2317;

  --row-hover: rgba(255, 255, 255, 0.014);

  --row-refresh-pending: #2c2f33;

  --row-refresh-icon: rgba(255, 255, 255, 0.45);

  --row-refresh-icon-hover: rgba(255, 255, 255, 0.75);

  --row-expand-icon: rgba(255, 255, 255, 0.55);

  --row-expand-icon-hover: rgba(255, 255, 255, 0.9);

  --series-expand-bg: rgba(20, 24, 30, 0.72);

  --series-expand-border: rgba(255, 255, 255, 0.08);

  --series-episode-hover: rgba(255, 255, 255, 0.04);

  --col-divider-color: rgba(255, 255, 255, 0.08);
  --chip-divider-color: rgba(255, 255, 255, 0.28);

  --row-focus: rgba(96, 165, 250, 0.32);

  --status-complete-flash-bg: rgba(74, 222, 128, 0.36);
  --status-complete-flash-peak: 0.78;
  --status-complete-flash-mid: 0.62;
  --status-complete-flash-low: 0.52;

  --row-refresh-success-strong: rgba(70, 210, 120, 0.28);
  --row-refresh-success-mid: rgba(70, 210, 120, 0.22);
  --row-refresh-success-low: rgba(70, 210, 120, 0.18);

  --audio-codec-width: 140px;

  --page-bg: radial-gradient(2000px 1050px at 20% -8%, rgba(74, 163, 255, 0.22), transparent 60%),

    radial-gradient(1960px 1120px at 95% 10%, rgba(56, 210, 122, 0.18), transparent 55%),

    var(--bg);

  --panel-surface: linear-gradient(180deg, rgba(24, 26, 30, 0.62), rgba(18, 20, 24, 0.48));

  --panel-surface-strong: linear-gradient(180deg, rgba(30, 32, 36, 0.85), rgba(24, 26, 30, 0.8));

  --panel-surface-soft: var(--panel-surface);

  --glass-surface: linear-gradient(180deg, rgba(24, 26, 30, 0.5), rgba(18, 20, 24, 0.4));
  --glass-surface-strong: linear-gradient(180deg, rgba(32, 34, 38, 0.5), rgba(26, 28, 32, 0.44));
  --column-panel-surface: linear-gradient(180deg, rgba(32, 34, 38, 0.38), rgba(26, 28, 32, 0.32));
  --filter-select-surface: linear-gradient(180deg, rgba(32, 34, 38, 0.92), rgba(26, 28, 32, 0.88));
  --filter-select-menu-fallback: linear-gradient(180deg, rgba(32, 34, 38, 0.9), rgba(26, 28, 32, 0.86));
  --filter-select-menu: linear-gradient(180deg, rgba(32, 34, 38, 0.64), rgba(26, 28, 32, 0.56));

  --filter-input-bg: rgba(18, 20, 24, 0.55);
  --input-focus-border: rgba(255, 255, 255, 0.35);
  --input-focus-glow: rgba(125, 211, 252, 0.25);
  --input-focus-sheen: rgba(255, 255, 255, 0.12);

  --button-bg: var(--panel-surface);

  --panel-header: rgba(0, 0, 0, 0.18);

  --panel-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);

  --table-header-bg: rgba(24, 28, 34, 0.86);

}



html,
body {

  margin: 0;

  padding: 0;

  background: var(--page-bg);

  touch-action: auto;

  background-repeat: no-repeat;

  color: var(--text);

  font-family: var(--font-sans);

}



html {
  overflow: hidden;
  scrollbar-gutter: stable;
}



body {

  overflow: hidden;

}



.app {

  padding: 14px 16px;

  min-height: 100vh;

  display: flex;

  flex-direction: column;

  box-sizing: border-box;

}



.toolbar {

  display: flex;

  align-items: center;

  gap: 10px;

  padding: 12px 14px;

  background:
    linear-gradient(120deg, var(--toolbar-top-tint), var(--toolbar-top-tint-end)),
    linear-gradient(180deg, var(--toolbar-top-bg), var(--toolbar-bg));

  border: 1px solid var(--border);

  border-radius: 10px;

  box-shadow: var(--panel-shadow);

}



.filters {

  margin-top: 10px;

  padding: 10px 12px;

  background: var(--glass-surface);

  border: 1px solid var(--border);

  border-radius: 10px;

  display: grid;

  gap: 0;

  box-shadow: var(--panel-shadow);

  position: relative;

  overflow: hidden;

}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {

  .filters,
  .column-panel {
    backdrop-filter: blur(var(--glass-blur)) saturate(120%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  }
}



.filters-body {

  display: grid;

  gap: 8px;

  max-height: 2000px;

  overflow: hidden;

  transition: opacity var(--motion-slow) var(--motion-ease), transform var(--motion-slow) var(--motion-ease), max-height var(--motion-slow) var(--motion-ease), margin var(--motion-slow) var(--motion-ease), padding var(--motion-slow) var(--motion-ease), border-width var(--motion-slow) var(--motion-ease);

  will-change: opacity, transform;

  position: relative;
  z-index: 1;
  overscroll-behavior: contain;

}



.filters.filters--collapsed .filters-body {

  opacity: 0;

  transform: translate3d(0, -6px, 0);

  max-height: 0;

  pointer-events: none;

}

.filters.filters--collapsed .chip-wrap {

  opacity: 0;

  transition-duration: 0s;

}



.filters-footer {

  display: flex;

  align-items: center;

  gap: 12px;

  flex-wrap: wrap;

  justify-content: flex-start;

  margin-top: 15px;

  --filters-footer-control-height: 32px;

}


.filters-footer .filters-toggle-btn,
.filters-footer .tabs button,
.filters-footer .status-pill,
.filters-footer .chip-advanced {
  height: var(--filters-footer-control-height);
  box-sizing: border-box;
}

.filters-footer .filters-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filters-footer .tabs .tab {
  background: var(--button-bg);
}

.filters-footer-chips {

  display: flex;

  align-items: center;

  gap: 12px;

  flex-wrap: wrap;

}

.filters-footer #chipsToggle {
  margin-left: auto;
}



.filters-footer .status-pill {

  margin-top: 0;

  align-self: center;

  color: var(--text);

  letter-spacing: 0;

  border-radius: 10px;

  transform: none;

  will-change: auto;

}



.filters.filters--collapsed {

  padding: 6px 8px;

  width: fit-content;

  align-self: flex-start;

  display: inline-flex;

  align-items: center;

}



.filters.filters--collapsed .filters-footer {

  margin-top: 0;

}

.filters.filters--collapsed #chipsToggle {
  display: none;
}



.filters.filters--collapsed .filters-body {

  position: absolute;

  left: 8px;

  right: 8px;

  top: 6px;

  margin: 0;

  padding: 0;

}



.filters-toggle-btn {

  width: 32px;

  padding: 6px 0;

  line-height: 1;

}



.filter-row {

  display: grid;

  grid-template-columns: 1fr auto;

  gap: 10px;

  align-items: center;

}



.filter-inputs {

  position: relative;

  flex: 1 1 440px;

  min-width: 220px;

  grid-column: 1;

}



.simple-filters {

  display: flex;

  gap: 10px;

  align-items: center;

  width: 100%;

}



.simple-filters input {

  flex: 1 1 220px;

}



.filter-row input {

  flex: 1 1 220px;

}



.filter-inputs .advanced-filter {

  position: absolute;

  top: 0;

  bottom: 0;

  left: 0;

  right: 0;

  width: auto;

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

}



.filter-inputs .simple-filters {

  opacity: 1;

  visibility: visible;

  pointer-events: auto;

}



.filter-inputs.advanced-on .advanced-filter {

  opacity: 1;

  visibility: visible;

  pointer-events: auto;

}



.filter-inputs.advanced-on .simple-filters {

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

}



.filter-controls {

  display: inline-flex;

  align-items: center;

  gap: 8px;

  flex-shrink: 0;

  grid-column: 2;

  justify-self: end;

}

.filter-builder {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.filter-builder-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.filter-builder-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 140px;
}

.filter-builder label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.filter-builder select,
.filter-builder input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

html.custom-selects .filter-builder select {
  display: none;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.custom-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  background: var(--filter-select-surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    background-image var(--motion-fast) var(--motion-ease);
}

.custom-select-trigger:hover {
  border-color: var(--accent);
}

.custom-select-trigger:focus,
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: inset 0 0 0 1px var(--input-focus-border),
    inset 0 0 14px var(--input-focus-glow);
  background-image: linear-gradient(180deg, var(--input-focus-sheen), rgba(255, 255, 255, 0));
}

.custom-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 150ms ease, border-color 150ms ease;
}

.custom-select--open .custom-select-caret {
  transform: rotate(-135deg);
  border-color: var(--text);
}

.custom-select-menu {
  position: fixed;
  top: 0;
  left: 0;
  background: var(--filter-select-menu-fallback);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  z-index: 2000;
  box-shadow: var(--panel-shadow);
  max-height: 240px;
  overflow: auto;
  scrollbar-width: none;
  --custom-select-blur: calc(var(--glass-blur) - 4px);
}

.custom-select-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.custom-select-menu.hidden {
  display: none;
}

.custom-select-search-wrap {
  padding: 2px 2px 8px 2px;
}

.custom-select-search {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  background: var(--filter-select-surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.custom-select-search:focus,
.custom-select-search:focus-visible {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: inset 0 0 0 1px var(--input-focus-border),
    inset 0 0 14px var(--input-focus-glow);
  background-image: linear-gradient(180deg, var(--input-focus-sheen), rgba(255, 255, 255, 0));
}

.custom-select-option {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 6px 8px;
  cursor: pointer;
  font: inherit;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--row-hover);
  outline: none;
}

.custom-select-option.is-selected {
  border-color: transparent;
  background: transparent;
}

.custom-select-option.is-selected:hover,
.custom-select-option.is-selected:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--row-hover);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .custom-select-menu {
    background: var(--filter-select-menu);
    backdrop-filter: blur(var(--custom-select-blur)) saturate(100%);
    -webkit-backdrop-filter: blur(var(--custom-select-blur)) saturate(100%);
  }
}

.filter-add-btn {
  height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85em;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82em;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.filter-bubble:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.filter-bubble-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--row-hover);
  color: var(--muted);
  font-size: 0.75em;
}

@media (max-width: 900px) {
  .toolbar {
    flex-wrap: wrap;
  }

  .brand {
    margin-right: 0;
  }

  .version-badge {
    flex-basis: 100%;
    white-space: normal;
  }

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

  .filter-inputs {
    min-width: 0;
  }

  .filter-controls {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .filter-builder-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-builder-field {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }

  .filter-add-btn {
    width: 100%;
    justify-self: stretch;
  }

  .simple-filters {
    flex-wrap: wrap;
  }

  .simple-filters input {
    flex: 1 1 100%;
  }

  .filter-inputs.advanced-on .advanced-filter {
    position: static;
    width: 100%;
  }

  .filter-inputs.advanced-on .simple-filters {
    display: none;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .status-row {
    max-height: none;
    overflow: visible;
  }

  .status-actions {
    margin-left: 0;
    width: 100%;
  }

  .status-actions-group {
    width: 100%;
  }

  .status-actions-group button {
    flex: 1 1 200px;
  }
}



.advanced-help-btn {

  visibility: hidden;

}



.advanced-help-btn.hidden {

  display: inline-flex;

  visibility: hidden;

}



.advanced-help-btn:not(.hidden) {

  visibility: visible;

}



.advanced-toggle {

  display: inline-flex;

  align-items: center;

  gap: 6px;

  color: var(--muted);

  font-size: 0.9em;

}



.advanced-toggle input {

  margin: 0;

}



.advanced-help-btn {

  padding: 4px 8px;

  border-radius: 999px;

  font-weight: 600;

}



.advanced-filter {

  width: 100%;

}



.hidden {

  display: none !important;

}



.advanced-help {

  color: var(--muted);

  font-size: 0.85em;

}



.advanced-warnings {

  color: #9f1239;

  font-size: 0.85em;

}



html[data-theme="dark"] .advanced-warnings {

  color: #fecdd3;

}



.chip-groups {

  display: flex;

  flex-wrap: wrap;

  align-items: flex-start;

  width: 100%;

  --chip-group-gap: 126px;

  justify-content: center;

  row-gap: 12px;

  column-gap: var(--chip-group-gap);

}



.chip-group {

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 6px;

  position: relative;

  padding: 0;

}



.chip-group+.chip-group::before {

  content: "|";

  position: absolute;

  left: calc(var(--chip-group-gap) / -2);

  top: 50%;

  transform: translateY(-50%);

  color: var(--chip-divider-color, var(--border));

  font-size: 0.9em;

}

.chip-group.chip-group--row-start::before {
  content: none;
}



.chip-group-title {

  font-size: 0.72em;

  text-transform: uppercase;

  letter-spacing: 0.08em;

  color: var(--muted);

  white-space: nowrap;

}



.chip-row {

  display: flex;

  flex-wrap: wrap;

  gap: 6px;

  justify-content: center;

  position: relative;
  z-index: 5;

}




.chip-wrap {

  display: grid;

  grid-template-columns: 1fr auto;

  align-items: center;

  max-height: none;

  overflow: visible;

  transition: opacity var(--motion-slow) var(--motion-ease), transform var(--motion-slow) var(--motion-ease);

  will-change: opacity, transform;

}


.chip-wrap--hidden {

  opacity: 0;

  transform: translate3d(0, -6px, 0);

  max-height: 0;

  overflow: hidden;

  pointer-events: none;

}



@media (prefers-reduced-motion: reduce) {

  .chip-wrap {

    transition: none;

  }

}



.chip-wrap .chip-groups {

  grid-column: 1;

}


.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  --chip-pos-border-hover: var(--match-ok);
  --chip-neg-border-hover: var(--match-bad);
  --chip-border-hover: var(--border);
  --chip-prefix-space: 0.78em;

  border: 1px solid var(--border);


  background:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.10),
      rgba(255, 255, 255, 0.02) 55%,
      rgba(0, 0, 0, 0.10) 100%),
    var(--glass-surface);
  padding: 2px calc(6px + var(--chip-prefix-space));
  border-radius: 15px;
  font-size: 0.90em;
  font-weight: 500;
  z-index: 15;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.chip--pos:hover {
  border-color: var(--match-ok);
}

.chip--neg:hover {
  border-color: var(--match-bad);
}

/* Assign per-state hover border var */
.chip--pos {
  --chip-border-hover: var(--chip-pos-border-hover);
}

.chip--neg {
  --chip-border-hover: var(--chip-neg-border-hover);
}


.chip:not(.chip--pos):not(.chip--neg):hover {
  border-color: rgba(255, 255, 255, 0.45);
}

html:not([data-theme="dark"]) .chip:not(.chip--pos):not(.chip--neg):hover {
  border-color: #f0bbfd;
}

.chip::after {
  opacity: 0.18;
  /* slightly subtler */
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(255, 255, 255, 0.10) 22%,
      rgba(255, 255, 255, 0.00) 55%);
}

/* Ensure chip content sits above the ::after layer */
.chip>* {
  position: relative;
  z-index: 1;
}


.chip--pos {
  border-color: rgba(78, 179, 112, 0.5);
  color: var(--match-ok);
  background:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.00) 100%),
    rgba(22, 163, 74, 0.12);
}


.chip--neg {
  border-color: rgba(179, 78, 78, 0.5);
  color: var(--match-bad);
  background:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.00) 100%),
    rgba(220, 38, 38, 0.12);
}



/* + / − prefix */
.chip::before {
  content: "+";
  position: absolute;
  left: 6px;
  width: var(--chip-prefix-space);
  text-align: center;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  line-height: 1;
}

.chip--pos::before,
.chip--neg::before {
  opacity: 1;
}

.chip--pos::before {
  content: "+";
}

.chip--neg::before {
  content: "−";
}





/* + green shine */
.chip--pos::after {
  background: linear-gradient(to bottom,
      rgba(22, 163, 74, 0.30) 0%,
      rgba(22, 163, 74, 0.08) 24%,
      rgba(22, 163, 74, 0.00) 60%);
}

/* - red shine */
.chip--neg::after {
  background: linear-gradient(to bottom,
      rgba(220, 38, 38, 0.30) 0%,
      rgba(220, 38, 38, 0.08) 24%,
      rgba(220, 38, 38, 0.00) 60%);
}



.chip:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.12),
    0 0 0 4px rgba(var(--accent-rgb), 0.45),
    0 10px 24px rgba(0, 0, 0, 0.22);
}


.chip-advanced {

  border: 1px dashed var(--border);

  background: transparent;

  padding: 4px 10px;

  border-radius: 999px;

  font-size: 0.85em;

  color: var(--muted);

}



.chip-advanced[aria-pressed="true"] {

  border-color: var(--accent);

  color: var(--text);

  background: var(--row-hover);

}



.column-menu {

  position: relative;

}



.column-panel {

  position: absolute;

  top: 36px;

  right: 0;

  background: var(--column-panel-surface);

  border: 1px solid var(--border);

  border-radius: 8px;

  padding: 10px 12px;

  display: grid;

  gap: 8px;

  min-width: 300px;

  max-height: 70vh;

  overflow: auto;

  scrollbar-width: none;

  z-index: 5;

  box-shadow: var(--panel-shadow);

}

@media (max-width: 700px) {
  .column-panel {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: min(94vw, 360px);
    max-width: 94vw;
  }
}

html[data-theme="dark"] .column-panel {
  background: var(--column-panel-surface);
}



.column-panel::-webkit-scrollbar {

  width: 0;

  height: 0;

}



.column-panel.hidden {

  display: none;

}



.column-scroll-hint {

  position: sticky;

  bottom: 6px;

  display: flex;

  align-items: center;

  justify-content: center;

  height: 18px;

  opacity: 0;

  transform: translateY(4px);

  pointer-events: none;

  transition: opacity var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);

}



.column-scroll-hint::before {

  content: "";

  width: 0;

  height: 0;

  border-left: 6px solid transparent;

  border-right: 6px solid transparent;

  border-top: 8px solid var(--muted);

}



.column-panel--scrollable-down .column-scroll-hint {

  opacity: 0.9;

  transform: translateY(0);

}



.column-panel-header {

  display: grid;

  gap: 8px;

}



.column-search {

  width: 100%;

  min-width: 0;

}



.column-actions {

  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 6px;

}



.column-actions button {

  padding: 4px 8px;

  font-size: 0.78em;

  background: var(--button-bg);

}



.column-toggle {

  display: flex;

  align-items: center;

  gap: 8px;

  font-size: 0.78em;

  color: var(--muted);

  white-space: nowrap;

  justify-self: start;

  width: fit-content;

}



.column-toggle input {

  margin: 0;

  flex: 0 0 auto;

}



.column-toggle span {

  white-space: nowrap;

}



.column-group {

  display: grid;

  gap: 2px;

  padding-top: 6px;

  border-top: 1px solid var(--border);

}



.column-group:first-of-type {

  border-top: none;

  padding-top: 0;

}



.column-group-title {

  font-size: 0.72em;

  text-transform: uppercase;

  letter-spacing: 0.08em;

  color: var(--muted);

  margin: 4px 2px;

}



.column-row {

  font-size: 0.85em;

  display: flex;

  gap: 8px;

  align-items: center;

  padding: 4px 6px;

  border-radius: 6px;

  cursor: pointer;

}



.column-row--group {

  font-weight: 600;

}



.column-row:hover {

  background: var(--row-hover);

}



.column-row input {

  margin: 0;

  min-width: 0;

}





.mixed-wrap {

  display: inline-flex;

  align-items: center;

  gap: 6px;

  white-space: nowrap;

}



.mixed-badge {

  padding: 1px 6px;

  border-radius: 10px;

  font-size: 0.75em;

  border: 1px solid var(--border);

  color: var(--muted);

  white-space: nowrap;

}



.mixed-badge-inline {

  margin-left: 0;

}



.bitrate-est {

  margin-left: 6px;

  font-size: 0.72em;

  text-transform: uppercase;

  letter-spacing: 0.08em;

  color: var(--muted);

}



.match-pill {

  padding: 2px 8px;

  border-radius: 999px;

  font-size: 0.75em;

  border: 1px solid var(--border);

  white-space: nowrap;

  display: inline-flex;

  align-items: center;

  justify-content: center;

}



.match-pill--ok {

  border-color: var(--match-ok);

  color: var(--match-ok);

  background: var(--match-ok-bg);

}



.match-pill--warn {

  border-color: var(--match-warn);

  color: var(--match-warn);

  background: var(--match-warn-bg);

}



.match-pill--future {

  border-color: var(--match-future);

  color: var(--match-future);

  background: var(--match-future-bg);

}



.match-pill--nodisk {

  border-color: var(--match-nodisk);

  color: var(--match-nodisk);

  background: var(--match-nodisk-bg);

}



.match-pill--muted {

  border-color: var(--border);

  color: var(--muted);

  background: var(--match-muted-bg);

}

.health-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.health-badges-slot {
  display: inline-flex;
  align-items: center;
}

.health-badge__icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transform: translateY(-2px);
}

.health-badge {
  position: relative;
  padding: 2px 35px 2px 8px;
  border-radius: 999px;
  font-size: 0.75em;
  border: 1px solid var(--border);
  white-space: nowrap;
  box-sizing: border-box;
  /* Keep all health badges the same width and truncate long messages */
  width: var(--health-badge-width, clamp(170px, 30vw, 280px));

  display: inline-flex;
  align-items: center;
  justify-content: flex-start;

  line-height: 1.9;

  background: var(--panel-surface-soft);
  overflow: hidden;
  /* clip sheen to pill */
  isolation: isolate;

  --badge-glow: 255, 255, 255;
  /* fallback for hover shadow */

  transition: filter 160ms ease, opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

/* sheen overlay base (no white gradient here) */
.health-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  transition: opacity 180ms ease, transform 220ms ease;
  transform: translateY(0);
}

/* content above sheen */
.health-badge>* {
  position: relative;
  z-index: 1;
}

/* text truncation */
.health-badge__text {
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  flex: 1;
  white-space: nowrap;
}

/* state colors */
.health-badge--ok {
  --badge-glow: 22, 163, 74;
  border-color: var(--match-ok);
  color: var(--match-ok);
  background: rgba(22, 163, 74, 0.10);
}

.health-badge--notice {
  --badge-glow: var(--accent-rgb);
  border-color: rgba(var(--accent-rgb), 0.65);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.10);
}

.health-badge--warning {
  --badge-glow: 251, 191, 36;
  border-color: var(--match-warn);
  color: var(--match-warn);
  background: rgba(251, 191, 36, 0.10);
}

.health-badge--error {
  --badge-glow: 220, 38, 38;
  border-color: var(--match-bad);
  color: var(--match-bad);
  background: rgba(220, 38, 38, 0.10);
}

/* colored sheen per state */
.health-badge--ok::before {
  background: linear-gradient(to bottom,
      rgba(22, 163, 74, 0.32) 0%,
      rgba(22, 163, 74, 0.16) 35%,
      rgba(22, 163, 74, 0.06) 60%,
      rgba(22, 163, 74, 0.00) 100%);
}

.health-badge--notice::before {
  background: linear-gradient(to bottom,
      rgba(251, 191, 36, 0.35) 0%,
      rgba(251, 191, 36, 0.18) 35%,
      rgba(251, 191, 36, 0.06) 60%,
      rgba(251, 191, 36, 0.00) 100%);
}

.health-badge--warning::before {
  background: linear-gradient(to bottom,
      rgba(251, 191, 36, 0.35) 0%,
      rgba(251, 191, 36, 0.18) 35%,
      rgba(251, 191, 36, 0.06) 60%,
      rgba(251, 191, 36, 0.00) 100%);
}

.health-badge--error::before {
  background: linear-gradient(to bottom,
      rgba(220, 38, 38, 0.35) 0%,
      rgba(220, 38, 38, 0.18) 35%,
      rgba(220, 38, 38, 0.06) 60%,
      rgba(220, 38, 38, 0.00) 100%);
}

/* hover glow */
.health-badge:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 0 0 2px rgba(var(--badge-glow), 0.45),
    inset 0 0 18px rgba(var(--badge-glow), 0.22),
    0 6px 14px rgba(0, 0, 0, 0.18);
}

.health-badge:hover::before {
  opacity: 0.95;
  transform: translateY(-1px);
}

.health-badge:active {
  transform: translateY(0);
  filter: brightness(1.03);
}

.health-badge.is-dismissing {
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
}

/* close button */
.health-badge__close {
  position: absolute;
  top: 50%;
  right: 10px;
  /* you didn’t have right set, add it */
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: currentColor;
  transition: transform 120ms ease, opacity 120ms ease;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.85;
  z-index: 2;
}

.health-badge__close:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.3);
}

@media (prefers-reduced-motion: reduce) {

  .health-badge,
  .health-badge::before,
  .health-badge__close {
    transition: none;
  }
}


.diag-cell {

  text-align: center;

}



.diag-actions {

  display: inline-flex;

  align-items: center;

  gap: 6px;

}



.match-diag-btn {

  border: 1px solid var(--border);

  background: transparent;

  color: var(--muted);

  font-size: 0.8em;

  line-height: 1;

  padding: 2px 6px;

  border-radius: 999px;

  cursor: pointer;

}

/* iOS/WebKit: prevent diagnostics button from inflating row height */
@supports (-webkit-touch-callout: none) {
  .match-diag-btn {
    min-height: 0;
    /* beats any coarse-pointer min-height */
    height: 20px;
    /* pick the visual target */
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
  }
}




.match-diag-btn:hover,

.match-diag-btn:focus-visible {

  color: var(--text);

  border-color: currentColor;

}



.row-refresh-btn {

  border: 1px solid var(--border);

  background: transparent;

  color: var(--muted);

  font-size: 0.8em;

  line-height: 1.2;

  padding: 2px 6px;

  border-radius: 999px;

  cursor: pointer;

}



.row-refresh-btn:hover,

.row-refresh-btn:focus-visible {

  color: var(--text);

  border-color: currentColor;

}



.row-refresh-btn--title {

  position: absolute;

  left: 10px;

  top: 50%;

  transform: translateY(-50%);

  width: var(--title-refresh-size);

  height: var(--title-refresh-size);

  padding: 0;

  border: 0;

  border-radius: 50%;

  color: var(--row-refresh-icon);

  background: transparent;

  font-size: 13px;

  line-height: 1;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  opacity: 0;

  pointer-events: none;

  transition: opacity var(--motion-fast) var(--motion-ease);

}

.series-expander {
  position: absolute;
  left: calc(10px + var(--title-refresh-gutter));
  top: 50%;
  transform: translateY(-50%);
  width: var(--title-expand-size);
  height: var(--title-expand-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--row-expand-icon);
  background: transparent;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  cursor: pointer;
}

/* iOS/WebKit: prevent diagnostics button from inflating row height */
@supports (-webkit-touch-callout: none) {
  button.series-expander {
    min-height: 0 !important;
    /* beat coarse-pointer UA rules */
    height: 20px;
    padding: 0 !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    line-height: 1;
    font-size: 14px;
    /* ensure glyph box is small */

    -webkit-appearance: none;
    appearance: none;
  }

  /* Ensure the + span itself doesn't expand the line box */
  .series-expander>span {
    line-height: 1;
    display: block;
  }
}

tbody tr:hover .series-expander,
tbody tr:focus-within .series-expander {
  opacity: 1;
  color: var(--row-expand-icon-hover);
}

tbody tr:hover .row-refresh-btn--title,
tbody tr:focus-within .row-refresh-btn--title {
  opacity: 1;
  pointer-events: auto;
}



.row-refresh-btn--title:hover,

.row-refresh-btn--title:focus-visible {

  color: var(--row-refresh-icon-hover);

  border-color: transparent;

}



.row-refresh-btn--title span {

  display: block;

  transform: translateY(-0.5px);

}

tbody tr.row-refresh-pending .row-refresh-btn--title span {
  animation: row-refresh-spin 0.85s linear infinite;
  transform-origin: center;
}

tbody tr.row-refresh-pending .row-refresh-btn--title {
  color: var(--row-refresh-icon-hover);
  opacity: 1;
  pointer-events: auto;
}

/* Default: tight layout (no giant runway) */
.lang-cell,
.lang-cell-truncated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: max-content;
}

.lang-cell .lang-toggle,
.lang-cell .mixed-badge-inline,
.lang-cell-truncated .lang-toggle,
.lang-cell-truncated .mixed-badge-inline {
  margin-left: 0;
}

/* Pills (Show all / Mixed) base styling */
.lang-cell .lang-toggle,
.lang-cell .mixed-badge-inline,
.lang-cell-truncated .lang-toggle,
.lang-cell-truncated .mixed-badge-inline {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 1px 6px;
  border-radius: 999px;
}

/* Toggle button specifics */
.lang-toggle {
  border: 1px solid var(--border);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  font-size: 0.75em;
  color: var(--muted);
}

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

/* Truncation: make the list take remaining width and ellipsize */
.lang-cell-truncated .lang-list {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Only these columns: align pills to the right edge of the cell */
td[data-col="VideoQuality"] .lang-cell,
td[data-col="Resolution"] .lang-cell,
td[data-col="VideoCodec"] .lang-cell,
td[data-col="VideoHDR"] .lang-cell,
td[data-col="VideoQuality"] .lang-cell-truncated,
td[data-col="Resolution"] .lang-cell-truncated,
td[data-col="VideoCodec"] .lang-cell-truncated,
td[data-col="VideoHDR"] .lang-cell-truncated {
  display: flex;
  width: 100%;
  gap: 2px;
  /* tighter pill spacing */
}

/* In those columns, push the toggle(s) to the right */
td[data-col="VideoQuality"] .lang-cell .lang-toggle,
td[data-col="Resolution"] .lang-cell .lang-toggle,
td[data-col="VideoCodec"] .lang-cell .lang-toggle,
td[data-col="VideoHDR"] .lang-cell .lang-toggle,
td[data-col="VideoQuality"] .lang-cell-truncated .lang-toggle,
td[data-col="Resolution"] .lang-cell-truncated .lang-toggle,
td[data-col="VideoCodec"] .lang-cell-truncated .lang-toggle,
td[data-col="VideoHDR"] .lang-cell-truncated .lang-toggle {
  margin-left: auto;
}

/* Expanded state: allow wrapping and show full text */
.lang-cell-truncated.is-expanded {
  white-space: normal;
  flex-wrap: wrap;
}

.lang-cell-truncated.is-expanded .lang-list {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* If you have these sub-elements, flatten the selectors (no nesting) */
.lang-cell-truncated.is-expanded .lang-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: max-content;
  flex-wrap: wrap;
  white-space: normal;
}

.lang-cell-truncated.is-expanded .lang-main {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.lang-cell-truncated.is-expanded .lang-more {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Global language list formatting (non-truncated contexts) */
.lang-list {
  white-space: normal;
  word-break: break-word;
}

/* iOS padding tweak */
@supports (-webkit-touch-callout: none) {

  .lang-cell .mixed-badge-inline,
  .lang-cell .mixed-badge {
    padding-top: 3px;
    padding-bottom: 3px;
  }
}



button {

  background: var(--button-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;

}



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



input {

  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 4px;
  min-width: 220px;
  transition: border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    background-image var(--motion-fast) var(--motion-ease);

}



#titleFilter,

#pathFilter,

#advancedFilter,

#filterCategory,

#filterCondition,

#filterValueSelect,

#filterValueInput {

  background: var(--filter-input-bg);

  border-radius: 10px;

}

#filterCategory,

#filterCondition,

#filterValueSelect {

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  --filter-select-sheen: rgba(255, 255, 255, 0.12);
  --filter-select-caret: var(--muted);

  background-color: var(--filter-input-bg);
  background-image:
    linear-gradient(180deg, var(--filter-select-sheen), rgba(255, 255, 255, 0)),
    linear-gradient(45deg, transparent 50%, var(--filter-select-caret) 50%),
    linear-gradient(135deg, var(--filter-select-caret) 50%, transparent 50%);
  background-position:
    0 0,
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 100% 100%, 6px 6px, 6px 6px;
  background-repeat: no-repeat;

  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 28px 6px 8px;
  min-width: 0;
  font: inherit;

  transition: border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    background-image var(--motion-fast) var(--motion-ease);

}

html[data-theme="dark"] #filterCategory,
html[data-theme="dark"] #filterCondition,
html[data-theme="dark"] #filterValueSelect {
  --filter-select-sheen: rgba(255, 255, 255, 0.06);
}

#filterCategory:focus,
#filterCategory:focus-visible,
#filterCondition:focus,
#filterCondition:focus-visible,
#filterValueSelect:focus,
#filterValueSelect:focus-visible {
  --filter-select-caret: var(--text);
  background-image:
    linear-gradient(180deg, var(--input-focus-sheen), rgba(255, 255, 255, 0)),
    linear-gradient(45deg, transparent 50%, var(--filter-select-caret) 50%),
    linear-gradient(135deg, var(--filter-select-caret) 50%, transparent 50%);
}

input:not([type="checkbox"]):not([type="radio"]):focus,

input:not([type="checkbox"]):not([type="radio"]):focus-visible,

textarea:focus,

textarea:focus-visible,

select:focus,

select:focus-visible {

  outline: none;

  border-color: var(--input-focus-border);

  box-shadow: inset 0 0 0 1px var(--input-focus-border),

    inset 0 0 14px var(--input-focus-glow);

  background-image: linear-gradient(180deg, var(--input-focus-sheen), rgba(255, 255, 255, 0));

}



input[type="checkbox"] {

  min-width: 0;

  width: 16px;

  height: 16px;

  padding: 0;

}



.status {
  color: var(--muted);
  font-size: 0.9em;
}

.version-badge {
  color: var(--muted);
  font-size: 0.8em;
}

.last-updated {
  color: var(--muted);
  font-size: 0.8em;
}

.muted {
  color: var(--muted);
}



.loading-indicator {

  width: 14px;

  height: 14px;

  border: 2px solid var(--border);

  border-top-color: var(--accent);

  border-radius: 50%;

  animation: spin 0.8s linear infinite;

  flex-shrink: 0;

}



button:disabled {

  opacity: 0.6;

  cursor: not-allowed;

}



@keyframes spin {

  to {
    transform: rotate(360deg);
  }

}



.tabs {

  display: flex;

  align-items: center;

  gap: 8px;

  margin-top: 10px;

}

.filters-footer .tabs {
  margin-top: 0;
}



.status-row {

  margin-top: 10px;

  padding: 10px 12px;

  display: flex;

  flex-wrap: wrap;

  gap: 12px;

  align-items: center;

  background: var(--panel-surface-soft);

  border: 1px solid var(--border);

  border-radius: 10px;

  box-shadow: var(--panel-shadow);

  transition: opacity var(--motion-slow) var(--motion-ease), transform var(--motion-slow) var(--motion-ease), max-height var(--motion-slow) var(--motion-ease), margin var(--motion-slow) var(--motion-ease), padding var(--motion-slow) var(--motion-ease);

  max-height: 140px;

  overflow: auto;

  position: relative;
  z-index: 50;
  touch-action: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;

}

.status-row.status-row--complete-flash {

  animation: none;

}



.status-row.status-row--complete-flash::after {

  content: "";

  position: absolute;

  inset: 2px;

  border-radius: 8px;

  background: var(--status-complete-flash-bg);

  opacity: 0;

  animation: status-complete-flash-inner 2.6s var(--motion-ease);

}



@keyframes status-complete-flash {

  0% {

    background: var(--progress-bg);

  }

  60% {

    background: var(--progress-bg);

  }

  100% {

    background: var(--progress-bg);

  }

}



@keyframes status-complete-flash-inner {

  0% {

    opacity: 0;

  }

  12% {

    opacity: var(--status-complete-flash-peak);

  }

  30% {

    opacity: 0;

  }

  45% {

    opacity: var(--status-complete-flash-mid);

  }

  64% {

    opacity: 0;

  }

  78% {

    opacity: var(--status-complete-flash-low);

  }

  100% {

    opacity: 0;

  }

}



.status-block {

  display: flex;

  flex-direction: column;

  gap: 2px;

  min-width: 140px;

}



.status-label {

  font-size: 0.72em;

  text-transform: uppercase;

  letter-spacing: 0.08em;

  color: var(--muted);

}



.status-value {

  font-weight: 600;

}



.status-actions {

  margin-left: auto;

  display: flex;

  flex-wrap: wrap;

  gap: 8px;

}

.status-actions-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}



.status-complete {

  flex-basis: 100%;

  font-size: 0.82em;

  color: var(--muted);

}



.status-complete.status-complete--muted {

  visibility: hidden;



}



.status-row.status-row--hidden {

  opacity: 0;

  transform: translateY(-6px);

  max-height: 0;

  margin-top: 0;

  padding-top: 0;

  padding-bottom: 0;


}



.status-pill {

  margin-top: 8px;

  display: inline-flex;

  align-items: center;

  gap: 6px;

  padding: 6px 12px;

  border-radius: 999px;

  border: 1px solid var(--border);

  background: var(--panel-surface);

  color: var(--muted);

  font-size: 0.82em;

  letter-spacing: 0.02em;

  cursor: default;

  opacity: 1;

  transform: translateY(0);

  pointer-events: auto;

  align-self: flex-start;

  max-height: 40px;

  overflow: hidden;

  transition: opacity var(--motion-medium) var(--motion-ease), transform var(--motion-medium) var(--motion-ease), max-height var(--motion-medium) var(--motion-ease), margin var(--motion-medium) var(--motion-ease), padding var(--motion-medium) var(--motion-ease), border-width var(--motion-medium) var(--motion-ease), border-color var(--motion-medium) var(--motion-ease), background var(--motion-medium) var(--motion-ease);

  will-change: opacity, transform;

}



.status-pill.status-pill--hidden {

  opacity: 0;

  transform: translateY(-6px);



  max-height: 0;

  margin-top: 0;

  padding: 0;

  border-width: 0;

}



.status-pill.status-pill--pending {

  color: rgb(135, 159, 189);

  border-color: rgb(29, 127, 255);

  background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-rgb), 0.18), rgba(var(--accent-rgb), 0.08));

  background-size: 200% 100%;

  animation: status-pill-sheen 2.8s var(--motion-ease) infinite;

}



.status-pill.status-pill--loaded {
  color: rgb(137, 177, 134);
  border-color: var(--match-ok);
  background: linear-gradient(120deg, rgba(var(--match-ok-rgb), 0.08), rgba(var(--match-ok-rgb), 0.18), rgba(var(--match-ok-rgb), 0.08));
  background-size: 200% 100%;
  animation: status-pill-sheen 2.8s var(--motion-ease) infinite;
}


/* Light mode visibility pass for animated status pills */
html:not([data-theme="dark"]) .status-pill.status-pill--pending {
  /* darker text for contrast on light backgrounds */
  color: color-mix(in srgb, rgb(var(--accent-rgb)) 60%, black);


  /* stronger, warmer border so it reads on white */
  border-color: rgba(var(--accent-rgb), 0.85);

  /* more opaque fill, less “washed out” */
  background: linear-gradient(120deg,
      rgba(var(--accent-rgb), 0.16),
      rgba(var(--accent-rgb), 0.60),
      rgba(var(--accent-rgb), 0.16));

  background-size: 200% 100%;

  /* subtle inner edge so it doesn't disappear on pale surfaces */
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.22),
    0 1px 0 rgba(110, 19, 19, 0.06);

  animation: status-pill-sheen 2.8s var(--motion-ease) infinite;
}

html:not([data-theme="dark"]) .status-pill.status-pill--loaded {
  color: rgba(10, 70, 18, 0.92);
  border-color: rgba(var(--match-ok-rgb), 0.85);

  background: linear-gradient(120deg,
      rgba(var(--match-ok-rgb), 0.16),
      rgba(var(--match-ok-rgb), 0.60),
      rgba(var(--match-ok-rgb), 0.16));

  background-size: 200% 100%;

  box-shadow:
    inset 0 0 0 1px rgba(var(--match-ok-rgb), 0.20),
    0 1px 0 rgba(0, 0, 0, 0.06);

  animation: status-pill-sheen 2.8s var(--motion-ease) infinite;
}


.status-pill.status-pill--active {

  opacity: 0.75;

  transform: translateY(-2px);

}



.status-row:hover {

  opacity: 1;

  transform: translateY(0);

  max-height: 140px;

  margin-top: 10px;

  padding-top: 10px;

  padding-bottom: 10px;

  pointer-events: auto;

}



.copy-toast {

  position: fixed;

  z-index: 9999;

  padding: 6px 10px;

  border-radius: 6px;

  background: var(--panel);

  color: var(--text);

  border: 1px solid var(--border);

  font-size: 0.85rem;

  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);

  pointer-events: none;

  opacity: 0;

  transform: translate(-50%, -90%) scale(0.98);

  transition: opacity var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);

  max-width: min(240px, 80vw);

  text-align: center;

}



.copy-toast.copy-toast--show {

  opacity: 1;

  transform: translate(-50%, -120%) scale(1);

}



.status-banner {

  margin-top: 8px;

  max-width: max-content;

  padding: 8px 12px;

  border-radius: 8px;

  border: 1px solid var(--info-banner-border);

  background: var(--info-banner-bg);

  color: var(--info-banner-text);

  font-size: 0.9em;

}

html:not([data-theme="dark"]) .status-banner {
  color: color-mix(in srgb, rgb(var(--accent-rgb)) 60%, black);
  max-width: max-content;

  /* stronger, warmer border so it reads on white */
  border-color: rgba(var(--accent-rgb), 0.85);

  /* more opaque fill, less “washed out” */
  background: linear-gradient(120deg,
      rgba(var(--accent-rgb), 0.18),
      rgba(var(--accent-rgb), 0.60),
      rgba(var(--accent-rgb), 0.18));

  background-size: 200% 100%;

  /* subtle inner edge so it doesn't disappear on pale surfaces */
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.22),
    0 1px 0 rgba(0, 0, 0, 0.06);

  animation: status-pill-sheen 2.8s var(--motion-ease) infinite;
}



@keyframes status-pill-sheen {

  0% {

    background-position: 0% 50%;

  }

  100% {

    background-position: 200% 50%;

  }

}



@media (prefers-reduced-motion: reduce) {

  .status-row,

  .status-pill,

  .filters-body,

  .chip-wrap,

  .column-scroll-hint,

  .copy-toast {

    transition: none;

  }

  .status-pill.status-pill--pending {

    animation: none;

  }

}



.tab {

  padding: 6px 12px;

  border-radius: 10px;

  border: 1px solid var(--border);

  background: var(--button-bg);

  cursor: pointer;

}



.tab.active {

  border-color: var(--accent);

  font-weight: 600;

}



.spacer {
  flex: 1;
}



.table-wrap {

  margin-top: 12px;
  overflow-x: auto;
  overflow-y: auto;

  position: relative;
  z-index: 1;

  border: 1px solid var(--border);

  border-radius: 12px;

  background:

    linear-gradient(var(--table-header-bg), var(--table-header-bg)) 0 0 / 100% var(--table-header-height) no-repeat,

    var(--data-bg);

  box-shadow: var(--panel-shadow);

  scrollbar-gutter: stable;

  max-width: 100%;

  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;


}

/* iOS Safari only: give the table area more minimum vertical space */
@supports (-webkit-touch-callout: none) {
  .table-wrap {
    min-height: 60svh;
    max-height: calc(100dvh - 180px);
  }
}

.table-wrap:focus {
  outline: none;
}



html[data-theme="dark"] .table-wrap {

  scrollbar-color: rgba(255, 255, 255, 0.3) var(--data-bg);

}



html[data-theme="dark"] .table-wrap::-webkit-scrollbar {

  width: 12px;

  height: 12px;

}



html[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb {

  background-color: rgba(255, 255, 255, 0.28);

  border-radius: 999px;

  border: 3px solid rgba(0, 0, 0, 0.28);

}



html[data-theme="dark"] .table-wrap::-webkit-scrollbar-track {

  background-color: var(--data-bg);

  border-radius: 999px;

}

/* Table fullscreen mode */
html.table-fullscreen .toolbar,
html.table-fullscreen .filters,
html.table-fullscreen .status-row,
html.table-fullscreen .status-banner {
  display: none !important;
}

.table-unfullscreen-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10001;
  /* above #tableWrap (9998) and tooltips (9999) */
  display: none;

  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-surface-strong);
  box-shadow: var(--panel-shadow);
  color: var(--text);
  cursor: pointer;
}

html.table-fullscreen .table-unfullscreen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Remove outer padding so the fixed table really uses the screen */
html.table-fullscreen .app {
  padding: 0 !important;
}

/* Make the table area fill the viewport (top offset set by JS) */
html.table-fullscreen #tableWrap.table-wrap {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--table-fullscreen-top, 0px);
  bottom: 0;

  margin-top: 0 !important;
  border-radius: 0 !important;

  max-height: none !important;
  min-height: 0 !important;

  z-index: 9998;
}


table {

  border-collapse: collapse;

  margin-top: 0;

  background: transparent;

  border: 0;

  border-radius: 0;

  box-shadow: none;

  min-width: 100%;

  width: auto;

  background-clip: padding-box;

  --cap-ContentHours: auto;
  --cap-RuntimeMins: auto;
  --cap-EpisodesCounted: auto;
  --cap-SeasonCount: auto;
  --cap-MissingCount: auto;
  --cap-CutoffUnmetCount: auto;
  --cap-AvgEpisodeSizeGB: auto;
  --cap-TotalSizeGB: auto;
  --cap-FileSizeGB: auto;
  --cap-GBPerHour: auto;
  --cap-BitrateMbps: auto;
  --cap-VideoQuality: auto;
  --cap-Resolution: auto;
  --cap-VideoCodec: auto;
  --cap-AudioCodec: auto;
  --cap-AudioChannels: auto;
  --cap-Status: auto;
  --cap-Instance: auto;
  --cap-QualityProfile: auto;
  --cap-ReleaseGroup: auto;
  --cap-Tags: 220px;
  --cap-Studio: auto;
  --cap-OriginalLanguage: auto;
  --cap-Genres: auto;
  --cap-Edition: auto;
  --cap-CustomFormats: auto;
  --cap-Languages: auto;
  --cap-AudioLanguages: auto;
  --cap-SubtitleLanguages: auto;
  --cap-VideoHDR: auto;

}



table.is-batching,

table.stable-columns {

  table-layout: auto;


}


table[data-app="radarr"] {

  table-layout: auto;
  --cap-RuntimeMins: auto;
  --cap-FileSizeGB: auto;
  --cap-GBPerHour: auto;
  --cap-BitrateMbps: auto;

  --cap-Status: auto;
  --cap-Instance: auto;
  --cap-QualityProfile: auto;
  --cap-ReleaseGroup: auto;
  --cap-Tags: auto;

  --cap-Studio: auto;
  --cap-OriginalLanguage: auto;
  --cap-Genres: auto;

  --cap-Edition: auto;
  --cap-CustomFormats: auto;

  --cap-VideoQuality: auto;
  --cap-Resolution: auto;
  --cap-VideoCodec: auto;
  --cap-VideoHDR: auto;

  --cap-AudioCodec: auto;
  --cap-AudioChannels: auto;
  --cap-Languages: auto;
  --cap-AudioLanguages: auto;
  --cap-SubtitleLanguages: auto;
}








th,
td {


  padding: 8px 10px;

  border-bottom: 1px solid var(--border);

  border-right: 1px solid var(--col-divider-color);

  text-align: left;

  font-size: 0.95em;

  vertical-align: middle;

}



td[data-col="AudioChannels"],
th[data-col="AudioChannels"] {
  text-align: left;

}

.audio-channels-cell {
  text-align: center;
}

th:last-child,

td:last-child {

  border-right: 0;

}



th {

  position: sticky;

  top: 0;

  background: var(--table-header-bg);

  z-index: 1;

  font-weight: 600;

  white-space: nowrap;

  line-height: 1.2;

}



th[data-col="Title"],

td[data-col="Title"] {

  padding-left: calc(10px + var(--title-refresh-gutter) + var(--title-expand-gutter));

  text-align: left;

  width: var(--title-col-width);

  min-width: var(--title-col-width);

  max-width: var(--title-col-width);

}



td[data-col="Title"] {

  position: relative;

}

/* Column sizing normalized. See bottom of file: NORMALIZED COLUMN SIZING panel. */

.audio-codec-wrap {

  display: inline-flex;

  align-items: center;

  gap: 6px;

  max-width: 100%;

}



.audio-codec-cell {

  display: inline-block;

  text-align: left;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

  vertical-align: middle;

}



.audio-channels-cell {

  display: block;

  width: 100%;

  max-width: 100%;

  min-width: 0;


}

.audio-channels-cell .lang-cell {

  max-width: 100%;

  min-width: 0;


}



.num-cell {

  display: inline-grid;

  grid-auto-flow: column;

  grid-template-columns: var(--num-int-width, auto) var(--num-dot-width, 0.4ch) var(--num-frac-width, auto);

  align-items: baseline;


}



.num-int {

  text-align: right;


}



.num-dot {

  text-align: center;

  width: var(--num-dot-width, 0.4ch);



}



.num-frac {

  text-align: center;

  min-width: var(--num-frac-width, 0ch);

}



.num-cell.no-frac .num-dot,
.num-cell.no-frac .num-frac {
  opacity: 0;
}


tbody tr.row-mismatch {
  background: var(--mismatch-bg);
}

tbody tr.row-mismatch td {
  background: var(--mismatch-bg);
}


tbody tr.row-selected,
tbody tr.row-selected td {
  background: var(--row-hover);
}


tbody tr:hover {
  background: var(--row-hover);
}

tbody tr:hover td {
  background: var(--row-hover);
}

tbody tr.row-selected:hover td {
  background: var(--row-hover);
}



tbody tr.row-refresh-pending td {

  background: var(--row-refresh-pending);

  transition: opacity var(--motion-fast) var(--motion-ease);

  animation: row-refresh-pending 1.2s linear infinite;

  will-change: box-shadow;

}





tbody tr.row-refresh-success td {

  animation: row-refresh-success 2.2s var(--motion-ease);

}



tbody tr.row-refresh-partial td {

  animation: row-refresh-partial 2.2s var(--motion-ease);

}



tbody tr.row-refresh-fail td {

  animation: row-refresh-fail 2.2s var(--motion-ease);

}



tbody tr.row-refresh-focus td {

  animation: row-refresh-focus 2.6s var(--motion-ease);

}



@keyframes row-refresh-success {

  0% {
    background-color: rgba(16, 140, 70, 0);
  }

  12% {
    background-color: var(--row-refresh-success-strong);
  }

  30% {
    background-color: rgba(16, 140, 70, 0);
  }

  46% {
    background-color: var(--row-refresh-success-mid);
  }

  62% {
    background-color: rgba(16, 140, 70, 0);
  }

  78% {
    background-color: var(--row-refresh-success-low);
  }

  100% {
    background-color: rgba(16, 140, 70, 0);
  }

}



@keyframes row-refresh-fail {

  0% {
    box-shadow: inset 0 0 0 0 rgba(234, 90, 90, 0);
  }

  12% {
    box-shadow: inset 0 0 0 9999px rgba(234, 90, 90, 0.26);
  }

  30% {
    box-shadow: inset 0 0 0 9999px rgba(234, 90, 90, 0);
  }

  46% {
    box-shadow: inset 0 0 0 9999px rgba(234, 90, 90, 0.22);
  }

  62% {
    box-shadow: inset 0 0 0 9999px rgba(234, 90, 90, 0);
  }

  78% {
    box-shadow: inset 0 0 0 9999px rgba(234, 90, 90, 0.18);
  }

  100% {
    box-shadow: inset 0 0 0 0 rgba(234, 90, 90, 0);
  }

}



@keyframes row-refresh-partial {

  0% {
    box-shadow: inset 0 0 0 0 rgba(245, 199, 66, 0);
  }

  12% {
    box-shadow: inset 0 0 0 9999px rgba(245, 199, 66, 0.26);
  }

  30% {
    box-shadow: inset 0 0 0 9999px rgba(245, 199, 66, 0);
  }

  46% {
    box-shadow: inset 0 0 0 9999px rgba(245, 199, 66, 0.22);
  }

  62% {
    box-shadow: inset 0 0 0 9999px rgba(245, 199, 66, 0);
  }

  78% {
    box-shadow: inset 0 0 0 9999px rgba(245, 199, 66, 0.18);
  }

  100% {
    box-shadow: inset 0 0 0 0 rgba(245, 199, 66, 0);
  }

}



@keyframes row-refresh-pending {

  0% {
    box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0);
  }

  25% {
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.18);
  }

  50% {
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.32);
  }

  75% {
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.16);
  }

  100% {
    box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0);
  }

}



@keyframes row-refresh-focus {

  0% {
    box-shadow: inset 0 0 0 0 var(--row-focus);
  }

  18% {
    box-shadow: inset 0 0 0 9999px var(--row-focus);
  }

  40% {
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0);
  }

  62% {
    box-shadow: inset 0 0 0 9999px var(--row-focus);
  }

  100% {
    box-shadow: inset 0 0 0 0 var(--row-focus);
  }

}



@keyframes row-refresh-spin {

  from {
    transform: translateY(-0.5px) rotate(0deg);
  }

  to {
    transform: translateY(-0.5px) rotate(360deg);
  }

}



.right {
  text-align: center;
}




td[data-col="AudioCodec"] {
  max-width: max-content;
}

td[data-col="RootFolder"],
td[data-col="Path"] {

  white-space: nowrap;

}



td[data-col="Title"] {

  white-space: nowrap;

  overflow: hidden;

}

td[data-col="Status"],
td[data-col="Instance"],
td[data-col="QualityProfile"],
td[data-col="ReleaseGroup"],
td[data-col="Tags"],
td[data-col="Studio"],
td[data-col="OriginalLanguage"],
td[data-col="Genres"],
td[data-col="LastSearchTime"],
td[data-col="Edition"],
td[data-col="CustomFormats"],
td[data-col="VideoQuality"],
td[data-col="Resolution"],
td[data-col="VideoCodec"],
td[data-col="VideoHDR"],
td[data-col="AudioCodec"] {




  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}



table.is-batching td[data-col="Path"],

table.stable-columns td[data-col="Path"] {

  overflow: hidden;

  text-overflow: ellipsis;

}

table.is-batching td[data-col="RootFolder"],
table.stable-columns td[data-col="RootFolder"] {
  overflow: hidden;
  text-overflow: ellipsis;
}



.brand {

  display: flex;

  align-items: center;

  gap: 10px;

  margin-right: 14px;

}



.brand img {

  width: 44px;

  height: 44px;

  flex-shrink: 0;

}



.brandText {

  display: flex;

  flex-direction: column;

  line-height: 1.05;

}



.brandName {
  font-size: 1.1rem;
  font-weight: 700;
}

.brandSub {
  font-size: 0.8rem;
  color: var(--muted);
}



th[data-sort] {
  user-select: none;
}

th[data-sort]:hover {
  opacity: 0.95;
}



.sort-indicator {

  display: inline-block;

  width: 12px;

  text-align: center;

  margin-left: 6px;

  font-size: 0.75em;

  opacity: 0.6;

}



th.active-sort .sort-indicator {
  opacity: 1;
}



.col-hidden {
  display: none;
}



.title-text {

  display: block;

  width: 100%;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}

.title-orb-wrap {

  display: inline-flex;

  align-items: center;

  gap: 16px;

  width: 100%;

  min-width: 0;

}

.title-orb-wrap .title-text {

  width: auto;

  flex: 0 1 auto;

  min-width: 0;

  max-width: 100%;

  display: inline-block;

}

.match-orb {

  width: 8px;

  height: 8px;

  border-radius: 50%;

  display: inline-block;

  flex: 0 0 auto;

  background: var(--match-orb-fill);

  box-shadow: 0 0 0 3px var(--match-orb-ring);

}

.match-orb--ok {

  --match-orb-fill: var(--match-ok);

  --match-orb-ring: rgba(var(--match-ok-rgb), 0.24);

}

.match-orb--warn {

  --match-orb-fill: var(--match-warn);

  --match-orb-ring: rgba(var(--match-warn-rgb), 0.24);

}

.match-orb--future {

  --match-orb-fill: var(--match-future);

  --match-orb-ring: rgba(var(--match-future-rgb), 0.24);

}

.match-orb--nodisk {

  --match-orb-fill: var(--match-nodisk);

  --match-orb-ring: rgba(var(--match-nodisk-rgb), 0.24);

}

.match-orb--muted {

  --match-orb-fill: rgba(var(--muted-rgb), 0.85);

  --match-orb-ring: rgba(var(--muted-rgb), 0.22);

}

/* clickable title link */

a.title-link {

  color: inherit;

  text-decoration: none;

}



a.title-link:hover {

  text-decoration: underline;

  text-decoration-color: var(--accent);

}

tr.series-child-row td {
  background: var(--series-expand-bg);
  border-bottom: 0 solid var(--series-expand-border);
  padding: 0 12px;
  text-align: left;
  transition: padding var(--motion-medium) var(--motion-ease), border-width var(--motion-medium) var(--motion-ease);
}

tr.series-child-row--open td {
  border-bottom-width: 1px;
  padding: 12px 12px 14px;
}

tbody tr.series-child-row:hover td {
  background: var(--series-expand-bg);
}

.series-expansion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition: opacity var(--motion-medium) var(--motion-ease),
    transform var(--motion-medium) var(--motion-ease),
    max-height var(--motion-medium) var(--motion-ease);
  will-change: opacity, transform;
}

tr.series-child-row--open .series-expansion {
  max-height: 12000px;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.series-expansion-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
}

.series-expansion-poster {
  width: auto;
  height: 200px;
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-surface-soft);
  padding: 6px;
  box-shadow: var(--panel-shadow);
  box-sizing: border-box;
}

.series-expansion-poster--empty {
  display: none;
}

.series-expansion-poster-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.series-expansion-title {
  display: none;
}

.series-expansion-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.series-expansion-toggle {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75em;
  background: transparent;
  border: 1px solid var(--series-expand-border);
  color: var(--muted);
}

.series-expansion-toggle:hover,
.series-expansion-toggle:focus-visible {
  color: var(--text);
  border-color: var(--accent);
}

.series-expansion-toggle.is-active,
.series-expansion-toggle[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

.series-expansion-status {
  font-size: 0.85em;
  color: var(--muted);
}

.series-expansion-status--warn {
  color: var(--match-warn);
}

.series-expansion-body {
  display: grid;
  gap: 8px;
}

.series-season-block {
  border: 1px solid var(--series-expand-border);
  border-radius: 12px;
  background: var(--data-bg);
}

.series-season-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.series-season-row--selected {
  background: var(--series-episode-hover);
}

.series-season-row:hover {
  background: var(--series-episode-hover);
}

.series-season-row--selected:hover {
  background: var(--series-episode-hover);
}

.series-season-toggle {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--series-expand-border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.series-season-toggle:hover,
.series-season-toggle:focus-visible {
  color: var(--text);
  border-color: currentColor;
}

.series-season-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.series-season-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.series-season-extras {
  margin-left: 0;
  flex-shrink: 0;
}

.series-season-title {
  font-weight: 600;
}

.series-season-meta {
  font-size: 0.85em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.series-season-episodes {
  border-top: 0 dashed var(--series-expand-border);
  padding: 0 10px;
  max-height: 0;
  overflow: hidden;
  contain: layout paint;
  scroll-behavior: smooth;

  opacity: 0;
  transform: translate3d(0, -6px, 0);
  pointer-events: none;
  transition: opacity var(--motion-medium) var(--motion-ease),
    transform var(--motion-medium) var(--motion-ease),
    max-height var(--motion-medium) var(--motion-ease),
    padding var(--motion-medium) var(--motion-ease),
    border-width var(--motion-medium) var(--motion-ease);
  will-change: opacity, transform;
}

.series-season-episodes.is-open {
  border-top-width: 1px;
  padding: 8px 10px 10px;
  max-height: 420px;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.series-expansion-empty,
.series-expansion-error {
  color: var(--muted);
  font-size: 0.9em;
  padding: 6px 4px;
}

.series-expansion-error {
  color: var(--match-warn);
}

.series-episode-scroll {
  position: relative;
  overflow-y: auto;
  border: 1px solid var(--series-expand-border);
  border-radius: 8px;
  background: var(--data-bg);
}

.series-episode-rows {
  display: block;
}

.series-episode-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--series-episode-grid-current);
  gap: 0;
  padding: 6px 8px;
  background: var(--series-expand-bg);
  border-bottom: 1px solid var(--series-expand-border);
  font-size: 0.8em;
  color: var(--muted);
}

.series-episode-header-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.series-episode-header-title {
  font-weight: 600;
}

.series-episode-row {
  display: grid;
  grid-template-columns: var(--series-episode-grid-current);
  gap: 0;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--series-expand-border);
}

.series-episode-row:last-child {
  border-bottom: 0;
}

.series-episode-row:hover {
  background: var(--series-episode-hover);
}

.series-episode-row--selected {
  background: var(--series-episode-hover);
}

.series-episode-row--selected:hover {
  background: var(--series-episode-hover);
}

.series-episode-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.series-episode-code {
  font-weight: 600;
  font-size: 0.85em;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
}

.series-episode-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.series-episode-cell {
  font-size: 0.85em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.series-episode-col {
  border-left: 1px solid var(--series-expand-border);
  padding-left: 6px;
  text-align: center;
}

.series-season-episodes {
  --series-episode-grid-current: var(--series-episode-grid-extras);
}

.series-season-episodes.series-episode-extras {
  --series-episode-grid-current: var(--series-episode-grid-extras);
}

.series-season-episodes .series-episode-extra {
  display: none;
}

.series-season-episodes.series-episode-extras .series-episode-extra {
  display: block;
}


.series-episode-size {
  font-family: var(--font-sans);
  color: var(--text);
}

.series-episode-row--missing .series-episode-size {
  color: var(--match-warn);
}

.series-episode-virtual-spacer {
  width: 100%;
}

.series-episode-virtual-items {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}

.series-skeleton {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--series-expand-border);
  background: linear-gradient(90deg, rgba(var(--muted-rgb), 0.12), rgba(var(--muted-rgb), 0.04), rgba(var(--muted-rgb), 0.12));
  background-size: 200% 100%;
  animation: series-skeleton-shimmer 1.2s linear infinite;
}

@keyframes series-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Perf overlay (Phase 0) */
.perf-overlay {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  font-size: 12px;
  line-height: 1.25;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.78);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  user-select: none;
  pointer-events: none;
  max-width: 280px;
}

.perf-overlay.hidden {
  display: none;
}

.perf-overlay__row {
  margin: 2px 0;
}

.perf-overlay__hint {
  opacity: 0.75;
  margin-top: 6px;
}


/* Virtual table body spacers (Phase 1) */
.virtual-spacer-row td.virtual-spacer-cell {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  height: 0px;
}


/* Containment hints (Phase 3) */
.table-wrap {
  contain: layout paint;
}

tbody tr {
  contain: layout paint;
}

.settings-modal,
.column-panel,
.advanced-help {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}

table[data-app="radarr"] td[data-col="AudioCodec"],
table[data-app="radarr"] td[data-col="AudioLanguages"],
table[data-app="radarr"] td[data-col="SubtitleLanguages"],
table[data-app="radarr"] td[data-col="AudioCodecMixed"],
table[data-app="radarr"] td[data-col="AudioLanguagesMixed"],
table[data-app="radarr"] td[data-col="SubtitleLanguagesMixed"] {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Force language columns to a single line (Sonarr + Radarr) */
td[data-col="AudioLanguages"],
td[data-col="SubtitleLanguages"],
td[data-col="Languages"],
td[data-col="AudioLanguagesMixed"],
td[data-col="SubtitleLanguagesMixed"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* If the cell contains nested spans/divs, clamp them too */
td[data-col="AudioLanguages"] *,
td[data-col="SubtitleLanguages"] *,
td[data-col="Languages"] *,
td[data-col="AudioLanguagesMixed"] *,
td[data-col="SubtitleLanguagesMixed"] * {
  white-space: nowrap;
}

/* Give the Mixed columns more room */
th[data-col="AudioLanguagesMixed"],
td[data-col="AudioLanguagesMixed"],
th[data-col="SubtitleLanguagesMixed"],
td[data-col="SubtitleLanguagesMixed"] {
  width: auto;
}

/* Let inner content shrink correctly (prevents hard clipping in flex/grid) */
td[data-col="AudioLanguagesMixed"]>*,
td[data-col="SubtitleLanguagesMixed"]>* {
  min-width: 0;
}

/* Force Audio Channels to single line with ellipsis */
td[data-col="AudioChannels"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Allow inner flex/grid content to shrink properly */
td[data-col="AudioChannels"]>* {
  min-width: 0;
}

/* Last Watched: keep single-line */
td[data-col="LastWatched"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

td[data-col="LastWatched"]>* {
  min-width: 0;
}


td[data-col="TitleSlug"],
th[data-col="TitleSlug"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  position: relative;
  /* tweak this */
  width: 260px;
}

/* ===========================
   NORMALIZED COLUMN SIZING
   Keep all column widths in one place, like a spreadsheet config panel.
   Edit the variables below (the mapping rules reference only these vars).
   =========================== */

/* Default caps (shared). Override inside table[data-app="sonarr"] or table[data-app="radarr"] if needed. */
table[data-app] {
  /* Title / Path */
  --w-Title: var(--title-col-width);
  --w-RootFolder: clamp(12ch, 16vw, 36ch);
  --w-Path: var(--path-col-width);

  /* Core numeric columns */
  --w-ContentHours: var(--cap-ContentHours, auto);
  --w-RuntimeMins: var(--cap-RuntimeMins, auto);
  --w-EpisodesCounted: var(--cap-EpisodesCounted, auto);
  --w-SeasonCount: var(--cap-SeasonCount, auto);
  --w-MissingCount: var(--cap-MissingCount, auto);
  --w-CutoffUnmetCount: var(--cap-CutoffUnmetCount, auto);
  --w-AvgEpisodeSizeGB: var(--cap-AvgEpisodeSizeGB, auto);
  --w-TotalSizeGB: var(--cap-TotalSizeGB, auto);
  --w-FileSizeGB: var(--cap-FileSizeGB, auto);
  --w-GBPerHour: var(--cap-GBPerHour, auto);
  --w-BitrateMbps: var(--cap-BitrateMbps, auto);

  /* Media details */
  --w-VideoQuality: var(--cap-VideoQuality, auto);
  --w-Resolution: var(--cap-Resolution, auto);
  --w-VideoCodec: var(--cap-VideoCodec, auto);
  --w-AudioCodec: var(--cap-AudioCodec, auto);
  --w-AudioChannels: var(--cap-AudioChannels, auto);
  --w-VideoHDR: var(--cap-VideoHDR, auto);

  /* Metadata columns */
  --w-Status: var(--cap-Status, auto);
  --w-Instance: var(--cap-Instance, auto);
  --w-QualityProfile: var(--cap-QualityProfile, auto);
  --w-ReleaseGroup: var(--cap-ReleaseGroup, auto);
  --w-Tags: var(--cap-Tags, auto);
  --w-Studio: var(--cap-Studio, auto);
  --w-OriginalLanguage: var(--cap-OriginalLanguage, auto);
  --w-Genres: var(--cap-Genres, auto);
  --w-Edition: var(--cap-Edition, auto);
  --w-CustomFormats: var(--cap-CustomFormats, auto);
  --w-Languages: var(--cap-Languages, auto);
  --w-AudioLanguages: var(--cap-AudioLanguages, auto);
  --w-SubtitleLanguages: var(--cap-SubtitleLanguages, auto);

  /* Optional: Sonarr-only, keep fairly tight */
  --w-TitleSlug: 260px;
}

/* Mapping rules (one selector per column). */
th[data-col="Title"],
td[data-col="Title"] {
  padding-left: calc(10px + var(--title-refresh-gutter) + var(--title-expand-gutter));
  text-align: left;
  width: var(--w-Title);
  min-width: var(--w-Title);
  max-width: var(--w-Title);

}

th[data-col="TotalSizeGB"],
td[data-col="TotalSizeGB"] {
  text-align: center;
}

th[data-col="RootFolder"],
td[data-col="RootFolder"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
  text-align: left;
}

td[data-col="RootFolder"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th[data-col="Path"],
td[data-col="Path"] {
  width: var(--w-Path);
  min-width: 400px;
  max-width: var(--w-Path);
  text-align: left;
}

td[data-col="Path"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* TitleSlug (Sonarr) */
th[data-col="TitleSlug"],
td[data-col="TitleSlug"] {
  width: var(--w-TitleSlug);
  min-width: var(--w-TitleSlug);
  max-width: var(--w-TitleSlug);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Numeric / compact columns */
th[data-col="ContentHours"],
td[data-col="ContentHours"] {
  width: var(--w-ContentHours);
  min-width: var(--w-ContentHours);
  max-width: var(--w-ContentHours);
}

th[data-col="RuntimeMins"],
td[data-col="RuntimeMins"] {
  width: var(--w-RuntimeMins);
  min-width: var(--w-RuntimeMins);
  max-width: var(--w-RuntimeMins);
}

th[data-col="EpisodesCounted"],
td[data-col="EpisodesCounted"] {
  min-width: 60px;
  width: max-content;
  max-width: none;
}

th[data-col="SeasonCount"],
td[data-col="SeasonCount"] {
  min-width: 80px;
  width: max-content;
  max-width: none;
}

th[data-col="MissingCount"],
td[data-col="MissingCount"] {
  min-width: 80px;
  width: max-content;
  max-width: none;
}

th[data-col="CutoffUnmetCount"],
td[data-col="CutoffUnmetCount"] {
  min-width: 80px;
  width: max-content;
  max-width: none;
}

th[data-col="AvgEpisodeSizeGB"],
td[data-col="AvgEpisodeSizeGB"] {
  min-width: 80px;
  width: max-content;
  max-width: none;
}

th[data-col="TotalSizeGB"],
td[data-col="TotalSizeGB"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="FileSizeGB"],
td[data-col="FileSizeGB"] {
  min-width: 110px;
  width: max-content;
  max-width: none;
}

th[data-col="GBPerHour"],
td[data-col="GBPerHour"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="BitrateMbps"],
td[data-col="BitrateMbps"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="VideoQuality"],
td[data-col="VideoQuality"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="Resolution"],
td[data-col="Resolution"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="VideoCodec"],
td[data-col="VideoCodec"] {
  min-width: 100px;
  width: max-content;
  max-width: none;

}

th[data-col="AudioCodec"],
td[data-col="AudioCodec"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="AudioChannels"],
td[data-col="AudioChannels"] {
  min-width: 200px;
  width: max-content;
  max-width: none;
}

th[data-col="VideoHDR"],
td[data-col="VideoHDR"] {
  width: var(--w-VideoHDR);
  min-width: var(--w-VideoHDR);
  max-width: var(--w-VideoHDR);
}

th[data-col="Status"],
td[data-col="Status"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="Instance"],
td[data-col="Instance"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="QualityProfile"],
td[data-col="QualityProfile"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="ReleaseGroup"],
td[data-col="ReleaseGroup"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="Tags"],
td[data-col="Tags"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}



th[data-col="Studio"],
td[data-col="Studio"] {
  min-width: 100px;
  width: max-content;
  max-width: none;
}

th[data-col="OriginalLanguage"],
td[data-col="OriginalLanguage"] {
  width: var(--w-OriginalLanguage);
  min-width: var(--w-OriginalLanguage);
  max-width: var(--w-OriginalLanguage);
}

th[data-col="Genres"],
td[data-col="Genres"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
}

th[data-col="Genre"],
td[data-col="Genre"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
}

th[data-col="Edition"],
td[data-col="Edition"] {
  width: var(--w-Edition);
  min-width: var(--w-Edition);
  max-width: var(--w-Edition);
}

th[data-col="CustomFormats"],
td[data-col="CustomFormats"] {
  width: var(--w-CustomFormats);
  min-width: var(--w-CustomFormats);
  max-width: var(--w-CustomFormats);
}

th[data-col="Languages"],
td[data-col="Languages"] {
  min-width: 220px;
  width: var(--w-OriginalLanguage);
  max-width: max-content;
}

th[data-col="AudioLanguages"],
td[data-col="AudioLanguages"] {
  min-width: 220px;
  width: var(--w-OriginalLanguage);
  max-width: max-content;
}

th[data-col="SubtitleLanguages"],
td[data-col="SubtitleLanguages"] {
  min-width: 220px;
  width: var(--w-OriginalLanguage);
  max-width: max-content;
}

table[data-app="radarr"] {
  --title-expand-gutter: 22px;
}

/* App specific tweaks */
table[data-app="radarr"] {
  --w-TitleSlug: 0px;
}

th[data-col="UsersWatched"],
td[data-col="UsersWatched"] {
  min-width: 120px;
  width: auto;
  max-width: none;
}


th[data-col="watchtimehours"],
td[data-col="watchtimehours"] {
  min-width: 100px;
  width: auto;
}

th[data-col="totalwatchtime"],
td[data-col="totalwatchtime"] {
  min-width: 100px;
  width: auto;
}


th[data-col="LastWatched"],
td[data-col="LastWatched"] {
  min-width: 100px;
  width: auto;
  max-width: none;
}

table[data-app="radarr"] th[data-col="Studio"],
table[data-app="radarr"] td[data-col="Studio"] {
  min-width: 220px;
  width: auto;
}

table[data-app="radarr"] {
  --cap-Studio: 300px;
}

table[data-app="radarr"] th[data-col="Genres"],
table[data-app="radarr"] td[data-col="Genres"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
}

table[data-app="radarr"] th[data-col="LastSearchTime"],
table[data-app="radarr"] td[data-col="LastSearchTime"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
}

table[data-app="radarr"] th[data-col="Languages"],
table[data-app="radarr"] td[data-col="Languages"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
}

table[data-app="radarr"] th[data-col="AudioLanguages"],
table[data-app="radarr"] td[data-col="AudioLanguages"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
}

table[data-app="radarr"] th[data-col="SubtitleLanguages"],
table[data-app="radarr"] td[data-col="SubtitleLanguages"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
}

table[data-app="radarr"] th[data-col="LastWatched"],
table[data-app="radarr"] td[data-col="LastWatched"] {
  width: auto;
  min-width: auto;
  max-width: max-content;
}

.radarr-poster-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  width: 190px;
  height: 285px;
  padding: 6px;
  border-radius: 12px;
  background: var(--panel-surface);
  border: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease);
  z-index: 9999;
}

.radarr-poster-tooltip.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.radarr-poster-tooltip__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  background: var(--panel-surface-soft);
}

/* When keyboard focus moves, the browser scrolls the focused row into view.
   These keep it aligned instead of "slightly scrolled". */
.series-episode-scroll {
  scroll-padding-top: 42px;
  /* tweak: should be >= your .series-episode-header height */
}

.series-episode-row {
  scroll-margin-top: 42px;
  /* match scroll-padding-top */
}

/* Optional: if header height differs on mobile, adjust via media query */
@media (max-width: 700px) {
  .series-episode-scroll {
    scroll-padding-top: 48px;
  }

  .series-episode-row {
    scroll-margin-top: 48px;
  }
}

/* Safari/iOS usability and rendering fallbacks */

/* Make nested scroll containers feel native on iOS Safari */
.table-wrap,
.column-panel {
  -webkit-overflow-scrolling: touch;
}

.table-wrap {
  /* instead of pan-y */
  overscroll-behavior: contain;
}

html.is-ios .table-wrap {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.column-panel {
  touch-action: auto;
}

/* iOS only: increase tap targets and prevent iOS input zoom */
html.is-ios button,
html.is-ios select,
html.is-ios input[type="text"],
html.is-ios input[type="search"] {
  min-height: 44px;
  /* Apple HIG tap target */
  font-size: 16px;
  /* Prevents iOS Safari zoom on focus */
}

/* iOS only table scale tweak */
html.is-ios .table-wrap {
  font-size: 0.95rem;
}



html.is-ios table[data-app="radarr"] .match-diag-btn,
html.is-ios table[data-app="radarr"] .row-refresh-btn--title,
html.is-ios table[data-app="radarr"] .history-btn,
html.is-ios table[data-app="radarr"] .lang-toggle,
html.is-ios table[data-app="sonarr"] .lang-toggle,
html.is-ios table[data-app="sonarr"] .series-season-toggle,
html.is-ios table[data-app="sonarr"] .series-expansion-toggle {
  min-height: 0;
  font-size: inherit;
  /* avoid the 16px bump affecting line boxes */
  line-height: 1;
  padding-top: 2px;
  padding-bottom: 2px;
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
}


.column-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.table-wrap {
  font-size: 0.95rem;
}

/* Safari: containment and content-visibility can cause broken scrolling and hit testing */
html.is-safari .table-wrap,
html.is-safari tbody tr,
html.is-safari .series-season-episodes {
  contain: none;
}

html.is-safari .settings-modal,
html.is-safari .column-panel,
html.is-safari .advanced-help {
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

html.is-ios {
  --column-panel-surface: var(--panel-surface-strong);
}

html.is-ios,
html.is-ios body {
  overflow-y: auto;
  overflow-x: hidden;
}

html.is-ios body {
  -webkit-overflow-scrolling: touch;
}

html.is-ios .series-expansion-poster {
  width: 140px;
}

html.is-ios .filters input,
html.is-ios .filters select {
  min-height: 35px;
  padding: 6px 10px;
}

/* iOS: blur can reduce readability and cause scroll jank */
html.is-ios .column-panel,
html.is-ios .filters,
html.is-ios .perf-overlay {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}


/* Table-only pinch zoom wrapper (iOS Safari) */
.table-zoom-inner {
  display: inline-block;
  will-change: transform;
}

/* History drawer */
.history-btn {
  margin-left: 4px;
  padding: 0 4px;
  border: 1px solid var(--border-color, #444);
  background: var(--bg-surface, rgba(255, 255, 255, 0.06));
  color: inherit;
  border-radius: 3px;
  cursor: pointer;
  height: 20px;
  min-height: 20px;
  line-height: 18px;
}

.history-btn:hover {
  background: var(--bg-surface-strong, rgba(255, 255, 255, 0.12));
}

.history-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 20000;
  overflow: hidden;
}

.history-overlay.hidden {
  display: none;
}

.history-scrim {
  flex: 1;
  background: rgba(0, 0, 0, 0.45);
  touch-action: auto;
}

.history-drawer {
  width: min(440px, 80vw);
  max-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  backdrop-filter: blur(12px);
  z-index: 20000;
  border-left: 1px solid var(--border-color, #444);
}


.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 20000;
  margin-bottom: 12px;
}

.history-title {
  font-weight: 600;
  font-size: 16px;
  z-index: 20000;
}

.history-actions {
  display: flex;
  gap: 8px;
  z-index: 20000;
  align-items: center;
}

.history-btn-text,
.history-close,
.history-expand {
  border: 1px solid var(--border-color, #444);
  background: var(--bg-surface, rgba(255, 255, 255, 0.06));
  color: inherit;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}

.history-close {
  line-height: 1;
  font-size: 16px;
}

.history-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.history-summary-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  background: var(--bg-surface, rgba(255, 255, 255, 0.04));
}

.history-summary-label {
  font-weight: 600;
}

.history-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.history-summary-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted-color, #aaa);
}

/* Prevent right-edge clipping in Latest/Previous on narrow screens */
.history-summary-line>span,
.history-summary-sub>span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.history-summary-delta {
  text-align: right;
  color: var(--accent, #7dd1ff);
  font-weight: 600;
}

.history-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;

  /* single vertical scroll owner */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* instead of auto */
  overflow-x: hidden;

  /* native momentum scrolling (iOS) + no scroll chaining */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge legacy */

  align-content: start;
  grid-auto-rows: max-content;

  /* ensure vertical pans scroll the drawer */
  touch-action: auto;
  padding-bottom: calc(125px + env(safe-area-inset-bottom));

}

.history-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.history-row {
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-surface, rgba(255, 255, 255, 0.03));
}

.history-row-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted-color, #aaa);
  margin-top: 4px;
}

/* Prevent long tokens (e.g. DL ids) from being clipped on narrow screens */
.history-row-meta>span,
.history-row-primary>span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.history-note {
  margin-top: 4px;
}

body.history-open {
  overflow: hidden;
}

/* When History is open, freeze the table scroll container too (it has its own scrollbars). */
body.history-open #tableWrap {
  overflow: hidden !important;
}

.title-control-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
  pointer-events: none;
}

.title-control-wrap button {
  pointer-events: auto;
}

.history-btn--episode {
  margin: 0 6px 0 0;
}

.series-episode-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

tr[data-app="radarr"] .title-control-wrap {
  margin-right: 13px;
  position: relative;
  left: -4px;
  gap: 1px;
}

tr[data-app="radarr"] .title-orb-wrap {
  position: relative;
  left: -4px;
  gap: 11px;
}

tr[data-app="radarr"] .title-control-wrap .row-refresh-btn--title {
  margin-right: 1px;
  position: relative;
  left: 0;
  top: 0;
  transform: none;
  display: inline-flex;
  align-items: center;
}

tr[data-app="radarr"] .title-control-wrap .history-btn {
  position: relative;
  left: 0;
}

tr[data-app="radarr"] td[data-col="Title"] {
  padding-left: 12px;
}

tr[data-app="radarr"] .title-orb-wrap .title-text {
  max-width: calc(100% - 16px);
}

/* Progress status clickable filters */
.progress-link {
  color: inherit;
  /* remove blue/purple */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: text-decoration-thickness 0.15s ease, opacity 0.15s ease;
}

.progress-link:hover,
.progress-link:focus-visible {
  text-decoration-thickness: 2px;
  opacity: 0.85;
}

/* Mobile tap feedback */
.progress-link:active {
  opacity: 0.7;
}
