:root {
  --bg: #111214;
  --surface: #1b1c1f;
  --text: #e8e8ea;
  --muted: #9a9aa2;
  --accent: #ff4d6d;
  --radius: 10px;
  --line: #2a2b2f;          /* separators, panel borders */
  --line-strong: #333;      /* inputs, buttons */
  --hover: #26272b;
  --placeholder: #2c2c30;   /* empty thumbs, avatars */
  --ok: #7ddc9a;
  --shadow: rgba(0, 0, 0, .45);
  color-scheme: dark;
}
/* Light theme: <html data-theme="light">, set by the header switch
   (spree base.html; remembered in localStorage). */
:root[data-theme="light"] {
  --bg: #f3f3f5;
  --surface: #fff;
  --text: #1b1c1f;
  --muted: #63636b;
  --accent: #e0264a;
  --line: #e2e2e7;
  --line-strong: #cfcfd6;
  --hover: #ececf0;
  --placeholder: #e4e4e9;
  --ok: #1f8a4c;
  --shadow: rgba(20, 20, 30, .14);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.4;
}

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

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  flex-wrap: wrap;
}

/* Header: logo · Разделы / Видео / Пользователь · search · language (legacy navbar) */
.logo { display: flex; flex-direction: column; line-height: 1; }
.logo-word {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.5px;
  color: #e3262e;
}
.logo-tagline { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px; }

.header-menus { display: flex; gap: 6px; }
.menu { position: relative; }
.menu summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 600;
  user-select: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: 11px; color: var(--muted); }
.menu[open] summary, .menu summary:hover { background: var(--hover); }
.menu-items {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 10px 30px var(--shadow);
}
.menu-items a, .menu-items .link-button { padding: 7px 10px; border-radius: 6px; text-align: left; }
.menu-items a:hover, .menu-items .link-button:hover { background: var(--hover); }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.menu-items a:has(> .icon), .menu-items .link-button:has(> .icon) { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.menu-items .inline-form:has(.icon) { display: block; }
.menu-items .link-button:has(> .icon) { width: 100%; color: var(--text); }
.menu-items a > .icon, .menu-items .link-button > .icon { color: var(--muted); transition: color .15s; }
.menu-items a:hover > .icon, .menu-items .link-button:hover > .icon { color: var(--accent); }
.menu-columns { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); min-width: 380px; }
.menu-columns .menu-all { grid-column: 1 / -1; color: var(--accent); }

.search-form { margin-left: auto; flex: 0 1 320px; display: flex; }
.search-form input[type=search] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
}

@media (max-width: 760px) {
  .header-row { gap: 10px; }
  .logo-word { font-size: 28px; }
  .search-form { order: 5; flex: 1 1 100%; margin-left: 0; }
  .menu-columns { grid-template-columns: 1fr; min-width: 220px; }
  .header-menus .menu:last-child .menu-items { left: auto; right: 0; }
}

main.wrap { padding-top: 24px; padding-bottom: 60px; }

.section-title {
  font-size: 20px;
  margin: 32px 0 16px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.video-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.video-card-link { display: block; }

.video-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.video-card:hover .video-card-actions,
.video-card:focus-within .video-card-actions { opacity: 1; }
@media (hover: none) { .video-card-actions { opacity: 1; } }

/* Staff-only quick actions on cards (video/_staff_panel.html): always
   shown, centred at the bottom of the thumbnail (the panel covers the
   16:9 thumbnail area, clicks pass through but on the buttons); an
   inactive video's card is dimmed. */
.video-card-staff {
  position: absolute; top: 0; left: 0; right: 0; aspect-ratio: 16 / 9;
  display: flex; align-items: flex-end; justify-content: center; gap: 4px;
  padding-bottom: 8px; pointer-events: none; z-index: 1;
}
.video-card-staff .action-btn-compact { display: inline-flex; align-items: center; padding: 3px 6px; text-decoration: none; pointer-events: auto; }
.video-card-staff .action-btn-compact:hover { background: rgba(0,0,0,.9); }
.video-card-staff.is-inactive .staff-toggle { background: #b3261e; }
.video-card:has(.video-card-staff.is-inactive) .video-card-link { opacity: .35; }

/* Staff-only categories editor on the video page (video/_staff_categories.html). */
.staff-cats { margin-top: 10px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: 13px; }
.staff-cats .staff-cats-filter { display: block; box-sizing: border-box; width: 100%; max-width: 320px; height: 26px; margin: 8px 0 0;
  padding: 0 8px; font: inherit; font-size: 12px; line-height: 1; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius); }
.staff-cats-list { display: flex; flex-wrap: wrap; gap: 4px; }
.staff-cats-available { margin-top: 6px; max-height: 180px; overflow-y: auto; }
.staff-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; }
.staff-chip:hover { border-color: var(--accent); }
.staff-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.staff-chip.is-off { opacity: .55; }
.staff-chip[hidden] { display: none; }

