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

:root {
  --bg: #000;
  --panel: #0f0f0f;
  --panel-strong: #141414;
  --stroke: #1d1d1d;
  --stroke-strong: #2a2a2a;
  --text: #f5f5f5;
  --muted: #6f6f6f;
  --muted-strong: #8a8a8a;
  --accent: #ffff00;
  --card-min: 121px;
  --card-gap: 15px;
}

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.search-note { grid-column: 1 / -1; margin: 4px 0 0; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 27px 51px;
}

/* ---------- header ---------- */
header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 27px;
}
.brand { min-width: 128px; }
.logo-btn { display: inline-flex; align-items: center; padding: 0; background: transparent; border: none; cursor: pointer; text-decoration: none; }
.logo-image {
  height: 54px; width: auto; max-width: 170px; object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6));
}
.search-box { flex: 1; display: flex; align-items: center; gap: 10px; }
.search-box input {
  flex: 1; padding: 12px 15px; border-radius: 12px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, #111 0%, #0b0b0b 100%);
  color: var(--text); font-size: 15px; font-weight: 500;
}
.search-box input::placeholder { color: #555; }
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 255, 0, 0.14); }
.search-button, .icon-btn {
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--stroke-strong); background: var(--panel);
  color: var(--accent); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; flex: none;
}
.icon-btn { color: var(--muted); font-size: 20px; }
.bookmark-nav-btn { position: relative; color: var(--accent); }
.bookmark-nav-btn > svg {
  width: 17px; height: 22px;
  overflow: visible;
  fill: transparent;
  transition: fill .16s, color .16s;
}
.bookmark-nav-btn.active { color: var(--accent); border-color: var(--accent); }
.bookmark-nav-btn.active > svg { fill: currentColor; }
.bookmark-nav-count {
  position: absolute; right: -4px; top: -4px;
  min-width: 16px; height: 16px; padding: 0 3px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg); border-radius: 999px;
  background: var(--accent); color: #000;
  font-size: 8px; font-weight: 600; line-height: 1;
}
.search-button:hover, .icon-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}
.search-button svg { width: 20px; height: 20px; }

/* ---------- settings ---------- */
.settings {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 24px;
}
.settings label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.settings input {
  flex: 1; min-width: 220px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--stroke); background: #0b0b0b; color: var(--text);
}
.settings button {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--stroke-strong);
  background: var(--panel-strong); color: var(--text); cursor: pointer;
}
.settings button:hover { border-color: var(--accent); }

/* ---------- rows / grids ---------- */
.row { margin-bottom: 29px; }
.row h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; margin-bottom: 14px; letter-spacing: .02em;
}
.continue-count {
  min-width: 19px; height: 19px; padding: 0 6px;
  border: 1px solid #333; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-strong); font-size: 10px; font-weight: 500;
}
.results-title { font-size: 17px; margin: 3px 0 15px; letter-spacing: .02em; }
.bookmarks-title { display: flex; align-items: center; gap: 9px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
  gap: var(--card-gap);
  align-items: start;
}

