/* OwnCloud web interface.
   The chrome is ink and paper; colour comes from your artwork. One family,
   Archivo, used across its width axis: expanded for titles (marquee),
   condensed for credits (the billing block on a poster). */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('../vendor/fonts/archivo-latin-wdth-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('../vendor/fonts/archivo-latin-ext-wdth-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('../vendor/fonts/archivo-latin-wdth-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- tokens ------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --font: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wide: 118%;
  --narrow: 68%;

  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;
  --fs-4xl: 2.75rem;

  --gutter: clamp(16px, 3.4vw, 48px);
  --side-w: 240px;
  --player-h: 0px;
  --r-media: 6px;
  --r-ui: 9px;
  --r-lg: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* paper */
  --bg: #f1f2f3;
  --bg-rgb: 241 242 243;
  --bg-2: #e6e7ea;
  --surface: #ffffff;
  --surface-rgb: 255 255 255;
  --line: #d8dadf;
  --line-2: #bcc0c7;
  --text: #121318;
  --text-2: #545862;
  --text-3: #858a94;
  --hover: rgb(18 19 24 / 0.055);
  --press: rgb(18 19 24 / 0.1);
  --ink: #121318;
  --on-ink: #ffffff;
  --ok: #1d8656;
  --work: #a85f00;
  --bad: #c4302a;
  --focus: #2e63cc;
  --ok-bg: #dff1e7;
  --work-bg: #f8ebd5;
  --bad-bg: #f9e2e0;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 10px 32px rgb(0 0 0 / 0.13);
  --tint: 140 144 152;
  --tint-a: 0.3;
  --backdrop-a: 0.42;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #17181c;
    --bg-rgb: 23 24 28;
    --bg-2: #101114;
    --surface: #212328;
    --surface-rgb: 33 35 40;
    --line: #2d3036;
    --line-2: #43474f;
    --text: #f2f1ee;
    --text-2: #a8abb2;
    --text-3: #747882;
    --hover: rgb(255 255 255 / 0.06);
    --press: rgb(255 255 255 / 0.11);
    --ink: #f2f1ee;
    --on-ink: #17181c;
    --ok: #4cc38a;
    --work: #f0b24e;
    --bad: #f3746b;
    --focus: #84abff;
    --ok-bg: rgb(76 195 138 / 0.14);
    --work-bg: rgb(240 178 78 / 0.14);
    --bad-bg: rgb(243 116 107 / 0.15);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 14px 44px rgb(0 0 0 / 0.5);
    --tint-a: 0.46;
    --backdrop-a: 0.6;
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #17181c;
  --bg-rgb: 23 24 28;
  --bg-2: #101114;
  --surface: #212328;
  --surface-rgb: 33 35 40;
  --line: #2d3036;
  --line-2: #43474f;
  --text: #f2f1ee;
  --text-2: #a8abb2;
  --text-3: #747882;
  --hover: rgb(255 255 255 / 0.06);
  --press: rgb(255 255 255 / 0.11);
  --ink: #f2f1ee;
  --on-ink: #17181c;
  --ok: #4cc38a;
  --work: #f0b24e;
  --bad: #f3746b;
  --focus: #84abff;
  --ok-bg: rgb(76 195 138 / 0.14);
  --work-bg: rgb(240 178 78 / 0.14);
  --bad-bg: rgb(243 116 107 / 0.15);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 14px 44px rgb(0 0 0 / 0.5);
  --tint-a: 0.46;
  --backdrop-a: 0.6;
}

/* ---- base -------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-md) / 1.45 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, dl, dd {
  margin: 0;
}

h1, h2, h3, h4 {
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img, svg {
  display: block;
}

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

::selection {
  background: color-mix(in srgb, var(--focus) 30%, transparent);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

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

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

.faint {
  color: var(--text-3);
}

.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
}

.link:hover {
  text-decoration-color: currentColor;
}

kbd {
  font: 600 11px/1 var(--font);
  padding: 3px 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--text-2);
}

code, .path {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

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

/* ---- shell ------------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  padding-bottom: calc(16px + var(--player-h));
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  min-width: 0;
}

.brand-mark {
  flex: none;
  color: var(--text);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  font-stretch: var(--wide);
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.brand-server {
  font-size: var(--fs-xs);
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ui);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  text-align: left;
}

.search-trigger:hover {
  border-color: var(--line-2);
  color: var(--text-2);
}

.search-trigger kbd {
  margin-left: auto;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav + .nav {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--r-ui);
  color: var(--text-2);
  font-weight: 560;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-item[aria-current='page'] {
  background: var(--press);
  color: var(--text);
  font-weight: 650;
}

.nav-count {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--work-bg);
  color: var(--work);
}

.nav-live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.add-btn {
  width: 100%;
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 8px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.offline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-ui);
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 600;
}

.main {
  min-width: 0;
  padding: 0 var(--gutter) calc(120px + var(--player-h));
}

.topbar {
  display: none;
}

.scrim {
  display: none;
}

/* ---- page headings & toolbars ------------------------------------------------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 28px;
  padding: 46px 0 20px;
}

.page-title {
  font-size: clamp(2.1rem, 4vw, var(--fs-4xl));
  font-weight: 800;
  font-stretch: var(--wide);
  letter-spacing: -0.025em;
  line-height: 0.94;
}

.page-sub {
  margin-top: 10px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: -4px 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

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

.tab[aria-selected='true'],
.tab[aria-current='page'] {
  color: var(--text);
}

.tab[aria-selected='true']::after,
.tab[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.tab-count {
  color: var(--text-3);
  font-weight: 500;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 calc(var(--gutter) * -1) 24px;
  padding: 10px var(--gutter);
  background: rgb(var(--bg-rgb) / 0.92);
  backdrop-filter: blur(12px);
}

.toolbar .grow {
  flex: 1;
}

.filter-input {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 200px;
  flex: 0 1 280px;
}

.filter-input .icon {
  position: absolute;
  left: 11px;
  color: var(--text-3);
  pointer-events: none;
}

.filter-input input {
  padding-left: 36px;
}

.result-count {
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

/* ---- buttons ------------------------------------------------------------------ */

.btn {
  --h: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ui);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn:hover {
  background: var(--hover);
}

.btn:active {
  background: var(--press);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.btn[aria-busy='true'] {
  opacity: 0.8;
}

.btn.primary {
  background: var(--ink);
  border-color: transparent;
  color: var(--on-ink);
}

.btn.primary:hover {
  background: color-mix(in srgb, var(--ink) 86%, var(--bg));
}

.btn.primary .spinner {
  border-color: color-mix(in srgb, var(--on-ink) 35%, transparent);
  border-top-color: var(--on-ink);
}

.btn.ghost {
  border-color: transparent;
}

.btn.subtle {
  border-color: transparent;
  background: var(--hover);
}

.btn.subtle:hover {
  background: var(--press);
}

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

.btn.danger.primary {
  background: var(--bad);
  color: #fff;
}

.btn.sm {
  --h: 30px;
  padding: 0 10px;
  font-size: 13px;
  gap: 6px;
}

.btn.lg {
  --h: 48px;
  padding: 0 24px 0 20px;
  border-radius: 999px;
  font-size: 16px;
}

.btn.pill {
  border-radius: 999px;
}

.btn.icon-only {
  width: var(--h);
  padding: 0;
}

.btn.lg.icon-only {
  padding: 0;
}

.btn.play svg {
  fill: currentColor;
}

.btn.on {
  background: var(--press);
  border-color: transparent;
}

/* ---- artwork ------------------------------------------------------------------ */

.art {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-media);
  background: var(--bg-2);
  isolation: isolate;
  width: 100%;
}

.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.art[data-state='loaded'] img {
  opacity: 1;
}

.art::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(127 127 127 / 0.16);
  pointer-events: none;
}

