/* ── Golos Text (local, OFL) ───────────────────────── */
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/GolosText-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/GolosText-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/GolosText-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/GolosText-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Roboto Slab (local) — used for brand wordmark ──── */
@font-face {
  font-family: "Roboto Slab";
  src: url("/fonts/RobotoSlab-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Slab";
  src: url("/fonts/RobotoSlab-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette based on edu.palata-nk.ru */
  --brand-primary: #1B3058;
  --brand-primary-dark: #11203E;
  --brand-primary-light: #2B4578;
  --brand-accent: #D4B26A;
  --brand-accent-dark: #B89550;
  --brand-accent-light: #E8D4A0;

  --bg: #F7F8FA;
  --bg-tint: #EEF1F6;
  --bg-soft: #E3E8F0;
  --surface: #FFFFFF;

  --ink: #1F2433;
  --ink-soft: #424A60;
  --muted: #7C8599;
  --border: #E1E5ED;
  --border-strong: #C9D0DC;

  --success: #2F6B3A;
  --warn: #B07316;
  --danger: #B52D2D;

  --radius: 6px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(27, 48, 88, 0.06);
  --shadow: 0 4px 16px rgba(27, 48, 88, 0.08);
  --shadow-lg: 0 18px 48px rgba(27, 48, 88, 0.14);

  --font-display: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* ── Typography ────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em 0;
}
h1 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); letter-spacing: -0.02em; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 1em 0; color: var(--ink-soft); }
a { color: var(--brand-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-primary-light); }

.text-muted { color: var(--muted); font-size: 0.9rem; }
.text-small { font-size: 0.875rem; }
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-accent-dark);
  font-weight: 700;
}
.mono { font-family: var(--font-mono); }

/* ── Top utility bar (dark slim) ───────────────────── */
.top-bar {
  background: var(--brand-primary);
  color: rgba(255,255,255,0.88);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--brand-primary-dark);
  position: sticky;
  top: 0;
  z-index: 60;     /* above site-header */
}
.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 28px;
  max-width: 1280px;
  margin: 0 auto;
}
.top-links {
  display: flex;
  gap: 14px;
  flex-wrap: nowrap;     /* keep on one line */
  min-width: 0;
}
.top-links a {
  color: rgba(255,255,255,0.82);
  font-size: 0.78rem;
  white-space: nowrap;
}
.top-links a:hover { color: var(--brand-accent); text-decoration: none; }
.top-contact {
  display: flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;        /* don't compress contact column */
  font-size: 0.78rem;
}
.top-contact a { color: var(--brand-accent); font-weight: 700; }
.top-contact a:hover { color: var(--brand-accent-light); text-decoration: none; }
.top-contact-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}
.top-contact-stack a { font-size: 0.78rem; }
@media (max-width: 1100px) {
  .top-bar { font-size: 0.75rem; }
  .top-links { gap: 10px; }
  .top-links a { font-size: 0.75rem; }
}
@media (max-width: 900px) { .top-bar { display: none; } }

/* ── Main header (white, big logo, clean) ──────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  /* top:32 is the actual height of top-bar's content (12 padding + ~19
     line + 1 border). Using 36 like before created a transparent 4-px
     gap above site-header during scroll. site-header is z:50, top-bar
     is z:60, so even if we slightly overlap into top-bar's area at
     edge cases, the top-bar wins and renders cleanly on top. */
  top: 32px;
  /* Pin geometry so the bottom edge is predictable: 96 = padding 20 +
     brand img 56 + padding 20. nav-bar.top is calibrated against this
     fixed bottom edge (32 + 96 = 128) with a 4-px overlap. */
  min-height: 96px;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  max-width: 1280px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img { width: 56px; height: auto; display: block; flex-shrink: 0; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: none;
  letter-spacing: 0;
}
.brand-text span { font-size: 0.92rem; }

.nav-auth { display: flex; align-items: center; gap: 10px; }
.inline-form { display: inline; margin: 0; }

/* ── Secondary nav bar (under header, left-aligned) ── */
.nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  /* site-header sticks at top:32 with min-height:96, so its bottom edge
     when stuck is at y=128. nav-bar.top:124 puts its top edge 4 pixels
     above that — overlap region. Both bars are white, nav-bar is z:40
     (behind site-header z:50), so the 4 overlapped pixels are covered
     by site-header and the seam is invisible. The overlap absorbs any
     sub-pixel rounding or font-load reflow that would otherwise open a
     transparent gap during scroll. */
  top: 124px;
  z-index: 40;
}
.nav-bar-inner {
  display: flex;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.main-nav a {
  display: inline-block;
  padding: 14px 20px 14px 0;
  margin-right: 12px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 400;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.main-nav a:first-child { padding-left: 0; }
.main-nav a:hover { color: var(--brand-primary); text-decoration: none; }
.main-nav a.active { color: var(--brand-primary); font-weight: 700; }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 12px;
  bottom: -1px;
  height: 3px;
  background: var(--brand-accent);
  border-radius: 3px 3px 0 0;
}

@media (max-width: 960px) {
  .header-inner { padding: 14px 20px; flex-wrap: wrap; }
  .brand-text { font-size: 0.82rem; }
  .brand-text span { font-size: 0.82rem; }
  .brand img { width: 44px; height: auto; }
  .site-header { top: 0; }       /* top-bar hidden below 900px, header back to 0 */
  .nav-bar { top: 88px; }
  .nav-bar-inner {
    padding: 0 20px;
    overflow-x: auto;             /* allow horizontal scroll only on narrow screens */
    overflow-y: hidden;
  }
  .main-nav a { padding: 12px 16px 12px 0; margin-right: 8px; font-size: 0.92rem; }
}

/* ── Main content ──────────────────────────────────── */
.site-main { flex: 1; padding: 48px 0 72px; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.btn-primary:hover { background: var(--brand-primary-light); border-color: var(--brand-primary-light); color: #fff; }
.btn-accent { background: var(--brand-accent); color: var(--brand-primary-dark); border-color: var(--brand-accent); }
.btn-accent:hover { background: var(--brand-accent-dark); border-color: var(--brand-accent-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand-primary); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-tint); color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-text { background: transparent; color: var(--ink-soft); border-color: transparent; padding: 10px 12px; }
.btn-text:hover { color: var(--brand-primary); background: var(--bg-tint); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Forms ─────────────────────────────────────────── */
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-field input[type=text],
.form-field input[type=password],
.form-field input[type=datetime-local],
.form-field input[type=email],
.form-field input[type=file],
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(27, 48, 88, 0.12);
}
.form-field textarea { min-height: 90px; resize: vertical; }
.form-field .field-hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.card-tight { padding: 20px; }

/* ── Hero (light, airy, no calendar) ───────────────── */
.hero {
  padding: 72px 0 64px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--brand-primary-dark);
}
/* Subtle dotted pattern decoration */
.hero::before {
  content: "";
  position: absolute;
  top: 40px;
  right: 40px;
  width: 220px;
  height: 220px;
  background-image: radial-gradient(circle, rgba(212, 178, 106, 0.18) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  opacity: 1;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 820px;
}
.hero h1 {
  color: #fff;
  margin-bottom: 20px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.15;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand-accent);
  font-weight: 700;
}
.hero .lead {
  font-size: 1.12rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 640px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .hero { padding: 48px 0 40px; }
  .hero::before { width: 140px; height: 140px; top: 20px; right: 20px; }
}

/* ── Sections ──────────────────────────────────────── */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-tint); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 36px;
  gap: 24px;
  flex-wrap: wrap;
}
.section-head p { max-width: 440px; color: var(--muted); margin-bottom: 0; }

