/* ============================================================
   KinoMartiz — Лендинг (v2)
   Токены из assets/colors_and_type.css.
   ⚠ Скругления — осознанное отступление от square-corner
   дизайн-системы по требованию заказчика. Радиусы вынесены в --r-*.
   ============================================================ */

:root {
  --r-genre: 22px;   /* жанровый блок            */
  --r-film: 14px;    /* строка фильма            */
  --r-poster: 9px;   /* миниатюра постера        */
  --r-pill: 9999px;  /* кнопки / CTA             */
  --r-method: 22px;  /* блок методологии         */
  --r-note: 10px;    /* блок впечатления         */
  --r-frame: 16px;   /* фото-рамка в Hero        */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg0);
  color: var(--fg1);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, picture, source { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: var(--sp-5);
  padding-right: var(--sp-5);
}

/* ---- Reveal --------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   TROPHY BACKGROUND (декор)
   ============================================================ */
.trophies {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.trophy {
  position: absolute;
  color: var(--gold);
  fill: currentColor;
  opacity: 0.07;
}
.trophy--1 { width: 240px; height: 620px; top: 1900px; left: -60px; transform: rotate(-6deg); }
.trophy--2 { width: 320px; height: 500px; top: 2600px; right: -80px; opacity: 0.06; }
.trophy--3 { width: 200px; height: 520px; top: 3500px; left: 4%; opacity: 0.05; transform: rotate(5deg); }
.trophy--4 { width: 280px; height: 440px; top: 4400px; right: 2%; opacity: 0.06; }
.trophy--5 { width: 220px; height: 560px; top: 5200px; left: -40px; opacity: 0.05; transform: rotate(-4deg); }
@media (prefers-reduced-motion: no-preference) {
  .trophy { animation: sway 9s var(--ease) infinite alternate; }
  .trophy--2 { animation-delay: -3s; }
  .trophy--3 { animation-delay: -5s; }
  .trophy--4 { animation-delay: -1.5s; }
  .trophy--5 { animation-delay: -6s; }
}
@keyframes sway {
  from { transform: translateY(0) rotate(var(--rot, 0deg)); }
  to   { transform: translateY(-22px) rotate(var(--rot, 0deg)); }
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--bg0);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: 1100px; margin: 0 auto; height: 64px;
  padding: 0 var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-5);
}
.nav__brand { font-size: 21px; flex-shrink: 0; }
.km-wordmark .km-kino, .km-wordmark .km-martiz { font-size: 1em; }

.nav__links {
  margin-left: auto;
  display: flex; align-items: center; gap: var(--sp-5);
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.nav__links::-webkit-scrollbar { display: none; }
.nav__link {
  position: relative;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--sand);
  white-space: nowrap; padding: 6px 0;
  transition: color var(--dur) var(--ease);
}
.nav__link:hover { color: var(--cream); }
.nav__link--lead { color: var(--gold-dim); }
.nav__link--lead:hover { color: var(--gold); }
.nav__link--admin {
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px 16px;
}
.nav__link--admin:hover { color: var(--obsidian); background: var(--gold); border-color: var(--gold); }
.nav__link--admin::after { display: none; }
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__link.is-active { color: var(--cream); }
.nav__link.is-active::after { transform: scaleX(1); }

.nav__burger {
  display: none; margin-left: auto; width: 40px; height: 40px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px; padding: 0;
}
.nav__burger span { display: block; width: 18px; height: 1.5px; background: var(--cream);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.nav__burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   HERO — dim photo bg + transparent gold shader + overlay + text
   Слои: фото(0) → анимация(1) → overlay(2) → текст(3)
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: calc(64px + var(--sp-6)) var(--sp-5) clamp(80px, 12vh, 120px);
  overflow: hidden;
  background: var(--bg0);
}
.hero__photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  opacity: 0.45;
}
.hero__shader { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; }
.hero__overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to bottom, rgba(13,13,11,0.22) 0%, rgba(13,13,11,0.42) 58%, rgba(13,13,11,0.64) 100%);
}