.art-type {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 12% 11%;
}

.art-type.over {
  z-index: 1;
  background: linear-gradient(to top, rgb(8 9 12 / 0.82), rgb(8 9 12 / 0.35) 45%, rgb(8 9 12 / 0) 70%);
}

.art-type.over .art-type-title {
  color: #fff;
}

.art-type.over .art-type-sub {
  color: rgb(255 255 255 / 0.78);
}

.art-type.pending {
  opacity: 0.55;
}

.art-type-title {
  font-size: clamp(14px, 1.15vw, 19px);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--text);
  /* Break long words with a hyphen ("Every-where") rather than anywhere. */
  overflow-wrap: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-type-title.long-word {
  font-size: clamp(12px, 0.95vw, 16px);
}

.art-type-sub {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.art-square .art-type-title,
.art-wide .art-type-title {
  -webkit-line-clamp: 3;
}

.art-wide .art-type {
  padding: 7% 6%;
}

.art-person {
  border-radius: 50%;
}

.art-tiny .art-type {
  padding: 4px;
}

.art-tiny .art-type-title {
  font-size: 8px;
  -webkit-line-clamp: 2;
}

.art-tiny .art-type-sub {
  display: none;
}

/* ---- grids and tiles ------------------------------------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile, 158px), 1fr));
  gap: 30px 20px;
}

.grid.square {
  --tile: 172px;
}

.grid.wide {
  --tile: 280px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.tile-link {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  border-radius: var(--r-media);
}

.tile-link:focus-visible {
  outline-offset: 4px;
}

.tile-media {
  position: relative;
}

.tile-link:hover .art img {
  filter: brightness(1.08);
}

.tile-title {
  font-weight: 620;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-sub {
  margin-top: -6px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 4px;
  border-radius: 2px;
  background: rgb(0 0 0 / 0.5);
  overflow: hidden;
  z-index: 2;
}

.tile-progress > span {
  display: block;
  height: 100%;
  background: #fff;
}

.tile-watched {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(10 10 12 / 0.66);
  color: #fff;
  backdrop-filter: blur(6px);
}

.tile-flag {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
  height: 24px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  background: rgb(10 10 12 / 0.74);
  color: #fff;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.tile-flag .ring-track {
  stroke: rgb(255 255 255 / 0.3);
}

.tile-flag.bad {
  background: var(--bad);
}

.tile-quick {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  opacity: 0;
}

.tile-quick .btn {
  --h: 30px;
  background: rgb(10 10 12 / 0.66);
  color: #fff;
  backdrop-filter: blur(6px);
}

.tile:hover .tile-quick,
.tile:focus-within .tile-quick {
  opacity: 1;
}

.tile:hover .tile-watched,
.tile:focus-within .tile-watched {
  opacity: 0;
}

@media (hover: none) {
  .tile-quick {
    opacity: 1;
  }
}

.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--tile, 158px);
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 10px;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.row > * {
  scroll-snap-align: start;
}

.row.wide {
  --tile: 300px;
}

.row.square {
  --tile: 168px;
}

/* ---- sections -------------------------------------------------------------------- */

.section {
  margin-top: 48px;
}

.section:first-child {
  margin-top: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.section-title {
  font-size: var(--fs-xl);
  font-weight: 750;
  font-stretch: 108%;
  letter-spacing: -0.01em;
}

.section-note {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* ---- home ------------------------------------------------------------------------- */

.marquee {
  position: relative;
  isolation: isolate;
  margin: 0 calc(var(--gutter) * -1) 8px;
  padding: clamp(110px, 17vw, 230px) var(--gutter) 40px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.marquee-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(var(--tint) / var(--tint-a));
}

.marquee-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}

.marquee-bg img.on {
  opacity: var(--backdrop-a);
}

.marquee-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgb(var(--bg-rgb)) 2%, rgb(var(--bg-rgb) / 0.82) 34%, rgb(var(--bg-rgb) / 0) 78%),
    linear-gradient(100deg, rgb(var(--bg-rgb) / 0.75) 10%, rgb(var(--bg-rgb) / 0) 70%);
}

.marquee-kicker {
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: 10px;
}

.marquee-title {
  font-size: clamp(2.4rem, 6.4vw, 5.25rem);
  font-weight: 850;
  font-stretch: var(--wide);
  letter-spacing: -0.03em;
  line-height: 0.9;
  max-width: 14ch;
  text-wrap: balance;
}

.marquee-sub {
  margin-top: 14px;
  color: var(--text-2);
  font-size: var(--fs-lg);
  font-variant-numeric: tabular-nums;
}

.marquee-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.marquee-progress {
  width: min(320px, 70vw);
  margin-top: 18px;
}