/* ── Feature cards (rounded, light, hover lift) ────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand-accent-light);
}
.feature-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--brand-accent-dark);
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  display: block;
  font-weight: 700;
}
.feature h3 { margin-bottom: 10px; color: var(--brand-primary); }
.feature p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
@media (max-width: 840px) { .features { grid-template-columns: 1fr; } }

/* ── Stats strip ───────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  padding: 44px 0;
  margin: 48px 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat .num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
}
.stat .num em { font-style: normal; color: var(--brand-accent-dark); }
.stat .label { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 640px) { .stats-strip { grid-template-columns: 1fr; gap: 24px; } }

/* ── Catalog cards ─────────────────────────────────── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand-accent-light);
}
.video-card-thumb {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  position: relative;
  overflow: hidden;
}
.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-card-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 30% 30%, rgba(212, 178, 106, 0.15) 0%, transparent 50%);
  pointer-events: none;
}
.video-card-thumb-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.video-card-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #fff;
  background: rgba(0,0,0,0.7);
  padding: 4px 9px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}
.video-card-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.video-card-body h3 { font-size: 1.08rem; margin-bottom: 8px; color: var(--brand-primary); }
.video-card-body p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.video-card-meta .btn { padding: 6px 14px; font-size: 0.85rem; }

/* ── Auth page ─────────────────────────────────────── */
.auth-wrap { max-width: 460px; margin: 20px auto 40px; }
.auth-wrap h1 { font-size: 2rem; margin-bottom: 8px; color: var(--brand-primary); }
.auth-wrap .lead { color: var(--muted); margin-bottom: 28px; }
.auth-wrap .card { padding: 32px; box-shadow: var(--shadow); }

/* ── Alerts ────────────────────────────────────────── */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.92rem;
  border-left: 4px solid transparent;
}
.alert-error { background: #FBECEC; border-color: var(--danger); color: #7C1A1A; }
.alert-success { background: #E9F2EC; border-color: var(--success); color: #214A2D; }
.alert-warn { background: #FBF3E4; border-color: var(--warn); color: #6B4513; }
.alert-info { background: var(--bg-tint); border-color: var(--brand-primary); color: var(--ink-soft); }

/* ── Admin layout ──────────────────────────────────── */
.admin-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
}
.admin-side {
  position: sticky;
  top: 140px;
  align-self: start;
  border-right: 1px solid var(--border);
  padding-right: 24px;
}
.admin-side-title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 700;
}
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  display: block;
  padding: 10px 16px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  border-radius: var(--radius);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.admin-nav a:hover { background: var(--bg-tint); color: var(--brand-primary); text-decoration: none; }
.admin-nav a.active {
  background: var(--bg-tint);
  color: var(--brand-primary);
  border-left-color: var(--brand-accent);
  font-weight: 700;
}
@media (max-width: 960px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-side { border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 16px; position: static; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.admin-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.admin-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand-accent);
}
.admin-stat .label {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-weight: 700;
}
.admin-stat .value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--brand-primary);
  line-height: 1;
  font-weight: 700;
}
@media (max-width: 800px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }

