:root {
  --bg: #0c0c10;
  --raised: #17171d;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3f3f6;
  --muted: #9a9aa6;
  --accent: #f5c518;
  --fresh: #fa320a;
  --listening: #5ad17e;
  --working: #ffc861;
  --refused: #ff9b6a;
  --radius: 16px;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --edge: env(safe-area-inset-top, 0px);
  --top: calc(var(--edge) + 65px);
  --glass: rgba(12, 12, 16, 0.72);
  --glass-bar: rgba(21, 21, 27, 0.74);
  --overhang: 48px;
  --glass-blur: blur(20px) saturate(1.8);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --bar: calc(env(safe-area-inset-bottom) + 70px);
  color-scheme: dark;
}

* { box-sizing: border-box; scrollbar-width: none; }

*::-webkit-scrollbar { display: none; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}

input, select, textarea { font-size: 16px; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
  overflow-wrap: anywhere;
}

input:not([type="checkbox"], [type="radio"], [type="range"]), textarea {
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

a, img { -webkit-user-drag: none; }

:is(.chip, .storage-button, .detail-links a, .brand) { position: relative; }

:is(.chip, .storage-button, .detail-links a)::after,
.brand::after,
:is(.resume, .forget)::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.brand::after { inset: -7px -4px; }
:is(.resume, .forget)::after { inset: -4px; border-radius: 50%; }

:is(.row, .chips, .detail-cast, .filter-options, .heat-scroll) { overscroll-behavior-x: contain; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

[hidden] { display: none !important; }

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg .solid { fill: currentColor; stroke: none; }

/* Header */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--edge) + 10px) var(--gutter) 10px;
  background: linear-gradient(var(--glass), var(--glass)) transparent;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  flex: none;
  margin-right: auto;
}

.brand:active { opacity: 0.7; }

.brand img {
  display: block;
  height: 30px;
  width: auto;
}

.mode {
  flex: none;
  position: relative;
  display: none;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 80px;
  height: 44px;
  padding: 3px;
  border-radius: 22px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
}

.mode::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 36px;
  border-radius: 50%;
  background: #34343f;
  transition: transform 0.2s ease-out;
}

html[data-phone-ready] .mode { display: grid; }
.as-laptop, html[data-device="laptop"] .as-phone { display: none; }
html[data-device="laptop"] .as-laptop { display: revert; }
.mode span { position: relative; display: grid; place-items: center; height: 100%; transition: color 0.2s; }
.mode svg { width: 20px; height: 20px; }
.mode[data-mode="tv"] .mode-tv, .mode:is([data-mode="phone"], [data-mode="moving"]) .mode-phone { color: var(--text); }
.mode:is([data-mode="phone"], [data-mode="moving"])::before { transform: translateX(36px); }
.mode:is([data-mode="moving"], [data-act="pending"])::before { animation: pulse 0.8s infinite alternate; }
.mode[data-act="pending"] { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .mode:is([data-mode="moving"], [data-act="pending"])::before { animation: none; opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .mode::before { transition: none; }
}

.mode-note {
  position: fixed;
  top: calc(var(--top) + 8px);
  left: var(--gutter);
  right: var(--gutter);
  z-index: 21;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #2a1d1d;
  color: var(--refused);
  font-size: 14px;
  text-align: center;
}

.mode-note:empty { display: none; }

.microphone {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.microphone-talk {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--line);
  transition: background 0.2s, color 0.2s;
}

.microphone-talk svg { position: relative; z-index: 1; }
.microphone-talk svg path:first-child { fill: currentColor; stroke: none; }

.microphone-level {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--listening);
  transform: scale(0);
  transition: transform 80ms linear;
}