.video-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

/* Hover preview clip (js/previews.js) — shown once playable. */
.video-thumb .video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

.video-thumb.previewing .video-preview {
  opacity: 1;
}

.video-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--placeholder), var(--hover));
}

.video-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.video-badge {
  position: absolute;
  left: 6px;
  top: 6px;
}

.video-meta { padding: 10px 12px; }

.video-title {
  font-size: 14px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-stats {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.video-stats-right { justify-content: flex-end; gap: 12px; }
.video-stats b { color: var(--text); font-weight: 600; }
.video-stats .icon { width: 12px; height: 12px; vertical-align: -1px; }

.video-page-title { font-size: 24px; margin: 12px 0; }

/* Legacy: a fixed 950x600 box (100% x 250px on phones), the video
   letterboxed inside it whatever its own aspect ratio. */
/* align-self pins it left regardless of .video-player-row's align-items —
   the max-width clamp leaves it narrower than the row on wide screens, so
   without this any align-items other than the default flex-start would
   shove the player itself sideways too, not just its siblings. */
.video-player { width: 100%; max-width: 950px; align-self: flex-start; }
.video-player > img, .video-player > .video-js {
  display: block;
  width: 100%;
  aspect-ratio: 950 / 600;
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
}
.video-player > img { object-fit: contain; }
.video-player > .video-js { height: auto; font-size: 12px; }
.video-player .vjs-tech { object-fit: contain; }
.video-player .vjs-poster { background-size: contain; }
@media (max-width: 600px) {
  .video-player > img, .video-player > .video-js { aspect-ratio: auto; height: 250px; }
}
/* VAST preroll overlay (js/vast-plugin.js; legacy .vast-btns): the whole
   ad above the control bar is the click-through. */
.vast-overlay { position: absolute; inset: 0 0 3em 0; z-index: 10; cursor: pointer; }
.vast-btns { position: absolute; color: #fff; background: rgba(0, 0, 0, .7); padding: 8px 10px; font-size: 13px; }
.vast-label { top: 0; left: 0; cursor: auto; font-size: 12px; }
.vast-countdown, .vast-skip { bottom: 6px; right: 6px; background: #a02203; border-radius: 4px; }
.vast-skip { cursor: pointer; font-weight: 600; }
/* the ad plays on the <video> directly, so video.js never clears its spinner */
.video-js.vjs-ad-playing .vjs-loading-spinner { display: none; }

.video-note { color: var(--muted); font-size: 13px; max-width: 900px; }

.video-info {
  display: flex;
  gap: 20px;
  color: var(--muted);
  margin: 12px 0;
  font-size: 14px;
}

.video-description { max-width: 900px; white-space: pre-line; }

.video-taxonomy > div { margin: 8px 0; }
.video-taxonomy a { color: var(--accent); }
.video-taxonomy a:not(:last-child)::after { content: ""; }

.category-description { color: var(--muted); max-width: 900px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 20px 0;
  font-size: 13px;
}

.video-grid-placeholder { color: var(--muted); font-size: 13px; }

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.link-button:hover { color: var(--text); }

.auth-box {
  max-width: 440px;
  margin: 40px auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
}
.auth-box h1 { font-size: 22px; margin-top: 0; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
}
.auth-form button {
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  padding: 11px;
}
.auth-hint, .auth-alt { color: var(--muted); font-size: 13px; margin-top: 16px; }
.auth-alt a { color: var(--accent); }
.auth-ok { color: var(--ok); }
.auth-error { color: var(--accent); }

.action-btn {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  padding: 7px 12px;
}
.action-btn:hover { border-color: var(--muted); }
.action-btn.is-active { border-color: var(--accent); color: var(--accent); }
.action-btn-compact { background: rgba(0,0,0,.7); color: #fff; border: 0; padding: 4px 8px; font-size: 13px; }

/* Player, then one row below it with the action buttons and the vote box
   together (.video-controls) — max-width matches .video-player's, so
   that row never gets wider than the player itself. */
.video-player-row { display: flex; flex-direction: column; align-items: flex-start; max-width: 950px; gap: 10px; }
.video-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: 100%; }

.video-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* margin-left: auto keeps it at the player's right edge, wrapped or not. */
.vote-box { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.vote-rate { font-weight: 600; min-width: 3ch; text-align: center; }
.vote-box .action-btn { filter: grayscale(1); opacity: .6; }
.vote-box .action-btn:hover { filter: none; opacity: 1; }
.vote-box .vote-up.is-voted { filter: none; opacity: 1; border-color: #3fb96a; background: rgba(63, 185, 106, .18); }
.vote-box .vote-down.is-voted { filter: none; opacity: 1; border-color: var(--accent); background: rgba(255, 77, 109, .18); }

.notice { color: var(--ok); }
.video-gone { max-width: 700px; margin: 40px 0; }
.video-gone a { color: var(--accent); }

.list-header { display: flex; align-items: baseline; justify-content: space-between; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 28px 0; }
.pager a, .pager-current { min-width: 36px; padding: 7px 10px; border-radius: 6px; text-align: center; background: var(--surface); }
.pager a:hover { background: var(--hover); }
.pager-current { background: var(--accent); color: #fff; font-weight: 700; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.pager-step { padding: 7px 14px; }
.auth-hint a { color: var(--accent); }
.empty { color: var(--muted); }


.comments { max-width: 900px; }
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment-avatar {
  flex: 0 0 36px; height: 36px; border-radius: 50%;
  background: var(--placeholder); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.comment-date { color: var(--muted); }
.comment-delete { margin-left: auto; }
.comment-text { margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.comment-votes { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); }
.comment-form { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; align-items: flex-start; }
.comment-form textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--text); padding: 10px 12px; font: inherit; resize: vertical;
}

.muted { color: var(--muted); }
.playlist-create { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.playlist-create input {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--text); padding: 8px 12px; min-width: 220px;
}
.playlist-list { list-style: none; padding: 0; }
.playlist-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.playlist-list a { color: var(--accent); }
.playlist-edit { margin: 8px 0 20px; max-width: 480px; }
.playlist-edit summary { cursor: pointer; color: var(--muted); }
.playlist-edit textarea {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--text); padding: 10px 12px; font: inherit;
}
.playlist-remove { margin-top: 6px; font-size: 13px; }
.playlist-save { position: relative; }
.playlist-save summary { list-style: none; display: inline-block; }
.playlist-save summary::-webkit-details-marker { display: none; }
.playlist-save-body:not(:empty) {
  position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; min-width: 280px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.playlist-widget { display: flex; flex-direction: column; gap: 6px; }
.playlist-toggle {
  background: none; border: 0; color: var(--text); cursor: pointer; font: inherit;
  text-align: left; padding: 4px 0;
}
.playlist-toggle.is-active { color: var(--accent); }

.profile-box { max-width: 520px; }
.auth-form textarea {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--text); padding: 10px 12px; font: inherit; resize: vertical;
}
.profile-links { padding-left: 18px; margin-top: 18px; }
.profile-links a, .playlist-list-link { color: var(--accent); }

.comment-avatar { position: relative; overflow: hidden; }
.comment-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-large { flex-basis: 72px; width: 72px; height: 72px; font-size: 28px; }
.profile-avatar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.avatar-form input[type=file] { color: var(--muted); max-width: 220px; }

.search-meta a, .quick-search a { color: var(--accent); }
.quick-search { color: var(--muted); margin-top: 32px; line-height: 1.8; }

/* Home page: category names, no thumbnails */
.section-title a { color: inherit; text-decoration: none; }
.section-title a:hover { color: var(--accent); }
.cat-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.cat-links a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 12px 11px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-weight: 500;
  transition: border-color .15s, background-color .15s, color .15s;
}
.cat-links a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-links a .icon { color: var(--muted); transition: transform .15s, color .15s; }
.cat-links a:hover { border-color: var(--accent); background: var(--hover); color: var(--accent); }
.cat-links a:hover .icon { color: var(--accent); transform: translateX(2px); }
.cat-links a.cat-all { color: var(--accent); border-style: dashed; background: transparent; }
@media (max-width: 600px) { .cat-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Sort/period switch above video lists */
.tabs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 16px; }
.tabs a { color: var(--muted, #999); text-decoration: none; padding-bottom: 2px; }
.tabs a.active { color: inherit; border-bottom: 2px solid var(--accent); }

/* Category / special-tag tiles */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 28px; }
.tile { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.tile img, .tile-blank { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--placeholder); border-radius: 4px; display: block; }
.tile-name { font-weight: 600; }
.tile-count { font-size: 0.85em; }
.plain-list { list-style: none; padding: 0; line-height: 1.9; }
.tag-cloud { line-height: 1.6; }
.tag-cloud a { color: inherit; margin-right: 8px; }
.static-page { max-width: 720px; line-height: 1.6; }
.more-link { text-align: center; margin: 12px 0 0; }
.more-link a { color: var(--accent); }
.public-profile { display: flex; gap: 20px; align-items: flex-start; }
.public-profile .avatar { border-radius: 50%; }
.profile-about { white-space: pre-line; max-width: 640px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.footer-links a { color: var(--muted); }

/* Advanced search */
.adv-search { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 18px; margin-bottom: 24px; }
.adv-search label { display: flex; flex-direction: column; gap: 4px; }
.adv-search label.check { flex-direction: row; align-items: center; gap: 6px; }
.adv-search .wide { grid-column: 1 / -1; }
.adv-search fieldset { border: 1px solid var(--line-strong); border-radius: 4px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.save-search { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }

/* Staff job monitoring */
.staff-table { width: 100%; border-collapse: collapse; font-size: 0.9em; margin-bottom: 24px; }
.staff-table th, .staff-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.small { font-size: 0.85em; }
.staff-chart { display: block; color: var(--accent); }
.status-ok { color: #4caf50; }
.status-failed { color: var(--accent); }
.status-skipped { color: var(--muted); }
.job-log { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 4px; font-size: 0.85em; overflow-x: auto; }
.job-error { color: #ff8a80; }

.category-description { color: var(--muted); max-width: 900px; margin-bottom: 16px; }
.category-description p { margin: 0 0 8px; }
.category-description b, .category-description strong { color: var(--text); }

/* Admin section */
.staff-nav { display: grid; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.staff-nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.staff-nav-label { width: 90px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.staff-nav a { padding: 4px 9px; border-radius: 6px; color: var(--muted); }
.staff-nav a:hover { background: var(--hover); color: var(--text); }
.staff-nav a.active { background: var(--accent); color: #fff; }
.staff-flash { background: #1e3a24; color: #9be7a5; padding: 8px 12px; border-radius: 6px; }
.staff-error { background: #3a1e22; color: #ff9aa2; padding: 8px 12px; border-radius: 6px; }
.staff-form { display: grid; gap: 14px; max-width: 980px; }
.staff-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 10px; }
.staff-form legend { color: var(--muted); padding: 0 6px; }
.staff-form label { display: grid; gap: 4px; }
.staff-form label.check { display: flex; align-items: center; gap: 6px; }
.staff-form input[type=text], .staff-form input[type=number], .staff-form input[type=datetime-local],
.staff-form input[type=search], .staff-form input[type=url], .staff-form textarea, .staff-form select,
.staff-filter input, .staff-filter select {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text); padding: 7px 10px; font: inherit;
}
.staff-form textarea { min-height: 90px; }
.staff-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.staff-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.staff-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.staff-actions form { margin: 0; }
.staff-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.staff-shots label { position: relative; display: block; }
.staff-shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; border: 3px solid transparent; }
.staff-shots input:checked + img { border-color: var(--accent); }
.staff-shots input { position: absolute; top: 6px; left: 6px; }
.staff-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 12px; }
.staff-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; display: block; overflow: hidden; }
.staff-thumb-row { width: 192px; }
.staff-lang { text-transform: uppercase; font-size: 0.85em; opacity: 0.8; }
.staff-thumb-row img { width: 100%; height: 100%; object-fit: cover; display: block; }
.staff-preview { margin: 12px 0; }
.staff-preview video { width: 100%; max-width: 480px; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; display: block; }
.staff-inline { display: flex; gap: 6px; align-items: center; }
.staff-trfield { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.staff-trfield .action-btn.small { padding: 2px 8px; font-size: 0.85em; }
.staff-row-editing > td { background: var(--hover); }
.staff-row-form fieldset { margin-bottom: 8px; }
.staff-row-actions { white-space: nowrap; }
.staff-row-actions > * { margin-right: 6px; }
.staff-main-shot img { width: 100%; max-width: 480px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 12px; }
.staff-shot { padding: 0; border: 3px solid transparent; border-radius: 6px; background: none; cursor: pointer; display: block; }
.staff-shot.is-main { border-color: var(--accent); }
.staff-shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; display: block; }
.staff-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.staff-stat { background: var(--surface); border-radius: 8px; padding: 14px; display: grid; gap: 4px; }
.staff-stat b { font-size: 26px; }
.staff-schedule { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.staff-schedule input[type=text] {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text); padding: 4px 7px; font: inherit; font-family: monospace;
}
label.check.small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.9em; }
.danger-btn { background: #5a1f27 !important; color: #fff !important; }

/* Pornstars — /pornstars/list/, /pornstars/view/<name>/, the video page's row */
.star-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.star-row { display: flex; gap: 14px; overflow-x: auto; padding: 8px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.star-row .star-card { flex: 0 0 120px; scroll-snap-align: start; }
.star-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px 8px; border-radius: var(--radius); background: var(--surface); }
.star-card:hover .star-name { color: var(--accent); }
.star-photo { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--placeholder); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.star-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.star-initial { font-size: 36px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.star-name { font-size: 14px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.star-count { font-size: 12px; color: var(--muted); }
.video-stars { margin-top: 12px; }
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a:hover { color: var(--accent); }
.star-profile { display: flex; gap: 28px; align-items: flex-start; padding: 20px; background: var(--surface); border-radius: var(--radius); }
.star-profile-photo { flex: 0 0 200px; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--placeholder); display: flex; align-items: center; justify-content: center; }
.star-profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.star-profile-photo .star-initial { font-size: 72px; }
.star-profile-body { flex: 1; min-width: 0; }
.star-profile-name { font-size: 26px; margin: 0 0 4px; }
.star-profile-count { color: var(--muted); margin: 0 0 16px; }
.star-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; font-size: 14px; }
.star-facts dt { color: var(--muted); }
.star-facts dd { margin: 0; overflow-wrap: anywhere; }
.star-facts a { color: var(--accent); }
.star-bio summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.star-bio p { margin: 0; line-height: 1.6; white-space: pre-line; }
@media (max-width: 640px) {
  .star-profile { flex-direction: column; align-items: center; padding: 16px; }
  .star-profile-photo { flex-basis: auto; width: 160px; }
  .star-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .star-photo { width: 80px; height: 80px; }
}
.search-star { display: inline-flex; align-items: center; gap: 14px; padding: 10px 18px 10px 10px; margin-bottom: 12px; border-radius: var(--radius); background: var(--surface); }
.search-star .star-photo { width: 64px; height: 64px; margin: 0; }
.search-star .star-initial { font-size: 26px; }
.search-star:hover b { color: var(--accent); }

/* Header light/dark switch (base.html): shows the theme it switches to. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: none; border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-to-dark, [data-theme="light"] .theme-to-light { display: none; }
[data-theme="light"] .theme-to-dark { display: inline-flex; }

/* Special tags: /t/ (every type), /t/<type>/ (its tag cards), and the
   "type › tag" heading and sibling chips on a tag's page. `body` raises
   the link rules above the skins' own `.skin-x a` colour. */
.st-hero {
  position: relative; isolation: isolate; overflow: hidden; margin: 8px 0 28px;
  min-height: 220px; display: flex; align-items: flex-end;
  border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.6); background: var(--surface);
}
.st-hero-mosaic {
  position: absolute; inset: 0; z-index: -2;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: 90px;
  background: var(--surface); opacity: .55; filter: saturate(1.1);
}
.st-hero-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, var(--bg) 8%, color-mix(in srgb, var(--bg) 70%, transparent) 55%, transparent),
              linear-gradient(to right, color-mix(in srgb, var(--bg) 80%, transparent), transparent 70%);
}
.st-hero-copy { padding: 28px clamp(16px, 4vw, 40px); max-width: 760px; }
.st-hero h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.05; letter-spacing: -.02em; }
body .st-hero h1 a { color: inherit; text-decoration: none; }
.st-hero p { margin: 0 0 14px; color: var(--muted); }
.st-hero-type { min-height: 190px; }
.st-crumbs { display: flex; align-items: center; gap: 4px; font-size: .9rem; margin-top: 8px; }
body .st-crumbs a { color: var(--muted); text-decoration: none; }
body .st-crumbs a:hover { color: var(--accent); }

.st-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
body .st-chips a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text); text-decoration: none; font-size: .9rem; backdrop-filter: blur(6px);
}
body .st-chips a span { color: var(--muted); font-size: .8em; }
body .st-chips a:hover { border-color: var(--accent); color: var(--accent); }
body .st-chips a.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
body .st-chips a.active span { color: inherit; opacity: .8; }

.st-breadcrumb { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 .4em; }
body .st-breadcrumb a { color: var(--text); }
body .st-breadcrumb a:first-child { color: var(--muted); }
body .st-breadcrumb a:hover, body .st-breadcrumb a:first-child:hover { color: var(--accent); }
.st-sep { color: var(--muted); font-weight: 400; }

.st-section { margin: 0 0 34px; scroll-margin-top: 80px; }
.st-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.st-section-head h2 { margin: 0; font-size: 1.35rem; }
body .st-section-head h2 a { color: inherit; text-decoration: none; }
body .st-section-head h2 a:hover, body a.st-more:hover { color: var(--accent); }
body a.st-more { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .9rem; white-space: nowrap; }

.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.st-tile {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius);
  background: var(--placeholder); text-decoration: none;
}
body a.st-tile { color: #fff; }
.st-tile img, .st-blank { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.st-blank { background: var(--placeholder); }
.st-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, 0) 60%); }
.st-tile-label { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 1; display: flex; flex-direction: column; }
.st-tile-label b { font-size: 1rem; line-height: 1.2; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.st-tile-label span { font-size: .78rem; opacity: .8; }
.st-tile:hover img { transform: scale(1.06); }
body .st-tile:hover .st-tile-label b { color: var(--accent); }

.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 32px; }
.st-card {
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
body a.st-card { color: var(--text); }
.st-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 14px 32px var(--shadow); }
.st-card-cover { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--placeholder); }
.st-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-card-count {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: .78rem; font-weight: 600;
}
.st-card-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 2px; }
.st-card-strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--placeholder); }
.st-card-name { padding: 10px 12px 0; font-weight: 700; font-size: 1.05rem; }
body .st-card:hover .st-card-name { color: var(--accent); }
.st-card-text { padding: 4px 12px 0; color: var(--muted); font-size: .85rem; }
.st-card > :last-child { padding-bottom: 12px; }
@media (max-width: 600px) {
  .st-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .st-cards { grid-template-columns: 1fr; }
  .st-hero { min-height: 180px; }
}