/* ── Tables ────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.data-table th {
  background: var(--bg-tint);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-tint); }
.data-table .actions { display: flex; gap: 8px; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }

/* ── Tags / badges ─────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 3px 11px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-weight: 700;
}
.tag-accent { background: rgba(212, 178, 106, 0.15); border-color: rgba(212, 178, 106, 0.4); color: var(--brand-accent-dark); }
.tag-success { background: #E9F2EC; border-color: #B9D3C2; color: #214A2D; }
.tag-warn { background: #FBF3E4; border-color: #EAD6A8; color: #6B4513; }
.tag-brand { background: rgba(27, 48, 88, 0.08); border-color: rgba(27, 48, 88, 0.2); color: var(--brand-primary); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ── Player ────────────────────────────────────────── */
.player-wrap { max-width: 1100px; margin: 0 auto; }
.player-container {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.player-container video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.player-meta { padding: 28px 0; }
.player-meta h1 { font-size: 2rem; margin-bottom: 12px; color: var(--brand-primary); }
.player-meta .meta-row {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.no-select { user-select: none; -webkit-user-select: none; }

/* ── Empty state ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}
.empty-state h3 { font-size: 1.25rem; color: var(--ink); margin-bottom: 8px; }

/* ── Upload ────────────────────────────────────────── */
.upload-card {
  background: var(--bg-tint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
}
.upload-progress {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 12px;
  display: none;
}
.upload-progress-bar {
  height: 100%;
  background: var(--brand-primary);
  width: 0%;
  transition: width .2s;
}

/* ── Access grid ───────────────────────────────────── */
.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.access-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
}
.access-row:hover { border-color: var(--brand-primary); }
.access-row input { cursor: pointer; accent-color: var(--brand-primary); }
.access-row.has-access { background: rgba(27, 48, 88, 0.04); border-color: var(--brand-primary-light); }
.access-row .user-name { font-weight: 700; font-size: 0.92rem; }
.access-row .user-meta { font-size: 0.78rem; color: var(--muted); }

/* ── Footer ────────────────────────────────────────── */
.site-footer {
  background: var(--brand-primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 56px 0 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand .brand-text { color: #fff; }
.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  max-width: 340px;
  line-height: 1.6;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--brand-accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  font-weight: 700;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255,255,255,0.8); font-size: 0.92rem; }
.footer-col a:hover { color: var(--brand-accent); text-decoration: none; }
.footer-contact { font-size: 0.92rem; color: rgba(255,255,255,0.8); line-height: 1.75; }
.footer-contact strong {
  color: var(--brand-accent);
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.footer-contact strong:first-child { margin-top: 0; }
.footer-contact a { color: #fff; }
.footer-contact a:hover { color: var(--brand-accent); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.6);
  flex-wrap: wrap;
}
.footer-social { display: flex; gap: 10px; align-items: center; }
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  transition: background .15s, color .15s;
}
.footer-social a:hover { background: var(--brand-accent); color: var(--brand-primary-dark); }
.footer-social svg { width: 18px; height: 18px; }

@media (max-width: 840px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── Contacts page ─────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.contact-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.contact-block::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--brand-accent);
}
.contact-block h3 { color: var(--brand-primary); font-size: 1.15rem; margin-bottom: 14px; }
.contact-block p { margin-bottom: 10px; font-size: 0.95rem; color: var(--ink-soft); }
.contact-block .label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
  margin-top: 14px;
}
.contact-block .label:first-child { margin-top: 0; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }

/* ── Animations ────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero h1, .hero .lead, .hero-actions {
  animation: fadeUp .6s cubic-bezier(.2,.8,.2,1) both;
}
.hero .lead { animation-delay: .08s; }
.hero-actions { animation-delay: .16s; }

/* ── Utilities ─────────────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-gap { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Catalog view toggle ──────────────────────────── */
.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.view-toggle button {
  appearance: none;
  background: transparent;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, color .15s;
}
.view-toggle button + button { border-left: 1px solid var(--border-strong); }
.view-toggle button:hover { background: var(--bg-tint); }
.view-toggle button.active { background: var(--brand-primary); color: #fff; }
.view-toggle svg { width: 16px; height: 16px; }

/* List view */
.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Layout for list-view rows is defined later in the file (search for
   "Catalog list-view row layout"). The duplicate rules previously here have
   been removed to avoid conflicting grid-template-columns and aspect-ratio. */

/* Video card author line (grid view) */
.video-card-author {
  font-size: 0.82rem;
  color: var(--brand-accent-dark);
  font-weight: 700;
  margin-bottom: 6px;
}

/* ── Register / forgot / reset pages use .auth-wrap ── */
.auth-wrap .form-field:last-of-type { margin-bottom: 22px; }
.auth-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-top: 16px;
}
.auth-links a { color: var(--brand-primary); }

/* ── Tabs (admin) ─────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.tabs a {
  display: inline-block;
  padding: 12px 22px;
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tabs a:hover { color: var(--brand-primary); text-decoration: none; }
.tabs a.active {
  color: var(--brand-primary);
  font-weight: 700;
  border-bottom-color: var(--brand-accent);
}
.tabs .tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  background: var(--bg-tint);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
}
.tabs a.active .tab-count { background: var(--brand-accent); color: var(--brand-primary-dark); }

/* ── Header contact block (email + phone) ──────── */
.top-contact .divider {
  opacity: 0.4;
  margin: 0 4px;
}

/* ══════════════════════════════════════════════════════════════
   Версия для слабовидящих (accessibility mode)
   Активируется классом .a11y на <body>, остальные классы
   модифицируют размер, цветовую схему, интервалы и т.п.
   ══════════════════════════════════════════════════════════════ */

body.a11y {
  font-family: "Golos Text", Arial, sans-serif;
}
body.a11y h1,
body.a11y h2,
body.a11y h3,
body.a11y h4 {
  font-family: "Golos Text", Arial, sans-serif;
  letter-spacing: 0;
}

/* Скрываем декоративные элементы (top-bar при этом сохраняется — он несёт
   осмысленные ссылки и должен оставаться доступным в a11y) */
body.a11y .hero::before,
body.a11y .footer-social,
body.a11y .video-card-thumb-icon,
body.a11y .catalog-list .video-row-thumb-icon {
  display: none !important;
}

/* Убираем тени и анимации по умолчанию в a11y-режиме */
body.a11y *,
body.a11y *::before,
body.a11y *::after {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Размеры шрифта */
body.a11y.a11y-font-normal { font-size: 18px; }
body.a11y.a11y-font-large { font-size: 22px; }
body.a11y.a11y-font-xlarge { font-size: 26px; }
body.a11y h1 { font-size: 2em; line-height: 1.2; }
body.a11y h2 { font-size: 1.6em; }
body.a11y h3 { font-size: 1.3em; }
body.a11y .hero h1 { font-size: 2em; }
body.a11y .eyebrow { font-size: 0.8em; }

/* Больше межстрочный и межбуквенный интервал */
body.a11y.a11y-spacing-wide {
  line-height: 2 !important;
  letter-spacing: 0.08em !important;
  word-spacing: 0.15em !important;
}
body.a11y.a11y-spacing-wide h1,
body.a11y.a11y-spacing-wide h2,
body.a11y.a11y-spacing-wide h3 {
  line-height: 1.4 !important;
}

/* Скрытие изображений */
body.a11y.a11y-no-images img,
body.a11y.a11y-no-images .video-card-thumb,
body.a11y.a11y-no-images .catalog-list .video-row-thumb,
body.a11y.a11y-no-images .brand img {
  display: none !important;
}
body.a11y.a11y-no-images .video-card-thumb,
body.a11y.a11y-no-images .catalog-list .video-row-thumb {
  display: none !important;
}

/* Отключение анимаций */
body.a11y.a11y-no-anim *,
body.a11y.a11y-no-anim *::before,
body.a11y.a11y-no-anim *::after {
  animation: none !important;
  transition: none !important;
}

/* ── Цветовые схемы ──────────────────────────────────── */

/* 1. Черный на белом (bw) */
body.a11y.a11y-scheme-bw {
  background: #fff !important;
  color: #000 !important;
}
body.a11y.a11y-scheme-bw .site-header,
body.a11y.a11y-scheme-bw .nav-bar,
body.a11y.a11y-scheme-bw .card,
body.a11y.a11y-scheme-bw .feature,
body.a11y.a11y-scheme-bw .admin-stat,
body.a11y.a11y-scheme-bw .video-card,
body.a11y.a11y-scheme-bw .catalog-list .video-row,
body.a11y.a11y-scheme-bw .contact-block,
body.a11y.a11y-scheme-bw .upload-card,
body.a11y.a11y-scheme-bw .access-row,
body.a11y.a11y-scheme-bw .data-table,
body.a11y.a11y-scheme-bw .hero {
  background: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
}
/* Top-bar (синяя полоска со ссылками на ресурсы Союза, для слабовидящих
   — Email и т.д.) сохраняет брендовую заливку во всех a11y-схемах. Без
   этого правила body.a11y.a11y-scheme-bw превращал текст в чёрный, но
   фон top-bar всё равно оставался синим (он не входит в список выше),
   из-за чего чёрный текст сливался с синим. Контраст синий-белый
   соответствует WCAG AAA, так что переключать в bw-стиль смысла нет. */
body.a11y .top-bar,
body.a11y .top-bar * {
  background: var(--brand-primary) !important;
  color: #fff !important;
  border-color: var(--brand-primary-dark) !important;
}
body.a11y .top-bar a {
  color: #fff !important;
  text-decoration: underline !important;
}
body.a11y.a11y-scheme-bw .site-footer {
  background: #fff !important;
  color: #000 !important;
  border-top: 2px solid #000 !important;
}
body.a11y.a11y-scheme-bw a,
body.a11y.a11y-scheme-bw .brand,
body.a11y.a11y-scheme-bw .site-footer a,
body.a11y.a11y-scheme-bw .footer-col a,
body.a11y.a11y-scheme-bw .footer-contact a,
body.a11y.a11y-scheme-bw .main-nav a,
body.a11y.a11y-scheme-bw .main-nav a.active,
body.a11y.a11y-scheme-bw h1, body.a11y.a11y-scheme-bw h2,
body.a11y.a11y-scheme-bw h3, body.a11y.a11y-scheme-bw h4 {
  color: #000 !important;
}
body.a11y.a11y-scheme-bw a { text-decoration: underline !important; }
body.a11y.a11y-scheme-bw .btn-primary,
body.a11y.a11y-scheme-bw .btn-accent {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #000 !important;
}
body.a11y.a11y-scheme-bw .btn-ghost {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
}
body.a11y.a11y-scheme-bw .main-nav a.active::after {
  background: #000 !important;
}

/* 2. Белый на чёрном (bw-inv) */
body.a11y.a11y-scheme-bw-inv {
  background: #000 !important;
  color: #fff !important;
}
body.a11y.a11y-scheme-bw-inv .site-header,
body.a11y.a11y-scheme-bw-inv .nav-bar,
body.a11y.a11y-scheme-bw-inv .card,
body.a11y.a11y-scheme-bw-inv .feature,
body.a11y.a11y-scheme-bw-inv .admin-stat,
body.a11y.a11y-scheme-bw-inv .video-card,
body.a11y.a11y-scheme-bw-inv .catalog-list .video-row,
body.a11y.a11y-scheme-bw-inv .contact-block,
body.a11y.a11y-scheme-bw-inv .upload-card,
body.a11y.a11y-scheme-bw-inv .access-row,
body.a11y.a11y-scheme-bw-inv .data-table,
body.a11y.a11y-scheme-bw-inv .hero,
body.a11y.a11y-scheme-bw-inv .site-footer,
body.a11y.a11y-scheme-bw-inv .section-alt {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
body.a11y.a11y-scheme-bw-inv a,
body.a11y.a11y-scheme-bw-inv .brand,
body.a11y.a11y-scheme-bw-inv .footer-col a,
body.a11y.a11y-scheme-bw-inv .main-nav a,
body.a11y.a11y-scheme-bw-inv h1, body.a11y.a11y-scheme-bw-inv h2,
body.a11y.a11y-scheme-bw-inv h3, body.a11y.a11y-scheme-bw-inv h4,
body.a11y.a11y-scheme-bw-inv p, body.a11y.a11y-scheme-bw-inv span,
body.a11y.a11y-scheme-bw-inv label, body.a11y.a11y-scheme-bw-inv strong,
body.a11y.a11y-scheme-bw-inv .text-muted {
  color: #fff !important;
}
body.a11y.a11y-scheme-bw-inv a { text-decoration: underline !important; }
body.a11y.a11y-scheme-bw-inv .btn-primary,
body.a11y.a11y-scheme-bw-inv .btn-accent {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #fff !important;
}
body.a11y.a11y-scheme-bw-inv .btn-ghost {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}
body.a11y.a11y-scheme-bw-inv input,
body.a11y.a11y-scheme-bw-inv textarea,
body.a11y.a11y-scheme-bw-inv select {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}
body.a11y.a11y-scheme-bw-inv .data-table th {
  background: #222 !important;
  color: #fff !important;
}
body.a11y.a11y-scheme-bw-inv .main-nav a.active::after {
  background: #fff !important;
}

/* 3. Жёлтый на чёрном (yellow-black) */
body.a11y.a11y-scheme-yellow-bl {
  background: #000 !important;
  color: #FFD700 !important;
}
body.a11y.a11y-scheme-yellow-bl .site-header,
body.a11y.a11y-scheme-yellow-bl .nav-bar,
body.a11y.a11y-scheme-yellow-bl .card,
body.a11y.a11y-scheme-yellow-bl .feature,
body.a11y.a11y-scheme-yellow-bl .admin-stat,
body.a11y.a11y-scheme-yellow-bl .video-card,
body.a11y.a11y-scheme-yellow-bl .catalog-list .video-row,
body.a11y.a11y-scheme-yellow-bl .contact-block,
body.a11y.a11y-scheme-yellow-bl .upload-card,
body.a11y.a11y-scheme-yellow-bl .access-row,
body.a11y.a11y-scheme-yellow-bl .data-table,
body.a11y.a11y-scheme-yellow-bl .hero,
body.a11y.a11y-scheme-yellow-bl .site-footer,
body.a11y.a11y-scheme-yellow-bl .section-alt {
  background: #000 !important;
  color: #FFD700 !important;
  border-color: #FFD700 !important;
}
body.a11y.a11y-scheme-yellow-bl a,
body.a11y.a11y-scheme-yellow-bl .brand,
body.a11y.a11y-scheme-yellow-bl .footer-col a,
body.a11y.a11y-scheme-yellow-bl .main-nav a,
body.a11y.a11y-scheme-yellow-bl h1, body.a11y.a11y-scheme-yellow-bl h2,
body.a11y.a11y-scheme-yellow-bl h3, body.a11y.a11y-scheme-yellow-bl h4,
body.a11y.a11y-scheme-yellow-bl p, body.a11y.a11y-scheme-yellow-bl span,
body.a11y.a11y-scheme-yellow-bl label, body.a11y.a11y-scheme-yellow-bl strong,
body.a11y.a11y-scheme-yellow-bl .text-muted {
  color: #FFD700 !important;
}
body.a11y.a11y-scheme-yellow-bl a { text-decoration: underline !important; }
body.a11y.a11y-scheme-yellow-bl .btn-primary,
body.a11y.a11y-scheme-yellow-bl .btn-accent {
  background: #FFD700 !important;
  color: #000 !important;
  border: 2px solid #FFD700 !important;
}
body.a11y.a11y-scheme-yellow-bl .btn-ghost {
  background: #000 !important;
  color: #FFD700 !important;
  border: 2px solid #FFD700 !important;
}
body.a11y.a11y-scheme-yellow-bl input,
body.a11y.a11y-scheme-yellow-bl textarea,
body.a11y.a11y-scheme-yellow-bl select {
  background: #000 !important;
  color: #FFD700 !important;
  border: 2px solid #FFD700 !important;
}
body.a11y.a11y-scheme-yellow-bl .main-nav a.active::after {
  background: #FFD700 !important;
}

/* ── Панель управления ─────────────────────────────────
   В обычном потоке (не sticky/fixed): просто блок в самом верху body,
   занимает своё место в layout и прокручивается вместе со страницей.
   JS вставляет панель в начало body, так что она физически выше всего
   остального содержимого — сайт визуально сдвигается ниже неё.

   Ключевой момент — НЕ делать панель sticky. Если бы она была sticky,
   sticky-stacking вместе с top-bar/site-header/nav-bar давал бы
   расхождения по высоте (a11y увеличивает font-size → растёт реальная
   высота шапки → жёстко заданные top-offset'ы у nav-bar/admin-side не
   совпадают → меню «зависают посередине»). В обычном потоке проблема
   исчезает: при прокрутке панель уезжает наверх естественно, остальные
   sticky-меню работают со стандартных top:0 / top:36 / top:136 без
   подгонок. */
.a11y-panel {
  background: #fff;
  color: #000;
  border-bottom: 3px solid #000;
  padding: 12px 20px;
  display: none;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  font-family: Arial, sans-serif;
  font-size: 16px;
  /* Sits in normal document flow at the very top of <body>. The rest of
     the page (top-bar, site-header, nav-bar, content) is naturally
     pushed below it. When the user scrolls the panel scrolls away
     with the page — top-bar (sticky top:0) then takes over and stays
     visible. The user does NOT want the panel to remain glued to the
     top during scroll. */
}
.a11y-panel.open { display: flex; }
.a11y-panel .a11y-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.a11y-panel .a11y-group-label {
  font-weight: 700;
  color: #000;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.a11y-panel button {
  background: #fff;
  color: #000;
  border: 2px solid #000;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border-radius: 3px;
  font-weight: 600;
  line-height: 1.2;
}
.a11y-panel button:hover,
.a11y-panel button:focus {
  outline: 2px solid #000;
  outline-offset: 1px;
}
.a11y-panel button.active {
  background: #000;
  color: #fff;
}
.a11y-panel .a11y-spacer { flex: 1; }
.a11y-panel .a11y-exit {
  background: #8B2626;
  color: #fff;
  border-color: #8B2626;
}
.a11y-panel .a11y-exit:hover { background: #6E1D1D; }

/* Panel follows the color scheme too */
body.a11y.a11y-scheme-bw-inv .a11y-panel {
  background: #000; color: #fff; border-bottom-color: #fff;
}
body.a11y.a11y-scheme-bw-inv .a11y-panel button {
  background: #000; color: #fff; border-color: #fff;
}
body.a11y.a11y-scheme-bw-inv .a11y-panel button.active {
  background: #fff; color: #000;
}
body.a11y.a11y-scheme-bw-inv .a11y-panel .a11y-group-label { color: #fff; }

body.a11y.a11y-scheme-yellow-bl .a11y-panel {
  background: #000; color: #FFD700; border-bottom-color: #FFD700;
}
body.a11y.a11y-scheme-yellow-bl .a11y-panel button {
  background: #000; color: #FFD700; border-color: #FFD700;
}
body.a11y.a11y-scheme-yellow-bl .a11y-panel button.active {
  background: #FFD700; color: #000;
}
body.a11y.a11y-scheme-yellow-bl .a11y-panel .a11y-group-label { color: #FFD700; }

/* ── A11y override for sticky-menu cascade ─────────────────────────────
   In a11y mode the body font-size is bumped up to 18/22/26 px, which
   makes the top-bar and site-header visibly taller than their hard-coded
   sticky offsets above. Without this override site-header and nav-bar
   would stay at the regular-mode positions and the overlap math would
   stop working. sticky_layout.js measures the live offsetHeight of each
   strip and writes it to CSS vars on :root, so the calc() below stays
   accurate. The 4-px subtraction reproduces the same overlap-trick we
   use in regular mode (see comments on .site-header / .nav-bar). */
body.a11y .site-header {
  top: calc(var(--top-bar-h, 32px) - 4px);
}
body.a11y .nav-bar {
  top: calc(var(--top-bar-h, 32px) + var(--site-header-h, 96px) - 8px);
}

@media (max-width: 900px) {
  .a11y-panel { padding: 10px; gap: 12px; font-size: 14px; }
  .a11y-panel button { padding: 5px 10px; font-size: 13px; }
}

/* ── Ссылка "Для слабовидящих" в шапке ──────────────── */
.a11y-link {
  color: var(--brand-accent);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.a11y-link:hover { color: var(--brand-accent-light); text-decoration: underline; }
.a11y-link svg { width: 18px; height: 18px; }

/* ══════════════════════════════════════════════════════════════
   Каталог: поиск, фильтры, теги
   ══════════════════════════════════════════════════════════════ */

.catalog-search {
  margin-bottom: 24px;
}
.catalog-search .search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.catalog-search input[type=search] {
  flex: 1;
  min-width: 240px;
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.catalog-search input[type=search]:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(27, 48, 88, 0.12);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
}

.catalog-filters {
  position: sticky;
  top: 160px;
  align-self: start;
}
@media (max-width: 900px) {
  .catalog-filters { position: static; }
}

.filter-block + .filter-block { margin-top: 28px; }
.filter-block h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 12px;
}
.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.filter-list li { margin-bottom: 2px; }
.filter-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.93rem;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.filter-list a:hover { background: var(--bg-tint); color: var(--brand-primary); text-decoration: none; }
.filter-list a.active {
  background: var(--bg-tint);
  color: var(--brand-primary);
  font-weight: 700;
  border-left-color: var(--brand-accent);
}
.filter-list .count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
}
.filter-list a.active .count { color: var(--brand-accent-dark); font-weight: 700; }

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  display: inline-block;
  padding: 4px 11px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: all .15s;
}
.tag-chip:hover {
  background: var(--surface);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  text-decoration: none;
}
.tag-chip.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  font-weight: 700;
}

/* Taxonomy on video cards */
.video-card-taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}
.video-card-taxonomy .tag {
  font-size: 0.72rem;
  padding: 2px 9px;
  text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════
   Анимации и переходы на ховерах
   ══════════════════════════════════════════════════════════════ */

/* Плавное появление подсвечивания для карточек */
.video-card, .feature, .catalog-list .video-row {
  transition: transform .25s cubic-bezier(.2,.8,.2,1),
              box-shadow .25s cubic-bezier(.2,.8,.2,1),
              border-color .2s;
}
.video-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(27,48,88,0.15); }
.feature:hover { transform: translateY(-4px); }

/* Превью-иконка реагирует на hover карточки */
.video-card-thumb-icon,
.catalog-list .video-row-thumb-icon {
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s;
}
.video-card:hover .video-card-thumb-icon,
.catalog-list .video-row:hover .video-row-thumb-icon {
  transform: translate(-50%, -50%) scale(1.08);
  background: #fff;
}

/* Картинка превью плавно масштабируется на hover */
.video-card-thumb { overflow: hidden; }
.video-card-thumb img {
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.video-card:hover .video-card-thumb img {
  transform: scale(1.05);
}

/* Кнопки: микро-лифт */
.btn { transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s; }
.btn-primary:hover, .btn-accent:hover {
  box-shadow: 0 4px 12px rgba(27, 48, 88, 0.2);
  transform: translateY(-1px);
}
.btn-primary:active, .btn-accent:active, .btn-ghost:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Навигация: плавное появление золотой полоски */
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 12px;
  bottom: -1px;
  height: 3px;
  background: var(--brand-accent);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a.active::after { transform: scaleX(1); }

/* Теги-чипы: плавный переход фона */
.tag-chip { transition: background-color .2s, border-color .2s, color .2s, transform .15s; }
.tag-chip:hover { transform: translateY(-1px); }

/* Ссылки в фильтре */
.filter-list a { transition: background-color .15s, color .15s, border-left-color .15s, padding-left .2s; }
.filter-list a:hover { padding-left: 16px; }
.filter-list a.active { padding-left: 12px; }

/* ══════════════════════════════════════════════════════════════
   Каталог: плашки доступа, заголовки годов, левое выравнивание
   ══════════════════════════════════════════════════════════════ */

/* Grid — явное выравнивание по левому краю */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  justify-content: flex-start;
  justify-items: stretch;
}

/* List — ширина 100% */
.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

/* Year grouping headings */
.year-group + .year-group { margin-top: 40px; }
.year-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--brand-primary);
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

/* Access badges in catalog */
.access-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
}
.access-badge.access-yes {
  background: #D6EBD9;
  color: #1E4B27;
  border: 1px solid #8FC098;
}
.access-badge.access-no {
  background: #F5E5E5;
  color: #7C1A1A;
  border: 1px solid #D9A0A0;
}
/* Grid: position access badge top-left of thumbnail */
.video-card-thumb { position: relative; }
.video-card-thumb .access-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* List: badge sits in action column — consolidated with rest at end of file */