.welcome {
  max-width: 760px;
  padding: 8vh 0 0;
}

.welcome .page-title {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  max-width: 13ch;
}

.welcome-text {
  margin-top: 18px;
  max-width: 58ch;
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--text-2);
}

.folder-list {
  display: grid;
  gap: 1px;
  margin-top: 28px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}

.folder-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
}

.folder-row + .folder-row {
  border-top: 1px solid var(--line);
}

.folder-row .path {
  color: var(--text-2);
  display: block;
  margin-top: 2px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.stats b {
  color: var(--text);
  font-weight: 700;
}

.notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--work-bg);
  color: var(--text);
}

.notice .icon {
  color: var(--work);
  flex: none;
}

.notice-text {
  flex: 1;
  min-width: 0;
}

.notice.bad {
  background: var(--bad-bg);
}

.notice.bad .icon {
  color: var(--bad);
}

.notice.info {
  background: var(--hover);
}

.notice.info .icon {
  color: var(--text-2);
}

/* ---- detail pages ------------------------------------------------------------------ */

.detail {
  position: relative;
  isolation: isolate;
}

.hero {
  padding: clamp(130px, 21vw, 300px) 0 10px;
}

.hero.compact {
  padding-top: clamp(80px, 12vw, 160px);
}

/* The backdrop is anchored to the page, behind everything that follows it. */
.hero-bg {
  position: absolute;
  top: 0;
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
  height: min(82vh, 760px);
  z-index: -1;
  overflow: hidden;
  background: rgb(var(--tint) / var(--tint-a));
  pointer-events: none;
}

.detail.compact .hero-bg {
  height: min(60vh, 520px);
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}

.hero-bg img.on {
  opacity: var(--backdrop-a);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgb(var(--bg-rgb)) 0%, rgb(var(--bg-rgb) / 0.9) 30%, rgb(var(--bg-rgb) / 0.25) 70%, rgb(var(--bg-rgb) / 0.05)),
    linear-gradient(90deg, rgb(var(--bg-rgb) / 0.55), rgb(var(--bg-rgb) / 0) 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: clamp(140px, 17vw, 250px) minmax(0, 1fr);
  gap: clamp(22px, 3.2vw, 48px);
  align-items: end;
}

.hero-grid.square-art {
  grid-template-columns: clamp(160px, 21vw, 300px) minmax(0, 1fr);
}

.hero-grid.wide-art {
  grid-template-columns: clamp(220px, 28vw, 420px) minmax(0, 1fr);
}

.hero-art .art {
  box-shadow: var(--shadow);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: 12px;
}

.crumbs a:hover {
  color: var(--text);
}

.crumbs .icon {
  color: var(--text-3);
}