/* Home page blocks (spree home.html): each list a framed section, its
   heading a link to the full list. The htmx blocks' own headings are
   hidden in favour of the section's; a block that loaded nothing hides. */
.home-block {
  margin: 0 0 28px; padding: 18px 20px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.4);
}
.home-block-lazy:not(:has(.video-grid)) { display: none; }
.home-block .section-title { display: none; }
.home-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.home-block-head h1, .home-block-head h2 { margin: 0; font-size: 21px; }
body .home-block-head :is(h1, h2) a { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.home-block-head :is(h1, h2) .icon { color: var(--accent); width: 1.05em; height: 1.05em; }
body .home-block-head :is(h1, h2) a:hover { color: var(--accent); }
body a.home-block-more {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; padding: 5px 10px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: 14px; border: 1px solid var(--line);
}
body a.home-block-more:hover { color: var(--accent); border-color: var(--accent); }
.home-block .cat-links a { background: var(--bg); }
.home-tag-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px 24px; }
.home-tag-type h3 { margin: 0 0 8px; font-size: 15px; }
body .home-tag-type h3 a { color: var(--text); text-decoration: none; }
body .home-tag-type h3 a:hover { color: var(--accent); }
.home-tag-type .st-chips { margin: 0; gap: 6px; }
body .home-tag-type .st-chips a { padding: 4px 10px; font-size: 13px; background: var(--bg); backdrop-filter: none; }
@media (max-width: 600px) {
  .home-block { padding: 14px 12px 16px; margin-left: -4px; margin-right: -4px; }
  .home-block-head :is(h1, h2) { font-size: 18px; }
  .home-tag-types { grid-template-columns: 1fr; }
}