.microphone[data-state="starting"] .microphone-talk { color: var(--working); }
.microphone[data-state="listening"] .microphone-talk { background: #1d3b27; color: var(--listening); border-color: #2f6b43; }
.microphone[data-state="processing"] .microphone-talk { color: var(--working); animation: microphone-working 1s ease-in-out infinite alternate; }

@keyframes microphone-working { to { background: #2a2416; border-color: #5a4a1e; } }

@media (prefers-reduced-motion: reduce) {
  .microphone[data-state="processing"] .microphone-talk { animation: none; background: #2a2416; }
}

/* Toasts */

.voice { display: none; }
.said, .tile-said, .controls-said, .setting-said { display: none !important; }

.toasts {
  position: fixed;
  z-index: 40;
  top: calc(var(--top) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 2 * var(--gutter)), 520px);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 12px 16px 12px 36px;
  border-radius: var(--radius);
  background: #1e1e25;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  font-size: 15px;
  line-height: 1.3;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.toast::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.toast[data-tone="ok"]::before { background: var(--listening); }
.toast[data-tone="error"]::before { background: var(--refused); }
.toast[data-tone="pending"]::before { background: var(--working); animation: pulse 0.8s infinite alternate; }
.toast-text { font-weight: 600; overflow-wrap: anywhere; }
.toast-detail { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.97); } }
@keyframes toast-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .toast { animation: toast-fade 0.15s; }
  .toast[data-tone="pending"]::before { animation: none; }
}

@keyframes arrive { from { opacity: 0; transform: translateY(-6px); } }
@keyframes pulse { to { opacity: 0.5; } }

/* A tap the TV hasn't confirmed yet pulses; one it refused shakes once and shows the state it is really in. */
[data-act="pending"] { animation: pulse 0.8s infinite alternate; }
[data-act="failed"] { animation: refused 0.36s ease-out; }
@keyframes refused {
  20%, 60% { translate: -4px 0; }
  40%, 80% { translate: 4px 0; }
}

@media (prefers-reduced-motion: reduce) {
  [data-act="pending"] { animation: none; opacity: 0.6; }
  [data-act="failed"] { animation: none; }
}

/* Layout */

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--top) + 12px) var(--gutter) calc(var(--bar) + 32px);
}

/* Search */

.search {
  position: relative;
  margin: 4px 0 12px;
}

.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 19px;
  height: 19px;
}

.search input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search input:focus { border-color: rgba(255, 255, 255, 0.28); }
.search input::placeholder { color: var(--muted); }

.tell { margin: -4px 0 12px; }

.tell button {
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 12px;
  background: #1c2230;
  color: #b9cdf7;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.said {
  margin: 12px 0;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  animation: arrive 0.25s ease-out;
}

/* Chips */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: -2px calc(-1 * var(--gutter)) 4px;
  padding: 4px var(--gutter);
}