/* ══════════════════════════════════════════════════════════════
   Admin: multi-lecturer rows, mini-progress
   ══════════════════════════════════════════════════════════════ */

.lecturer-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.lecturer-row input[type=text] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
}
.lecturer-row input[type=text]:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(27, 48, 88, 0.12);
}

/* Mini progress bar in admin videos list */
.progress-mini {
  height: 4px;
  background: var(--bg-soft);
  border-radius: 100px;
  overflow: hidden;
  width: 110px;
}
.progress-mini-bar {
  height: 100%;
  background: var(--brand-accent);
  transition: width .4s ease-out;
}

/* Part headings on watch page when a video has multiple parts */
.part-heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--brand-primary);
  margin: 0 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════
   Каталог: фильтры сверху (категория + теги), без боковой панели
   ══════════════════════════════════════════════════════════════ */

/* Override the two-column layout introduced earlier: make it single column */
.catalog-layout {
  display: block;
}
.catalog-filters { display: none; } /* убираем старый сайдбар */

/* Top filters bar: category dropdown + collapsible tags */
.catalog-topfilters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.catalog-topfilters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.catalog-topfilters label {
  font-size: 0.86rem;
  color: var(--ink-soft);
  font-weight: 700;
}
.catalog-topfilters select {
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  min-width: 220px;
  cursor: pointer;
  transition: border-color .15s;
}
.catalog-topfilters select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(27, 48, 88, 0.12);
}