.hero__content {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-5);
  max-width: 760px;
}
.hero__eyebrow { display: block; }

.hero__title {
  position: relative;
  display: inline-block;
  margin: var(--sp-2) 0 0;
  line-height: 0.95;
}
.hero__wordmark { display: inline-flex; align-items: baseline; }
.hero__title .km-kino {
  font-family: var(--font-sans); font-weight: 800; color: var(--cream);
  font-size: clamp(52px, 10vw, 124px); letter-spacing: -0.03em;
}
.hero__title .km-martiz {
  font-family: var(--font-display); font-style: italic; font-weight: 500; color: var(--gold);
  font-size: clamp(52px, 10vw, 124px);
}
/* Animation — подчёркивание, рисуется слева направо */
.hero__underline {
  position: absolute; left: 0; right: 0; bottom: -0.16em;
  width: 100%; height: 0.18em; min-height: 14px;
  color: var(--gold); overflow: visible;
}
.hero__underline-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: drawline 1.4s var(--ease) 0.5s forwards;
}
@keyframes drawline { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero__underline-path { animation: none; stroke-dashoffset: 0; }
}

.hero__subtitle {
  margin: var(--sp-3) 0 0;
  font-size: clamp(17px, 2.4vw, 26px); font-weight: 500; color: var(--cream);
  letter-spacing: -0.01em; text-shadow: 0 2px 18px rgba(13,13,11,0.6);
}
.hero__lede {
  margin: 0; max-width: 44ch;
  font-size: clamp(14px, 1.5vw, 16px); line-height: 1.75; color: var(--sand);
  text-shadow: 0 2px 18px rgba(13,13,11,0.6);
}

.hero__cue {
  position: absolute; z-index: 3; left: 50%; bottom: var(--sp-5);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
}
.hero__cue-label { font-size: 9px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sand); }
.hero__cue-line { width: 1px; height: 40px; background: linear-gradient(180deg, var(--gold), transparent); animation: cuedrop 2.2s var(--ease) infinite; }
@keyframes cuedrop {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .hero__cue-line { animation: none; } }
@media (max-height: 820px) { .hero__cue { display: none; } }

/* ============================================================
   SECTIONS — shared
   ============================================================ */
.section { position: relative; z-index: 1; padding: clamp(72px, 11vh, 128px) 0; }
.section--method { border-top: 1px solid var(--border); }
.section--genres { background: var(--bg1); border-top: 1px solid var(--border); }

.section__head { max-width: 680px; margin-bottom: var(--sp-8); }
.section__head .km-eyebrow { display: block; margin-bottom: var(--sp-3); }
.section__title {
  margin: 0; font-weight: 700; font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05; letter-spacing: -0.02em; color: var(--cream);
}
.section__intro { margin: var(--sp-5) 0 0; font-size: clamp(15px, 1.6vw, 17px); line-height: 1.75; color: var(--sand); }

/* ============================================================
   METHODOLOGY
   ============================================================ */
.criteria {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-method);
  overflow: hidden;
}
.criterion { display: flex; gap: var(--sp-4); background: var(--bg0); padding: var(--sp-6); }
.criterion__num {
  font-family: var(--font-sans); font-weight: 800; font-size: 22px; color: var(--gold);
  line-height: 1; flex-shrink: 0; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; padding-top: 3px;
}
.criterion__name { margin: 0 0 var(--sp-3); font-weight: 600; font-size: clamp(17px, 1.8vw, 20px); color: var(--cream); line-height: 1.2; }
.criterion__desc { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--sand); }

/* ============================================================
   GENRES — wide cards with film rows
   ============================================================ */
.genres { display: grid; grid-template-columns: 1fr; gap: var(--sp-7); }