.chip {
  flex: none;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:active { transform: scale(0.96); }
.chip { transition: transform 0.12s ease-out; }

/* Shelves */

.shelf { margin: 18px 0 28px; }

.shelf h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

@media (min-width: 640px) {
  :root { --gutter: max(24px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; }
}

.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(72%, 300px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: var(--gutter);
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
}

.row.posters { grid-auto-columns: min(30%, 150px); gap: 10px; }

.row .tile { scroll-snap-align: start; }

.dragging-row { scroll-snap-type: none !important; cursor: grabbing; user-select: none; }

.tile { display: grid; align-content: start; gap: 2px; min-width: 0; }

.tile:active .art { transform: scale(0.97); }

.art, .hero, .still {
  --hue: 220;
  position: relative;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 0%, hsl(var(--hue) 55% 38%), transparent 70%),
    linear-gradient(135deg, hsl(var(--hue) 45% 22%), hsl(calc(var(--hue) + 40) 55% 10%));
}

.art {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  margin-bottom: 6px;
  transition: transform 0.15s ease;
  box-shadow: inset 0 0 0 1px var(--line);
}

.art.poster { aspect-ratio: 2 / 3; border-radius: 8px; }
.art.poster .art-title { font-size: 13px; }
.art.poster + .tile-name { font-size: 14px; }
.art.poster ~ .tile-sub { font-size: 12px; gap: 0 6px; line-height: 1.3; white-space: normal; }
.art.poster ~ .tile-sub .ratings { gap: 2px 6px; }
.art.poster ~ .tile-sub .rating { font-size: 12px; white-space: nowrap; }

.art img, .hero img, .still img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.tile-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.watching { position: relative; }
.tile-link { display: grid; gap: 2px; min-width: 0; }
.watching .art .progress { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 1; }

.resume {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(243, 243, 246, 0.92);
  color: var(--bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.resume svg { width: 18px; height: 18px; margin-left: 2px; }
.resume:active { transform: scale(0.92); }

.tile-said { font-size: 13px; color: var(--listening); }

.empty { color: var(--muted); padding: 24px 0; text-align: center; }

/* Ratings */

.ratings { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; max-width: 100%; }

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.rating.imdb b {
  padding: 0 4px;
  border-radius: 3px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
}

.rating.rt i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fresh);
}

.rating.rt.rotten i { background: #8fb82e; border-radius: 40% 60% 45% 55%; }

.rating.popcorn i {
  width: 11px;
  height: 12px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(to bottom, #ffe9a8 0 45%, #fa320a 45% 100%);
}

.rating.popcorn.spilled i { transform: rotate(-35deg); opacity: 0.8; }

/* Title pages */

.title { position: relative; margin: -12px calc(-1 * var(--gutter)) 0; }

.title > .back {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: var(--gutter);
  margin: 0;
  background: rgba(12, 12, 16, 0.55);
  border-color: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
}

.hero {
  aspect-ratio: 16 / 9;
  max-height: 62vh;
  width: 100%;
  background-size: 100% calc(100% - 4px);
  background-repeat: no-repeat;
}

.hero img { height: calc(100% - 4px); }

.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 -2px;
  background: linear-gradient(to bottom, transparent 45%, var(--bg) calc(100% - 6px));
}

.title-body {
  position: relative;
  margin-top: -56px;
  padding: 0 var(--gutter);
  max-width: 820px;
}

.title h1 {
  margin: 0;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.title-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
  color: var(--muted);
}

.details { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }

.progress {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.progress i { display: block; height: 100%; background: var(--text); }

.title-body > .progress { margin: 0 0 16px; max-width: 360px; }

.play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  height: 52px;
  margin: 8px 0 4px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 17px;
  font-weight: 700;
}

.play:active { opacity: 0.8; }

.seasons { margin-top: 22px; }

.episodes {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.episode {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px;
  margin: 0 -8px;
  border-radius: 12px;
  text-align: left;
}

.episode:active { background: var(--raised); }

.still {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

.still .progress {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 1;
}

.episode-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; }
.episode-row .episode { margin-right: 0; }

.mark-seen {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  color: var(--muted);
}

.mark-seen svg { width: 20px; height: 20px; stroke-width: 2.6; }
.mark-seen[aria-pressed="true"] { border-color: rgba(90, 209, 126, 0.55); color: #5ad17e; }
.mark-seen:active { transform: scale(0.94); }

.mark-film { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding-left: 12px; }
.mark-film svg { width: 18px; height: 18px; stroke-width: 2.6; }
.pill.mark-film[aria-pressed="true"] { border-color: rgba(90, 209, 126, 0.55); color: #5ad17e; }

.episode-text { display: grid; gap: 2px; min-width: 0; }
.episode-text b { font-size: 15px; line-height: 1.25; }
.episode-text span { color: var(--muted); font-size: 13px; }

@media (min-width: 640px) {
  .episode { grid-template-columns: 200px minmax(0, 1fr); }
}

.heat { margin-top: 28px; }
.heat h2 { font-size: 20px; margin: 0 0 10px; }
.heat-scroll { overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.heat-grid { border-collapse: separate; border-spacing: 3px 3px; margin: 0 -3px; }
.heat-grid th { color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; padding: 0 2px; white-space: nowrap; }
.heat-grid tbody th { text-align: right; padding: 0 2px 0 0; }
.heat-grid td { padding: 0; }

.heat-cell {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border-radius: 6px;
  background: var(--raised);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.heat-cell.awesome { background: #1e8449; }
.heat-cell.great { background: #58c46e; color: #12141a; }
.heat-cell.good { background: #f2d04a; color: #12141a; }
.heat-cell.regular { background: #ef8f3a; color: #12141a; }
.heat-cell.bad { background: #d9443c; }
.heat-cell.garbage { background: #7d3c98; }
button.heat-cell:active { outline: 2px solid var(--text); }

.heat-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.heat-legend span { display: inline-flex; align-items: center; gap: 6px; }
.heat-legend i { width: 14px; height: 14px; border-radius: 4px; }

/* Player bar */

.when-paused { display: none; }
html:has(.now-state.paused) .when-paused { display: block; }
html:has(.now-state.paused) .when-playing { display: none; }
html[data-flip]:not(:has(.now-state.paused)) .when-paused { display: block; }
html[data-flip]:not(:has(.now-state.paused)) .when-playing { display: none; }
html[data-flip]:has(.now-state.paused) .when-paused { display: none; }
html[data-flip]:has(.now-state.paused) .when-playing { display: block; }

.bar {
  position: fixed;
  z-index: 25;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--overhang));
  display: flex;
  align-items: center;
  height: calc(var(--bar) + var(--overhang));
  padding: 0 max(0px, calc((100% - 1280px) / 2)) calc(env(safe-area-inset-bottom) + var(--overhang));
  background: var(--glass-bar);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateZ(0);
  will-change: transform;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .top { background: var(--bg); }
  .bar { background: #15151b; }
}

.bar-progress {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.bar-progress i { display: block; height: 100%; background: var(--accent); transition: width 0.5s linear; }

.bar-open {
  touch-action: none;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 var(--gutter);
  text-align: left;
}

.bar-art {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--raised);
  color: var(--muted);
}

.bar-art img { width: 100%; height: 100%; object-fit: cover; }
.bar-text { flex: 1; display: grid; min-width: 0; }

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

.bar-text strong { font-size: 15px; }
.bar-text span { color: var(--muted); font-size: 13px; }
.bar-chevron { flex: none; width: 20px; height: 20px; color: var(--muted); }

.bar-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-right: var(--gutter);
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
}

.bar-toggle svg { width: 24px; height: 24px; }
.bar-toggle:active { opacity: 0.8; }
html:not(:has(.now-state)) .bar-toggle { display: none; }

/* Player sheet */

.sheet-dim {
  position: fixed;
  z-index: 39;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s, visibility 0s 0.4s;
}

html[data-sheet] .sheet-dim,
html[data-sheet-drag] .sheet-dim {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s;
}

html[data-sheet] .sheet-dim { pointer-events: auto; }

.sheet {
  position: fixed;
  z-index: 40;
  top: calc(var(--edge) + 8px);
  left: 0;
  right: 0;
  bottom: -60px;
  padding-bottom: 60px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #111116;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
  visibility: hidden;
  transform: translateY(calc(100% + 40px));
  transition: transform 0.6s var(--spring), visibility 0s 0.6s;
}

html[data-sheet] .sheet,
html[data-sheet-drag] .sheet {
  visibility: visible;
  transition: transform 0.6s var(--spring);
}

html[data-sheet] .sheet { transform: none; }

@media (min-width: 760px) {
  .sheet { width: min(640px, calc(100% - 2 * var(--gutter))); margin: 0 auto; }
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.022, 0.079, 0.156, 0.246, 0.339, 0.431, 0.519, 0.6, 0.673, 0.737, 0.792, 0.839, 0.879, 0.911, 0.937, 0.958, 0.974, 0.986, 0.995, 1.002, 1.006, 1.009, 1.01, 1.011, 1.011, 1.011, 1.01, 1.009, 1.008, 1.007, 1.006, 1.005, 1.004, 1.003, 1.003, 1.002, 1.002, 1.001, 1.001, 1);
  }
}

.sheet.dragging,
.sheet-dim.dragging { transition: none !important; }
html[data-sheet] body { overflow: hidden; }

.sheet-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--gutter) calc(env(safe-area-inset-bottom) + 40px);
}

.sheet-top {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 calc(-1 * var(--gutter));
  background: #111116;
  touch-action: none;
  cursor: grab;
}

.sheet.dragging .sheet-top { cursor: grabbing; }

.sheet-close {
  display: grid;
  place-items: center;
  width: 100%;
  height: 44px;
}

.sheet-grabber {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
}

.sheet-close:focus { outline: none; }
.sheet-close:focus-visible .sheet-grabber { background: var(--text); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 560px;
  margin: 0 auto;
}

.now { display: grid; gap: 16px; }

.now-art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 0% 0%, hsl(220 55% 30%), transparent 70%),
    linear-gradient(135deg, hsl(220 45% 18%), hsl(260 55% 9%));
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
}

.now-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.now-title { display: grid; gap: 4px; }
.now h2 { margin: 0; color: var(--text); font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; }
.now span { color: var(--muted); font-size: 15px; }
.now.idle { gap: 6px; padding-top: 8px; }
.now.idle h2 { font-size: 32px; }

.sheet-playback { display: grid; gap: 22px; }
html:not(:has(.now-state)) .sheet-playback { display: none; }

.sheet .scrub { width: 100%; height: 40px; margin: 0; padding-top: 0; }
.sheet .scrub-time { font-size: 13px; }
.sheet .scrub-thumb { transform: scale(1); }

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.transport .skip {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.transport .skip svg { width: 32px; height: 32px; }
.transport .skip-amount { font-size: 15px; }

.transport-toggle {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
}

.transport-toggle svg { width: 36px; height: 36px; }
.transport button:active { transform: scale(0.94); }

.pick { display: grid; gap: 10px; }

.pick h3, .remote h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices.speeds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.choices.speeds .choice { padding: 0; font-size: 14px; font-variant-numeric: tabular-nums; }

.choice {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
}

.choice[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #1a1406; }
.choice[data-act="pending"] { border-color: var(--accent); color: var(--accent); }
.choice:active { transform: scale(0.96); }
.sheet-playback > .answer { margin: -8px 0 0; }

.choices.outputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.outputs .choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  padding: 0 12px;
}

.outputs .choice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outputs .choice svg { flex: none; width: 20px; height: 20px; }
.sound > .answer { margin: 0; }

.delay { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 8px; }
.delay span { color: var(--muted); font-size: 14px; }
.delay .choice { padding: 0 12px; font-variant-numeric: tabular-nums; }
.delay output { justify-self: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.pick .find-subtitles { justify-self: start; }
.pick > .answer { margin: 0; }
.find-subtitles-row { display: grid; justify-items: start; gap: 0; margin-top: 12px; }
.find-subtitles-row .answer { margin-top: 8px; }

.bar-phones { display: none; flex: none; color: var(--accent); }
.bar-phones svg { width: 18px; height: 18px; }
html:has(.sound[data-output="headphones"]) .bar-phones { display: grid; }

.stop {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

.stop svg { width: 18px; height: 18px; }

.remote {
  display: grid;
  gap: 10px;
  padding: 18px 14px 14px;
  border-radius: 24px;
  background: var(--raised);
  border: 1px solid var(--line);
}

.remote h3 { padding: 0 4px; }
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.key {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 10px 6px;
  border-radius: 16px;
  background: #23232c;
  font-size: 13px;
  font-weight: 600;
}

.key svg { width: 26px; height: 26px; }
.keys.volume .key { min-height: 60px; }
.volume-block { display: grid; gap: 8px; margin-top: 4px; }
.volume-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.volume-head output { color: var(--text); font-variant-numeric: tabular-nums; }
.volume-level { display: block; height: 4px; margin: 0 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.volume-level i { display: block; height: 100%; background: var(--accent); transition: width 0.2s ease-out; }
.key:active { background: #30303b; transform: scale(0.97); }
.remote .answer { margin: 2px 4px 0; }

.pair { display: grid; gap: 10px; padding: 6px 4px 0; }
.pair p { margin: 0; color: var(--muted); font-size: 14px; }
.pair .pill { justify-self: start; }

@media (prefers-reduced-motion: reduce) {
  .sheet, html[data-sheet] .sheet, .sheet-dim, html[data-sheet] .sheet-dim { transition: none; }
}

/* Header link */

.top-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--line);
}

.top-link:active, .microphone-talk:active { background: #23232c; }

/* Back */

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  margin: 2px 0 10px;
  padding: 0 18px 0 10px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.back svg { width: 22px; height: 22px; stroke-width: 2.4; }
.back:active { background: rgba(255, 255, 255, 0.12); }

.controls-said { min-height: 20px; margin: 8px 0 0; color: var(--listening); font-size: 14px; }
.controls-said:empty { display: none; }

/* Settings */

.page { max-width: 560px; margin: 0 auto; }
.page h1 { margin: 6px 0 2px; font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; }

.settings { margin: 26px 0; }

.settings h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.settings h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.row-link {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.row-link > svg:first-child { color: var(--muted); }
.row-link:active { background: #1f1f27; }
.row-chevron { width: 18px; height: 18px; color: var(--muted); }

.pill {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 650;
}

.pill:active { opacity: 0.8; }
.pill.play-tv { display: none; }
html[data-phone-ready]:is([data-mode="phone"], :has(.mode[data-mode="phone"])) .pill.play-tv { display: inline-flex; justify-self: start; margin-top: 2px; }
.pill.handoff { display: none; }
html[data-phone-ready]:has(.mode[data-mode="tv"]) .pill.handoff { display: inline-flex; justify-self: start; }
.pill.quiet { background: transparent; border: 1px solid var(--line); color: var(--text); }
.pill:has(svg) { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; }
.pill svg { width: 18px; height: 18px; }
.setting-row .answer { grid-column: 1 / -1; margin: 0; }

.answer { margin: 10px 0 0; color: var(--listening); font-size: 14px; }
.answer.refused { color: var(--refused); }
.answer:empty { display: none; }

.setting-group { border-radius: var(--radius); overflow: hidden; }

.setting {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}

.setting-group .setting:last-child { border-bottom: 0; }

.setting-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.setting-row .setting-said { grid-column: 1 / -1; }

.setting-name { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; }
.setting-row .setting-name { display: grid; gap: 2px; }
.setting-name:has(> small) { display: grid; gap: 2px; }
.setting-name small { color: var(--muted); font-size: 12px; }
.setting-name small:empty { display: none; }
.setting-name output { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.setting-note { margin: 0; color: var(--muted); font-size: 14px; }
.setting-said { font-size: 13px; color: var(--listening); }

.setting input[type="range"] {
  width: 100%;
  margin: 4px 0;
  accent-color: var(--accent);
}

.setting input[type="color"] {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
}

.setting select {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 9em;
  min-height: 44px;
  padding: 0 10px;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.switch:checked { background: var(--listening); }
.switch:checked::after { transform: translateX(20px); }

.tracks { display: grid; gap: 8px; margin-bottom: 8px; }

.track {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--line);
}

.track span { color: var(--muted); font-size: 13px; }
.track.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Scrubber (semmeltv-scrub) */

.scrub {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1280px;
  height: 30px;
  margin: 0 auto;
  padding-top: 4px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  outline: none;
}

.scrub-time {
  flex: none;
  width: 3.4em;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.scrub-time.long { width: 4.4em; }
.scrub-time:last-child { text-align: right; }

.scrub-rail {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  transition: height 0.15s;
}

.scrub-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--text);
}

.scrub-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transform: scale(0);
  transition: transform 0.15s;
}

.scrub-bubble {
  position: absolute;
  bottom: 18px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: pre;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.scrub:is(:hover, .dragging, .jumping, :focus-visible) .scrub-rail { height: 6px; }
.scrub:is(:hover, .dragging, .jumping, :focus-visible) .scrub-thumb { transform: scale(1); }
.scrub:is(.dragging, .hovering, .jumping) .scrub-bubble { opacity: 1; }
.scrub.dragging .scrub-bubble { bottom: 30px; }

@media (hover: none) {
  .scrub-thumb { transform: scale(0.8); }
}

.skip { position: relative; }
.skip-amount { display: none; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.skip.skipped svg { display: none; }
.skip.skipped .skip-amount { display: block; }

/* Storage */

.storage { max-width: 560px; margin: 0 auto; }
.storage h1 { margin: 6px 0 2px; font-size: 28px; line-height: 1.15; }

.storage-meter {
  position: relative;
  display: flex;
  height: 14px;
  margin: 4px 0 10px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  overflow: hidden;
}

.storage-meter i { display: block; height: 100%; background: var(--muted); }
.storage-meter i.downloads { background: var(--accent); }

.storage-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--text);
  opacity: 0.6;
}

.storage-numbers { margin: 0 0 6px; font-size: 15px; font-variant-numeric: tabular-nums; }

.storage-sort { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.storage-sort .track { min-height: 44px; place-content: center; text-align: center; padding: 0 12px; }

.storage-titles {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--radius);
  overflow: hidden;
}

.storage-title {
  order: var(--by-age);
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}

.storage-titles.by-size .storage-title { order: var(--by-size); }
.storage-title.gone .storage-title-line,
.storage-title.gone .storage-title-text { opacity: 0.45; }

.storage-title-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.storage-title-text { display: grid; gap: 2px; min-width: 0; }
.storage-title-text b { font-weight: 600; overflow-wrap: anywhere; }
.storage-title-text span { color: var(--muted); font-size: 13px; }
.storage-size { flex: none; font-size: 15px; font-variant-numeric: tabular-nums; }

.storage-tag { font-style: normal; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.storage-tag.kept { color: var(--listening); }
.storage-tag.next { color: var(--refused); }

.storage-actions { display: flex; gap: 8px; margin-left: auto; }
.storage-actions[hidden] { display: none; }

.storage-button {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font-size: 14px;
}

.storage-button:active { background: rgba(255, 255, 255, 0.16); }
.storage-button.danger { background: var(--fresh); border-color: transparent; color: #fff; font-weight: 600; }

/* Downloads (semmeltv-downloads) */

.download-search { display: flex; gap: 8px; align-items: center; }
.download-search input { flex: 1; min-width: 0; }
.download-search .storage-button { flex: none; min-height: 46px; padding: 0 18px; border-radius: 12px; font-size: 16px; font-weight: 600; }

.download-choices,
.download-jobs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }

.download-choice,
.download-job {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--line);
}

.download-choice.best { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.download-choice b { font-weight: 600; }
.download-choice .storage-button { justify-self: start; }

.download-name { color: var(--muted); font-size: 13px; }

.download-why { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.download-why li { color: var(--muted); font-size: 13px; }

.download-job-line { display: grid; gap: 2px; }
.download-job-line b { font-weight: 600; }
.download-job-line span { color: var(--muted); font-size: 13px; }

.download-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.download-bar i { display: block; height: 100%; background: var(--accent); }
.download-job[data-stage="failed"] .download-bar i,
.download-job[data-stage="stopped"] .download-bar i { background: var(--refused); }
.download-job .storage-button { justify-self: start; }

.download-facts,
.download-log { margin: 0; color: var(--muted); font-size: 13px; }

/* title detail */

.detail .title-body { max-width: 900px; }

.detail-head {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.detail-poster {
  margin: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), inset 0 0 0 1px var(--line);
}

.detail-heading { min-width: 0; }

.detail .detail-heading h1 { font-size: clamp(25px, 6.6vw, 44px); }

.detail-original { margin: 4px 0 0; color: var(--muted); font-size: 14px; font-style: italic; }

.detail-line { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.35; }

.detail-ratings { margin: 8px 0 0; gap: 4px 10px; }

.detail-score {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.detail-score b { color: var(--text); font-size: 15px; font-weight: 700; }

.detail-score b.detail-metacritic {
  padding: 1px 5px;
  border-radius: 5px;
  background: #66cc33;
  color: #0c0c10;
  font-size: 13px;
}

.detail-tagline {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

.detail-playback {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--raised);
  border: 1px solid var(--line);
}

.detail-playback p { margin: 0; }

.detail-last,
.detail-next,
.detail-seen-count { color: var(--muted); font-size: 14px; }

.detail-last b,
.detail-next b { color: var(--text); font-weight: 600; }

.detail-playback .progress { height: 5px; }

.detail-stopped { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.detail-actions { display: flex; gap: 10px; margin-top: 4px; }

.detail-actions .play { flex: 1; max-width: none; margin: 0; }

.detail-trailer {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.detail-trailer:active { opacity: 0.8; }

.detail-playback .said { margin: 0; }

.detail-more { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 4px; }
.detail-more .mark-film, .detail-more .find-subtitles-row { margin-top: 0; }

.detail-plot { margin: 18px 0 0; font-size: 16px; line-height: 1.55; }

.detail-facts {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.detail-facts div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }

.detail-facts dt { color: var(--muted); font-size: 14px; }

.detail-facts dd { margin: 0; font-size: 14px; }

.detail-section { margin-top: 28px; }

.detail-section h2 { font-size: 20px; margin: 0 0 10px; }

.detail-cast {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 var(--gutter);
}


.detail-cast li {
  display: grid;
  align-content: start;
  gap: 2px;
  flex: none;
  width: 92px;
  scroll-snap-align: start;
}

.detail-face {
  --hue: 220;
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 3;
  margin-bottom: 4px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg, hsl(var(--hue) 35% 28%), hsl(calc(var(--hue) + 40) 45% 12%));
  box-shadow: inset 0 0 0 1px var(--line);
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  font-weight: 700;
}

.detail-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.detail-cast b { font-size: 13px; line-height: 1.25; }

.detail-role { color: var(--muted); font-size: 12px; line-height: 1.25; }

.detail-section .seasons { margin-top: 0; }

.detail-seen {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(12, 12, 16, 0.8);
  color: #5ad17e;
}

.detail-seen svg { width: 15px; height: 15px; stroke-width: 3; }

.detail-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }

.detail-links a {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.detail-links a:active { background: rgba(255, 255, 255, 0.12); }

.detail-columns { display: flex; flex-direction: column; }

.detail-side,
.detail-main { display: contents; }

.detail-playback { order: 1; }
.detail-plot { order: 2; }
.detail-facts { order: 3; }
.detail-cast-section { order: 4; }
.detail-episodes { order: 5; }
.detail-columns .heat { order: 6; }
.detail-links { order: 7; }

@media (min-width: 640px) {
  .detail-head { grid-template-columns: 160px minmax(0, 1fr); gap: 22px; }
  .detail-cast li { width: 110px; }
  .detail-facts { grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .detail-actions { max-width: 480px; }
}

@media (min-width: 1000px) {
  .detail .hero { max-height: 46vh; }
  .detail .title-body { max-width: 1200px; margin-top: -150px; }
  .detail-side { margin-top: 150px; }
  .detail-side .detail-playback { margin-top: 0; }
  .detail-head { grid-template-columns: 210px minmax(0, 1fr); gap: 28px; }
  .detail-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 44px;
    align-items: start;
  }
  .detail-main { display: block; grid-column: 1; grid-row: 1; }
  .detail-side {
    display: block;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--top) + 16px);
  }
  .detail-side .detail-facts { grid-template-columns: 1fr; }
  .detail-side .detail-actions { max-width: none; }
  .detail-main .detail-plot { font-size: 17px; }
  .detail-cast { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
}

/* end title detail */

/* home rows and filters */

.sections .chips { gap: 6px; margin-bottom: 4px; }
.sections .chip { padding: 7px 12px; font-size: 14px; }
.chip-gap { flex: none; width: 1px; margin: 6px 1px; background: var(--line); }
.chip.pick { display: inline-flex; align-items: center; gap: 3px; padding: 7px 6px 7px 10px; }
.chip.pick svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip.pick .glyph { width: 17px; height: 17px; stroke-width: 1.9; }
.chip.pick[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.chip.pick.on { background: var(--accent); border-color: var(--accent); color: #111; }

.filter-options {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 2px calc(-1 * var(--gutter)) 4px;
  padding: 6px var(--gutter);
  animation: arrive 0.18s ease-out;
}


.filter-option {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.filter-option.on { background: var(--raised); border-color: var(--accent); color: var(--accent); }

.tile.watching.gone { display: none; }

.forget {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.forget svg {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(12, 12, 16, 0.72);
  box-shadow: 0 0 0 1px var(--line);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.forget:active svg { transform: scale(0.9); }

/* end home rows and filters */

/* Instant navigation */

semmel-shell {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: block;
  overflow: hidden;
  background: var(--bg);
}

.bone {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: var(--raised);
  animation: bone 0.9s ease-in-out infinite alternate;
}

.detail-line .bone { height: 12px; margin-top: 6px; }
.nav-skeleton .bones { display: grid; gap: 12px; max-width: 520px; margin-top: 28px; }

@keyframes bone { to { opacity: 0.45; } }

@media (prefers-reduced-motion: reduce) {
  .bone { animation: none; }
}

.trouble { display: grid; justify-items: start; gap: 12px; padding-top: 24px; }
.trouble h1 { margin: 0; }
.trouble p { margin: 0; color: var(--muted); }
.trouble .pill { display: inline-flex; align-items: center; margin-top: 8px; }

/* Profiles and sign-in */

.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--avatar, var(--raised));
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  flex: none;
}

.avatar.small { width: 34px; height: 34px; font-size: 16px; }
.avatar.large { width: 84px; height: 84px; font-size: 38px; border-radius: 24px; }
.top-link.profile-link { background: transparent; border: 0; }

.sign-in { display: grid; justify-items: center; gap: 18px; padding-top: 12px; text-align: center; }
.sign-in h1 { margin-top: 8px; }

.profile-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 132px));
  justify-content: center;
  gap: 22px 28px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.profile-choice {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 0;
  border-radius: 20px;
  color: var(--text);
}

.profile-choice .avatar { transition: transform 0.15s var(--spring), box-shadow 0.15s; }
.profile-choice:active .avatar { transform: scale(0.94); }
.profile-choice.active .avatar, .profile-choice.chosen .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.profile-choice[data-act="pending"] .avatar { opacity: 0.6; }
.profile-name { font-size: 17px; font-weight: 600; }
.profile-state { color: var(--muted); font-size: 12px; margin-top: -6px; }

.password-form { display: grid; gap: 10px; width: min(100%, 340px); text-align: left; }
.password-form[hidden] { display: none; }
.password-label { color: var(--muted); font-size: 14px; }
.password-label b { color: var(--text); }
.password-actions { display: flex; gap: 10px; }

.password-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
}

.sign-in-note { min-height: 20px; max-width: 34ch; margin: 0; color: var(--refused); font-size: 15px; line-height: 1.4; }
.sign-in-note:empty { visibility: hidden; }
.sign-in-help { max-width: 34ch; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.sign-in-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

.account-head { display: grid; justify-items: center; gap: 8px; margin: 4px 0 20px; text-align: center; }
.account-head h1 { margin: 6px 0 0; }
.password-set .setting input { margin-top: 2px; }

.member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  padding: 12px 14px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}

.member:last-child { border-bottom: 0; }
.member-text { display: grid; gap: 2px; min-width: 0; }
.member-text small { color: var(--muted); font-size: 12px; }
.member-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.member-actions .pill { min-height: 36px; font-size: 14px; }
.pill.danger { color: var(--refused); }
.invite-link { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--bg); font-size: 13px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.invite-link[hidden] { display: none; }
.add-member .setting-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.role-select { min-height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--text); }