.hero-title {
  font-size: clamp(2.3rem, 5.6vw, 4.75rem);
  font-weight: 850;
  font-stretch: var(--wide);
  letter-spacing: -0.03em;
  line-height: 0.9;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero-title.long {
  font-size: clamp(2rem, 4.2vw, 3.6rem);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin-top: 16px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.facts a:hover {
  color: var(--text);
  text-decoration: underline;
}

.rated {
  display: inline-block;
  padding: 0 5px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.02em;
}

.score {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.score svg {
  fill: currentColor;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.resume-note {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 56px;
  margin-top: 30px;
}

.tagline {
  font-style: italic;
  font-stretch: 96%;
  color: var(--text-2);
  font-size: var(--fs-lg);
}

.overview {
  max-width: 68ch;
  margin-top: 12px;
  font-size: var(--fs-lg);
  line-height: 1.6;
}

.overview.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.more-toggle {
  margin-top: 6px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--text-2);
  font-weight: 650;
  cursor: pointer;
}

.more-toggle:hover {
  color: var(--text);
}

/* Credits set like a poster's billing block: condensed, dense, quiet. */
.credits {
  display: grid;
  gap: 8px;
  max-width: 96ch;
  margin-top: 26px;
  font-stretch: var(--narrow);
  font-size: 17px;
  line-height: 1.45;
}

.credit {
  color: var(--text-2);
}

.credit-role {
  font-weight: 400;
}

.credit-names {
  color: var(--text);
  font-weight: 560;
  letter-spacing: 0.01em;
}

.credit-names span {
  display: inline-block;
  margin-right: 0.7em;
}

.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
}

a.chip:hover {
  background: var(--press);
  color: var(--text);
}

.chip.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.chip.work {
  background: var(--work-bg);
  color: var(--work);
}

.chip.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.chip .chip-x {
  margin-right: -6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: none;
  color: inherit;
  cursor: pointer;
}

.chip .chip-x:hover {
  background: var(--press);
}

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

/* ---- files panel ----------------------------------------------------------------------- */

.files {
  display: grid;
}

.file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.file:last-child {
  border-bottom: 1px solid var(--line);
}

.file-name {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.file-path {
  margin-top: 2px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.file-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.file-actions {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.file-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.file-subs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.file-subs-label {
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-right: 6px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.status.ok {
  color: var(--ok);
}

.status.work {
  color: var(--work);
}

.status.bad {
  color: var(--bad);
}

.status-bar {
  width: 180px;
}

/* ---- episodes ---------------------------------------------------------------------------- */

.episodes {
  display: grid;
}

.episode {
  display: grid;
  grid-template-columns: clamp(140px, 17vw, 236px) minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.episode:last-child {
  border-bottom: 1px solid var(--line);
}

.episode-still {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--r-media);
}

.episode-still:disabled {
  cursor: default;
}

.episode-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  color: #fff;
  z-index: 3;
}

.episode-play span {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgb(10 10 12 / 0.62);
  backdrop-filter: blur(6px);
}

.episode-play svg {
  fill: currentColor;
}

.episode-still:not(:disabled):hover .episode-play,
.episode-still:focus-visible .episode-play {
  opacity: 1;
}

.episode-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.episode-num {
  color: var(--text-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.episode-title {
  font-weight: 700;
  font-size: var(--fs-lg);
}

.episode-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.episode-meta {
  margin-top: 4px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-variant-numeric: tabular-nums;
}

.episode-overview {
  margin-top: 8px;
  max-width: 76ch;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-side {
  display: flex;
  align-items: center;
  gap: 4px;
}

.watch-btn.on {
  color: var(--ok);
}

/* ---- tables (tracks, songs) ---------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0 12px 8px;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--bg);
}

.table th button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.table th button:hover,
.table th[aria-sort] button {
  color: var(--text);
}

.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr {
  cursor: default;
}

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

.table td:first-child,
.table th:first-child {
  padding-left: 10px;
}

.table .num-col {
  width: 48px;
  text-align: right;
  color: var(--text-3);
}

.table .time-col {
  width: 80px;
  text-align: right;
  color: var(--text-2);
}

.table .act-col {
  width: 44px;
  text-align: right;
}

.track-num-cell {
  position: relative;
}

.track-play {
  display: none;
  margin-left: auto;
  border: 0;
  background: none;
  padding: 0;
  color: var(--text);
  cursor: pointer;
}

.track-play svg {
  fill: currentColor;
}

.table tbody tr:hover .track-num,
.table tbody tr:focus-within .track-num {
  display: none;
}

.table tbody tr:hover .track-play,
.table tbody tr:focus-within .track-play {
  display: inline-block;
}

.table tr.playing .track-title,
.table tr.playing .track-num {
  color: var(--ok);
}

.track-title {
  font-weight: 600;
}

.track-sub {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.cell-media {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cell-media .art {
  width: 40px;
  flex: none;
}

.cell-text {
  min-width: 0;
}

.cell-text > * {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unplayable {
  opacity: 0.55;
}

.disc-row td {
  padding-top: 22px;
  font-weight: 700;
  color: var(--text-2);
  background: none !important;
}

/* ---- menus, dialogs, toasts -------------------------------------------------------------- */

.menu-wrap {
  position: relative;
  display: inline-flex;
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 230px;
  max-width: 320px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: pop 0.12s var(--ease);
  transform-origin: top right;
}

.menu.end {
  right: 0;
}

.menu.start {
  left: 0;
  transform-origin: top left;
}

.menu.up {
  top: auto;
  bottom: calc(100% + 6px);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 14px;
  font-weight: 520;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.menu-item .icon {
  color: var(--text-2);
  flex: none;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--hover);
  outline: none;
}

.menu-item.danger,
.menu-item.danger .icon {
  color: var(--bad);
}

.menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.menu-hint {
  margin-left: auto;
  padding-left: 12px;
  color: var(--text-3);
  font-size: 12px;
}

.menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(-3px);
  }
}

dialog.modal {
  width: min(600px, calc(100vw - 32px));
  max-height: min(88vh, 920px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog.modal[open] {
  animation: dialog-in 0.18s var(--ease);
}

dialog.modal.sm {
  width: min(440px, calc(100vw - 32px));
}

dialog.modal.lg {
  width: min(880px, calc(100vw - 32px));
}

dialog.modal::backdrop {
  background: rgb(8 9 12 / 0.56);
  backdrop-filter: blur(3px);
}

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

.modal-inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 4px 24px;
}

.modal-head h2 {
  font-size: var(--fs-xl);
  font-weight: 760;
  font-stretch: 108%;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 10px 24px 22px;
  overflow: auto;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line);
}

.modal-foot .grow {
  flex: 1;
}

.dialog-message {
  color: var(--text-2);
  line-height: 1.55;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--player-h));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 8px 6px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 560;
  animation: toast-in 0.22s var(--ease);
}

.toast:not(:has(.toast-action)) {
  padding-right: 18px;
}

.toast.error {
  background: var(--bad);
  color: #fff;
  border-radius: 14px;
}

.toast-action {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--on-ink) 14%, transparent);
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

/* ---- forms ------------------------------------------------------------------------------- */

.input,
.select select,
textarea.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ui);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
}

textarea.input {
  height: auto;
  min-height: 110px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

.input::placeholder {
  color: var(--text-3);
}

/* Shown but not editable (e.g. a folder set on the command line). */
.input[readonly] {
  background: var(--bg-2);
  border-color: transparent;
  color: var(--text-2);
}

.input:focus,
.select select:focus {
  outline: 2px solid var(--focus);
  outline-offset: -1px;
  border-color: transparent;
}

.input.lg {
  height: 48px;
  font-size: var(--fs-lg);
  padding: 0 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field + .field {
  margin-top: 18px;
}

.field-label {
  font-weight: 650;
  font-size: 14px;
}

.field-hint {
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.field-error {
  color: var(--bad);
  font-size: var(--fs-sm);
  font-weight: 560;
}

.field.has-error .input {
  border-color: var(--bad);
}

.field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field-row .input {
  flex: 1;
}

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select select {
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
  height: 36px;
  font-weight: 560;
}

.select .icon {
  position: absolute;
  right: 11px;
  color: var(--text-2);
  pointer-events: none;
}

.select.block,
.select.block select {
  width: 100%;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-2);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  min-width: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  white-space: nowrap;
}

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

.segmented button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.14);
}

.segmented.lg button {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  cursor: pointer;
}

.switch-row.disabled {
  opacity: 0.5;
  cursor: default;
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.switch-label {
  font-weight: 620;
}

.switch {
  position: relative;
  flex: none;
  margin-top: 1px;
}

.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  display: block;
  width: 42px;
  height: 26px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background-color 0.15s;
}

.switch-thumb {
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition: transform 0.18s var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--ink);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
  background: var(--on-ink);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---- progress, spinners ------------------------------------------------------------------ */

.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--press);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--text);
  transition: width 0.4s var(--ease);
}

.bar.work .bar-fill {
  background: var(--work);
}

.bar.ok .bar-fill {
  background: var(--ok);
}

.bar.bad .bar-fill {
  background: var(--bad);
}

.bar.thin {
  height: 4px;
}

.ring {
  flex: none;
}

.ring-track {
  stroke: var(--line-2);
}

.ring-fill {
  stroke: currentColor;
  transition: stroke-dashoffset 0.4s var(--ease);
}

.ring-spin {
  animation: spin 1.1s linear infinite;
}