/* Collapsible tags (details/summary) */
.tags-collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 0;
  overflow: hidden;
}
.tags-collapsible summary {
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  user-select: none;
}
.tags-collapsible summary::-webkit-details-marker { display: none; }
.tags-collapsible summary::after {
  content: "▾";
  transition: transform .2s;
  color: var(--muted);
}
.tags-collapsible[open] summary::after { transform: rotate(180deg); }
.tags-collapsible summary:hover { background: var(--bg-tint); }
.tags-collapsible .tags-content {
  padding: 0 18px 16px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ══════════════════════════════════════════════════════════════
   Видео-карточка (grid): перекомпоновка — кнопки и плашка красиво
   ══════════════════════════════════════════════════════════════ */
.video-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.video-card-body h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--brand-primary);
}
.video-card-author { margin: 0; font-size: 0.82rem; color: var(--brand-accent-dark); font-weight: 700; }
.video-card-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-taxonomy {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin: 0;
}
.video-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

/* List row: access badge moved into row body below title, actions right */
/* (Catalog list-view styles consolidated at end of file — search for
   "Catalog list-view row layout".) */

/* Watch: taxonomy block above the player */
.video-taxonomy-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.video-taxonomy-top .tag {
  font-size: 0.82rem;
  padding: 3px 10px;
  text-decoration: none;
}

/* Lecturer line under the title on watch page */
.player-lecturer {
  font-size: 1.05rem;
  color: var(--brand-accent-dark);
  font-weight: 700;
  margin-bottom: 14px;
}