.genre {
  background: var(--bg0);
  border: 1px solid var(--border);
  border-radius: var(--r-genre);
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
  min-height: 200px;
  display: flex; flex-direction: column;
  scroll-margin-top: 84px;
  transition: border-color var(--dur) var(--ease);
}
.genre:hover { border-color: rgba(201,168,76,0.34); }
.genre__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4);
  padding-bottom: var(--sp-4); border-bottom: 1px solid var(--border-soft); margin-bottom: var(--sp-3);
}
.genre__name { margin: 0; font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); color: var(--cream); letter-spacing: -0.01em; }
.genre__count { font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dim); white-space: nowrap; }

.genre__empty {
  display: flex; align-items: center; gap: var(--sp-3);
  flex: 1; min-height: 96px;
  color: var(--sand);
}
.genre__empty-mark { color: var(--gold-dim); font-size: 12px; }
.genre__empty p { margin: 0; font-size: 14px; color: var(--sand); }

.genre__add {
  align-self: flex-start; margin-top: var(--sp-4);
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold); border-radius: var(--r-pill);
  padding: 9px 18px; transition: all var(--dur) var(--ease);
}
.genre__add:hover { background: var(--gold); color: var(--obsidian); }

/* film row */
.films { list-style: none; margin: 0; padding: 0; }
.film {
  display: flex; align-items: flex-start; gap: var(--sp-5);
  padding: var(--sp-4); border-radius: var(--r-film);
  transition: background var(--dur) var(--ease);
}
.film:hover { background: var(--bg2); }
.film + .film { margin-top: var(--sp-2); }

.film__poster {
  position: relative; flex-shrink: 0;
  width: 60px; height: 90px;
  border-radius: var(--r-poster);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
}
.film__poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film__poster-ph { color: var(--gold-dim); font-size: 20px; }
.film__poster.has-img .film__poster-ph { display: none; }

.film__main { min-width: 0; flex: 1; }
.film__title { margin: 0; font-weight: 700; font-size: clamp(18px, 2vw, 22px); color: var(--cream); line-height: 1.25; letter-spacing: -0.01em; }
.film__attr { margin: var(--sp-2) 0 0; font-size: 13px; color: var(--sand); }
.film__by { font-family: var(--font-display); font-style: italic; font-weight: 500; color: var(--gold); font-size: 15px; }
.film__impression { margin: var(--sp-3) 0 0; max-width: 62ch; }
.film__note-label {
  margin: 0 0 var(--sp-2);
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em;
  color: var(--gold-dim); font-style: italic;
}
.film__note {
  margin: 0; padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-sans); font-style: normal;
  font-size: 14.5px; line-height: 1.65; color: var(--sand);
  background: var(--bg1); border-radius: var(--r-note);
  border-left: 2px solid var(--border);
}
.section--genres .film__note { background: var(--bg0); }
.film__note--empty { color: var(--gold-dim); }

.film__score { flex-shrink: 0; display: flex; align-items: baseline; gap: 6px; padding-top: 2px; }
.film__star { color: var(--gold); font-size: 15px; line-height: 1; }
.film__num { font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }

/* inline edit affordance — visible to every visitor;
   the action itself is gated by the password screen inside the panel */
.film__edit {
  display: inline-flex; flex-shrink: 0; align-self: center;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--r-poster); color: var(--sand);
  opacity: 0.5; cursor: pointer;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
              color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.film__edit svg { width: 16px; height: 16px; display: block; }
