:root {
  --bg: #0b0a0a;
  --surface: #141111;
  --elevated: #1c1818;
  --fg: #f0ece8;
  --muted: #8a7f7a;
  --faint: #5c5552;
  --accent: #c94b5a;
  --accent-fg: #fff7f5;
  --border: rgb(240 236 232 / 0.1);
  --font: "Commissioner", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; background: var(--bg); color: var(--fg); }
body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; margin: 0; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.site { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
header.top {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgb(11 10 10 / 0.92);
  backdrop-filter: blur(12px);
}
header.top .row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; }
.logo { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; flex-shrink: 0; }
.accent { color: var(--accent); }
.search { flex: 1; min-width: 0; position: relative; }
.search input, .field, textarea, select {
  width: 100%;
  height: 2.75rem;
  border: 0;
  border-radius: 8px;
  background: var(--elevated);
  color: var(--fg);
  padding: 0 1rem;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
  outline: none;
  font: inherit;
}
.search input { padding-left: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238a7f7a' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 0.75rem 50%; }
.field, textarea, select { background-image: none; }
input[type="color"].field { padding: 0.2rem; cursor: pointer; max-width: 6rem; }
textarea { height: auto; padding: 0.75rem; resize: vertical; font-family: ui-monospace, monospace; font-size: 0.875rem; }
.search input:focus, .field:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 1px rgb(201 75 90 / 0.7);
}
.btn, .chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 1rem; border-radius: 8px; border: 0;
  font: 600 0.875rem/1 var(--font);
}
.btn-accent { background: var(--accent); color: var(--accent-fg); }
.btn-ghost { background: var(--elevated); color: var(--fg); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1); }
.btn:disabled { opacity: 0.5; }
main { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }
.kicker { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.lead { color: var(--muted); max-width: 42rem; margin: 0.75rem 0 0; font-size: 0.95rem; }
.cats { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; margin: 1.25rem 0 0; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a, .chip {
  flex-shrink: 0; border-radius: 999px; padding: 0.35rem 0.75rem; min-height: 0;
  background: var(--elevated); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08); font-size: 0.875rem; font-weight: 500;
}
.cats a.on, .chip.on { background: var(--accent); color: var(--accent-fg); box-shadow: none; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 0.75rem; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } .md-show { display: block !important; } .search { display: block !important; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card .thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 8px;
  background: var(--elevated); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { margin-top: 0.5rem; font-size: 0.875rem; font-weight: 500; line-height: 1.35; }
.card:hover h3 { color: var(--accent); }
.badge {
  position: absolute; top: 0.5rem; left: 0.5rem; background: rgb(0 0 0 / 0.7);
  color: var(--fg); font-size: 10px; font-weight: 600; padding: 0.15rem 0.4rem; border-radius: 4px;
}
.badge.r { left: auto; right: 0.5rem; }
.badge.d { top: auto; bottom: 0.5rem; left: auto; right: 0.5rem; font-size: 11px; }
.meta { margin-top: 0.25rem; font-size: 0.75rem; color: var(--muted); }
footer.site-foot { border-top: 1px solid var(--border); margin-top: auto; }
footer.site-foot .wrap { padding: 2rem 1rem; font-size: 0.875rem; color: var(--muted); }
footer.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.75rem; }
.player { overflow: hidden; border-radius: 12px; background: #000; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1); }
.stage { position: relative; aspect-ratio: 16/9; background: #000; }
.stage iframe, .stage .poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage .poster { display: flex; align-items: center; justify-content: center; background: #000; color: inherit; }
.stage .poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.playpill {
  position: relative; display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 3.5rem; padding: 0 1.25rem; border-radius: 999px; background: var(--accent); color: var(--accent-fg);
  font-weight: 600; font-size: 0.875rem; border: 0;
}
.player-bar { display: flex; justify-content: space-between; gap: 0.75rem; background: var(--elevated); padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--muted); }
.player-warn {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgb(201 75 90 / 0.14);
  box-shadow: 0 0 0 1px rgb(201 75 90 / 0.4);
  color: var(--fg);
  font-size: 0.9rem;
  line-height: 1.45;
}
.player-warn a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.pager { display: flex; gap: 0.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.box { background: var(--surface); border-radius: 12px; padding: 1.25rem; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08); }
.muted { color: var(--muted); }
.err { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gate {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem; background: rgb(11 10 10 / 0.96);
}
html.age-ok .gate, .gate[hidden] { display: none !important; }
.gate-card { width: 100%; max-width: 32rem; background: var(--surface); border-radius: 16px; padding: 2rem; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1); }
.row2 { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.row2 .btn { flex: 1; min-width: 8rem; }
.admin { display: flex; min-height: 100dvh; background: var(--bg); color: var(--fg); }
.aside {
  width: 15rem; flex-shrink: 0; background: var(--surface); padding: 1.25rem 0.75rem;
  border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.25rem;
}
.aside a, .aside button.linkish {
  display: block; width: 100%; text-align: left; padding: 0.65rem 0.85rem; border-radius: 8px;
  background: transparent; color: var(--fg); border: 0; font: 500 0.9rem var(--font);
}
.aside a.on, .aside a:hover { background: var(--elevated); }
.admin-main { flex: 1; padding: 1.5rem; min-width: 0; }
.admin-h { font-size: 1.5rem; margin-bottom: 1rem; }
label.lbl { display: block; font-size: 0.875rem; font-weight: 500; margin: 1rem 0 0.4rem; }
.checks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 0.4rem; }
.admin-table td { padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table img { width: 7rem; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--elevated); }
.md-hide { }
@media (min-width: 640px) { .md-hide { display: none; } .md-show { display: inline-flex !important; } .search { display: block !important; } }
@media (max-width: 639px) {
  .search { display: none; }
  .aside { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .admin { flex-direction: column; }
}
.empty { text-align: center; padding: 3rem 1.25rem; background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08); }
.dl-bar { border-bottom: 1px solid var(--border); background: var(--surface); font-size: 0.8rem; color: var(--muted); }
.dl-bar .row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; }
.dl-bar p { margin: 0; }
.btn-sm { min-height: 2.25rem; padding: 0 0.85rem; font-size: 0.8rem; flex: 0 0 auto; }
.hero h1 { font-size: clamp(1.4rem, 3vw, 1.85rem); margin-top: 0.4rem; }
.block-title { margin: 2rem 0 1rem; font-size: 1.15rem; }
.crumbs { font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem; display: flex; gap: 0.5rem; }
.video-title { margin: 1rem 0 0.35rem; font-size: 1.25rem; }
.meta-row { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--muted); }
.shade { position: absolute; inset: 0; background: rgb(0 0 0 / 0.35); }
.login-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 1.25rem; background: var(--bg); color: var(--fg);
}
.login-card { width: 100%; max-width: 28rem; background: var(--surface); border-radius: 16px; padding: 2rem; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1); }
.stack .lbl:first-child { margin-top: 0; }
.ok { color: #7dba8a; }
.stat-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 1.25rem; }
.stat { background: var(--surface); border-radius: 12px; padding: 1rem; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08); }
.stat span { display: block; font-size: 0.75rem; color: var(--muted); }
.stat strong { font-size: 1.15rem; }
.max { max-width: 40rem; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.chip.check { cursor: pointer; }
.chip.check input { margin-right: 0.35rem; }
.cron-pre, pre {
  overflow-x: auto; background: var(--elevated); padding: 0.75rem 1rem; border-radius: 8px;
  font-size: 0.75rem; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08); color: var(--fg);
}
.help section { margin-bottom: 2rem; max-width: 40rem; }
.help ol, .help ul, .steps { padding-left: 1.2rem; color: var(--muted); line-height: 1.55; }
.help li, .steps li { margin: 0.4rem 0; }
.help a { text-decoration: underline; text-underline-offset: 2px; }
.narrow { max-width: 42rem; }
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.6rem; margin-top: 1.5rem; }
.tag-card {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  background: var(--elevated); padding: 0.85rem 1rem; border-radius: 10px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
}
.tag-card span { color: var(--muted); font-size: 0.8rem; }
.search-page { display: flex; gap: 0.5rem; margin: 1.25rem 0; }
.search-page .field { flex: 1; }
.search-page .btn { flex: 0 0 auto; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.tpl-extra { padding: 0.75rem 0; font-size: 0.9rem; color: var(--muted); }
.tpl-extra a { text-decoration: underline; }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.75rem 1rem; }
.colors input[type="color"] { padding: 0.15rem; height: 2.75rem; cursor: pointer; background: var(--elevated); }
.css-edit { font-family: ui-monospace, Menlo, Consolas, monospace; min-height: 8rem; }
.seo-page { max-width: 54rem; }
.ph-box {
  max-width: 54rem; background: var(--surface); border-radius: 12px;
  padding: 0.9rem 1rem; margin: 0 0 1.25rem; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
}
.ph-list { margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; }
.ph-list code, .help code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.75rem;
  background: var(--elevated); padding: 0.15rem 0.4rem; border-radius: 4px;
}
.cat-seo { max-width: 54rem; background: var(--surface); border-radius: 10px; padding: 0.4rem 0.9rem 0.6rem; margin: 0.4rem 0; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08); }
.cat-seo summary { cursor: pointer; padding: 0.5rem 0; font-weight: 500; }
.cat-intro { margin: 0.5rem 0 1rem; max-width: 42rem; }
.admin-snip { color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; max-width: 36rem; line-height: 1.4; }
.prose-edit {
  font-family: inherit !important;
  font-size: 0.95rem !important;
  min-height: 9rem;
  line-height: 1.5;
}
.desc-edit { margin-top: 1rem; }
.desc-edit .lbl { margin-top: 0.85rem; }
.desc-edit .row2 { margin-top: 1rem; }

.max { max-width: 42rem; }
.stack h2 { margin: 1.75rem 0 0.5rem; font-size: 1.05rem; }
.stack .row2 { margin-top: 1.25rem; }

.admin-ver { margin: 0 0.85rem 0.75rem; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; }
.nav-new {
  display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.4rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; vertical-align: middle;
}
.engine-banner {
  margin: 0 0 1.25rem; padding: 1rem 1.15rem; border-radius: 12px;
  background: rgb(201 75 90 / 0.12); box-shadow: 0 0 0 1px rgb(201 75 90 / 0.35);
}
.engine-banner .kicker { margin: 0 0 0.35rem; }
.engine-banner p { margin: 0; }