.spinner {
  display: inline-block;
  flex: none;
  border: 2px solid var(--line-2);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.loading {
  display: grid;
  place-items: center;
  min-height: 40vh;
}

.skeleton {
  background: var(--bg-2);
  border-radius: var(--r-media);
}

/* ---- empty states -------------------------------------------------------------------------- */

.empty {
  max-width: 540px;
  margin: 10vh auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hover);
  color: var(--text-2);
  margin-bottom: 4px;
}

.empty-title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  font-stretch: var(--wide);
  letter-spacing: -0.015em;
  line-height: 1.05;
  text-wrap: balance;
}

.empty-text {
  color: var(--text-2);
  line-height: 1.55;
  max-width: 52ch;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.inline-empty {
  padding: 28px 0;
  color: var(--text-2);
}

/* ---- search -------------------------------------------------------------------------------- */

.search {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 9vh 16px 16px;
  background: rgb(var(--bg-rgb) / 0.7);
  backdrop-filter: blur(14px);
  animation: fade 0.12s ease-out;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.search-panel {
  width: min(780px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 66px;
  padding: 0 14px 0 20px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  flex: none;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-size: 21px;
  font-weight: 560;
  font-stretch: 104%;
  color: var(--text);
}

.search-field input::placeholder {
  color: var(--text-3);
}

.search-results {
  overflow-y: auto;
  padding: 6px 8px 12px;
}

.search-group-title {
  padding: 14px 12px 6px;
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--text-3);
}

.result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 11px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.result[aria-selected='true'] {
  background: var(--hover);
}

.result-title {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-sub {
  font-size: var(--fs-sm);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-kind {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.result.top {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  padding: 10px;
}

.result.top .result-title {
  font-size: var(--fs-xl);
  font-stretch: 110%;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.search-hint {
  padding: 22px 14px;
  color: var(--text-2);
}

.search-foot {
  display: flex;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--text-3);
  flex: none;
}

.search-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---- drop overlay & uploads ------------------------------------------------------------ */

.drop {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
  background: rgb(var(--bg-rgb) / 0.88);
  backdrop-filter: blur(10px);
  animation: fade 0.12s ease-out;
}

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 28px;
  border: 2px dashed var(--line-2);
  border-radius: 20px;
  transition: border-color 0.1s, background-color 0.1s;
}

.drop-zone.auto {
  grid-row: 1 / span 3;
  padding: 36px 40px;
}

.drop-zone.hot {
  border-style: solid;
  border-color: var(--text);
  background: var(--hover);
}

.drop-zone > .icon {
  position: absolute;
  top: 24px;
  left: 26px;
  color: var(--text-3);
}

.drop-zone.auto > .icon {
  top: 36px;
  left: 38px;
}

.drop-zone.hot > .icon {
  color: var(--text);
}

.drop-zone h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.6rem);
  font-weight: 850;
  font-stretch: var(--wide);
  letter-spacing: -0.025em;
  line-height: 0.95;
}

.drop-zone.auto h2 {
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  max-width: 9ch;
}

.drop-zone p {
  margin-top: 10px;
  max-width: 40ch;
  color: var(--text-2);
}

.tray {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--player-h));
  z-index: 65;
  width: min(430px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: toast-in 0.2s var(--ease);
}

.tray-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 10px 12px 18px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.tray-title {
  font-weight: 700;
}

.tray-sub {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.tray-head-text {
  flex: 1;
  min-width: 0;
}

.tray-bar {
  padding: 0 18px 12px;
}

.tray-list {
  max-height: min(46vh, 440px);
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.tray-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.up-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 10px 16px;
}

.up-item + .up-item {
  border-top: 1px solid var(--line);
}

.up-thumb {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--hover);
  color: var(--text-2);
  overflow: hidden;
}

.up-thumb .art {
  height: 100%;
  width: auto;
}

.up-name {
  font-weight: 620;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.up-state {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.up-state.ok {
  color: var(--ok);
}

.up-state.work {
  color: var(--work);
}

.up-state.bad {
  color: var(--bad);
  white-space: normal;
}

.up-item .bar {
  margin-top: 6px;
}

.add-drop {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 300px;
  padding: 48px 24px;
  border: 2px dashed var(--line-2);
  border-radius: 22px;
  text-align: center;
  transition: border-color 0.1s, background-color 0.1s;
}

.add-drop.hot {
  border-style: solid;
  border-color: var(--text);
  background: var(--hover);
}

.add-drop h2 {
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  font-weight: 850;
  font-stretch: var(--wide);
  letter-spacing: -0.025em;
  line-height: 0.95;
}

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

.kind-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-2);
}

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

.import-row:last-child {
  border-bottom: 1px solid var(--line);
}

.import-row .art {
  width: 44px;
}

/* ---- jobs (activity) ------------------------------------------------------------------- */

.job {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.job:last-child {
  border-bottom: 1px solid var(--line);
}

.job-icon {
  display: grid;
  place-items: center;
  color: var(--text-2);
}

.job-icon.ok {
  color: var(--ok);
}

.job-icon.bad {
  color: var(--bad);
}

.job-title {
  font-weight: 620;
  overflow-wrap: anywhere;
}

.job-msg {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.job-msg.bad {
  color: var(--bad);
}

.job .bar {
  margin-top: 8px;
  max-width: 520px;
}

.job-time {
  color: var(--text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* ---- settings ----------------------------------------------------------------------------- */

.settings {
  display: grid;
  grid-template-columns: 200px minmax(0, 760px);
  gap: 56px;
  align-items: start;
}

.settings-index {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-index a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 560;
}

.settings-index a:hover {
  background: var(--hover);
  color: var(--text);
}

.settings-section {
  padding: 4px 0 40px;
  scroll-margin-top: 24px;
}

.settings-section + .settings-section {
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.settings-section > h2 {
  font-size: var(--fs-2xl);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.015em;
}

.settings-section > .section-intro {
  margin-top: 8px;
  max-width: 62ch;
  color: var(--text-2);
  line-height: 1.55;
}

.settings-body {
  margin-top: 22px;
}

.settings-body > .switch-row {
  border-top: 1px solid var(--line);
}

.settings-body > .switch-row:last-child {
  border-bottom: 1px solid var(--line);
}

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

.setting-line:last-child {
  border-bottom: 1px solid var(--line);
}

.setting-line .field-hint {
  margin-top: 3px;
}

.key-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.key-state.ok {
  color: var(--ok);
}

.key-state.off {
  color: var(--text-3);
}

.test-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: var(--fs-sm);
  font-weight: 560;
}

.test-result.ok {
  color: var(--ok);
}

.test-result.bad {
  color: var(--bad);
}

.dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 28px;
  font-variant-numeric: tabular-nums;
}

.dl dt {
  color: var(--text-2);
}

.dl dd {
  overflow-wrap: anywhere;
}

/* ---- starting automatically ------------------------------------------------------------- */

.autostart {
  border-top: 1px solid var(--line);
}

.autostart-note {
  display: grid;
  gap: 6px;
  max-width: 64ch;
  padding: 0 0 16px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.autostart-note[role='status'] {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 560;
}

.autostart-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-weight: 600;
}

.autostart-state .icon {
  color: var(--ok);
}

.command {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 4px 4px 12px;
  border-radius: var(--r-ui);
  background: var(--hover);
  color: var(--text);
}

.setup-autostart {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---- away from home --------------------------------------------------------------------- */

.remote-text {
  max-width: 62ch;
  color: var(--text-2);
  line-height: 1.55;
}

.remote-form .steps {
  margin-top: 18px;
}

.remote-form .segmented {
  margin-bottom: 18px;
}

.input-suffix {
  display: flex;
  align-items: center;
  max-width: 420px;
}

.input-suffix .input {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-suffix span {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--r-ui) var(--r-ui) 0;
  background: var(--hover);
  color: var(--text-2);
}

.remote-form .field .input:not(.input-suffix .input) {
  max-width: 420px;
}

.remote-form .field-hint {
  max-width: 60ch;
}

.remote-forward {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  max-width: 62ch;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--hover);
  line-height: 1.5;
}

.remote-forward > .icon {
  margin-top: 2px;
  color: var(--text-2);
}

.remote-forward b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.remote-forward .field-hint {
  margin-top: 6px;
}

.remote-ports {
  margin-top: 14px;
  max-width: 420px;
  align-items: flex-start;
}

.remote-ports .field + .field {
  margin-top: 0;
}

.remote-ports + .field-hint {
  margin-top: 8px;
  max-width: 62ch;
}

.link-button {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

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

.remote-card {
  display: grid;
  gap: 16px;
  max-width: 720px;
}

.remote-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.remote-name {
  font-size: var(--fs-xl);
  font-weight: 800;
  font-stretch: var(--wide);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* The address to use away from home is the thing to take away. */
.remote-url {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.remote-url > .icon {
  flex: none;
  color: var(--ok);
}

.remote-url a {
  flex: 1;
  min-width: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 750;
  font-stretch: var(--wide);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.remote-checks {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.remote-checks li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
}

.remote-checks li.done,
.remote-checks li.now {
  color: var(--text);
}

.remote-check-mark {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
}

.remote-checks li.done .remote-check-mark {
  border-color: transparent;
  background: var(--ink);
  color: var(--on-ink);
}

.remote-checks li.now .remote-check-mark {
  border-color: transparent;
}

.remote-checks li.failed {
  color: var(--text);
}

.remote-checks li.failed .remote-check-mark {
  border-color: transparent;
  background: var(--bad);
  color: #fff;
}

.remote-duck {
  display: flex;
  align-items: center;
  gap: 6px;
}

.remote-card .actions {
  margin-top: 4px;
}

/* ---- devices & pairing --------------------------------------------------------------------- */

.device {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.device:last-child {
  border-bottom: 1px solid var(--line);
}

.device-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--hover);
  color: var(--text-2);
}

.device-name {
  font-weight: 700;
  font-size: var(--fs-lg);
}

.device-meta {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.pair {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.pair-qr {
  width: 220px;
  height: 220px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}

.pair-qr img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.pair-code {
  font-size: clamp(2.6rem, 6vw, 3.8rem);
  font-weight: 850;
  font-stretch: var(--wide);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pair-steps {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--text-2);
  line-height: 1.5;
}

.pair-done {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 26px 0 10px;
  text-align: center;
}

.pair-done .icon {
  color: var(--ok);
}

/* ---- setup & sign in -------------------------------------------------------------------- */

.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.gate-art {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 64px);
  border-right: 1px solid var(--line);
}

.gate-wordmark {
  /* Sized to the panel, so the word always fits on one line. */
  font-size: min(15.5cqi, 8rem);
  font-weight: 900;
  font-stretch: var(--wide);
  letter-spacing: -0.04em;
  line-height: 0.85;
}

.gate-tag {
  margin-top: 18px;
  max-width: 30ch;
  font-size: var(--fs-lg);
  color: var(--text-2);
  line-height: 1.5;
}

.gate-shelf {
  position: absolute;
  inset: clamp(28px, 5vw, 64px) clamp(28px, 5vw, 64px) auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 46%;
}

.gate-shelf span {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: var(--line-2);
  opacity: 0.55;
}

.gate-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 88px);
  max-width: 640px;
}

.gate-form h1 {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 850;
  font-stretch: var(--wide);
  letter-spacing: -0.025em;
  line-height: 0.95;
}

.gate-form .lead {
  margin-top: 12px;
  color: var(--text-2);
  line-height: 1.55;
  max-width: 50ch;
}

.steps {
  display: grid;
  gap: 0;
  margin-top: 30px;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.step-num {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
}

.step.done .step-num {
  border-color: transparent;
  background: var(--ink);
  color: var(--on-ink);
}

.step-title {
  font-weight: 750;
  font-size: var(--fs-lg);
  margin-bottom: 12px;
}

.gate-submit {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.folder-pick {
  display: flex;
  gap: 8px;
}

.folder-pick .input {
  flex: 1;
}

.picker {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  min-height: 340px;
}

.picker-places {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--line);
  padding-right: 12px;
}

.picker-places button,
.picker-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  cursor: pointer;
  font-weight: 540;
  color: var(--text);
}

.picker-places button:hover,
.picker-list button:hover {
  background: var(--hover);
}

.picker-places .icon,
.picker-list .icon {
  color: var(--text-3);
  flex: none;
}

.picker-list {
  max-height: 360px;
  overflow-y: auto;
}

.picker-path {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.picker-path .path {
  flex: 1;
  color: var(--text-2);
}

.picker-note {
  margin: 0 0 10px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

/* ---- music player bar ---------------------------------------------------------------------- */

.player {
  position: fixed;
  left: var(--side-w);
  right: 0;
  bottom: 0;
  z-index: 50;
  height: 78px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(300px, 1.5fr) minmax(170px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  background: rgb(var(--surface-rgb) / 0.9);
  backdrop-filter: blur(20px) saturate(1.3);
}

.player-now {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-now .art {
  width: 52px;
  flex: none;
}

.player-text {
  min-width: 0;
}

.player-title {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: var(--fs-sm);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist a:hover {
  color: var(--text);
  text-decoration: underline;
}

.player-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-buttons .btn.on {
  color: var(--ok);
  background: none;
}

.player-buttons .main-toggle {
  --h: 40px;
  border-radius: 50%;
}

.player-buttons .main-toggle svg {
  fill: currentColor;
}

.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.seek {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.seek span {
  width: 40px;
  text-align: center;
  flex: none;
}

.slider {
  --pct: 0%;
  flex: 1;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--text) var(--pct), var(--line-2) var(--pct));
}

.slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
}

.slider::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--text);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0;
  transition: opacity 0.1s;
}

.slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  opacity: 0;
}

.slider:hover::-webkit-slider-thumb,
.slider:focus-visible::-webkit-slider-thumb {
  opacity: 1;
}

.slider:hover::-moz-range-thumb,
.slider:focus-visible::-moz-range-thumb {
  opacity: 1;
}

.volume {
  width: 110px;
  flex: none;
}

.queue {
  position: fixed;
  right: 16px;
  bottom: calc(var(--player-h) + 12px);
  z-index: 55;
  width: min(380px, calc(100vw - 32px));
  max-height: min(60vh, 560px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: toast-in 0.18s var(--ease);
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 10px 18px;
  font-weight: 750;
}

.queue-list {
  overflow-y: auto;
  padding: 0 6px 8px;
}

.queue-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.queue-item:hover {
  background: var(--hover);
}

.queue-item.now .player-title {
  color: var(--ok);
}

.queue-item .art {
  width: 36px;
}

/* The artwork in the bar opens the lyrics. */
.player-art {
  position: relative;
  flex: none;
  width: 52px;
  padding: 0;
  border: 0;
  border-radius: var(--r-media);
  background: none;
  cursor: pointer;
}

.player-art-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-media);
  background: rgb(8 9 12 / 0.5);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.player-art:hover .player-art-hint,
.player-art:focus-visible .player-art-hint {
  opacity: 1;
}

/* ---- lyrics -------------------------------------------------------------------------------
   A lyric sheet printed on the album's colour: the song's title set as a
   marquee, the credits condensed, and the words in heavy type that light up
   as they're sung. */

.lyrics {
  position: fixed;
  top: 0;
  left: var(--side-w);
  right: 0;
  bottom: var(--player-h);
  z-index: 45;
  display: flex;
  flex-direction: column;
  background: linear-gradient(rgb(var(--tint) / var(--tint-a)), rgb(var(--tint) / var(--tint-a))), var(--bg);
  animation: lyrics-rise 0.28s var(--ease);
}

@keyframes lyrics-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.lyrics-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgb(var(--surface-rgb) / 0.55);
  backdrop-filter: blur(12px);
}

.lyrics-tools .btn {
  border-radius: 999px;
}

.lyrics-tools .lyrics-queue {
  display: none;
}

.lyrics-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}

.lyrics-scroll:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -4px;
}

.lyrics-sheet {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(56px, 10vh, 112px) var(--gutter) 72px;
}

/* Room below the last line, so it can scroll up to where the current line sits. */
.lyrics-sheet.timed {
  padding-bottom: 58vh;
}

.lyrics-card {
  margin-bottom: clamp(32px, 6vh, 64px);
}

.lyrics-title {
  font-size: clamp(2rem, 1.1rem + 3.2vw, 3.9rem);
  font-weight: 850;
  font-stretch: var(--wide);
  letter-spacing: -0.03em;
  line-height: 0.92;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

.lyrics-credit {
  margin-top: 14px;
  font-size: var(--fs-lg);
  font-weight: 600;
  font-stretch: var(--narrow);
  line-height: 1.3;
  color: var(--text-2);
}

.lyrics-credit a:hover {
  color: var(--text);
  text-decoration: underline;
}

.lyric-lines {
  --lyric-size: clamp(1.55rem, 0.95rem + 1.9vw, 2.6rem);
}

.lyric {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.22em 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: color-mix(in srgb, var(--text) 45%, transparent);
  font-size: var(--lyric-size);
  font-weight: 780;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-align: left;
  text-wrap: pretty;
  cursor: pointer;
  transition: color 0.35s var(--ease);
}

.lyric.sung {
  color: color-mix(in srgb, var(--text) 66%, transparent);
}

.lyric.now {
  color: var(--text);
}

.lyric:hover {
  color: color-mix(in srgb, var(--text) 84%, transparent);
}

.lyric.now:hover {
  color: var(--text);
}

.lyric:focus-visible {
  outline-offset: 2px;
}

/* A pause in the singing: three dots that breathe while it lasts. */
.lyric-break {
  display: flex;
  gap: 0.3em;
  padding: 0.62em 0 0.62em 0.04em;
  font-size: var(--lyric-size);
}

.lyric-break span {
  width: 0.26em;
  height: 0.26em;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 45%, transparent);
}

.lyric-break.sung span {
  background: color-mix(in srgb, var(--text) 66%, transparent);
}

.lyric-break.now span {
  background: var(--text);
  animation: lyric-dot 1.5s var(--ease) infinite;
}

.lyric-break.now span:nth-child(2) {
  animation-delay: 0.18s;
}

.lyric-break.now span:nth-child(3) {
  animation-delay: 0.36s;
}

.lyrics-scroll:not(.playing) .lyric-break.now span {
  animation-play-state: paused;
}

@keyframes lyric-dot {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.72);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.lyrics-hint {
  margin: calc(clamp(32px, 6vh, 64px) * -0.5) 0 32px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.lyrics-plain p {
  margin: 0 0 1.1em;
  font-size: clamp(1.25rem, 0.95rem + 1.1vw, 1.8rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.012em;
  white-space: pre-line;
  text-wrap: pretty;
}

.lyrics-note {
  max-width: 34rem;
  color: var(--text-2);
  line-height: 1.55;
}

.lyrics-big {
  margin-bottom: 10px;
  color: var(--text);
  font-size: clamp(1.6rem, 1rem + 1.8vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lyrics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.lyrics-wait {
  padding: 24px 0;
  opacity: 0;
  animation: lyrics-fade 0.2s 0.35s forwards;
}

@keyframes lyrics-fade {
  to {
    opacity: 1;
  }
}

.lyrics-source {
  margin-top: 64px;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 600;
  font-stretch: 84%;
}

.lyrics-return {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  font-weight: 650;
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: translateX(-50%);
  animation: toast-in 0.18s var(--ease);
}

/* The editor */
.lyrics-input {
  min-height: 340px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.lyrics-help {
  margin-top: 10px;
  max-width: 76ch;
}

.stamp-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stamp-time {
  min-width: 3.3em;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .lyrics-tools .lyrics-queue {
    display: inline-flex;
  }
}

/* ---- video player ------------------------------------------------------------------------- */

.video {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #fff;
}

.video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px 40px;
  background: linear-gradient(rgb(0 0 0 / 0.72), rgb(0 0 0 / 0));
  transition: opacity 0.3s;
  pointer-events: none;
}

.video-top > * {
  pointer-events: auto;
}

.video.idle .video-top {
  opacity: 0;
}

.video .btn {
  color: #fff;
  border-color: rgb(255 255 255 / 0.3);
}

.video .btn:hover {
  background: rgb(255 255 255 / 0.12);
}

.video .btn.primary {
  background: #fff;
  color: #000;
}

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

.video-title b {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-title span {
  color: rgb(255 255 255 / 0.72);
  font-size: var(--fs-sm);
}

.video-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.video-card {
  pointer-events: auto;
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 18px;
  background: rgb(22 23 27 / 0.92);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
  text-align: left;
}

.video-card h2 {
  font-size: var(--fs-xl);
  font-weight: 750;
}

.video-card p {
  margin-top: 8px;
  color: rgb(255 255 255 / 0.75);
  line-height: 1.5;
}

.video-card .actions {
  margin-top: 18px;
}

.next-up {
  position: absolute;
  right: 28px;
  bottom: 96px;
  z-index: 3;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  width: min(440px, calc(100vw - 40px));
  padding: 14px;
  border-radius: 16px;
  background: rgb(22 23 27 / 0.9);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
  animation: toast-in 0.25s var(--ease);
}

.next-up-label {
  color: rgb(255 255 255 / 0.7);
  font-size: var(--fs-sm);
}

.next-up-title {
  font-weight: 700;
  margin: 2px 0 10px;
}

/* ---- needs attention ------------------------------------------------------------------------ */

.attn {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.attn:last-child {
  border-bottom: 1px solid var(--line);
}

.attn .art {
  width: 48px;
}

.attn-title {
  font-weight: 650;
}

.attn-msg {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
}

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

/* ---- fix match & edit ------------------------------------------------------------------------- */

.match-search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.match-search .input:first-child {
  flex: 1;
}

.match-search .year {
  width: 96px;
  flex: none;
}

.candidates {
  display: grid;
  gap: 2px;
}

.candidate {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.candidate:hover,
.candidate:focus-visible {
  background: var(--hover);
}

.candidate.current {
  background: var(--ok-bg);
}

.candidate-title {
  font-weight: 700;
}

.candidate-meta {
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-top: 1px;
}

.candidate-overview {
  margin-top: 6px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid .field + .field {
  margin-top: 0;
}

.subs-results {
  display: grid;
  max-height: 50vh;
  overflow: auto;
}

.sub-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.sub-result-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sub-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

/* ---- responsive --------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .settings {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .settings-index {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --side-w: 0px;
  }

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

  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 75;
    width: min(300px, 86vw);
    background: var(--bg);
    box-shadow: var(--shadow);
    transform: translateX(-104%);
    transition: transform 0.24s var(--ease);
  }

  .side.open {
    transform: none;
  }

  .scrim.on {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 74;
    background: rgb(8 9 12 / 0.45);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 56px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 calc(var(--gutter) - 8px);
    background: rgb(var(--bg-rgb) / 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }

  .topbar .brand-name {
    font-size: 17px;
  }

  .topbar .grow {
    flex: 1;
  }

  .toolbar {
    top: 56px;
  }

  .page-head {
    padding-top: 26px;
  }

  .player {
    grid-template-columns: minmax(0, 1fr) auto;
    height: 68px;
  }

  .player-mid .seek,
  .player-right .volume,
  .player-right .vol-btn {
    display: none;
  }

  .player-mid {
    order: 2;
  }

  .player-right {
    display: none;
  }

  .hero-grid,
  .hero-grid.square-art,
  .hero-grid.wide-art {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .hero-art {
    width: min(48vw, 210px);
  }

  .hero-grid.wide-art .hero-art {
    width: 100%;
  }

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

  .gate-art {
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .gate-shelf {
    position: static;
    height: 44px;
    gap: 5px;
    margin-bottom: 18px;
    max-width: 200px;
  }

  .gate-shelf span {
    border-radius: 2px 2px 1px 1px;
  }

  .drop {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1.6fr repeat(3, minmax(0, 1fr));
  }

  .drop-zone.auto {
    grid-row: auto;
  }

  .pair {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

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

  .picker-places {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 10px;
  }

  .picker-places button {
    width: auto;
  }
}

@media (max-width: 640px) {
  .grid {
    --tile: 104px;
    gap: 22px 12px;
  }

  .grid.square {
    --tile: 140px;
  }

  .row {
    --tile: 112px;
    gap: 12px;
  }

  .row.wide {
    --tile: 236px;
  }

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

  .episode-side {
    grid-column: 2;
  }

  .episode-overview {
    display: none;
  }

  .table .hide-sm {
    display: none;
  }

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

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

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

  .tile-title {
    font-size: var(--fs-sm);
  }

  .filter-input {
    flex: 1 1 100%;
  }
}

.queue-item .player-title,
.queue-item .player-artist {
  display: block;
}