/* Darker video player container */
.player-container {
  background: #0B0D12;    /* было #000, но контейнер с #0B — слегка мягче */
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.player-container video { background: #0B0D12; }

/* Make the thumbnail gradient on cards darker too */
.video-card-thumb {
  background: linear-gradient(135deg, #0A1525 0%, #050A14 100%);
}
.catalog-list .video-row-thumb {
  background: linear-gradient(135deg, #0A1525 0%, #050A14 100%);
}

/* Close button in a11y panel */
.a11y-panel .a11y-close {
  background: transparent;
  color: #000;
  border: 2px solid #000;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.a11y-panel .a11y-close:hover {
  background: #000; color: #fff;
}
body.a11y.a11y-scheme-bw-inv .a11y-panel .a11y-close { color: #fff; border-color: #fff; }
body.a11y.a11y-scheme-bw-inv .a11y-panel .a11y-close:hover { background: #fff; color: #000; }
body.a11y.a11y-scheme-yellow-bl .a11y-panel .a11y-close { color: #FFD700; border-color: #FFD700; }
body.a11y.a11y-scheme-yellow-bl .a11y-panel .a11y-close:hover { background: #FFD700; color: #000; }

/* Top bar: active site link */
.top-links a strong {
  color: var(--brand-accent);
  font-weight: 700;
}
.top-links a:has(strong):hover strong {
  color: var(--brand-accent-light);
}

/* ══════════════════════════════════════════════════════════════
   Раздел Видеосеминары → вкладка "Описание"
   ══════════════════════════════════════════════════════════════ */

.catalog-description {
  max-width: 880px;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
}

.desc-lead {
  background: var(--bg-tint);
  border-left: 4px solid var(--brand-accent);
  padding: 22px 28px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-bottom: 28px;
}
.desc-lead-text {
  font-size: 1.18rem;
  margin: 0 0 12px 0;
  color: var(--brand-primary);
}
.desc-lead p { margin: 0; }
.desc-lead p + p { margin-top: 10px; color: var(--ink-soft); }

.desc-notice {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #FFF7E6;
  border: 1px solid #F0CC85;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 36px;
}
.desc-notice-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
}
.desc-notice strong { color: var(--brand-primary); }
.desc-notice a { color: var(--brand-primary); font-weight: 700; text-decoration: underline; }
.desc-notice a:hover { color: var(--brand-accent-dark); }

.desc-section-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--brand-primary);
  margin: 36px 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.desc-list {
  padding-left: 24px;
  margin: 12px 0 24px 0;
}
.desc-list li {
  margin-bottom: 8px;
  padding-left: 4px;
}
.desc-list li::marker { color: var(--brand-accent); font-weight: 700; }

/* Three info cards: cost / free / application */
.desc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 32px 0;
}
.desc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.desc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(27,48,88,0.12);
}
.desc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.desc-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brand-primary);
  line-height: 1.25;
}
.desc-card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.desc-card-meta {
  font-size: 0.82rem !important;
  color: var(--muted) !important;
  font-style: italic;
}
.desc-card .btn { align-self: flex-start; margin-top: auto; padding-top: 8px; padding-bottom: 8px; }

/* Highlight banner: discount */
.desc-highlight {
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, var(--brand-primary), #2E4D7A);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin: 36px 0;
  box-shadow: 0 10px 32px rgba(27, 48, 88, 0.2);
}
.desc-highlight h3 { color: #fff; }
.desc-highlight p { color: rgba(255,255,255,0.92); }
.desc-highlight strong { color: var(--brand-accent); }
.desc-highlight-badge {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(212, 178, 106, 0.35);
}
@media (max-width: 600px) {
  .desc-highlight { flex-direction: column; text-align: center; padding: 24px; }
}

/* Linked-list of related activities */
.desc-link-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 32px 0;
}
.desc-link-list li {
  border-left: 3px solid var(--border);
  padding: 10px 18px;
  margin-bottom: 10px;
  background: var(--bg-tint);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: border-left-color .2s, background .2s;
}
.desc-link-list li:hover {
  border-left-color: var(--brand-accent);
  background: var(--surface);
}
.desc-link-list li a {
  display: block;
  font-weight: 700;
  color: var(--brand-primary);
  text-decoration: none;
  font-size: 1.02rem;
}
.desc-link-list li a:hover { color: var(--brand-accent-dark); text-decoration: underline; }
.desc-link-meta {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 3px;
}

/* Contact CTA at the bottom */
.desc-contact-cta {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-top: 40px;
  text-align: center;
}
.desc-contact-cta h3 {
  margin: 0 0 6px 0;
  font-family: var(--font-display);
  color: var(--brand-primary);
  font-size: 1.4rem;
}
.desc-contact-cta p { margin: 0 0 16px 0; color: var(--ink-soft); }
.desc-contact-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════
   Описание — раскрывашки (стоимость / бесплатно / заявка)
   ══════════════════════════════════════════════════════════════ */

.desc-accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.desc-accordion[open] {
  border-color: var(--brand-primary);
  box-shadow: 0 6px 22px rgba(27,48,88,0.08);
}
.desc-accordion summary {
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  user-select: none;
  transition: background .15s;
}
.desc-accordion summary:hover { background: var(--bg-tint); }
.desc-accordion summary::-webkit-details-marker { display: none; }
.desc-accordion summary::after {
  content: "";
  width: 11px; height: 11px;
  border-right: 2px solid var(--brand-primary);
  border-bottom: 2px solid var(--brand-primary);
  transform: rotate(45deg);
  margin-left: auto;
  transition: transform .25s;
}
.desc-accordion[open] summary::after {
  transform: rotate(-135deg);
  margin-bottom: -4px;
}

.desc-accordion-icon {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
}

.desc-accordion-body {
  padding: 4px 24px 22px 24px;
  font-size: 1rem;
  line-height: 1.65;
}
.desc-accordion-body p { margin: 0 0 12px 0; }
.desc-accordion-body p:last-child { margin-bottom: 0; }

.desc-subhead {
  margin: 18px 0 8px 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.desc-asterisk { color: var(--brand-accent-dark); font-weight: 700; }

.desc-bullet-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px 0;
}
.desc-bullet-list li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.desc-bullet-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--brand-accent-dark);
  font-weight: 700;
}

.desc-note-soft {
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 16px !important;
}

.desc-note-block {
  background: var(--bg-tint);
  border-left: 3px solid var(--brand-accent);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 16px;
}
.desc-note-line {
  margin: 0 0 4px 0 !important;
  color: var(--ink-soft);
}
.desc-note-line:last-child { margin-bottom: 0 !important; }

.desc-warning {
  margin-top: 18px !important;
  padding: 14px 18px;
  background: #FFF1F1;
  border: 1px solid #E8B4B4;
  border-radius: var(--radius);
  color: #8B2626;
}
.desc-warning a {
  color: #8B2626;
  text-decoration: underline;
}

/* Pricing table inside accordion */
.desc-pricing-table {
  margin-top: 4px;
}
.desc-pricing-table thead th {
  background: var(--bg-soft);
  color: var(--brand-primary);
  font-size: 0.86rem;
}
.desc-pricing-divider {
  background: var(--bg-tint) !important;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding: 10px 16px !important;
}
.desc-pricing-table td:first-child {
  font-weight: 700;
  color: var(--brand-primary);
}
.desc-pricing-table td:nth-child(2),
.desc-pricing-table td:nth-child(3) {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  /* Цены всегда в одну строку: даже на относительно узком вьюпорте
     столбец сам расширится, а не свернёт «3 150 руб., включая НДС 5%»
     в две строки. На совсем узких экранах (мобильных) появится
     горизонтальный скролл у table-wrap — это лучше, чем ломать
     цифры. nbsp в самих значениях дополнительно склеивают отдельные
     словосочетания вроде «3 150» и «руб.». */
  white-space: nowrap;
}

/* Hide the old desc-cards block in favor of accordions */
.desc-cards { display: none; }

/* ══════════════════════════════════════════════════════════════
   Значок "Платный" на превью видео
   ══════════════════════════════════════════════════════════════ */

.paid-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--brand-primary);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand-accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: help;
  user-select: none;
  z-index: 2;
  transition: transform .15s, background .15s, color .15s;
}
.paid-badge:hover {
  transform: scale(1.08);
  background: var(--brand-accent);
  color: #fff;
}
/* Tooltip-подобное поведение через title — браузер показывает нативно.
   Для list-view значок имеет тот же стиль, абсолютно позиционирован
   относительно .video-row-thumb (которая уже position: relative). */