.film__edit:hover {
  opacity: 1; transform: scale(1.1);
  color: var(--gold); border-color: var(--gold); background: var(--bg2);
}
.film__edit:focus-visible { opacity: 1; outline: 2px solid var(--gold); outline-offset: 2px; }
@media (hover: none) {
  .film__edit { width: 36px; height: 36px; opacity: 1; }
  .film__edit:hover { transform: none; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer { position: relative; z-index: 1; background: var(--bg0); border-top: 1px solid var(--border); padding: var(--sp-8) 0; }
.footer__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-4); }
.footer__brand { font-size: 22px; }
.footer__line { margin: 0; font-size: 14px; color: var(--sand); max-width: 40ch; }
.footer__meta { margin: var(--sp-2) 0 0; font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dim); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .nav__burger { display: flex; }
  .nav__links {
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg0); border-bottom: 1px solid var(--border);
    padding: var(--sp-3) var(--sp-5) var(--sp-5);
    overflow-y: auto; max-height: calc(100vh - 64px);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__link { padding: var(--sp-4) 0; border-bottom: 1px solid var(--border-soft); letter-spacing: 0.12em; }
  .nav__link::after { display: none; }
  .nav__link.is-active { color: var(--gold); }
  .nav__link--admin { text-align: center; margin-top: var(--sp-3); padding: var(--sp-3); border-bottom: 1px solid var(--gold); }
}

@media (max-width: 767px) {
  .criteria { grid-template-columns: 1fr; }
  .film { gap: var(--sp-4); }
  .film__note { max-width: none; }
  .film__num { font-size: clamp(22px, 5vw, 30px); }
  .film__title { font-size: clamp(16px, 3.5vw, 20px); }
  .film__poster { width: 52px; height: 78px; }
}