.card {
  cursor: pointer; text-align: left; position: relative; min-width: 0;
  transition: transform .18s cubic-bezier(.2,.8,.2,1); outline: none;
}
.card:hover { transform: translateY(-3px); }
.card-media {
  position: relative; overflow: hidden; border-radius: 11px;
  border: 1px solid var(--stroke);
  background: #101010;
  transition: border-color .18s, box-shadow .18s;
}
.card .poster {
  width: 100%; aspect-ratio: 2 / 3; background: #111;
  border: 0; object-fit: cover; display: block;
  transition: filter .18s, transform .25s;
}
.card.square .poster { aspect-ratio: 1 / 1; }
.card .ctitle {
  font-size: 12px; font-weight: 600; line-height: 1.22; margin: 8px 2px 3px;
  text-align: left;
  white-space: normal; overflow-wrap: anywhere;
}
.card .cmeta {
  font-size: 9px; color: var(--muted-strong); margin: 0 2px;
  text-align: left;
}
.card-hover-meta {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 10px 8px;
  background: rgba(0,0,0,.38);
  color: #fff; opacity: 0;
  transition: opacity .18s;
  backdrop-filter: blur(.35px);
}
.hover-ratings {
  display: grid;
  grid-template-columns: minmax(0,1fr) 1px minmax(0,1fr);
  align-items: center;
  column-gap: 8px;
  width: 100%;
  max-width: 117px;
}
.hover-rating {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
}
.hover-rating-name {
  color: #fff;
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hover-rating-value {
  color: var(--accent);
  max-width: 100%;
  font-size: clamp(18px, 1.8vw, 25px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.hover-rating-divider {
  display: block;
  width: 1px;
  height: 37px;
  background: rgba(255,255,255,.62);
}
.hover-duration {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .015em;
  text-align: center;
  white-space: nowrap;
}
.card:hover .card-media,
.card:focus-visible .card-media {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px var(--accent),
    0 10px 24px rgba(0,0,0,.55);
}
.card:hover .poster,
.card:focus-visible .poster { filter: brightness(.66); transform: scale(1.015); }
.card:hover .card-hover-meta,
.card:focus-visible .card-hover-meta { opacity: 1; }
.card-bookmark {
  position: absolute; z-index: 4; top: -1px; right: 7px;
  width: 24px; height: 31px; padding: 0;
  border: 0; background: transparent; color: #fff;
  display: inline-flex; align-items: flex-start; justify-content: center;
  cursor: pointer; opacity: 0;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.75));
  transform: translateY(-2px);
  transition: opacity .15s, transform .15s, color .15s;
}
.card-bookmark svg {
  width: 21px; height: 28px;
  fill: transparent;
  stroke: currentColor;
  transition: fill .15s, color .15s, transform .15s;
}
.card:hover .card-bookmark,
.card:focus-within .card-bookmark,
.card-bookmark.on {
  opacity: 1;
  transform: translateY(0);
}
.card-bookmark:hover svg { transform: scale(1.06); }
.card-bookmark.on { color: var(--accent); }
.card-bookmark.on svg { fill: currentColor; }
.card-bookmark:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
/* «Для вас»: dismiss cross, mirrors the bookmark control on the left */
.fy-hide {
  position: absolute; z-index: 4; top: 5px; left: 7px;
  width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff;
  font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.75));
  transform: translateY(-2px);
  transition: opacity .15s, transform .15s, background .15s;
}
.card:hover .fy-hide,
.card:focus-within .fy-hide {
  opacity: 1;
  transform: translateY(0);
}
.fy-hide:hover { background: rgba(0, 0, 0, .88); transform: scale(1.08); }
.fy-hide:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card .rating-pill {
  position: absolute; top: 8px; left: 8px; padding: 3px 7px; border-radius: 8px;
  z-index: 2; font-size: 11px; font-weight: 600; background: rgba(0,0,0,.72); color: var(--accent);
}
.curated-label {
  position: absolute; top: 7px; left: 7px; z-index: 4;
  max-width: calc(100% - 14px); min-height: 22px; padding: 4px 7px;
  border: 1px solid rgba(220, 220, 70, .86); border-radius: 7px;
  background: rgba(0,0,0,.76); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; line-height: 1.05; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.curated-label[data-tone="season"] { font-size: 9.5px; padding-inline: 6px; }
.curated-card:hover .curated-label,
.curated-card:focus-within .curated-label {
  background: var(--accent); color: #050505; border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(215, 215, 42, .22);
}
.card-remove {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(18,18,18,.86); border: 1px solid #454545; color: #bdbdbd; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1; z-index: 2; opacity: 0;
  transition: opacity .15s, background .15s, color .15s, border-color .15s;
}
.card-remove-glyph {
  display: block;
  font: 400 15px/1 Arial, sans-serif;
  transform: translateY(-1px);
}
.card:hover .card-remove { opacity: 1; }
.card-remove:hover { background: #1b1b1b; border-color: #5b5b5b; color: #dedede; }
.continue-card .card-remove { left: 5px; right: auto; }

/* Admin-only "add to curated list" button on a card (soap browser + search). */
.card-add-list {
  position: absolute; top: 5px; left: 5px; width: 21px; height: 21px; border-radius: 50%;
  background: rgba(18,18,18,.86); border: 1px solid #454545; color: #d8d84a; cursor: pointer;
  display: none; align-items: center; justify-content: center; line-height: 1; z-index: 5; padding: 0;
  font: 400 16px/1 Arial, sans-serif;
  transition: background .15s, color .15s, border-color .15s;
}
body.admin-mode .card-add-list { display: flex; }
.card-add-list:hover { background: #1b1b1b; border-color: var(--accent); color: #fff; }

/* soap admin browser header + controls */
.soap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.soap-controls { display: flex; gap: 8px; align-items: center; }
.soap-controls input {
  background: #141414; border: 1px solid #333; border-radius: 8px; color: #e6e6e6;
  padding: 7px 11px; font-size: 13px; min-width: 220px; outline: none;
}
.soap-controls input:focus { border-color: #5b5b5b; }
.soap-controls button {
  background: #141414; border: 1px solid #333; border-radius: 8px; color: #cfcfcf;
  padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.soap-controls button:hover { border-color: #5b5b5b; color: #fff; }
.continue-section .card-grid {
  --continue-media-height: clamp(189px, 17.8vw, 219px);
  display: flex;
  align-items: flex-start;
  gap: 15px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 3px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.continue-section .card-grid::-webkit-scrollbar { width: 0; height: 0; display: none; }
.continue-card {
  flex: 0 0 clamp(126px, 11.9vw, 146px);
  scroll-snap-align: start;
}
.continue-featured {
  flex-basis: clamp(306px, 33vw, 388px);
}
.continue-card .continue-media {
  height: var(--continue-media-height);
  border-radius: 12px;
}
.continue-card .poster {
  width: 100%; height: 100%; aspect-ratio: auto;
  object-fit: cover;
  filter: none;
}
.continue-featured .poster { filter: none; }
.continue-card:hover .poster,
.continue-card:focus-visible .poster {
  filter: none;
  transform: none;
}
.continue-card .ctitle {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.22;
}
.continue-featured .ctitle { font-size: 14px; }
.continue-card .cmeta { font-size: 9px; }
.continue-overlay {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  padding: 24px 9px 9px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.78));
  pointer-events: none;
}
.continue-status {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-featured .continue-status { font-size: 11px; }
.continue-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(40,0,0,.82);
}
.continue-progress-bar {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--accent);
}
.continue-play {
  position: absolute; z-index: 2; left: 50%; top: 46%;
  width: 0; height: 0;
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
  border-left: 26px solid var(--accent);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
  opacity: 0;
  transform: translate(-42%, -50%) scale(.86);
  transition: opacity .16s, transform .16s;
  pointer-events: none;
}
.continue-featured .continue-play,
.continue-card:hover .continue-play,
.continue-card:focus-visible .continue-play {
  opacity: .96;
  transform: translate(-42%, -50%) scale(1);
}
.continue-card:hover .card-media,
.continue-card:focus-visible .card-media {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px var(--accent),
    0 10px 24px rgba(0,0,0,.48);
}

.home-empty {
  display: flex; flex-direction: column; gap: 8px; padding: 60px 20px; text-align: center;
  color: var(--muted);
}
.home-empty strong { color: var(--text); font-size: 18px; }

/* ---------- watch ---------- */
.watch-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.watch-title { font-size: 18px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-actions { display: flex; gap: 10px; }
.add-list-btn {
  padding: 9px 16px; border: 1px solid var(--stroke-strong); border-radius: 10px;
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 14px;
}
.add-list-btn:hover { border-color: var(--accent); }

/* ---------- curated lists / compact admin ---------- */
.curated-section { margin: 7px 0 32px; }
.curated-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; margin-bottom: 0;
}
.catalog-state {
  display: inline-block; min-height: 14px; margin-top: 3px;
  color: var(--muted); font-size: 10px; letter-spacing: .06em;
}
.catalog-state[data-mode="dirty"], .catalog-state[data-mode="saving"] { color: #d9d966; }
.catalog-state[data-mode="error"] { color: #e28f8f; }
.admin-catalog-actions { display: flex; gap: 7px; }
.admin-catalog-actions button,
.curated-list-controls button {
  min-height: 30px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--stroke-strong); background: #0e0e0e;
  color: #cfcfcf; cursor: pointer; font-size: 11px;
}
.admin-catalog-actions button:hover,
.curated-list-controls button:hover { color: var(--accent); border-color: var(--accent); }
.admin-catalog-actions button:disabled,
.curated-list-controls button:disabled { opacity: .35; cursor: default; }
.curated-lists { display: grid; gap: 22px; }
.curated-list { min-width: 0; }
.curated-list-head {
  min-height: 31px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 7px;
}
.curated-list-head h3 { font-size: 14px; font-weight: 600; }
.curated-title-input {
  width: min(460px, 100%); min-width: 0; padding: 7px 9px;
  border: 1px solid var(--stroke-strong); border-radius: 8px;
  background: #0b0b0b; color: var(--text); font: inherit; font-weight: 600;
}
.curated-title-input:focus { outline: 0; border-color: var(--accent); }
.curated-list-controls { display: flex; gap: 5px; flex: none; }
.curated-list-controls button { width: 30px; padding: 0; font-size: 15px; }
.foryou-controls select {
  min-height: 30px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--stroke-strong); background: #0e0e0e;
  color: #cfcfcf; cursor: pointer; font: inherit; font-size: 11px;
}
.foryou-controls select:hover { color: var(--accent); border-color: var(--accent); }
/* Category shelf: 8 tiles per row, 2 rows = one page of 16; extra titles page
   off to the right via the arrows. The row places each card explicitly (see
   layoutCuratedCards in catalog.js) so reading order stays 1-8 then 9-16. */
.curated-row-wrap { position: relative; }
.curated-row {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: var(--curated-col, clamp(117px, 11.9vw, 138px));
  align-content: start;
  gap: 18px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 1px 10px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.curated-row::-webkit-scrollbar { width: 0; height: 0; display: none; }
.curated-row > .card {
  width: 100%;
  grid-row: var(--curated-r, auto);
  grid-column: var(--curated-c, auto);
}
.curated-row > .card.page-lead { scroll-snap-align: start; }

/* Paging arrows — only added when a list overflows one page (>16). */
.curated-nav {
  position: absolute; top: 7px; bottom: 10px; width: 54px;
  display: grid; align-items: center; padding: 0 4px;
  border: 0; cursor: pointer; z-index: 6;
  opacity: 0; transition: opacity .2s;
}
.curated-nav-prev { left: 0; justify-items: start;
  background: linear-gradient(90deg, var(--bg) 16%, rgba(0,0,0,0) 100%); }
.curated-nav-next { right: 0; justify-items: end;
  background: linear-gradient(270deg, var(--bg) 16%, rgba(0,0,0,0) 100%); }
.curated-nav .glyph {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(18,18,18,.94); border: 1px solid var(--stroke-strong);
  color: #eaeaea; font-size: 19px; line-height: 1; padding-bottom: 2px;
  transition: color .16s, border-color .16s, transform .16s;
}
.curated-row-wrap:hover .curated-nav { opacity: 1; }
.curated-nav:hover .glyph { color: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.curated-nav:disabled { opacity: 0; pointer-events: none; }
.curated-empty {
  padding: 16px; border: 1px dashed var(--stroke-strong); border-radius: 10px;
  color: var(--muted); font-size: 12px;
}
.admin-label-controls {
  position: absolute; z-index: 6; left: 6px; right: 6px; bottom: 36px;
  display: grid; grid-template-columns: 25px minmax(0, 1fr) 25px; gap: 4px;
}
.admin-item-controls {
  position: absolute; z-index: 5; bottom: 6px; left: 6px; right: 6px;
  display: grid; grid-template-columns: 25px 25px minmax(0, 1fr) 25px 25px; gap: 4px;
}
.admin-label-controls button,
.admin-label-controls input,
.admin-item-controls button,
.admin-item-controls select {
  min-width: 0; height: 25px; border: 1px solid #4a4a4a; border-radius: 6px;
  background: rgba(0,0,0,.88); color: #fff; font-size: 11px;
}
.admin-label-controls button,
.admin-item-controls button { cursor: pointer; }
.admin-label-controls button:hover,
.admin-item-controls button:hover { color: var(--accent); border-color: var(--accent); }
.admin-item-controls button:disabled { opacity: .3; }
.admin-label-controls input { padding: 0 6px; outline: none; }
.admin-label-controls input:focus { border-color: var(--accent); }
.admin-label-controls .season-preset { grid-column: 1 / -1; }
.admin-item-controls select { padding: 0 3px; }
.admin-mode .curated-card .poster { filter: brightness(.7); }

/* ---------- login / list picker ---------- */
.compact-dialog {
  width: min(420px, calc(100vw - 28px)); max-height: min(620px, calc(100dvh - 28px));
  margin: auto; padding: 0; border: 1px solid #353535; border-radius: 20px;
  background: #0d0d0d; color: var(--text); box-shadow: 0 24px 70px rgba(0,0,0,.75);
}
.compact-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.compact-dialog form { display: grid; gap: 16px; padding: 24px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head strong { font-size: 20px; }
.dialog-close {
  width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: #171717; color: #aaa; cursor: pointer; font-size: 24px;
}
.compact-dialog label {
  display: grid; gap: 7px; color: var(--muted-strong);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.compact-dialog input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--stroke-strong);
  border-radius: 11px; background: #080808; color: #fff; font-size: 16px;
}
.compact-dialog input:focus { outline: 0; border-color: var(--accent); }
.dialog-primary,
.list-picker-options button {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--stroke-strong); border-radius: 11px;
  background: #151515; color: #fff; cursor: pointer; text-align: left;
}
.dialog-primary { text-align: center; color: #000; background: var(--accent); border-color: var(--accent); }
.dialog-primary:disabled { opacity: .55; cursor: wait; }
.dialog-error { color: #f1a1a1; font-size: 13px; line-height: 1.35; }
.list-picker-options { display: grid; gap: 7px; overflow-y: auto; }
.list-picker-options button:hover { border-color: var(--accent); }
.list-picker-options .list-picker-create { color: var(--accent); }

.site-footer { display: flex; justify-content: center; padding: 42px 0 0; }
.admin-entry {
  border: 0; background: transparent; color: #292929; cursor: pointer;
  font-size: 9px; letter-spacing: .08em; text-transform: lowercase;
}
.admin-entry:hover { color: #555; }

.watch-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 20px; align-items: start; }
.watch-main { min-width: 0; }
.player-host {
  width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.player-host iframe, .player-host video { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.player-host .placeholder { display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--muted); }

.meta-panel {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 12px;
  padding: 13px; display: flex; flex-direction: column; gap: 10px;
}
.meta-poster { position: relative; overflow: hidden; border-radius: 9px; }
.meta-panel img { width: 100%; display: block; border-radius: 9px; border: 1px solid var(--stroke); object-fit: cover; }
.meta-poster .card-bookmark {
  top: -1px; right: 10px; width: 45px; height: 57px;
  opacity: 1;
}
.meta-poster .card-bookmark svg { width: 39px; height: 52px; stroke-width: 1.8; }
.meta-panel .mp-title { font-size: 14px; font-weight: 600; }
.meta-panel .mp-sub { font-size: 10px; color: var(--muted-strong); }
.meta-ratings { display: flex; gap: 16px; }
.meta-ratings .rt { display: flex; flex-direction: column; gap: 2px; }
.meta-ratings .rt b { font-size: 18px; color: var(--accent); }
.meta-ratings .rt span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.meta-desc { font-size: 11px; line-height: 1.45; color: #cfcfcf; max-height: 185px; overflow: auto; }

/* ---------- track / quality controls (Shaka) ---------- */
.serial-panel {
  display: flex; flex-direction: column; gap: 7px;
  margin: 0 0 10px;
}
.track-panel { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.track-group { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.track-group > strong { min-width: 86px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.track-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.track-buttons button {
  padding: 7px 12px; border: 1px solid var(--stroke-strong); border-radius: 9px;
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px;
}
.track-buttons button:hover { border-color: var(--accent); }
.track-buttons button.active {
  background: var(--panel); color: var(--accent); border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.track-buttons .subtitle-note {
  align-self: center;
  max-width: 320px;
  font-size: 12px;
  line-height: 1.25;
}
.serial-panel .track-group { gap: 0; }
.serial-panel .track-buttons {
  gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding: 1px 1px 3px;
  scrollbar-width: thin; scrollbar-color: #292929 transparent;
}
.serial-panel .track-buttons button {
  flex: none; padding: 6px 10px; font-size: 12px;
}
.serial-panel .serial-episodes .track-buttons button {
  min-width: 30px; padding-inline: 8px;
}

/* ---------- loading / error ---------- */
.loading { text-align: center; padding: 40px; color: #888; }
.spinner {
  border: 3px solid #333; border-top: 3px solid var(--accent); border-radius: 50%;
  width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--accent); padding: 20px; text-align: center; }

@media (max-width: 900px) {
  .container { padding: 20px 16px 48px; }
  header { flex-direction: column; align-items: stretch; gap: 16px; }
  .brand { display: flex; justify-content: center; }
  .watch-layout { grid-template-columns: 1fr; }
  .meta-panel { flex-direction: row; flex-wrap: wrap; }
  .meta-poster { width: 110px; flex: none; }
  .meta-panel img { width: 100%; }
  .watch-head { align-items: flex-start; flex-wrap: wrap; }
  .watch-title { white-space: normal; }
  .watch-actions { margin-left: auto; }
}

@media (max-width: 560px) {
  :root {
    --mobile-card-width: calc((100vw - 43px) / 4);
    --card-gap: 6px;
  }
  .container { padding: 14px 12px 42px; }
  header { margin-bottom: 18px; gap: 10px; }
  .logo-image { height: 40px; max-width: 130px; }
  .search-box { gap: 5px; }
  .search-box input { min-width: 0; padding: 9px 10px; font-size: 12px; }
  .search-button, .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
  .search-button svg { width: 20px; height: 20px; }
  .bookmark-nav-btn > svg { width: 17px; height: 21px; }
  .bookmark-nav-count {
    right: -4px; top: -5px; min-width: 16px; height: 16px;
    border-width: 1px; font-size: 8px;
  }
  .row { margin-bottom: 24px; }
  .row h3, .results-title { font-size: 16px; margin-bottom: 10px; }
  .continue-count { min-width: 18px; height: 18px; padding: 0 5px; font-size: 9px; }
  .card-grid,
  .curated-row {
    display: grid;
    grid-template-columns: none;
    grid-template-rows: max-content;
    grid-auto-flow: column;
    grid-auto-columns: var(--mobile-card-width);
    justify-content: start;
    align-items: start;
    gap: 13px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 7px 2px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .card-grid::-webkit-scrollbar,
  .curated-row::-webkit-scrollbar { width: 0; height: 0; display: none; }
  .card-grid.mobile-two-row,
  .curated-row.mobile-two-row {
    grid-template-rows: repeat(2, max-content);
  }
  .card-grid > .card,
  .curated-row > .card {
    grid-row: var(--mobile-row);
    grid-column: var(--mobile-column);
  }
  .card { width: var(--mobile-card-width); }
  .card-media { border-radius: 7px; }
  .card .ctitle {
    margin: 6px 1px 2px; font-size: 10.5px; line-height: 1.17;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .card .cmeta { margin: 0 1px; font-size: 8px; }
  .card-bookmark {
    top: -1px; right: 4px; width: 19px; height: 25px;
  }
  .card-bookmark svg { width: 17px; height: 23px; stroke-width: 2.2; }
  .card-hover-meta {
    gap: 6px;
    padding: 5px 4px;
    backdrop-filter: blur(.2px);
  }
  .hover-ratings {
    column-gap: 4px;
    max-width: 76px;
  }
  .hover-rating { gap: 2px; }
  .hover-rating-name { font-size: 6.5px; letter-spacing: .02em; }
  .hover-rating-value { font-size: 14.5px; letter-spacing: -.02em; }
  .hover-rating-divider { height: 26px; }
  .hover-duration { font-size: 8px; }
  .card-remove {
    top: 3px; width: 18px; height: 18px; font-size: 11px;
  }
  .card-remove-glyph { font-size: 11px; transform: translateY(-.5px); }
  .continue-section .card-grid {
    --continue-media-height: calc(var(--mobile-card-width) * 1.5);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 7px 2px 10px;
  }
  .continue-card {
    width: var(--mobile-card-width);
    flex: 0 0 var(--mobile-card-width);
  }
  .continue-featured {
    width: calc(var(--mobile-card-width) * 2.6667);
    flex-basis: calc(var(--mobile-card-width) * 2.6667);
  }
  .continue-card .continue-media {
    height: var(--continue-media-height);
    aspect-ratio: auto;
    border-radius: 7px;
  }
  .continue-card .poster { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
  .continue-card .ctitle,
  .continue-featured .ctitle { font-size: 10.5px; }
  .continue-card .cmeta { font-size: 8px; }
  .continue-overlay { padding: 18px 4px 5px; }
  .continue-status,
  .continue-featured .continue-status {
    margin-bottom: 4px; font-size: 7.5px;
  }
  .continue-progress { height: 3px; }
  .continue-play {
    display: none;
  }
  .curated-section { margin-bottom: 26px; }
  .curated-lists { gap: 18px; }
  .curated-list-head { min-height: 26px; margin-bottom: 3px; }
  .curated-list-head h3 { font-size: 14px; }
  .curated-toolbar { align-items: center; }
  .curated-list-head { align-items: stretch; }
  .curated-title-input { font-size: 13px; }
  .admin-catalog-actions button { padding: 0 8px; }
  .watch-head { gap: 5px; }
  .watch-title { font-size: 16px; }
  .watch-actions { width: 100%; justify-content: flex-end; }
  .add-list-btn { padding: 9px 12px; font-size: 12px; }
  .track-group { gap: 7px; }
  .track-group > strong { width: 100%; min-width: 0; }
  .meta-panel { display: grid; grid-template-columns: 92px minmax(0,1fr); }
  .meta-poster { width: 92px; grid-row: span 4; }
  .meta-panel img { width: 100%; }
  .meta-poster .card-bookmark {
    right: 5px; width: 30px; height: 39px;
  }
  .meta-poster .card-bookmark svg { width: 27px; height: 36px; }
  .serial-panel .track-buttons button { padding: 5px 8px; font-size: 11px; }
}

@media (hover: none) {
  .curated-nav { display: none; }
  .card-hover-meta { display: none; }
  .card-bookmark { opacity: .82; transform: none; }
  .card-bookmark.on { opacity: 1; }
  .card:hover { transform: none; }
  .card:hover .poster { filter: none; transform: none; }
  .continue-card:hover .poster,
  .continue-featured:hover .poster { filter: none; }
  .continue-card:hover .card-media { border-color: var(--stroke); box-shadow: none; }
  .continue-card:not(.continue-featured) .continue-play { display: none; }
}