.video-row-thumb { position: relative; }
.catalog-list .video-row-thumb .paid-badge {
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  border-width: 1.5px;
}

/* Inline variant — used in admin /admin/videos table next to the title.
   Same visual identity as the badge in the catalog (golden ring, brand-blue
   ruble glyph), but rendered inline so it sits in the row of tags rather
   than absolute-positioned over a thumbnail. */
.paid-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--brand-primary);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1.5px solid var(--brand-accent);
  cursor: help;
  user-select: none;
  vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════════
   Чекбокс с подписью в формах админки
   ══════════════════════════════════════════════════════════════ */

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--ink);
  padding: 4px 0;
}
.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-primary);
  margin: 0;
  flex-shrink: 0;
}
.checkbox-field span {
  line-height: 1.3;
}
.checkbox-field:hover span {
  color: var(--brand-primary);
}

/* ══════════════════════════════════════════════════════════════
   Legal pages (Privacy / Terms / Personal data)
   ══════════════════════════════════════════════════════════════ */

.legal-page {
  max-width: 880px;
  padding-top: 24px;
  padding-bottom: 64px;
}

.legal-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.legal-head h1 {
  margin: 8px 0 8px 0;
  color: var(--brand-primary);
  font-size: 2rem;
  line-height: 1.2;
}
.legal-head .text-muted {
  margin: 0;
  font-size: 0.95rem;
}

.legal-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
}
.legal-body h2 {
  font-family: var(--font-display);
  color: var(--brand-primary);
  font-size: 1.4rem;
  margin: 32px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.legal-body h3 {
  font-family: var(--font-display);
  color: var(--brand-primary);
  font-size: 1.1rem;
  margin: 22px 0 10px 0;
}
.legal-body p {
  margin: 0 0 12px 0;
}
.legal-body ul, .legal-body ol {
  padding-left: 24px;
  margin: 8px 0 16px 0;
}
.legal-body li {
  margin-bottom: 6px;
}
.legal-body li::marker {
  color: var(--brand-accent-dark);
}
.legal-body a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-color: rgba(27, 48, 88, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color .15s;
}
.legal-body a:hover {
  text-decoration-color: var(--brand-primary);
}
.legal-body strong {
  color: var(--ink);
  font-weight: 700;
}

.legal-contact-block {
  background: var(--bg-tint);
  border-left: 3px solid var(--brand-accent);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0 20px 0;
}
.legal-contact-block > div {
  margin-bottom: 6px;
}
.legal-contact-block > div:last-child {
  margin-bottom: 0;
}

.legal-related {
  margin-top: 48px;
  padding: 22px 26px;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
}
.legal-related h3 {
  margin: 0 0 12px 0 !important;
  font-size: 1.05rem;
  color: var(--brand-primary);
}
.legal-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.legal-related li {
  margin-bottom: 6px;
}
.legal-related a {
  font-weight: 600;
}

/* Subtitle right under the page H1 (e.g. "Союза по организации деятельности
   консультантов..." subtitle on the Terms page). Smaller and de-emphasized
   so it doesn't compete with the main H1. */
.legal-body .legal-subtitle {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  margin: -8px 0 24px 0;
  padding-bottom: 0;
  border-bottom: none;
  line-height: 1.4;
}

/* Tables inside legal documents — cookie categories table and the
   third-parties table on the privacy page. */
.legal-body .legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px 0;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.legal-body .legal-table thead th {
  background: var(--bg-tint);
  color: var(--brand-primary);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--brand-accent);
  font-size: 0.92rem;
}
.legal-body .legal-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.legal-body .legal-table tbody tr:first-child td {
  border-top: none;
}
.legal-body .legal-table tbody tr:nth-child(even) td {
  background: rgba(247, 248, 250, 0.5);
}
.legal-body .legal-table a {
  word-break: break-word;
}
@media (max-width: 720px) {
  .legal-body .legal-table,
  .legal-body .legal-table thead,
  .legal-body .legal-table tbody,
  .legal-body .legal-table tr,
  .legal-body .legal-table th,
  .legal-body .legal-table td {
    display: block;
  }
  .legal-body .legal-table thead {
    display: none;
  }
  .legal-body .legal-table tr {
    border-top: 1px solid var(--border);
    padding: 10px 0;
  }
  .legal-body .legal-table tbody tr:first-child {
    border-top: none;
  }
  .legal-body .legal-table td {
    border-top: none;
    padding: 4px 14px;
  }
}

/* ══════════════════════════════════════════════════════════════
   Cookie consent banner
   ══════════════════════════════════════════════════════════════ */

.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 40px);
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: 0 16px 40px rgba(11, 20, 39, 0.18), 0 4px 12px rgba(11, 20, 39, 0.08);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s;
  opacity: 0;
}
.cookie-banner.shown {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.cookie-banner-text {
  flex: 1;
  min-width: 240px;
}
.cookie-banner-text a {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(27, 48, 88, 0.3);
}
.cookie-banner-text a:hover {
  text-decoration-color: var(--brand-primary);
}
.cookie-banner .btn {
  flex-shrink: 0;
}
@media (max-width: 540px) {
  .cookie-banner {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 14px 18px;
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner .btn {
    width: 100%;
  }
}

/* Footer legal links row (above the bottom copyright row) */
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px 0 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 32px;
  font-size: 0.88rem;
}
.footer-legal-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.footer-legal-links a:hover {
  color: var(--brand-accent);
  border-bottom-color: var(--brand-accent);
}

/* ══════════════════════════════════════════════════════════════
   Catalog list-view row layout — final
   - Tags above title in body
   - Lecturers each on own line (from video_lecturers array)
   - Smaller thumb (160×100) centered vertically
   - Paid badge in top-right of the WHOLE card (not on thumb)
   ══════════════════════════════════════════════════════════════ */

.catalog-list .video-row {
  display: grid;
  grid-template-columns: 184px 1fr 160px;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  align-items: stretch;
  position: relative;     /* anchor for paid-badge */
}
.catalog-list .video-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: var(--brand-accent-light);
  text-decoration: none;
}

.catalog-list .video-row-thumb {
  position: relative;
  width: 160px;
  height: 100px;
  background: linear-gradient(135deg, #0A1525 0%, #050A14 100%);
  align-self: center;     /* center vertically inside row */
  margin: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.catalog-list .video-row-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.catalog-list .video-row-thumb-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-primary);
  font-size: 0.95rem;
  pointer-events: none;
}
.catalog-list .video-row-badge {
  position: absolute;
  bottom: 4px; right: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #fff;
  background: rgba(0,0,0,0.7);
  padding: 2px 6px;
  border-radius: 100px;
}