@media (max-width: 520px) {
  .container { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .nav__inner { padding: 0 var(--sp-4); gap: var(--sp-3); }
  .genre { padding: var(--sp-5) var(--sp-4); }
  .film { padding: var(--sp-3); }
  .film__score { padding-top: 4px; }
  .film__num { font-size: 28px; }
  .panel { padding: var(--sp-5) var(--sp-4) var(--sp-6); }
  .panel__cols { grid-template-columns: 1fr; }
}

/* ============================================================
   REVIEWS (отзывы-овации)
   ============================================================ */
.section--reviews { border-top: 1px solid var(--border); }
.reviews {
  position: relative;
  margin: 0;
  max-width: 860px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: var(--sp-8) var(--sp-7) var(--sp-6);
}
.reviews__wink { color: var(--gold-dim); font-style: italic; }
.reviews__mark {
  position: absolute; top: 4px; left: 24px;
  font-family: var(--font-display); font-style: italic;
  font-size: 120px; line-height: 1; color: var(--gold);
  opacity: 0.22; pointer-events: none;
}
.reviews__quote { margin: 0; transition: opacity 0.24s var(--ease), transform 0.24s var(--ease); }
.reviews__quote.is-fading { opacity: 0; transform: translateY(8px); }
.reviews__text {
  margin: 0;
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 2.8vw, 30px); line-height: 1.5; color: var(--cream);
  text-wrap: pretty;
}
.reviews__by {
  display: flex; align-items: center; gap: var(--sp-4);
  margin-top: var(--sp-6);
  transition: opacity 0.24s var(--ease);
}
.reviews__by.is-fading { opacity: 0; }
.reviews__avatar {
  position: relative;
  width: 56px; height: 56px; flex-shrink: 0;
}
.reviews__avatar-initial {
  position: absolute; inset: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-weight: 700; font-size: 16px;
  color: var(--gold);
  opacity: 0; pointer-events: none;
  transition: opacity 0.24s var(--ease);
  text-transform: uppercase; letter-spacing: 0.02em;
  user-select: none;
}
.reviews__avatar-initial.is-active {
  opacity: 1; pointer-events: auto;
}
.reviews__avatar image-slot::part(frame) {
  background: var(--bg2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.reviews__author { display: flex; flex-direction: column; gap: 2px; }
.reviews__name { font-weight: 700; font-size: 16px; color: var(--cream); }
.reviews__role { font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dim); }
.reviews__nav { display: flex; align-items: center; gap: var(--sp-4); margin-top: var(--sp-6); }
.reviews__arrow {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: transparent; border: 1px solid var(--border); color: var(--gold);
  font-size: 20px; line-height: 1; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.reviews__arrow:hover { background: var(--gold); color: var(--obsidian); border-color: var(--gold); }
.reviews__dots { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.reviews__dot {
  width: 8px; height: 8px; border-radius: 50%; padding: 0;
  background: var(--border); border: none; cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reviews__dot:hover { background: var(--sand); }
.reviews__dot.is-active { background: var(--gold); transform: scale(1.35); }
@media (max-width: 520px) {
  .reviews { padding: var(--sp-7) var(--sp-5) var(--sp-5); }
  .reviews__mark { font-size: 80px; left: 16px; }
}

/* ============================================================
   FORM CONTROLS (shared by panel)
   ============================================================ */
.btn {
  font-family: var(--font-sans); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 13px 26px; border: 1px solid transparent; border-radius: var(--r-pill);
  cursor: pointer; transition: all var(--dur) var(--ease); white-space: nowrap;
}
.btn--primary { background: var(--gold); color: var(--obsidian); }
.btn--primary:hover { background: var(--gold-light); }
.btn--ghost { background: transparent; color: var(--gold); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--gold); }
.btn--sm { padding: 9px 16px; font-size: 11px; }
.btn--danger { background: transparent; color: #c98a8a; border-color: #5a2222; margin-left: auto; }
.btn--danger:hover { background: #5a2222; color: var(--cream); border-color: #5a2222; }

.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field__label { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sand); }
.field__label em { color: var(--gold); font-style: normal; }
.field__label small { text-transform: none; letter-spacing: 0; color: var(--gold-dim); font-weight: 400; }
.field__input {
  font-family: var(--font-sans); font-size: 15px; color: var(--cream);
  background: var(--bg2); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 12px 14px; width: 100%; transition: border-color var(--dur) var(--ease);
}
.field__input::placeholder { color: var(--gold-dim); }
.field__input:focus { outline: none; border-color: var(--gold); }
.field__textarea { resize: vertical; line-height: 1.6; }
select.field__input { appearance: none; -webkit-appearance: none; cursor: pointer; }

/* ============================================================
   AUTHOR PANEL (drawer)
   ============================================================ */
.panel-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold); color: var(--obsidian);
  border: none; cursor: pointer;
  font-size: 30px; font-weight: 400; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.7);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.panel-fab:hover { background: var(--gold-light); transform: translateY(-2px); }
.panel-fab span { margin-top: -2px; }

.panel-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(5,5,4,0.66);
  opacity: 0; transition: opacity 0.28s var(--ease);
}
.panel-backdrop.is-open { opacity: 1; }

.panel {
  position: fixed; left: 50%; bottom: 0; z-index: 71;
  width: min(720px, 100%);
  transform: translate(-50%, 100%);
  background: var(--bg1);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: var(--sp-6) var(--sp-6) var(--sp-7);
  max-height: 92vh; overflow-y: auto;
  transition: transform 0.32s var(--ease);
}
.panel.is-open { transform: translate(-50%, 0); }
.panel__handle {
  width: 44px; height: 4px; border-radius: 4px; background: var(--border);
  margin: 0 auto var(--sp-5);
}
.panel__close {
  position: absolute; top: 16px; right: 18px;
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border-soft); color: var(--sand);
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.panel__close:hover { color: var(--cream); border-color: var(--sand); }

.panel__inner { display: flex; flex-direction: column; gap: var(--sp-4); }
.panel__inner .km-eyebrow { display: block; }
.panel__title { margin: 0; font-weight: 700; font-size: 26px; color: var(--cream); }
.panel__auth { max-width: 360px; }
.panel__hint { margin: 0; font-size: 12px; line-height: 1.6; color: var(--gold-dim); }
.panel__hint code { font-family: var(--font-mono); color: var(--gold); font-size: 11px; }
.panel__error {
  margin: 0; font-size: 13px; color: var(--danger);
  background: rgba(182,64,47,0.1); border-left: 2px solid var(--danger); border-radius: 8px;
  padding: 10px 14px;
}
.panel__form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); }
.panel__cols { display: grid; grid-template-columns: 1fr 200px; gap: var(--sp-5); align-items: start; }
.panel__fields { display: flex; flex-direction: column; gap: var(--sp-4); }
.field-row { display: grid; grid-template-columns: 1fr 0.7fr; gap: var(--sp-4); }
.panel__cover { display: flex; flex-direction: column; gap: var(--sp-3); }
.cover-preview {
  width: 124px; height: 186px; border-radius: 10px; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.cover-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-preview__ph { color: var(--gold-dim); font-size: 30px; }
.cover-upload { display: inline-flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.cover-note { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--gold-dim); }
.cover-note code { font-family: var(--font-mono); color: var(--sand); font-size: 11px; }
.panel__actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-2); }