.catalog-list .video-row-body {
  padding: 14px 18px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  justify-content: center;
}
.catalog-list .video-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}
.catalog-list .video-row-tags .tag {
  font-size: 0.74rem;
  padding: 2px 8px;
}
.catalog-list .video-row-body h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--brand-primary);
  line-height: 1.3;
}
.catalog-list .video-row-lecturers {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.catalog-list .video-row-lecturer {
  font-size: 0.85rem;
  color: var(--brand-accent-dark);
  font-weight: 700;
  line-height: 1.4;
}
.catalog-list .video-row-body p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.catalog-list .video-row-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.catalog-list .video-row-action {
  background: var(--bg-tint);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-left: 1px solid var(--border);
}
.catalog-list .video-row-action .btn {
  text-align: center;
  white-space: nowrap;
}
.catalog-list .video-row:hover .video-row-action {
  background: var(--bg-soft);
}

/* Paid badge in TOP-RIGHT of the whole card (not on thumb) */
.catalog-list .video-row > .paid-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

@media (max-width: 640px) {
  .catalog-list .video-row { grid-template-columns: 110px 1fr; }
  .catalog-list .video-row-thumb { width: 110px; height: 70px; margin: 12px 0 12px 12px; }
  .catalog-list .video-row-action { display: none; }
  .catalog-list .video-row-body { padding: 12px 14px 12px 12px; }
  .catalog-list .video-row > .paid-badge { top: 8px; right: 8px; }
}

/* ══════════════════════════════════════════════════════════════
   Grid card: tags top, lecturers per line, paid badge on card
   ══════════════════════════════════════════════════════════════ */
.video-card { position: relative; }
.video-card > .paid-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
/* Reset old position of paid-badge that was in thumb */
.video-card-thumb > .paid-badge { display: none; }

.video-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 4px 0;
}
.video-card-tags .tag {
  font-size: 0.74rem;
  padding: 2px 8px;
}
.video-card-lecturers {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.video-card-lecturer {
  font-size: 0.82rem;
  color: var(--brand-accent-dark);
  font-weight: 700;
  line-height: 1.4;
}

/* Watch page: lecturers stacked one per line under title */
.player-lecturers {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.player-lecturers .player-lecturer {
  margin: 0;
}

/* ── Scientific Council (NES) cards — accordion content ─────────────
   Each video item lives in its own .desc-nes-block card. Visual goals:
     - clear separation between cards (panel background + border)
     - badge "Открытый доступ" right inside the card it applies to
     - the mini-warning ("Материалы не предоставляются. Зачёт баллов
       не производится.") sits on its own as a section preamble, not
       glued to the first card
     - "Видеозапись" rendered as a soft button, not bare link */

.desc-accordion-body h4.desc-nes-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--brand-primary);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

/* Section-level preamble (warning notes that apply to all NES videos).
   Sits above all cards as one block with its own subtle treatment. */
.desc-nes-preamble {
  margin: 4px 0 18px 0;
  padding: 12px 16px;
  background: var(--bg-tint);
  border-left: 3px solid var(--brand-accent);
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.desc-nes-preamble-title {
  display: block;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 4px;
}

/* Card per NES video item */
.desc-nes-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 0 0 14px 0;
  box-shadow: var(--shadow-sm);
}
.desc-nes-block:last-child {
  margin-bottom: 4px;
}

.desc-nes-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.desc-nes-tag-free {
  background: #E8F4EA;
  color: #2F6B3A;
  border: 1px solid #C9E5CD;
}

.desc-nes-role {
  font-weight: 600;
  color: var(--ink-soft);
  margin: 8px 0 4px 0;
  font-size: 0.95rem;
}
.desc-nes-people {
  list-style: disc;
  padding-left: 22px;
  margin: 0 0 12px 0;
}
.desc-nes-people li {
  margin: 4px 0;
  line-height: 1.55;
}
.desc-nes-people strong {
  color: var(--brand-primary);
}

.desc-nes-note {
  margin: 10px 0 0 0;
  padding: 10px 14px;
  background: #FFF8EC;
  border-left: 3px solid var(--brand-accent);
  border-radius: 6px;
  font-size: 0.93rem;
  color: var(--ink-soft);
}
.desc-nes-note a {
  color: var(--brand-primary);
  font-weight: 600;
}

/* "▶ Видеозапись" — soft button under a card */
.desc-nes-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 14px;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.desc-nes-link:hover {
  background: var(--brand-primary-light);
  color: #fff;
}

/* Sessions list inside "Налоговый конгресс" card */
.desc-nes-sessions {
  list-style: none;
  padding: 0;
  margin: 0;
}
.desc-nes-sessions > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.desc-nes-sessions > li:first-child {
  padding-top: 6px;
  border-top: none;
}
.desc-nes-session-num {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--brand-accent-dark);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 80px;
}
.desc-nes-session-text {
  flex: 1 1 320px;
  line-height: 1.5;
}
.desc-nes-link-inline {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--bg-tint);
  color: var(--brand-primary);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.desc-nes-link-inline:hover {
  background: var(--bg-soft);
  text-decoration: none;
}

/* Hero on dark background — overrides for elements inside .hero */
.hero .eyebrow {
  color: var(--brand-accent);
}
/* Primary CTA in hero is gold (variant A) — solid background, dark
   navy text. Stays a strong accent against the navy gradient backdrop
   without competing with the gold "Палаты налоговых консультантов"
   in the headline (they're the same color, which is intentional —
   visually pairs the headline emphasis with the action). */
.hero .btn-primary {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--brand-primary);
}
.hero .btn-primary:hover {
  background: var(--brand-accent-light);
  border-color: var(--brand-accent-light);
  color: var(--brand-primary);
}
.hero .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.hero .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════
   Admin /access pages — toolbar + sortable list-table
   ══════════════════════════════════════════════════════════════ */

.access-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.access-toolbar input[type="search"] {
  flex: 1;
  min-width: 240px;
  padding: 9px 14px;
  font-size: 0.92rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.access-toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(27, 48, 88, 0.12);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.access-table {
  width: 100%;
  border-collapse: collapse;
}
.access-table thead {
  background: var(--bg-tint);
  border-bottom: 2px solid var(--border-strong);
}
.access-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}
.access-table th.sortable {
  cursor: pointer;
  transition: background .15s;
}
.access-table th.sortable:hover {
  background: var(--bg-soft);
}
.access-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.access-table tbody tr:last-child {
  border-bottom: none;
}
.access-table tbody tr:hover {
  background: var(--bg-tint);
}
.access-table td {
  padding: 12px 16px;
  vertical-align: middle;
  font-size: 0.92rem;
  color: var(--ink);
}
.access-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  margin: 0;
}
.access-table .mono {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.84rem;
}

/* Hidden video tag in admin list */
.tag.tag-hidden {
  background: #FFF4E5;
  color: #8B5300;
  border: 1px solid #F0CC8B;
}

/* ══════════════════════════════════════════════════════════════
   Admin CMS — menu editor + page form + settings
   ══════════════════════════════════════════════════════════════ */

/* Menu editor */
.menu-section {
  padding: 18px 20px;
}
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow .15s, opacity .15s;
}
.menu-item.dragging {
  opacity: 0.5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.menu-handle {
  width: 28px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}
.menu-handle:active { cursor: grabbing; }
.menu-item-fields {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.menu-item-fields input {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.88rem;
  background: var(--surface);
  width: 100%;
  min-width: 0;
}
.menu-newtab,
.menu-active {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.menu-newtab input,
.menu-active input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.menu-newtab span,
.menu-active span {
  font-size: 0.95rem;
  color: var(--muted);
  user-select: none;
}
.menu-newtab:has(input:checked),
.menu-active:has(input:checked) {
  background: var(--brand-accent);
  border-color: var(--brand-accent-dark);
}
.menu-newtab:has(input:checked) span,
.menu-active:has(input:checked) span {
  color: var(--brand-primary);
}

/* CMS public page (custom /p/:slug) */
.cms-page {
  max-width: 880px;
  padding-top: 24px;
  padding-bottom: 64px;
}
.cms-page-title {
  color: var(--brand-primary);
  margin-bottom: 24px;
  font-size: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 16px;
}
.cms-page-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
}
.cms-page-body h2 {
  color: var(--brand-primary);
  margin: 28px 0 12px 0;
  font-size: 1.4rem;
}
.cms-page-body h3 {
  color: var(--brand-primary);
  margin: 22px 0 10px 0;
  font-size: 1.15rem;
}
.cms-page-body p { margin: 0 0 12px 0; }
.cms-page-body ul, .cms-page-body ol {
  padding-left: 24px;
  margin: 8px 0 16px 0;
}
.cms-page-body a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-color: rgba(27, 48, 88, 0.3);
}
.cms-page-body a:hover {
  text-decoration-color: var(--brand-primary);
}
.cms-page-body table {
  border-collapse: collapse;
  margin: 16px 0;
  width: 100%;
}
.cms-page-body table th,
.cms-page-body table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.cms-page-body table th {
  background: var(--bg-tint);
  font-weight: 700;
}