@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .panel__cover { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .panel__cover .field__label { width: 100%; }
}

/* ============================================================
   ADD-FILM CTA (крупная pill-кнопка в конце каталога)
   ============================================================ */
.section--add { border-top: 1px solid var(--border); text-align: center; }
.add-cta { max-width: 620px; margin: 0 auto; }
.add-cta .km-eyebrow { display: block; margin-bottom: var(--sp-3); }
.add-cta .section__title { font-size: clamp(28px, 4vw, 44px); }
.add-cta .section__intro { margin-left: auto; margin-right: auto; max-width: 520px; }
.add-cta__btn { margin-top: var(--sp-6); }
.btn--lg { padding: 17px 40px; font-size: 13px; }
.add-cta__btn::before { content: "+"; margin-right: 10px; font-size: 16px; line-height: 0; vertical-align: middle; }

/* ============================================================
   AUTHOR-PANEL additions
   ============================================================ */
/* password screen subtitle */
.panel__subtitle { margin: calc(var(--sp-3) * -1) 0 var(--sp-2); font-size: 15px; line-height: 1.6; color: var(--sand); }

/* invalid password field highlight */
.field__input.is-invalid,
.field__input.is-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* brute-force lockout notice */
.panel__lock {
  margin: 0; font-size: 13px; line-height: 1.6; color: var(--danger);
  background: rgba(182,64,47,0.1); border-left: 2px solid var(--danger); border-radius: 8px;
  padding: 12px 14px;
}
.panel__lock strong { font-variant-numeric: tabular-nums; }
.panel__auth.is-locked .field__input,
.panel__auth.is-locked button[type="submit"] { opacity: 0.5; pointer-events: none; }

/* ---- delete-confirm modal ---------------------------------- */
.confirm-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(5,5,4,0.72);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  opacity: 0; transition: opacity 0.2s var(--ease);
}
.confirm-backdrop[hidden] { display: none; }
.confirm-backdrop.is-open { opacity: 1; }
.confirm {
  width: min(420px, 100%);
  background: var(--bg1); border: 1px solid var(--border);
  border-left: 2px solid #5a2222;
  border-radius: 14px; padding: var(--sp-6);
  transform: translateY(8px) scale(0.98); transition: transform 0.22s var(--ease);
}
.confirm-backdrop.is-open .confirm { transform: none; }
.confirm__eyebrow { display: block; margin-bottom: var(--sp-3); color: #c98a8a; }
.confirm__title { margin: 0 0 var(--sp-3); font-weight: 700; font-size: 21px; line-height: 1.2; color: var(--cream); }
.confirm__body { margin: 0 0 var(--sp-5); font-size: 14px; line-height: 1.7; color: var(--sand); }
.confirm__body em { font-style: normal; color: var(--cream); }
.confirm__actions { display: flex; gap: var(--sp-3); }
.confirm__actions .btn--danger { margin-left: 0; }

/* ---- delete fade-out animation ----------------------------- */
.film {
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease);
}
.film.is-removing {
  opacity: 0; transform: translateX(-12px);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .film.is-removing { transform: none; }
}

/* edited card flash — instant in-place update cue */
@keyframes km-edit-flash {
  0%   { background: rgba(201,168,76,0.14); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: no-preference) {
  .film.is-edited { animation: km-edit-flash 0.9s var(--ease); }
}
