:root {
  --bg: #0f0d0d;
  --bg2: #171312;
  --panel: rgba(20, 18, 18, 0.82);
  --panel-strong: rgba(27, 23, 22, 0.95);
  --text: #efe7db;
  --muted: #b6aa99;
  --line: rgba(255, 226, 178, 0.12);
  --gold: #d9b16f;
  --gold-soft: rgba(217, 177, 111, 0.18);
  --danger: #a74f4f;
  --shadow: 0 20px 60px rgba(0,0,0,.35);
  --reader-scale: 1;
}
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: radial-gradient(circle at top, #231d1a 0%, var(--bg) 36%, #090909 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.texture {
  position: fixed; inset: 0; pointer-events: none; opacity: .16;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.08) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,.04) 0 1px, transparent 1px),
    linear-gradient(140deg, rgba(255,255,255,.03), transparent 35%),
    linear-gradient(0deg, rgba(255,120,50,.03), transparent 30%);
  background-size: 14px 14px, 18px 18px, 100% 100%, 100% 100%;
}
.top-progress { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: rgba(255,255,255,.05); z-index: 1000; }
.top-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7a4e21, var(--gold)); box-shadow: 0 0 14px rgba(217,177,111,.55); }
.hero { min-height: 82vh; position: relative; display: flex; align-items: center; padding: 80px 20px 40px; background-size: cover; background-position: center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.72)); }
.hero-inner { position: relative; max-width: 820px; margin: 0 auto; text-align: center; z-index: 1; animation: rise .9s ease both; }
.eyebrow { letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.hero h1, .chapter-title, .sidebar-card h2, .reader-card h2 { text-shadow: 0 0 18px rgba(217,177,111,.18), 0 0 44px rgba(255,255,255,.06); }
.hero h1 { font-size: clamp(42px, 7vw, 82px); margin: 0 0 14px; }
.tagline { font-size: clamp(18px, 2.5vw, 28px); color: #f5ddbb; margin: 0 0 18px; }
.description { max-width: 700px; margin: 0 auto 26px; line-height: 1.8; color: var(--muted); }
.hero-actions, .chapter-nav, .chapter-admin-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; cursor: pointer;
  transition: .2s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(180deg, #7d5730, #5c3f23); color: #fff3e0; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.btn-ghost { background: rgba(255,255,255,.02); color: #fff; }
.btn-like { background: rgba(167,79,79,.12); color: #ffd8d8; }
.full { width: 100%; }
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; max-width: 1400px; margin: 0 auto; padding: 24px; }
.content-top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 18px;
}
.content-action-btn {
  color: #fff !important;
  background: rgba(16, 14, 14, 0.88);
  backdrop-filter: blur(8px);
}
.sidebar, .content { min-width: 0; }
/* Боковая панель чтения: отдельная прокрутка списка глав/содержания */
.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.sidebar-card, .reader-card, .admin-card, .login-box, .admin-sidebar {
  background: var(--panel); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.sidebar-card, .reader-card, .admin-card { padding: 22px; }

.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inline-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.reader-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sidebar-close { display: none; }
body.sidebar-collapsed .sidebar .chapter-list,
body.sidebar-collapsed .sidebar .reader-last-box { display: none; }
.chapter-list { display: grid; gap: 10px; }
.chapter-link {
  padding: 12px; border-radius: 16px; border: 1px solid transparent; background: rgba(255,255,255,.02); display: grid;
  grid-template-columns: 42px 1fr; gap: 12px; align-items: start;
}
.chapter-link.active, .chapter-link:hover { border-color: var(--gold-soft); background: rgba(255,255,255,.035); }
.chapter-link small { display: block; color: var(--muted); margin-top: 4px; }
.chapter-order {
  width: 42px; height: 42px; border-radius: 14px; background: rgba(217,177,111,.12); display: flex; align-items: center; justify-content: center; color: var(--gold);
}
.reader-card { margin-bottom: 24px; animation: rise .7s ease both; }
.chapter-meta, .muted, .comment-head span, .simple-table small { color: var(--muted); }
.chapter-title { font-size: clamp(30px, 4vw, 54px); margin: 10px 0; }
.chapter-summary { color: #ddcfbb; max-width: 760px; line-height: 1.7; }
.story { display: grid; gap: 24px; }
.story-text { font-size: clamp(18px, 2vw, 24px); line-height: 1.95; color: #f3ecdf; opacity: .96; }
.story-text, .story-text p, .story-text li, .story-text blockquote { font-size: calc(clamp(18px, 2vw, 24px) * var(--reader-scale)); }
/* Защита от случайно сохранённых заголовков внутри обычного текста главы.
   Android Chrome в режиме «Версия для ПК» иначе раздувает h2/h3/h4. */
.story-text h2,
.story-text h3,
.story-text h4 {
  margin: 0 0 1em;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: none;
}
.story-image img { width: 100%; border-radius: 20px; display: block; border: 1px solid var(--line); }
.story-image figcaption { text-align: center; margin-top: 8px; color: var(--muted); }
.comment-form, .admin-form { display: grid; gap: 12px; }
.comment-form input, .comment-form textarea, .admin-form input, .admin-form textarea, .admin-form select {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); border-radius: 14px; padding: 14px;
}
.comment-list { display: grid; gap: 14px; margin-top: 18px; }
.comment-item { padding: 16px; border-radius: 18px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); }
.comment-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.admin-bg { min-height: 100vh; padding: 24px; }
.login-box { max-width: 520px; margin: 8vh auto; padding: 24px; }
.error-box { padding: 12px 14px; border-radius: 14px; background: rgba(167,79,79,.14); border: 1px solid rgba(167,79,79,.35); margin-bottom: 14px; }
.admin-wrap { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 20px; }
.admin-sidebar { padding: 22px; position: sticky; top: 20px; height: max-content; }
.admin-main { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full-span { grid-column: 1 / -1; }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.stats-grid div, .simple-table div { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); }
.stats-grid strong { display: block; font-size: 32px; margin-top: 8px; }
.simple-table { display: grid; gap: 10px; }
.simple-table div { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.chapter-admin-list { display: grid; gap: 12px; }
.chapter-admin-item, .admin-header-inline { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.upload-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cinematic body, body.cinematic-mode { overflow-x: hidden; }
body.cinematic-mode::after {
  content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.38); pointer-events: none; z-index: 0;
}
body.cinematic-mode .story .cinematic-target { opacity: 0; transform: translateY(16px); }
body.cinematic-mode .story .cinematic-target.visible { opacity: 1; transform: translateY(0); transition: opacity .8s ease, transform .8s ease; }
.fade-in { animation: rise .7s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 980px) {
  .layout, .admin-wrap, .grid-2, .stats-grid { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(92vw, 380px);
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    background: rgba(6, 6, 8, 0.96);
    z-index: 9998;
    transform: translateX(-105%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-card { margin-bottom: 16px; }
  .sidebar-close { display: inline-flex; }
  .hero { min-height: 72vh; }
}
@media (max-width: 720px) {
  .btn,
  .mobile-toc-toggle,
  .sidebar-close,

  .content-top-actions {
    margin-top: -8px;
    margin-bottom: 18px;
  }

  .content-action-btn {
    padding: 10px 12px;
    border-radius: 14px;
  }
}

/* ===== LIGHTBOX / fullscreen image viewer ===== */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.92);
  z-index: 999999;
  flex-direction: column;
  gap: 14px;
}

.lightbox.hidden {
  display: none !important;
}

#lightboxImage,
.lightbox img {
  display: none;
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

#lightboxImage.is-ready,
.lightbox img.is-ready {
  display: block;
}

.lightbox-status {
  color: #fff;
  font-size: 16px;
  text-align: center;
  max-width: 92vw;
}

.lightbox-status.hidden {
  display: none !important;
}

.lightbox-status.is-error {
  color: #ffb4b4;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.68);
  color: #fff !important;
  font-size: 34px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000000;
}

body.lightbox-open {
  overflow: hidden !important;
}

.story-lightbox-trigger {
  cursor: zoom-in;
}

/* ===== ARCHIVE MODULE ===== */
.archive-page { min-height: 100vh; }
.archive-hero { position: relative; padding: 72px 22px 34px; background: radial-gradient(circle at 50% 0%, rgba(217,177,111,.12), transparent 38%), linear-gradient(180deg, rgba(0,0,0,.4), rgba(0,0,0,.05)); }
.archive-hero-inner { max-width: 980px; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.archive-hero h1 { font-size: clamp(38px, 6vw, 72px); margin: 0 0 12px; text-shadow: 0 0 24px rgba(217,177,111,.16); }
.archive-shell { max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; gap: 20px; }
.archive-search { display: flex; gap: 10px; max-width: 760px; margin: 22px auto 0; }
.archive-search input { flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); border-radius: 14px; padding: 14px; }
.archive-breadcrumbs { color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.archive-breadcrumbs a { color: #f3ddba; }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.archive-card { min-height: 180px; padding: 16px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.025); display: flex; flex-direction: column; gap: 10px; transition: .2s ease; overflow: hidden; }
.archive-card:hover { transform: translateY(-2px); border-color: var(--gold-soft); background: rgba(255,255,255,.04); }
.archive-card img { width: 100%; height: 150px; object-fit: cover; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); }
.archive-card strong { color: #fff3df; font-size: 20px; }
.archive-card p { color: var(--muted); line-height: 1.55; margin: 0; }
.archive-kicker { color: var(--gold); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.archive-detail-image { width: min(100%, 820px); max-height: 620px; object-fit: cover; border-radius: 24px; border: 1px solid var(--line); display: block; margin: 16px 0 20px; cursor: zoom-in; }
.archive-full-text { margin-top: 18px; }
.archive-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.archive-gallery img { width: 100%; height: 170px; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); cursor: zoom-in; }
.archive-section-head { overflow: hidden; }
.archive-head-image { width: 100%; height: auto; max-height: none; object-fit: contain; border-radius: 20px; border: 1px solid var(--line); margin: 10px 0 14px; background: rgba(0,0,0,.18); display: block; }
.archive-admin-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 18px; }
.archive-admin-list { display: grid; gap: 10px; }
.archive-admin-list.cards { max-height: 760px; overflow: auto; padding-right: 4px; }
.archive-admin-item { border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: rgba(255,255,255,.025); padding: 12px; }
.archive-admin-item summary { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.archive-admin-item summary span { color: var(--muted); font-size: 13px; }
.checkline { display: flex !important; align-items: center; gap: 10px; color: var(--muted); padding: 12px 0; }
.checkline input { width: auto !important; }
@media (max-width: 980px) { .archive-admin-grid { grid-template-columns: 1fr; } .archive-search { flex-direction: column; } }

/* ===== UPDATE: archive atmosphere, gallery, feedback ===== */
.archive-atmosphere {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
  opacity: .72;
  mix-blend-mode: screen;
}
.archive-page .texture,
.archive-page .archive-hero,
.archive-page .archive-shell,
.archive-music-panel {
  position: relative;
  z-index: 3;
}
.archive-music-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 8px;
  border-radius: 18px;
  background: rgba(9,7,6,.72);
  border: 1px solid rgba(217,177,111,.2);
  backdrop-filter: blur(12px);
}
.archive-detail-image {
  margin-bottom: 12px;
}
.archive-gallery-block {
  width: min(100%, 860px);
  margin: 0 0 22px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(217,177,111,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  box-shadow: inset 0 0 30px rgba(217,177,111,.035);
}
.archive-gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.archive-gallery-head h3 {
  margin: 0;
  color: #fff3df;
}
.archive-gallery-head span {
  color: var(--muted);
  font-size: 13px;
}
.archive-gallery {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin-top: 0;
}
.archive-gallery-tile {
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
  cursor: zoom-in;
}
.archive-gallery .archive-gallery-tile img,
.archive-gallery img {
  height: 132px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.archive-gallery .archive-gallery-tile:hover img {
  transform: translateY(-2px);
  border-color: rgba(217,177,111,.45);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 58px;
  height: 72px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.54);
  color: #fff;
  font-size: 54px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000000;
}
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.feedback-list {
  display: grid;
  gap: 14px;
}
.feedback-item {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
  padding: 14px;
}
.feedback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.admin-reply {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(217,177,111,.22);
  background: rgba(217,177,111,.06);
}
.admin-reply p { margin-bottom: 0; }
.status-new { border-color: rgba(217,177,111,.35); color: #f3ddba; }
.status-read { border-color: rgba(145,160,190,.35); color: #cbd6ef; }
.status-answered { border-color: rgba(118,190,145,.35); color: #bfeccc; }
.status-closed { border-color: rgba(180,180,180,.22); color: #b8b8b8; }
.admin-feedback-list .feedback-item form + form { margin-top: 10px; }
@media (max-width: 700px) {
  .archive-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-gallery .archive-gallery-tile img, .archive-gallery img { height: 118px; }
  .archive-music-panel { left: 12px; right: 12px; bottom: 12px; }
  .archive-music-panel .btn { width: 100%; }
  .lightbox-arrow { width: 46px; height: 56px; font-size: 42px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}


/* Books upgrade */
.book-switcher{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 12px}
.book-chip{display:inline-flex;align-items:center;border:1px solid rgba(217,177,111,.28);border-radius:999px;padding:7px 10px;color:#e8dcc8;text-decoration:none;background:rgba(255,255,255,.04);font-size:13px}
.book-chip.active{background:rgba(217,177,111,.18);border-color:rgba(217,177,111,.7);color:#fff}
body.cinematic-mode .texture, body.cinematic-mode .hero-overlay{filter:brightness(.55)}
body.cinematic-mode .chapter-focus-shell{position:relative;z-index:4;background:rgba(20,16,14,.92)}
body.cinematic-mode .story, body.cinematic-mode .chapter-title, body.cinematic-mode .chapter-summary{position:relative;z-index:5;filter:none;opacity:1}

/* ===== PHASE 2: landing + multi-book library ===== */
.landing-page, .books-page { min-height: 100vh; overflow-x: hidden; }
.landing-hero { position: relative; min-height: 92vh; display: flex; align-items: center; justify-content: center; padding: 84px 20px 48px; overflow: hidden; }
.landing-slideshow { position: absolute; inset: 0; z-index: 0; background: radial-gradient(circle at top, #2b211c, #090807); }
.landing-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transform: scale(1.06); transition: opacity 1.4s ease, transform 9.5s ease; filter: blur(2px) saturate(.9) brightness(.75); }
.landing-slide.is-active { opacity: 1; transform: scale(1); }
.landing-shade { position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle at 50% 38%, rgba(0,0,0,.18), rgba(0,0,0,.78) 62%, rgba(0,0,0,.94)), linear-gradient(180deg, rgba(20,12,8,.28), rgba(0,0,0,.88)); }
.landing-content { position: relative; z-index: 2; max-width: 920px; text-align: center; padding: 28px; border-radius: 30px; border: 1px solid rgba(255,226,178,.12); background: rgba(10,8,8,.34); backdrop-filter: blur(8px); box-shadow: 0 30px 100px rgba(0,0,0,.42); }
.afira-seal { width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 50%; border: 1px solid rgba(217,177,111,.38); display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 36px; box-shadow: 0 0 28px rgba(217,177,111,.12), inset 0 0 24px rgba(217,177,111,.08); background: rgba(0,0,0,.24); }
.afira-seal.has-emblem {
  position: relative;
  width: var(--home-emblem-size, 74px);
  height: var(--home-emblem-size, 74px);
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  isolation: isolate;
}
.afira-seal.has-emblem::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 168%;
  height: 168%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236,190,112,.26) 0%, rgba(217,177,111,.13) 32%, rgba(217,177,111,.055) 52%, transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}
.afira-seal.has-emblem img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(227,182,103,.24)) drop-shadow(0 0 20px rgba(217,177,111,.12));
}
.landing-content h1, .books-hero h1 { font-size: clamp(42px, 8vw, 88px); margin: 0 0 14px; text-shadow: 0 0 18px rgba(217,177,111,.22), 0 0 60px rgba(0,0,0,.9); }
.landing-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0 0 22px; }
.landing-actions { justify-content: center; }
.landing-books, .books-wrap { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 34px 20px 70px; }
.landing-books .section-head { text-align: center; margin-bottom: 22px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.book-card { border: 1px solid var(--line); background: rgba(20,18,18,.78); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 100%; }
.book-cover { height: 260px; background: radial-gradient(circle at 50% 30%, rgba(217,177,111,.16), rgba(255,255,255,.025)); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover > span:not(.book-read-badge) { color: var(--gold); font-size: 72px; }
.book-card-body { padding: 18px; display: grid; gap: 10px; flex: 1; }
.book-card-body h3 { margin: 0; font-size: 26px; color: #fff3df; }
.book-card-body p { margin: 0; color: var(--muted); line-height: 1.6; }
.book-card-body small { color: var(--gold); }
.books-hero { position: relative; max-width: 1180px; margin: 0 auto; padding: 72px 20px 24px; text-align: center; }
.books-hero .hero-actions { justify-content: center; margin-top: 18px; }
@media (max-width: 720px) {
  .landing-hero { min-height: 86vh; padding: 58px 14px 34px; }
  .landing-content { padding: 22px 16px; border-radius: 24px; }
  .landing-actions .btn, .books-hero .btn { width: 100%; }
  .book-grid { grid-template-columns: 1fr; }
  .book-cover { height: 220px; }
}


/* Archive forbidden records and per-card atmosphere */
.archive-detail.archive-weather{position:relative;overflow:hidden;}
.archive-detail.archive-weather > *:not(.archive-weather-layer){position:relative;z-index:2;}
.archive-weather-layer{position:absolute;inset:0;z-index:1;pointer-events:none;opacity:.7;overflow:hidden;}
.archive-weather-snow .archive-weather-layer{background-image:radial-gradient(circle,rgba(255,255,255,.85) 0 1px,transparent 1.7px),radial-gradient(circle,rgba(255,255,255,.45) 0 1px,transparent 2px);background-size:80px 80px,130px 130px;animation:archiveSnow 14s linear infinite;}
.archive-weather-rain .archive-weather-layer{background-image:linear-gradient(115deg,rgba(190,210,255,.0) 0%,rgba(190,210,255,.35) 45%,rgba(190,210,255,.0) 60%);background-size:18px 70px;animation:archiveRain .8s linear infinite;opacity:.45;}
.archive-weather-ash .archive-weather-layer{background-image:radial-gradient(circle,rgba(210,190,160,.38) 0 1px,transparent 2px),radial-gradient(circle,rgba(100,90,80,.28) 0 1.2px,transparent 2.5px);background-size:90px 90px,150px 150px;animation:archiveAsh 18s linear infinite;}
.archive-weather-fog .archive-weather-layer{background:radial-gradient(circle at 20% 30%,rgba(180,180,170,.16),transparent 35%),radial-gradient(circle at 70% 55%,rgba(120,130,140,.18),transparent 42%),linear-gradient(90deg,transparent,rgba(200,200,190,.08),transparent);filter:blur(10px);animation:archiveFog 16s ease-in-out infinite alternate;}
.archive-weather-aurora .archive-weather-layer{background:linear-gradient(120deg,transparent 10%,rgba(70,210,170,.18) 35%,rgba(90,80,220,.14) 55%,transparent 80%);filter:blur(18px);transform:skewY(-8deg);animation:archiveAurora 11s ease-in-out infinite alternate;}
.archive-weather-magic .archive-weather-layer{background-image:radial-gradient(circle,rgba(190,150,255,.62) 0 1px,transparent 2px),radial-gradient(circle,rgba(80,190,255,.42) 0 1px,transparent 2.5px);background-size:70px 70px,120px 120px;animation:archiveMagic 12s linear infinite;}
@keyframes archiveSnow{from{background-position:0 -120px,40px -160px}to{background-position:0 320px,40px 300px}}
@keyframes archiveRain{from{background-position:0 -80px}to{background-position:0 80px}}
@keyframes archiveAsh{from{background-position:0 180px,80px 220px}to{background-position:50px -120px,20px -160px}}
@keyframes archiveFog{from{transform:translateX(-4%)}to{transform:translateX(4%)}}
@keyframes archiveAurora{from{transform:translateX(-8%) skewY(-8deg);opacity:.35}to{transform:translateX(8%) skewY(-8deg);opacity:.8}}
@keyframes archiveMagic{from{background-position:0 150px,80px 180px}to{background-position:60px -100px,10px -120px}}
.forbidden-entry{position:relative;z-index:3;margin:28px auto;padding:32px 22px;max-width:720px;text-align:center;border:1px solid rgba(220,170,90,.35);border-radius:24px;background:radial-gradient(circle at 50% 0,rgba(150,60,30,.18),rgba(10,8,8,.72));box-shadow:0 0 45px rgba(0,0,0,.45), inset 0 0 34px rgba(220,160,80,.06);}
.forbidden-seal{width:84px;height:84px;margin:0 auto 14px;border-radius:50%;display:grid;place-items:center;border:1px solid rgba(220,170,90,.55);color:#e6c385;font-size:42px;box-shadow:0 0 26px rgba(220,140,60,.25);}
.forbidden-entry h3{margin:8px 0 12px;font-size:clamp(1.4rem,5vw,2.1rem);}
.forbidden-entry p{color:rgba(245,236,220,.82);}
.archive-locked-detail .chapter-title{filter:drop-shadow(0 0 16px rgba(180,80,40,.28));}

.archive-card .archive-locked-seal-img{height:150px;object-fit:contain;background:radial-gradient(circle,rgba(170,110,45,.18),rgba(8,7,7,.78));padding:18px;filter:drop-shadow(0 0 18px rgba(220,150,70,.25));}
.archive-card .archive-locked-seal-fallback{height:150px;border-radius:16px;border:1px solid rgba(220,170,90,.25);display:grid;place-items:center;font-size:58px;color:#d8b272;background:radial-gradient(circle,rgba(170,110,45,.18),rgba(8,7,7,.78));}
.archive-card:has(.archive-locked-seal-img),.archive-card:has(.archive-locked-seal-fallback){border-color:rgba(220,170,90,.25);background:linear-gradient(180deg,rgba(80,45,20,.12),rgba(255,255,255,.02));}
.forbidden-seal-image{width:112px;height:112px;margin:0 auto 16px;display:block;object-fit:contain;filter:drop-shadow(0 0 24px rgba(220,150,70,.35));}

/* Locked archive record detail: keep the seal compact, never stretch it like a banner */
.archive-locked-detail .chapter-title{font-size:clamp(1.7rem,6vw,3rem);}
.archive-locked-detail .forbidden-entry{max-width:620px;}
.archive-locked-detail .forbidden-seal-frame{width:min(320px,78vw);height:min(320px,78vw);max-height:320px;margin:0 auto 18px;display:grid;place-items:center;border-radius:24px;border:1px solid rgba(220,170,90,.28);background:radial-gradient(circle,rgba(170,110,45,.18),rgba(8,7,7,.82));box-shadow:inset 0 0 30px rgba(220,160,80,.08),0 0 28px rgba(0,0,0,.35);overflow:hidden;}
.archive-locked-detail .forbidden-seal-frame .forbidden-seal-image,
.archive-locked-detail img.forbidden-seal-image{width:min(280px,70vw)!important;height:auto!important;max-width:280px!important;max-height:280px!important;object-fit:contain!important;margin:0 auto!important;border:0!important;border-radius:0!important;background:transparent!important;padding:0!important;display:block!important;}
@media(max-width:640px){.archive-locked-detail .forbidden-seal-frame{width:min(260px,76vw);height:min(260px,76vw);} .archive-locked-detail .forbidden-seal-frame .forbidden-seal-image,.archive-locked-detail img.forbidden-seal-image{width:min(230px,68vw)!important;max-width:230px!important;max-height:230px!important;}}

/* Phase: archive terms, sounds, cinematic readability */
.archive-term-link{
  appearance:none;border:0;background:linear-gradient(180deg,rgba(220,170,90,.16),rgba(220,170,90,.06));
  color:#f1d18a;border-bottom:1px solid rgba(231,183,96,.55);border-radius:7px;padding:0 4px;margin:0 1px;
  font:inherit;cursor:pointer;text-shadow:0 0 12px rgba(230,170,80,.18);transition:background .18s ease, color .18s ease, box-shadow .18s ease;
}
.archive-term-link:hover{background:rgba(220,170,90,.24);color:#ffe3a6;box-shadow:0 0 18px rgba(220,170,90,.18)}
.archive-term-modal.hidden{display:none}
.archive-term-modal{position:fixed;inset:0;z-index:10020;display:grid;place-items:center;padding:18px}
.archive-term-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.72);backdrop-filter:blur(4px)}
.archive-term-card{position:relative;z-index:2;width:min(720px,94vw);display:grid;grid-template-columns:minmax(150px,230px) 1fr;gap:18px;padding:18px;border-radius:24px;border:1px solid rgba(220,170,90,.25);background:linear-gradient(145deg,rgba(22,18,15,.96),rgba(8,8,10,.98));box-shadow:0 24px 80px rgba(0,0,0,.55),inset 0 0 40px rgba(220,160,80,.05)}
.archive-term-close{position:absolute;right:12px;top:10px;width:34px;height:34px;border-radius:50%;border:1px solid rgba(255,255,255,.12);background:rgba(0,0,0,.35);color:#f4e5c7;font-size:24px;cursor:pointer}
.archive-term-media{min-height:170px;border-radius:18px;border:1px solid rgba(255,255,255,.08);background:radial-gradient(circle,rgba(170,110,45,.16),rgba(0,0,0,.55));display:grid;place-items:center;overflow:hidden}
.archive-term-media img{width:100%;height:100%;object-fit:cover;display:block}
.archive-term-seal{font-size:76px;color:#d8b272;filter:drop-shadow(0 0 18px rgba(220,160,80,.25))}
.archive-term-body h3{margin:2px 0 8px;font-size:clamp(1.4rem,4vw,2.25rem)}
.archive-term-body p{color:#d8c8aa;line-height:1.65;max-height:180px;overflow:auto;padding-right:6px}
body.term-modal-open{overflow:hidden}
body.cinematic-mode::after{z-index:1;background:rgba(0,0,0,.56)}
body.cinematic-mode .chapter-focus-shell{position:relative;z-index:3;background:rgba(20,16,14,.96);box-shadow:0 0 0 1px rgba(220,170,90,.08),0 22px 80px rgba(0,0,0,.62)}
body.cinematic-mode .story, body.cinematic-mode .chapter-title, body.cinematic-mode .chapter-summary, body.cinematic-mode .chapter-topline, body.cinematic-mode .chapter-reader-actions, body.cinematic-mode .chapter-nav{position:relative;z-index:4;filter:none!important;opacity:1!important;color:inherit}
@media(max-width:680px){.archive-term-card{grid-template-columns:1fr}.archive-term-media{min-height:150px}.archive-term-body p{max-height:210px}}


/* Archive entrance screen */
html.archive-intro-active, html.archive-intro-active body{overflow:hidden;}
.archive-intro-screen{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 50% 35%,rgba(75,43,23,.42),rgba(4,4,6,.94) 58%,#010102 100%);overflow:hidden;}
.archive-intro-screen::before{content:"";position:absolute;inset:-15%;background:radial-gradient(circle at 50% 45%,rgba(210,145,66,.12),transparent 28%),radial-gradient(circle at 20% 80%,rgba(120,78,35,.12),transparent 32%);animation:archiveIntroGlow 7s ease-in-out infinite alternate;}
.archive-intro-smoke{position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 30% 70%,rgba(130,120,100,.12),transparent 30%),radial-gradient(circle at 70% 40%,rgba(170,120,75,.09),transparent 34%);filter:blur(18px);opacity:.75;animation:archiveIntroSmoke 10s linear infinite alternate;}
.archive-intro-card{position:relative;max-width:560px;width:min(92vw,560px);padding:34px 24px 28px;text-align:center;border:1px solid rgba(220,170,90,.28);border-radius:28px;background:linear-gradient(180deg,rgba(18,14,12,.84),rgba(5,5,7,.88));box-shadow:0 26px 90px rgba(0,0,0,.65),0 0 44px rgba(205,132,55,.12);backdrop-filter:blur(10px);}
.archive-intro-pattern{position:relative;width:min(260px,62vw);height:min(150px,36vw);margin:0 auto 20px;border-radius:24px;border:1px solid rgba(220,170,90,.26);background:radial-gradient(circle at 50% 50%,rgba(210,146,70,.18),transparent 34%),repeating-linear-gradient(45deg,rgba(218,174,94,.14) 0 1px,transparent 1px 13px),repeating-linear-gradient(-45deg,rgba(218,174,94,.10) 0 1px,transparent 1px 17px),linear-gradient(180deg,rgba(16,12,10,.62),rgba(5,5,7,.78));box-shadow:inset 0 0 34px rgba(0,0,0,.52),0 0 38px rgba(205,132,55,.12);overflow:hidden;}
.archive-intro-pattern::before,.archive-intro-pattern::after{content:"";position:absolute;inset:18px;border:1px solid rgba(220,170,90,.18);border-radius:50%;transform:rotate(12deg);}
.archive-intro-pattern::after{inset:34px;border-radius:18px;transform:rotate(-12deg);}
.archive-intro-pattern span{position:absolute;left:50%;top:50%;width:90px;height:90px;transform:translate(-50%,-50%) rotate(45deg);border:1px solid rgba(220,170,90,.26);box-shadow:0 0 28px rgba(220,150,70,.10);}
.archive-intro-seal{width:min(260px,62vw);height:min(260px,62vw);max-width:260px;max-height:260px;object-fit:contain;display:block;margin:0 auto 20px;filter:drop-shadow(0 0 26px rgba(220,150,70,.35));}
.archive-intro-seal-fallback{width:min(220px,58vw);height:min(220px,58vw);margin:0 auto 20px;border-radius:50%;display:grid;place-items:center;border:1px solid rgba(220,170,90,.45);color:#e0b878;font-size:92px;background:radial-gradient(circle,rgba(170,110,45,.18),rgba(8,7,7,.78));box-shadow:0 0 32px rgba(220,150,70,.22), inset 0 0 34px rgba(0,0,0,.45);}
.archive-intro-card h1{font-size:clamp(34px,8vw,64px);margin:6px 0 12px;letter-spacing:.08em;text-transform:uppercase;}
.archive-intro-card p{color:rgba(238,228,207,.78);font-size:1.02rem;line-height:1.6;}
.archive-intro-open{margin-top:18px;min-width:210px;justify-content:center;}
.archive-intro-screen.is-leaving{animation:archiveIntroLeave .52s ease forwards;}
@keyframes archiveIntroLeave{to{opacity:0;transform:scale(1.02);visibility:hidden;}}
@keyframes archiveIntroGlow{from{transform:scale(1);opacity:.78;}to{transform:scale(1.08);opacity:1;}}
@keyframes archiveIntroSmoke{from{transform:translate3d(-2%,2%,0) scale(1.04);}to{transform:translate3d(2%,-2%,0) scale(1.12);}}

/* Related archive records */
.archive-related-block{margin-top:28px;padding-top:22px;border-top:1px solid rgba(220,170,90,.18)}
.archive-related-block h3{margin:0;color:#f2d7a0}
.archive-related-grid{margin-top:14px}
.admin-form select[multiple]{min-height:190px;background:rgba(10,8,7,.75);color:#eadcc1;border:1px solid rgba(220,170,90,.22);border-radius:14px;padding:10px;width:100%;outline:none}
.admin-form select[multiple] option{padding:6px 8px;border-radius:8px}
.admin-form select[multiple] option:checked{background:rgba(202,142,70,.45);color:#fff0cf}

.secret-lines-editor{display:grid;gap:10px}.secret-line-row{display:grid;grid-template-columns:1.2fr .8fr;gap:10px}.archive-secret-lines{margin-top:22px;padding:18px;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.03)}.archive-secret-line{margin:8px 0;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.04)}.archive-secret-line.locked{opacity:.65;font-style:italic}
@media(max-width:700px){.secret-line-row{grid-template-columns:1fr}}

.reader-music-box {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.reader-audio-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

/* Исправление расположения кнопок в блоке "Содержание" */
.sidebar-head {
  flex-wrap: wrap;
  align-items: flex-start;
}
.sidebar-head h2 {
  margin-right: 8px;
}
.sidebar-head .book-switcher {
  flex: 1 1 180px;
  min-width: 0;
  margin: 0;
}
.sidebar-head .inline-tools {
  flex: 0 0 auto;
  position: static !important;
  transform: none !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
}
.sidebar-pin,
.sidebar-close {
  position: static !important;
  transform: none !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .sidebar-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .sidebar-head .book-switcher,
  .sidebar-head .inline-tools {
    width: 100%;
  }
  .sidebar-head .inline-tools {
    justify-content: flex-start;
  }
}

/* ===== Book landing page + audio upload ===== */
.upload-stack{display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.book-landing-page{min-height:100vh;overflow-x:hidden;background:var(--bg);color:var(--text)}
.book-landing-hero{position:relative;min-height:76vh;background-size:cover;background-position:center center;background-repeat:no-repeat;display:flex;align-items:center;padding:56px 20px}
.book-landing-overlay{position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,8,8,.94),rgba(10,8,8,.78),rgba(10,8,8,.35)),radial-gradient(circle at 20% 30%,rgba(217,177,111,.16),transparent 42%)}
.book-landing-inner{position:relative;z-index:2;max-width:1180px;margin:0 auto;display:grid;grid-template-columns:minmax(220px,340px) 1fr;gap:34px;align-items:center;width:100%}
.book-landing-cover{min-height:440px;border:1px solid var(--line);border-radius:28px;overflow:hidden;background:rgba(255,255,255,.045);box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center}
.book-landing-cover img{width:100%;height:100%;object-fit:cover;display:block}
.book-landing-cover span{font-size:120px;color:var(--gold);text-shadow:0 0 30px rgba(217,177,111,.35)}
.book-landing-info{display:grid;gap:16px;max-width:760px}
.book-landing-info h1{font-size:clamp(42px,7vw,86px);line-height:.95;margin:0;color:#fff3df;text-shadow:0 0 45px rgba(0,0,0,.85)}
.book-landing-info .description{font-size:17px;line-height:1.75;color:var(--muted);max-width:780px}
.book-landing-audio-box{display:grid;gap:8px;max-width:520px;margin-top:4px}
.book-landing-audio-box audio:not(.reader-audio-native){width:100%;filter:sepia(.25) saturate(.9)}
.book-landing-main{position:relative;z-index:2;width:100%;max-width:none;margin:0;padding:0 0 70px}
.book-landing-main .admin-card{width:100%;border-left:0;border-right:0;border-radius:24px 24px 0 0;box-sizing:border-box}
.book-landing-chapters{max-height:none;overflow:visible;width:100%}
.book-landing-chapters .chapter-link{width:100%;box-sizing:border-box}
@media (max-width: 820px){.book-landing-inner{grid-template-columns:1fr}.book-landing-cover{min-height:300px;max-width:320px}.upload-stack{align-items:stretch}.upload-inline{width:100%}.book-landing-hero{padding-top:34px}}


/* Fix book landing cover/background on different screens */
.book-landing-page .texture{background-repeat:no-repeat;background-size:cover;}
@media (max-width: 820px){
  .book-landing-main .admin-card{border-radius:22px 22px 0 0;padding-left:18px;padding-right:18px;}
  .book-landing-hero{background-size:cover;background-repeat:no-repeat;background-position:center top;}
}

/* Красивее музыкальные плееры книги и главы */
.reader-music-box,
.book-landing-audio-box {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(217,177,111,.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(217,177,111,.16), transparent 38%),
    linear-gradient(135deg, rgba(31,24,20,.94), rgba(10,9,9,.88));
  box-shadow: inset 0 0 28px rgba(217,177,111,.04), 0 14px 38px rgba(0,0,0,.28);
}
.reader-music-box::before,
.book-landing-audio-box::before {
  content: "Музыка";
  display: block;
  margin-bottom: 8px;
  color: #f0d39a;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.book-landing-audio-box audio:not(.reader-audio-native) {
  width: 100%;
  height: 38px;
  border-radius: 999px;
  background: rgba(0,0,0,.36);
  box-shadow: 0 0 0 1px rgba(217,177,111,.12);
  filter: sepia(.18) saturate(.85) brightness(.92);
}
.reader-music-box .btn,
.book-landing-audio-box .btn,
.custom-audio-toggle {
  border-color: rgba(217,177,111,.32);
  background: linear-gradient(135deg, rgba(217,177,111,.16), rgba(255,255,255,.035));
  color: #ffe8bd;
}
.reader-music-box small,
.book-landing-audio-box small { color: rgba(239,231,219,.72); }

.custom-audio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.custom-audio-toggle {
  flex: 0 0 auto;
  white-space: nowrap;
}
.custom-audio-progress {
  flex: 1 1 280px;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(217,177,111,.22);
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  box-shadow: inset 0 0 16px rgba(0,0,0,.22);
}
.custom-audio-progress input[type=range] {
  --audio-progress: 0%;
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 5px;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg,
    #d9b16f 0%,
    #d9b16f var(--audio-progress),
    rgba(239,231,219,.28) var(--audio-progress),
    rgba(239,231,219,.28) 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.55);
  cursor: pointer;
}
.custom-audio-progress input[type=range]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: transparent;
}
.custom-audio-progress input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7.5px;
  border: 2px solid #f5d9a5;
  border-radius: 50%;
  background: #c99b52;
  box-shadow: 0 0 0 4px rgba(217,177,111,.12), 0 3px 10px rgba(0,0,0,.55);
}
.custom-audio-progress input[type=range]::-moz-range-track {
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(239,231,219,.28);
}
.custom-audio-progress input[type=range]::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: #d9b16f;
}
.custom-audio-progress input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #f5d9a5;
  border-radius: 50%;
  background: #c99b52;
  box-shadow: 0 0 0 4px rgba(217,177,111,.12), 0 3px 10px rgba(0,0,0,.55);
}
.custom-audio-progress input[type=range]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px rgba(217,177,111,.25), 0 3px 10px rgba(0,0,0,.55);
}
.custom-audio-time {
  min-width: 88px;
  white-space: nowrap;
  text-align: right;
  font-size: 12px;
  color: rgba(239,231,219,.72);
  font-variant-numeric: tabular-nums;
}
[data-audio-player].is-playing [data-audio-toggle] {
  border-color: rgba(231,205,151,.54);
  background: rgba(164,126,67,.68);
}
@media (max-width: 720px) {
  .custom-audio-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .custom-audio-progress {
    min-width: 0;
    width: 100%;
  }
  .custom-audio-time {
    min-width: 74px;
    font-size: 11px;
  }
}

/* Скрытых строк теперь может быть сколько угодно */
.secret-lines-editor { display: grid; gap: 10px; }
.secret-line-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(160px, .8fr) auto; gap: 10px; align-items: center; }
.secret-line-remove { min-width: 42px; padding-left: 10px; padding-right: 10px; }
.secret-line-add { margin-top: 10px; width: max-content; }
.archive-secret-line small { display: block; margin-top: 5px; color: rgba(217,177,111,.78); font-size: 13px; font-style: normal; }
.archive-secret-line p { margin: 0; }
.archive-unlock-item strong { color: #ffe2aa; }
@media(max-width:700px){ .secret-line-row{grid-template-columns:1fr;} .secret-line-add{width:100%;} }

/* Кабинет читателя: открытия и последние главы */
.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.account-card-head h2 { margin-bottom: 6px; }
.account-toggle { flex: 0 0 auto; }
.unlock-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}
.unlock-stats span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(217,177,111,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: rgba(239,231,219,.78);
  font-size: 14px;
}
.unlock-stats strong { color: #ffe2aa; }
.account-list {
  display: grid;
  gap: 10px;
}
.account-list.is-collapsed {
  display: none;
}
.account-item {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(217,177,111,.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  color: #efe7db;
  text-decoration: none;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.account-item:hover {
  border-color: rgba(217,177,111,.34);
  background: linear-gradient(135deg, rgba(217,177,111,.09), rgba(255,255,255,.025));
}
.account-item strong {
  display: block;
  color: #fff2d7;
  font-size: 18px;
  line-height: 1.25;
}
.account-item small {
  display: block;
  color: rgba(239,231,219,.68);
  font-size: 13px;
}
.account-item-kicker {
  display: block;
  color: #d9b16f;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.archive-unlock-item {
  position: relative;
  padding-left: 42px;
}
.archive-unlock-item::before {
  content: "✦";
  position: absolute;
  left: 15px;
  top: 16px;
  color: #d9b16f;
  text-shadow: 0 0 14px rgba(217,177,111,.45);
}
.progress-item {
  grid-template-columns: 1fr;
}
.account-badge-link { position: relative; }
.account-alert-badge {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d9b16f;
  color: #160f0b;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 0 2px rgba(18,13,11,.95), 0 0 16px rgba(217,177,111,.45);
}
@media (max-width: 720px) {
  .account-card-head { flex-direction: column; }
  .account-toggle { width: 100%; }
  .account-item { padding: 13px 14px; }
}

/* Корреспонденция: письма, указы, свитки */
.inline-alert-badge {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  margin-left: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #d9b16f;
  color: #160f0b;
  font-size: 13px;
  font-weight: 900;
  vertical-align: middle;
  box-shadow: 0 0 18px rgba(217,177,111,.35);
}
.correspondence-item {
  position: relative;
  padding-left: 44px;
}
.correspondence-item::before {
  content: "✉";
  position: absolute;
  left: 15px;
  top: 16px;
  color: #d9b16f;
  text-shadow: 0 0 14px rgba(217,177,111,.45);
}
.correspondence-item.is-unread {
  border-color: rgba(217,177,111,.42);
  background: linear-gradient(135deg, rgba(217,177,111,.12), rgba(255,255,255,.035));
}
.correspondence-item.is-important::after {
  content: "важное";
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(217,177,111,.18);
  color: #ffe2aa;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.document-section-entry {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 0%, rgba(217,177,111,.18), transparent 42%),
    linear-gradient(135deg, rgba(38,28,20,.88), rgba(10,9,9,.82));
}
.document-seal-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 10px;
  border-radius: 50%;
  border: 1px solid rgba(217,177,111,.22);
  background: rgba(0,0,0,.22);
  font-size: 36px;
  box-shadow: inset 0 0 24px rgba(217,177,111,.08);
}
.document-card { position: relative; }
.document-card.locked { opacity: .78; }
.document-page .document-hero { min-height: 320px; }
.document-shell { max-width: 1100px; }
.document-detail-card { overflow: visible; }
.document-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.document-meta-grid div {
  padding: 12px 14px;
  border: 1px solid rgba(217,177,111,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
.document-meta-grid span {
  display: block;
  margin-bottom: 5px;
  color: rgba(239,231,219,.58);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.document-meta-grid strong { color: #ffe2aa; }
.document-pages {
  display: grid;
  gap: 22px;
  margin: 24px 0;
}
.document-page-frame {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(217,177,111,.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(217,177,111,.10), transparent 42%),
    rgba(255,255,255,.035);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.document-page-frame img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  cursor: zoom-in;
  background: rgba(0,0,0,.22);
}
.document-page-frame figcaption {
  margin-top: 9px;
  color: rgba(239,231,219,.62);
  font-size: 13px;
  text-align: center;
}
.document-transcript {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(217,177,111,.16);
}
@media(max-width:720px){
  .correspondence-item { padding-left: 38px; }
  .document-page-frame { padding: 9px; border-radius: 16px; }
  .document-meta-grid { grid-template-columns: 1fr; }
}

/* Admin sections: show only the selected menu tab */
.admin-main .tab-pane {
    display: none;
}
.admin-main .tab-pane.active {
    display: block;
}
.admin-tabs .tab-btn.active,
.admin-sidebar .btn.active {
    border-color: rgba(217,177,111,.85);
    background: rgba(217,177,111,.16);
    color: #fff;
}

/* Кабинет: явное разделение новых и прочитанных */
.account-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.account-filter-row .btn {
  min-height: 36px;
  padding: 8px 12px;
}
.account-filter-row .account-filter.is-active {
  border-color: rgba(217,177,111,.48);
  background: linear-gradient(135deg, rgba(217,177,111,.18), rgba(255,255,255,.04));
  color: #ffe2aa;
}
.account-new-count strong { color: #ffd58b; }
.account-item.is-unread {
  border-color: rgba(217,177,111,.50);
  background:
    radial-gradient(circle at 0% 0%, rgba(217,177,111,.18), transparent 34%),
    linear-gradient(135deg, rgba(217,177,111,.12), rgba(255,255,255,.035));
  box-shadow: 0 0 0 1px rgba(217,177,111,.08), 0 14px 34px rgba(0,0,0,.18);
}
.account-item.is-read {
  opacity: .82;
}
.account-state-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(217,177,111,.16);
  color: rgba(239,231,219,.68);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.account-item.is-unread .account-state-badge {
  background: rgba(217,177,111,.20);
  border-color: rgba(217,177,111,.34);
  color: #ffe2aa;
  box-shadow: 0 0 16px rgba(217,177,111,.20);
}
.account-item.is-unread .account-item-kicker,
.account-item.is-unread strong { color: #ffe2aa; }
.account-mark-read { margin-left: auto; }
@media (max-width: 720px) {
  .account-filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .account-mark-read { grid-column: 1 / -1; margin-left: 0; }
}

.category-card-links-box{border:1px solid rgba(202,167,90,.22);border-radius:16px;padding:12px;background:rgba(10,8,7,.28);display:grid;gap:10px}
.category-card-links-editor{display:grid;gap:8px}
.category-card-link-row{display:grid;grid-template-columns:minmax(180px,1.5fr) minmax(140px,1fr) 88px auto;gap:8px;align-items:center}
.category-card-link-row select,.category-card-link-row input{width:100%}
.archive-category-linked-block{margin-top:22px;padding-top:18px;border-top:1px solid rgba(202,167,90,.22)}
@media (max-width:760px){.category-card-link-row{grid-template-columns:1fr}.category-card-link-row .btn{width:100%}}

/* Interactive world map */
.world-map-page .archive-hero { padding-bottom: 24px; }
.world-map-shell { width: min(1400px, calc(100vw - 28px)); margin: 0 auto 48px; position: relative; z-index: 2; }
.world-map-card { border: 1px solid rgba(216, 178, 102, .22); border-radius: 24px; background: linear-gradient(180deg, rgba(24,20,16,.92), rgba(10,9,8,.96)); box-shadow: 0 28px 90px rgba(0,0,0,.45); overflow: hidden; }
.world-map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid rgba(216,178,102,.18); background: rgba(0,0,0,.22); }
.world-map-toolbar strong { display: block; color: #f1dfbd; letter-spacing: .02em; }
.world-map-toolbar small { display: block; color: rgba(239,222,188,.58); margin-top: 3px; }
.world-map-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.world-map-stage { position: relative; height: min(78vh, 820px); min-height: 460px; background: radial-gradient(circle at center, rgba(90,65,36,.25), rgba(5,4,3,.95)); touch-action: none; overflow: hidden; isolation: isolate; }
#worldMapCanvas { display: block; width: 100%; height: 100%; cursor: grab; }
#worldMapCanvas:active { cursor: grabbing; }
.world-map-hint { position: absolute; left: 16px; bottom: 16px; max-width: min(520px, calc(100% - 32px)); padding: 10px 12px; border: 1px solid rgba(216,178,102,.24); border-radius: 14px; background: rgba(6,5,4,.76); color: rgba(245,230,197,.78); font-size: 13px; pointer-events: none; transition: opacity .25s ease; }
.world-map-tooltip { position: absolute; z-index: 4; width: 176px; padding: 10px 12px; border: 1px solid rgba(229,190,104,.34); border-radius: 14px; background: rgba(8,7,6,.92); box-shadow: 0 14px 38px rgba(0,0,0,.38); pointer-events: none; }
.world-map-tooltip strong { display: block; color: #f4dfad; font-size: 14px; }
.world-map-tooltip small { display: block; color: rgba(243,226,190,.62); font-size: 12px; margin-top: 4px; }
.world-map-entry .document-seal-icon { filter: drop-shadow(0 0 10px rgba(203,163,86,.22)); }
@media (max-width: 760px) {
  .world-map-shell { width: calc(100vw - 16px); }
  .world-map-toolbar { align-items: flex-start; flex-direction: column; }
  .world-map-actions { width: 100%; justify-content: space-between; }
  .world-map-stage { min-height: 520px; height: 72vh; }
}

.admin-map-picker{margin:16px 0 22px;border:1px solid rgba(216,178,102,.22);border-radius:18px;overflow:hidden;background:rgba(8,7,6,.45)}
.admin-map-picker.is-picking{box-shadow:0 0 0 2px rgba(236,201,120,.28),0 0 38px rgba(236,201,120,.12)}
.admin-map-picker-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(216,178,102,.16);background:rgba(0,0,0,.22)}
.admin-map-picker-head strong{display:block;color:#f1dfbd}.admin-map-picker-head small{display:block;margin-top:3px;color:rgba(239,222,188,.62)}
.admin-map-picker-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.admin-map-picker-stage{height:min(58vh,620px);min-height:420px;position:relative;background:radial-gradient(circle at center, rgba(90,65,36,.22), rgba(5,4,3,.95));touch-action:none}.admin-map-picker-stage canvas{display:block;width:100%;height:100%;cursor:crosshair}


/* Global unread notice */
.global-unread-notice{
  position:fixed;
  right:18px;
  bottom:22px;
  z-index:12000;
  width:min(390px,calc(100vw - 28px));
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:11px;
  padding:13px 14px;
  border:1px solid rgba(219,174,92,.48);
  border-radius:17px;
  color:#fff4df;
  background:linear-gradient(145deg,rgba(35,25,18,.97),rgba(10,9,10,.98));
  box-shadow:0 18px 55px rgba(0,0,0,.58),inset 0 0 24px rgba(216,158,75,.07);
  text-decoration:none;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.global-unread-notice:hover{
  transform:translateY(-2px);
  border-color:rgba(239,194,111,.76);
  background:linear-gradient(145deg,rgba(48,33,22,.98),rgba(14,11,11,.99));
}
.global-unread-notice.is-entering{animation:globalUnreadNoticeIn .32s ease both;}
.global-unread-notice-dot{
  width:11px;
  height:11px;
  border-radius:50%;
  background:#e6aa51;
  box-shadow:0 0 0 5px rgba(230,170,81,.12),0 0 18px rgba(230,170,81,.62);
  animation:globalUnreadPulse 1.8s ease-in-out infinite;
}
.global-unread-notice-copy{display:grid;gap:3px;min-width:0;}
.global-unread-notice-copy strong{font-size:15px;line-height:1.25;color:#fff0d3;}
.global-unread-notice-copy small{font-size:12px;line-height:1.35;color:rgba(236,222,198,.72);white-space:normal;}
.global-unread-notice-count{
  min-width:31px;
  height:31px;
  padding:0 8px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-size:13px;
  font-weight:800;
  color:#1b1208;
  background:#d9a250;
  box-shadow:0 5px 16px rgba(0,0,0,.28);
}
@keyframes globalUnreadNoticeIn{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
@keyframes globalUnreadPulse{0%,100%{opacity:.8;transform:scale(.9)}50%{opacity:1;transform:scale(1.08)}}

/* Compact descriptions in archive and book grids */
.archive-grid .archive-card > p,
.archive-grid .archive-card .archive-card-summary,
.book-card-body .book-card-summary,
.book-card-body > p{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:5;
  overflow:hidden;
  max-height:7.75em;
  text-overflow:ellipsis;
}

@media(max-width:700px){
  .global-unread-notice{
    right:12px;
    bottom:76px;
    width:calc(100vw - 24px);
    padding:12px 13px;
    border-radius:15px;
  }
  .global-unread-notice-copy strong{font-size:14px;}
  .global-unread-notice-copy small{font-size:11px;}
  .archive-grid .archive-card > p,
  .archive-grid .archive-card .archive-card-summary,
  .book-card-body .book-card-summary,
  .book-card-body > p{
    -webkit-line-clamp:4;
    max-height:6.2em;
  }
}

/* Map discovery: search, filters, preview and direct links */
.world-map-controls{
  display:grid;
  grid-template-columns:minmax(260px,420px) minmax(0,1fr);
  gap:14px;
  align-items:end;
  padding:14px 16px;
  border-bottom:1px solid rgba(216,178,102,.16);
  background:rgba(6,5,4,.34);
}
.world-map-search{position:relative;display:grid;gap:6px;z-index:8}
.world-map-search label{font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:rgba(239,222,188,.66)}
.world-map-search input{
  width:100%;
  min-height:44px;
  padding:10px 13px;
  border:1px solid rgba(216,178,102,.28);
  border-radius:13px;
  color:#f6e7c9;
  background:rgba(0,0,0,.34);
  outline:none;
}
.world-map-search input:focus{border-color:rgba(236,201,120,.68);box-shadow:0 0 0 3px rgba(236,201,120,.10)}
.world-map-search-results{
  position:absolute;
  top:calc(100% + 7px);
  left:0;
  right:0;
  max-height:340px;
  overflow:auto;
  border:1px solid rgba(216,178,102,.28);
  border-radius:14px;
  background:rgba(9,8,7,.98);
  box-shadow:0 20px 55px rgba(0,0,0,.55);
}
.world-map-search-results button{
  width:100%;
  display:grid;
  gap:3px;
  padding:11px 13px;
  border:0;
  border-bottom:1px solid rgba(216,178,102,.10);
  color:#f2dfbb;
  text-align:left;
  background:transparent;
  cursor:pointer;
}
.world-map-search-results button:last-child{border-bottom:0}
.world-map-search-results button:hover,.world-map-search-results button:focus{background:rgba(216,178,102,.11)}
.world-map-search-results button strong{font-size:14px}
.world-map-search-results button small{color:rgba(239,222,188,.58)}
.world-map-search-empty{padding:13px;color:rgba(239,222,188,.58)}
.world-map-filters{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.world-map-filter{
  min-height:36px;
  padding:7px 11px;
  border:1px solid rgba(216,178,102,.20);
  border-radius:999px;
  color:rgba(239,222,188,.62);
  background:rgba(255,255,255,.025);
  cursor:pointer;
  transition:.18s ease;
}
.world-map-filter:hover{border-color:rgba(216,178,102,.42);color:#f3dfb8}
.world-map-filter.is-active{color:#22170b;background:#d7a75d;border-color:#e5bd78;box-shadow:0 7px 18px rgba(0,0,0,.24)}
.world-map-preview{
  position:absolute;
  right:16px;
  top:16px;
  z-index:7;
  width:min(390px,calc(100% - 32px));
  max-height:calc(100% - 32px);
  overflow:auto;
  border:1px solid rgba(229,190,104,.38);
  border-radius:20px;
  color:#f5e7cc;
  background:linear-gradient(155deg,rgba(28,21,15,.97),rgba(8,7,6,.98));
  box-shadow:0 24px 70px rgba(0,0,0,.58);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.world-map-preview.is-opening{animation:worldMapPreviewIn .28s ease both}
.world-map-preview-close{
  position:absolute;
  right:10px;
  top:10px;
  z-index:2;
  width:34px;
  height:34px;
  border:1px solid rgba(255,255,255,.15);
  border-radius:50%;
  color:#f6e7c9;
  background:rgba(7,6,5,.74);
  font-size:23px;
  line-height:1;
  cursor:pointer;
}
.world-map-preview>img{display:block;width:100%;height:190px;object-fit:cover;border-radius:19px 19px 0 0}
.world-map-preview-body{display:grid;gap:10px;padding:18px}
.world-map-preview-type{font-size:11px;font-weight:900;letter-spacing:.13em;text-transform:uppercase;color:#d9ad67}
.world-map-preview h2{margin:0;padding-right:34px;font-size:25px;line-height:1.12;color:#f8e6c4}
.world-map-preview p{margin:0;color:rgba(241,227,201,.74);line-height:1.55;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:7;overflow:hidden}

.world-map-preview-media-notice{
  padding:9px 11px;
  border:1px solid rgba(224,177,82,.58);
  border-radius:12px;
  color:#f4d99b;
  background:rgba(5,4,3,.92);
  box-shadow:0 0 0 rgba(0,0,0,.95), inset 0 0 0 rgba(217,165,67,0);
  font-size:12px;
  font-weight:800;
  line-height:1.35;
  letter-spacing:.02em;
  text-align:center;
  animation:worldMapMediaNoticePulse 2.4s ease-in-out infinite;
}
@keyframes worldMapMediaNoticePulse{
  0%,100%{border-color:rgba(224,177,82,.34);color:rgba(244,217,155,.72);box-shadow:0 0 15px rgba(0,0,0,.92),inset 0 0 10px rgba(0,0,0,.72)}
  50%{border-color:rgba(239,194,96,.88);color:#ffe8ad;box-shadow:0 0 20px rgba(211,155,56,.34),inset 0 0 18px rgba(211,155,56,.08)}
}
@media (prefers-reduced-motion: reduce){.world-map-preview-media-notice{animation:none}}
.world-map-preview-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:2px}
.world-map-preview-actions .btn{flex:1 1 150px;text-align:center}
.world-map-copy-status{min-height:16px;color:rgba(239,222,188,.58);overflow-wrap:anywhere}
@keyframes worldMapPreviewIn{from{opacity:0;transform:translateY(-10px) scale(.985)}to{opacity:1;transform:none}}

@media(max-width:900px){
  .world-map-controls{grid-template-columns:1fr;align-items:stretch}
  .world-map-filters{justify-content:flex-start}
}
@media(max-width:700px){
  .world-map-controls{padding:12px}
  .world-map-filter{font-size:12px;min-height:34px;padding:6px 9px}
  .world-map-preview{left:10px;right:10px;top:auto;bottom:10px;width:auto;max-height:min(62%,460px)}
  .world-map-preview>img{height:145px}
  .world-map-preview-body{padding:15px}
  .world-map-preview h2{font-size:21px}
  .world-map-hint{bottom:12px}
}

/* Map borders and region editor */
.world-map-actions [data-map-regions-toggle].is-active{
  color:#22170b;
  background:#d7a75d;
  border-color:#e5bd78;
}
.admin-region-editor{
  margin:16px 0 24px;
  overflow:hidden;
  border:1px solid rgba(216,178,102,.24);
  border-radius:18px;
  background:rgba(8,7,6,.46);
}
.admin-region-editor-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  border-bottom:1px solid rgba(216,178,102,.16);
  background:rgba(0,0,0,.22);
}
.admin-region-editor-head strong{display:block;color:#f1dfbd}
.admin-region-editor-head small{display:block;margin-top:3px;color:rgba(239,222,188,.62)}
.admin-region-editor-actions,.admin-region-tools{display:flex;gap:8px;flex-wrap:wrap}
.admin-region-tools{
  padding:10px 12px;
  border-bottom:1px solid rgba(216,178,102,.13);
  background:rgba(0,0,0,.12);
}
.admin-region-tools .is-active{
  color:#22170b;
  background:#d7a75d;
  border-color:#e5bd78;
}
.admin-region-editor-stage{
  position:relative;
  height:min(62vh,660px);
  min-height:440px;
  background:radial-gradient(circle at center,rgba(90,65,36,.22),rgba(5,4,3,.95));
  touch-action:none;
}
.admin-region-editor-stage canvas{display:block;width:100%;height:100%;cursor:crosshair}
.admin-region-help{padding:0 14px 12px}
.map-region-form{
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}
.map-region-form.is-region-active{
  border-color:rgba(229,190,104,.46);
  box-shadow:0 0 0 2px rgba(229,190,104,.12);
  background:rgba(216,178,102,.035);
}
.map-region-form input[type="color"]{
  width:100%;
  min-height:44px;
  padding:4px;
  border:1px solid rgba(216,178,102,.22);
  border-radius:12px;
  background:rgba(0,0,0,.24);
}
.region-form-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.region-point-count{
  display:inline-flex;
  min-height:34px;
  align-items:center;
  padding:6px 10px;
  border:1px solid rgba(216,178,102,.18);
  border-radius:999px;
  color:rgba(239,222,188,.68);
  background:rgba(0,0,0,.18);
}
.map-region-list{display:grid;gap:12px}
.map-region-item{
  padding:14px;
  border:1px solid rgba(216,178,102,.16);
  border-radius:16px;
  background:rgba(255,255,255,.018);
}
.map-region-item-head{display:flex;align-items:center;gap:11px}
.map-region-item-head strong,.map-region-item-head small{display:block}
.map-region-item-head small{margin-top:3px;color:rgba(239,222,188,.58)}
.map-region-color{
  width:18px;
  height:42px;
  flex:0 0 18px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:999px;
  background:var(--region-color,#c89b55);
  box-shadow:0 0 18px rgba(216,178,102,.16);
}
.map-region-item details{margin-top:12px}

@media(max-width:700px){
  .admin-region-editor-head{align-items:flex-start;flex-direction:column}
  .admin-region-editor-actions{width:100%;justify-content:space-between}
  .admin-region-tools .btn{flex:1 1 140px}
  .admin-region-editor-stage{min-height:500px;height:68vh}
}


/* Map distance ruler */
.world-map-actions [data-map-measure-toggle].is-active{
  color:#22170b;
  background:#d7a75d;
  border-color:#e5bd78;
}
.world-map-measure-status{
  position:absolute;
  left:16px;
  top:16px;
  z-index:6;
  max-width:min(390px,calc(100% - 32px));
  padding:10px 13px;
  border:1px solid rgba(229,190,104,.38);
  border-radius:14px;
  color:#f5e7cc;
  background:rgba(8,7,6,.90);
  box-shadow:0 14px 38px rgba(0,0,0,.36);
  pointer-events:none;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.world-map-measure-status strong,.world-map-measure-status small{display:block}
.world-map-measure-status strong{color:#ffe2a3;font-size:15px}
.world-map-measure-status small{margin-top:3px;color:rgba(241,227,201,.66);font-size:12px;line-height:1.35}
.map-distance-scale-form{
  margin:16px 0 20px;
  padding:16px;
  border:1px solid rgba(216,178,102,.18);
  border-radius:16px;
  background:rgba(0,0,0,.18);
}
.map-distance-scale-summary{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  padding:12px 14px;
  border:1px solid rgba(216,178,102,.16);
  border-radius:13px;
  background:rgba(255,255,255,.025);
}
.map-distance-scale-summary strong{color:#f1dfbd}
.map-distance-scale-summary small{color:rgba(239,222,188,.62)}
@media(max-width:700px){
  .world-map-measure-status{left:10px;top:10px;max-width:calc(100% - 20px)}
}


/* ===== Reader update: completed books, collapsed descriptions, mobile desktop prompt ===== */
.book-card { position: relative; transition: opacity .25s ease, border-color .25s ease, background .25s ease; }
.book-card.is-read {
  border-color: rgba(185,155,105,.18);
  background: rgba(10,10,10,.84);
}
.book-card.is-read .book-cover img { filter: brightness(.48) saturate(.58); }
.book-card.is-read .book-cover > span:not(.book-read-badge) { opacity: .42; }
.book-card.is-read .book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.48));
  pointer-events: none;
}
.book-card.is-read .book-card-body { opacity: .78; }
.book-cover { position: relative; }
.book-cover > .book-read-badge {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  left: auto;
  bottom: auto;
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  max-width: calc(100% - 28px);
  height: auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(226,194,137,.38);
  border-radius: 999px;
  background: rgba(10,9,8,.78);
  color: #f0d39a;
  box-shadow: 0 8px 24px rgba(0,0,0,.34);
  backdrop-filter: blur(9px);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.book-cover > .book-read-badge::before { content: "✓"; font-size: 16px; line-height: 1; }

.collapsible-description { display: grid; gap: 8px; max-width: 780px; }
.collapsible-description-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-height: 5.35em;
}
.collapsible-description.is-expanded .collapsible-description-text {
  display: block;
  max-height: none;
  overflow: visible;
  -webkit-line-clamp: initial;
}
.description-toggle {
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d9b16f;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.description-toggle:hover { color: #ffe4b0; }

.completed-books-grid { display: grid; gap: 12px; }
.completed-book-item {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(217,177,111,.16);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
}
.completed-book-cover {
  width: 72px;
  height: 94px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.28);
  color: #d9b16f;
  font-size: 30px;
}
.completed-book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(.72); }
.completed-book-copy { min-width: 0; display: grid; gap: 5px; }
.completed-book-copy strong { color: #fff0d3; font-size: 18px; }
.completed-book-copy small { color: rgba(239,231,219,.62); }
.completed-book-actions { display: grid; gap: 8px; justify-items: stretch; }
.completed-book-actions form { margin: 0; }
.completed-book-actions .btn { width: 100%; }

.visit-stats-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.visit-stat-card small { display: block; }
.visit-stat-card span { display: block; margin-top: 5px; color: rgba(239,231,219,.62); font-size: 12px; }
.hidden-book-access-list { display: grid; gap: 10px; }
.hidden-book-access-item {
  display: grid;
  grid-template-columns: minmax(160px,1fr) minmax(160px,1fr) minmax(150px,.8fr);
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(217,177,111,.14);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
}
.hidden-book-access-item strong, .hidden-book-access-item small { display: block; }
.hidden-book-access-item small { margin-top: 4px; color: rgba(239,231,219,.62); }

.desktop-mode-prompt {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.desktop-mode-prompt.is-visible { opacity: 1; visibility: visible; }
.desktop-mode-prompt-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); }
.desktop-mode-prompt-card {
  position: relative;
  z-index: 1;
  width: min(520px,100%);
  padding: 26px 22px 22px;
  border: 1px solid rgba(217,177,111,.28);
  border-radius: 24px;
  background: radial-gradient(circle at 25% 0%, rgba(217,177,111,.14), transparent 42%), linear-gradient(145deg,#1a1512,#090808);
  box-shadow: 0 28px 90px rgba(0,0,0,.64);
  color: #efe7db;
}
.desktop-mode-prompt-card h2 { margin: 6px 0 10px; color: #fff0d3; font-size: 27px; }
.desktop-mode-prompt-card > p { margin: 0 0 16px; color: rgba(239,231,219,.72); line-height: 1.55; }
.desktop-mode-prompt-mark { color: #d9b16f; font-size: 30px; }
.desktop-mode-prompt-x { position: absolute; right: 13px; top: 11px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.05); color: #fff; font-size: 24px; cursor: pointer; }
.desktop-mode-instruction { display: grid; gap: 4px; margin: 9px 0; padding: 11px 13px; border: 1px solid rgba(217,177,111,.14); border-radius: 14px; background: rgba(255,255,255,.025); }
.desktop-mode-instruction strong { color: #e7c990; }
.desktop-mode-instruction span { color: rgba(239,231,219,.72); font-size: 13px; line-height: 1.45; }
.desktop-mode-prompt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }

@media (max-width: 760px) {
  .completed-book-item { grid-template-columns: 58px minmax(0,1fr); }
  .completed-book-cover { width: 58px; height: 78px; }
  .completed-book-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .visit-stats-grid { grid-template-columns: 1fr; }
  .hidden-book-access-item { grid-template-columns: 1fr; }
  .desktop-mode-prompt-actions { grid-template-columns: 1fr; }
  .desktop-mode-prompt-card { padding: 24px 17px 18px; border-radius: 20px; }
  .desktop-mode-prompt-card h2 { font-size: 23px; padding-right: 34px; }
}


/* ===== Update 13: bookmarks, account sections, map legend and entrance ===== */
.chapter-link { position: relative; padding-right: 42px; }
.chapter-bookmark-indicator {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 13px;
  height: 18px;
  display: block;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(180deg, #f1c77c, #b77a2f);
  box-shadow: 0 0 0 1px rgba(255,226,170,.28), 0 0 14px rgba(217,177,111,.34);
  clip-path: polygon(0 0,100% 0,100% 100%,50% 72%,0 100%);
}
.chapter-bookmark-indicator[hidden] { display: none !important; }

.account-section-nav-card { display: grid; gap: 16px; }
.account-section-nav-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.account-section-nav-head h2 { margin-bottom: 6px; }
.account-world-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.account-section-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 10px;
}
.account-section-tab {
  position: relative;
  min-height: 52px;
  padding: 11px 15px;
  border: 1px solid rgba(217,177,111,.18);
  border-radius: 15px;
  color: rgba(239,231,219,.76);
  background: linear-gradient(135deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.account-section-tab:hover {
  border-color: rgba(217,177,111,.38);
  color: #ffe7bb;
  transform: translateY(-1px);
}
.account-section-tab.is-active {
  border-color: rgba(217,177,111,.62);
  color: #21160a;
  background: linear-gradient(135deg, #e0b56b, #b97d35);
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
}
.account-section-tab.has-unread:not(.is-active) {
  border-color: rgba(235,181,91,.56);
  color: #ffe0a4;
  box-shadow: 0 0 0 1px rgba(217,177,111,.08), 0 0 22px rgba(217,157,66,.16);
}
.account-section-alert {
  position: absolute;
  top: -8px;
  right: -7px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #17110c;
  background: #d9a250;
  color: #1c1208;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 0 18px rgba(230,170,81,.62);
  animation: globalUnreadPulse 1.8s ease-in-out infinite;
}
.account-section-alert[hidden] { display: none !important; }
[data-account-section][hidden] { display: none !important; }

.world-map-region-legend {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid rgba(216,178,102,.18);
  border-radius: 15px;
  background: rgba(0,0,0,.20);
}
.world-map-region-legend[hidden] { display: none !important; }
.world-map-region-legend-title {
  margin-right: 3px;
  color: rgba(239,222,188,.60);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.world-map-region-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(216,178,102,.16);
  border-radius: 999px;
  color: rgba(244,230,200,.78);
  background: rgba(255,255,255,.025);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: .18s ease;
}
.world-map-region-legend-item:hover,
.world-map-region-legend-item.is-active {
  border-color: rgba(229,190,104,.58);
  color: #ffe4ae;
  background: rgba(216,178,102,.11);
  box-shadow: 0 0 18px rgba(216,178,102,.10);
}
.world-map-region-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.32);
  background: var(--region-color,#c89b55);
  box-shadow: 0 0 10px rgba(216,178,102,.22);
}

.world-map-enter {
  position: fixed;
  inset: 0;
  z-index: 20000;
  width: 100%;
  border: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #f4efe5;
  background:
    radial-gradient(circle at 50% 42%, rgba(63,45,25,.34), rgba(0,0,0,.94) 68%),
    rgba(0,0,0,.96);
  font-family: Georgia,"Times New Roman",serif;
  cursor: pointer;
  transition: opacity .72s ease, visibility .72s ease;
}
.world-map-enter.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.world-map-enter-inner {
  max-width: 720px;
  text-align: center;
  text-shadow: 0 3px 24px #000;
  animation: galleryPulse 3.2s ease-in-out infinite;
}
.world-map-enter-mark {
  display: block;
  margin-bottom: 16px;
  color: #d8b777;
  font-size: 38px;
}
.world-map-enter-title {
  display: block;
  margin-bottom: 14px;
  color: #fff0d3;
  font-size: clamp(40px,7vw,90px);
  font-weight: 500;
  letter-spacing: .04em;
}
.world-map-enter-text {
  display: block;
  color: rgba(244,239,229,.72);
  font: 600 clamp(14px,2vw,20px)/1.5 Arial,sans-serif;
  letter-spacing: .05em;
}

@media (max-width: 760px) {
  .account-section-nav-head { flex-direction: column; }
  .account-world-links { width: 100%; justify-content: stretch; }
  .account-world-links .btn { flex: 1 1 140px; text-align: center; }
  .account-section-tabs { grid-template-columns: 1fr 1fr; }
  .world-map-region-legend { gap: 6px; padding: 9px; }
  .world-map-region-legend-title { flex-basis: 100%; margin-bottom: 2px; }
  .world-map-region-legend-item { font-size: 11px; padding: 6px 9px; }
}


/* ===== Update 14: admin quality-of-life ===== */
.admin-book-description {
  margin: 10px 0 4px;
  padding: 9px 11px;
  border: 1px solid rgba(217,177,111,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
}
.admin-book-description > summary {
  cursor: pointer;
  color: #d9b16f;
  font-size: 13px;
  user-select: none;
}
.admin-book-description > p {
  margin: 10px 0 2px;
  color: rgba(239,231,219,.78);
  line-height: 1.55;
}
.hidden-book-revoke-form { margin: 10px 0 0; }
.hidden-book-revoke-form .btn { width: 100%; }

.archive-card-search {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
}
.archive-card-search label {
  color: #e7c990;
  font-weight: 700;
}
.archive-card-search input[type="search"] {
  width: 100%;
}
.archive-admin-item[hidden] {
  display: none !important;
}


/* Admin panels: do not flash fully expanded before admin-ui.js initializes. */
.admin-bg.admin-panels-booting .tab-pane.active .admin-card {
  max-height: 64px;
  min-height: 64px;
  overflow: hidden;
  contain: layout paint;
}
.admin-bg.admin-panels-booting .tab-pane.active .admin-card > :not(h2):not(.admin-header-inline) { visibility: hidden; }
@media (max-width: 720px) {
  .admin-bg.admin-panels-booting .tab-pane.active .admin-card { max-height: 58px; min-height: 58px; }
}

/* ===== Update 15: compact admin panels + dual save ===== */
.admin-collapsible-card {
  padding: 0;
  overflow: hidden;
}
.admin-panel-toggle {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 0;
  background: linear-gradient(135deg, rgba(217,177,111,.07), rgba(255,255,255,.018));
  color: #f5ead7;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.admin-panel-toggle:hover {
  background: linear-gradient(135deg, rgba(217,177,111,.12), rgba(255,255,255,.03));
}
.admin-panel-chevron {
  flex: 0 0 auto;
  color: #d9b16f;
  font-size: 25px;
  line-height: 1;
  transition: transform .18s ease;
}
.admin-collapsible-card.is-open .admin-panel-chevron { transform: rotate(180deg); }
.admin-panel-body { padding: 20px 22px 22px; border-top: 1px solid rgba(217,177,111,.12); }
.admin-panel-body[hidden] { display: none !important; }
.admin-panel-original-title { display: none !important; }
.admin-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.full-span > .admin-save-actions { width: 100%; }
.admin-save-actions .btn { min-width: 190px; }
@media (max-width: 720px) {
  .admin-panel-toggle { min-height: 58px; padding: 16px 17px; font-size: 18px; }
  .admin-panel-body { padding: 16px 17px 18px; }
  .admin-save-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .admin-save-actions .btn { width: 100%; min-width: 0; }
}

/* Admin attention notifications: comments + feedback */
.admin-attention-host { position: relative; }
.admin-attention-badge {
  position: absolute;
  right: -7px;
  top: -8px;
  z-index: 8;
  width: 23px;
  min-width: 23px;
  height: 23px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #17110c;
  background: #d9a250;
  color: #1c1208;
  font-size: 14px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 0 18px rgba(230,170,81,.62);
  animation: globalUnreadPulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
.admin-sidebar .admin-attention-badge {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
.admin-tabs .admin-attention-badge {
  right: -7px;
  top: -8px;
}
.stats-grid .admin-attention-badge {
  right: 10px;
  top: 10px;
}
.feedback-item.is-unread-reply {
  border-color: rgba(217,162,80,.55);
  box-shadow: 0 0 0 1px rgba(217,162,80,.08), 0 0 24px rgba(217,162,80,.12);
}


/* ===== UPDATE 19: comment replies + archive navigation ===== */
.comment-admin-reply {
  position: relative;
  margin: 18px 0 4px 18px;
  padding: 13px 16px 14px 18px;
  border: 0;
  border-left: 3px solid #d9a250;
  border-radius: 0 14px 14px 0;
  background: linear-gradient(90deg, rgba(217,162,80,.13), rgba(217,162,80,.035) 68%, rgba(217,162,80,.012));
  box-shadow: inset 10px 0 22px rgba(217,162,80,.035);
}
.comment-admin-reply::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(225,174,93,.55);
  pointer-events: none;
}
.comment-admin-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(231,189,120,.34);
  border-radius: 999px;
  background: rgba(217,162,80,.08);
  color: #f0c77f;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(231,189,120,.24);
}
.comment-admin-label span {
  color: #ffd58b;
  font-size: .86rem;
  filter: drop-shadow(0 0 5px rgba(255,207,125,.35));
}
.comment-admin-reply p {
  margin: 10px 0 0;
  color: rgba(245,237,224,.93);
  line-height: 1.58;
}
.admin-comment-reply-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid rgba(217,177,111,.28);
  background: linear-gradient(135deg, rgba(217,177,111,.09), rgba(217,177,111,.025));
}
.admin-comment-reply-preview strong {
  color: #e7bd78;
  letter-spacing: .04em;
  text-shadow: 0 0 14px rgba(231,189,120,.2);
}
.admin-comment-reply-preview p { margin: 7px 0 0; }
@media (max-width: 620px) {
  .comment-admin-reply { margin-left: 8px; padding: 12px 13px 13px 14px; }
  .comment-admin-label { font-size: .68rem; }
}
.admin-comment-reply-form { margin: 14px 0 10px; }
.archive-nav-actions { display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; }
.archive-bottom-actions { margin: 4px 0 26px; padding-top: 4px; }
.archive-head-description, .archive-interactive-summary { line-height:1.7; }
.archive-interactive-summary p { margin:0; }
@media (max-width: 620px) {
  .archive-bottom-actions .btn, .archive-hero .archive-nav-actions .btn { flex:1 1 140px; }
}

/* === Tactical story layer / temporary archive cards === */
.tactics-help{border:1px solid rgba(216,178,102,.18);border-radius:14px;background:rgba(0,0,0,.18);overflow:hidden}
.tactics-help>summary{cursor:pointer;padding:14px 16px;color:#ead6aa;font-weight:700;list-style:none}
.tactics-help>summary::-webkit-details-marker{display:none}.tactics-help>summary:before{content:'▸';display:inline-block;margin-right:8px;color:#c8944d;transition:transform .18s ease}.tactics-help[open]>summary:before{transform:rotate(90deg)}
.tactics-help-body{padding:0 18px 16px;color:rgba(240,225,195,.78);line-height:1.65}.tactics-help-body p{margin:.45em 0}.tactics-help-body strong{color:#f1d79b}
.tactics-story-panel{display:grid;gap:12px}.tactics-story-top{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}.tactics-story-top>div{min-width:220px;flex:1}.tactics-story-top select{width:100%}
.tactics-chapter-menu{position:relative;min-width:min(100%,360px);flex:1;border:1px solid rgba(216,178,102,.18);border-radius:12px;background:rgba(8,7,6,.56)}
.tactics-chapter-menu>summary{cursor:pointer;padding:12px 14px;list-style:none;color:#e6d4b2}.tactics-chapter-menu>summary::-webkit-details-marker{display:none}
.tactics-chapter-list{display:grid;gap:5px;max-height:330px;overflow:auto;padding:8px;border-top:1px solid rgba(216,178,102,.14)}
.tactics-chapter-list button{appearance:none;border:1px solid rgba(216,178,102,.12);border-radius:9px;background:rgba(255,255,255,.025);color:rgba(244,230,203,.84);padding:9px 11px;text-align:left;cursor:pointer}
.tactics-chapter-list button:hover,.tactics-chapter-list button.is-active{border-color:rgba(216,178,102,.48);background:rgba(178,124,59,.16);color:#ffe1a2}
.tactics-story-state{margin:0}.admin-tactics-map{margin:14px 0 20px;border:1px solid rgba(216,178,102,.22);border-radius:18px;overflow:hidden;background:rgba(8,7,6,.45)}
.admin-tactics-map.is-picking{box-shadow:0 0 0 2px rgba(236,201,120,.28),0 0 38px rgba(236,201,120,.12)}
.admin-tactics-map-stage{height:min(64vh,680px);min-height:440px;position:relative;background:radial-gradient(circle at center,rgba(90,65,36,.22),rgba(5,4,3,.96));touch-action:none}
.admin-tactics-map-stage canvas{display:block;width:100%;height:100%;cursor:grab}.admin-tactics-map.is-picking .admin-tactics-map-stage canvas{cursor:crosshair}
.tactics-create-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 18px}.tactics-create-grid>.admin-card{margin:0;min-width:0}
.tactics-type-list{display:grid;gap:10px;margin-top:14px}.tactics-type-summary{display:grid;grid-template-columns:42px 1fr;grid-template-rows:auto auto;align-items:center;column-gap:10px;width:100%}.tactics-type-summary img{grid-row:1/3;width:38px;height:38px;object-fit:contain}.tactics-type-summary strong,.tactics-type-summary small{min-width:0}.tactics-type-summary small{color:rgba(238,219,183,.58)}
.tactics-object-item[hidden]{display:none!important}
.archive-temporary-box{border:1px solid rgba(216,178,102,.2);border-radius:14px;padding:13px 14px;background:rgba(133,87,35,.07)}.archive-temporary-toggle{font-weight:700;color:#f0d395}.archive-temporary-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:12px}.archive-temporary-fields[hidden]{display:none!important}.archive-temporary-fields select{width:100%}
.world-map-tactics-legend{position:absolute;left:14px;bottom:14px;z-index:9;display:grid;gap:7px;max-width:min(340px,calc(100% - 28px));padding:10px 12px;border:1px solid rgba(216,178,102,.28);border-radius:14px;background:rgba(7,6,5,.88);backdrop-filter:blur(10px);box-shadow:0 10px 28px rgba(0,0,0,.26);pointer-events:auto}
.world-map-tactics-legend[hidden]{display:none!important}.world-map-tactics-legend-title{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#d4ad68;font-weight:800}.world-map-tactics-legend-item{display:flex;align-items:center;gap:9px;color:#eadcbc;font-size:12px}.world-map-tactics-legend-item img{width:27px;height:27px;object-fit:contain;flex:0 0 27px}.world-map-tactics-legend-item span{line-height:1.25}
@media(max-width:980px){.tactics-create-grid{grid-template-columns:1fr}.archive-temporary-fields{grid-template-columns:1fr 1fr}.admin-tactics-map-stage{min-height:400px;height:58vh}}
@media(max-width:640px){.tactics-story-top{align-items:stretch}.tactics-story-top>div,.tactics-chapter-menu{min-width:100%}.archive-temporary-fields{grid-template-columns:1fr}.admin-tactics-map-stage{min-height:370px;height:54vh}.world-map-tactics-legend{left:9px;bottom:9px;padding:8px 10px}.world-map-tactics-legend-item{font-size:11px}.world-map-tactics-legend-item img{width:23px;height:23px;flex-basis:23px}}


/* === Tactical editor precision / PNG arrows === */
.tactics-transform-box{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:8px 10px;align-items:center}
.tactics-transform-box>label,.tactics-transform-box>small{grid-column:1/-1}
.tactics-transform-box input[type="range"]{width:100%;accent-color:#c9964d}
.tactics-transform-box input[type="number"]{width:100%}
.tactics-object-summary-main{display:flex;align-items:center;gap:9px;min-width:0;flex-wrap:wrap}
.tactics-object-type-badge{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:3px 9px;border:1px solid rgba(221,178,94,.34);border-radius:999px;background:rgba(171,111,42,.13);color:#e7bf79;font:700 11px/1.2 sans-serif;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
.tactics-object-actions{display:flex;gap:10px;flex-wrap:wrap}
.tactics-object-actions .btn{flex:1 1 180px}
@media(max-width:640px){
  .tactics-transform-box{grid-template-columns:minmax(0,1fr) 92px}
  .tactics-object-actions{display:grid;grid-template-columns:1fr}
}

/* Update 24: tactical editor object visibility state */
.tactics-object-story-badge{display:inline-flex;align-items:center;min-height:22px;padding:2px 8px;border:1px solid rgba(170,150,120,.18);border-radius:999px;background:rgba(255,255,255,.025);color:rgba(232,218,190,.48);font:700 10px/1.2 sans-serif;white-space:nowrap}
.tactics-object-story-badge.is-active{border-color:rgba(108,190,119,.30);background:rgba(76,150,87,.10);color:#bfe0bd}
.tactics-object-item.is-story-inactive>summary{opacity:.68}
.tactics-object-item.is-story-inactive[open]>summary{opacity:.92}

/* === Archive story image states === */
.archive-image-states-box{border:1px solid rgba(216,178,102,.18);border-radius:14px;padding:14px;background:rgba(8,7,6,.34);display:grid;gap:12px}
.archive-image-states-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}.archive-image-states-head>div{display:grid;gap:5px;flex:1;min-width:220px}.archive-image-states-head strong{color:#ead6aa}.archive-image-state-list{display:grid;gap:10px}.archive-image-state-row{display:grid;grid-template-columns:minmax(220px,1.3fr) minmax(180px,1fr) minmax(180px,1fr) auto;gap:10px;align-items:end;padding:12px;border:1px solid rgba(216,178,102,.12);border-radius:12px;background:rgba(255,255,255,.018)}.archive-image-state-row>div{min-width:0}.archive-image-state-remove{align-self:end;white-space:nowrap}
@media(max-width:800px){.archive-image-state-row{grid-template-columns:1fr}.archive-image-state-remove{width:100%}}

/* Update 26: tactical object sizing + arrow library */
.tactics-arrow-library-thumb{width:64px!important;height:36px!important;object-fit:contain!important;background:rgba(255,255,255,.04);border-radius:6px;padding:3px}
.tactics-arrow-library-list .tactics-type-summary{align-items:center}

/* Update 27: tactical placed objects grouped by start chapter */
.tactics-chapter-groups{display:grid;gap:12px}
.tactics-chapter-object-group{border:1px solid rgba(216,178,102,.18);border-radius:14px;background:rgba(7,6,5,.28);overflow:hidden}
.tactics-chapter-object-group[hidden]{display:none!important}
.tactics-chapter-object-summary{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 15px;cursor:pointer;list-style:none;background:rgba(255,255,255,.018);transition:background .18s ease,border-color .18s ease}
.tactics-chapter-object-summary::-webkit-details-marker{display:none}
.tactics-chapter-object-summary:before{content:'▸';flex:0 0 auto;color:#c8944d;font-weight:800;transition:transform .18s ease}
.tactics-chapter-object-group[open]>.tactics-chapter-object-summary:before{transform:rotate(90deg)}
.tactics-chapter-object-group[open]>.tactics-chapter-object-summary{background:rgba(178,124,59,.08)}
.tactics-chapter-object-group.is-selected-chapter{border-color:rgba(216,178,102,.46);box-shadow:0 0 0 1px rgba(216,178,102,.08)}
.tactics-chapter-object-title{display:grid;gap:3px;min-width:0;flex:1}
.tactics-chapter-object-title strong{color:#ead7ae;line-height:1.3}
.tactics-chapter-object-title small{color:rgba(238,219,183,.52)}
.tactics-chapter-object-counts{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.tactics-chapter-object-counts span{display:inline-flex;align-items:center;min-height:24px;padding:3px 8px;border:1px solid rgba(216,178,102,.18);border-radius:999px;background:rgba(255,255,255,.025);color:rgba(240,222,188,.68);font:700 10px/1.2 sans-serif;white-space:nowrap}
.tactics-chapter-object-list{display:grid;gap:10px;padding:10px;border-top:1px solid rgba(216,178,102,.12)}
@media(max-width:700px){.tactics-chapter-object-summary{align-items:flex-start;flex-wrap:wrap}.tactics-chapter-object-counts{width:100%;justify-content:flex-start;padding-left:22px}}

/* ===== Update 31: draggable tactics, archive AJAX notices, map marker crests ===== */
.admin-save-toast{
  position:fixed;
  left:50%;
  top:max(18px,env(safe-area-inset-top));
  z-index:50000;
  width:max-content;
  max-width:min(560px,calc(100vw - 28px));
  padding:13px 20px;
  border:1px solid rgba(230,190,106,.68);
  border-radius:15px;
  color:#fff0cf;
  background:linear-gradient(145deg,rgba(53,38,20,.98),rgba(17,13,9,.98));
  box-shadow:0 16px 60px rgba(0,0,0,.62),0 0 30px rgba(222,168,71,.16);
  font-weight:900;
  letter-spacing:.025em;
  text-align:center;
  opacity:0;
  transform:translate(-50%,-18px) scale(.97);
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
}
.admin-save-toast.is-visible{opacity:1;transform:translate(-50%,0) scale(1)}
.admin-save-toast.is-success{border-color:rgba(237,194,102,.86);animation:adminSaveGoldPulse 1s ease-in-out 2}
.admin-save-toast.is-error{border-color:rgba(221,85,72,.88);color:#ffe4df;background:linear-gradient(145deg,rgba(72,23,20,.98),rgba(24,10,9,.98));box-shadow:0 16px 60px rgba(0,0,0,.66),0 0 34px rgba(209,66,54,.22)}
@keyframes adminSaveGoldPulse{0%,100%{box-shadow:0 16px 60px rgba(0,0,0,.62),0 0 18px rgba(222,168,71,.12)}50%{box-shadow:0 16px 60px rgba(0,0,0,.62),0 0 38px rgba(236,183,78,.38)}}
.admin-form.is-ajax-saving{opacity:.82}
.admin-form.is-ajax-saving button[type="submit"]{cursor:wait}

.map-marker-crest-box{
  margin-top:4px;
  padding:14px;
  border:1px solid rgba(216,178,102,.22);
  border-radius:16px;
  background:rgba(0,0,0,.16);
}
.map-marker-crest-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.map-marker-crest-head strong{display:block;color:#f2ddb4}
.map-marker-crest-head small{display:block;margin-top:4px;max-width:760px;line-height:1.45}
.map-marker-crest-list{display:grid;gap:10px}
.map-marker-crest-row{display:grid;grid-template-columns:minmax(160px,1fr) minmax(180px,1.2fr) minmax(160px,1fr) minmax(160px,1fr) auto;gap:10px;align-items:end;padding:11px;border:1px solid rgba(216,178,102,.14);border-radius:14px;background:rgba(255,255,255,.018)}
.map-marker-crest-remove{align-self:end;white-space:nowrap}
@media(max-width:1100px){.map-marker-crest-row{grid-template-columns:1fr 1fr}.map-marker-crest-remove{grid-column:1/-1;justify-self:start}}
@media(max-width:650px){.map-marker-crest-head{flex-direction:column}.map-marker-crest-row{grid-template-columns:1fr}}

.world-map-preview-crest{
  position:absolute;
  left:8px;
  top:8px;
  z-index:4;
  width:68px;
  height:68px;
  display:grid;
  place-items:center;
  border:2px solid rgba(231,191,109,.78);
  border-radius:50%;
  background:radial-gradient(circle at 40% 34%,rgba(70,52,30,.98),rgba(13,10,8,.98) 72%);
  box-shadow:0 8px 24px rgba(0,0,0,.72),0 0 0 4px rgba(12,9,7,.62),0 0 22px rgba(218,165,74,.22);
  text-decoration:none;
  transform:translate(-10%,-10%) rotate(-2deg);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.world-map-preview-crest[hidden]{display:none!important}
.world-map-preview-crest:hover{transform:translate(-10%,-10%) rotate(0deg) scale(1.06);border-color:#f1c978;box-shadow:0 10px 28px rgba(0,0,0,.78),0 0 0 4px rgba(12,9,7,.68),0 0 28px rgba(229,177,80,.34)}
.world-map-preview-crest img{display:block;width:82%;height:82%;object-fit:contain;border-radius:50%;filter:drop-shadow(0 2px 4px rgba(0,0,0,.55))}
@media(max-width:700px){.world-map-preview-crest{width:58px;height:58px;left:7px;top:7px}}

/* ===== Update 32: clearer map marker list + admin marker search ===== */
.map-marker-admin-search {
  margin-bottom: 16px;
}
.map-marker-admin-list {
  display: grid;
  gap: 12px;
}
.map-marker-admin-item {
  display: grid;
  gap: 9px;
  padding: 14px 16px;
  border: 1px solid rgba(217,177,111,.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(217,177,111,.055), rgba(255,255,255,.018));
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.map-marker-admin-item:hover {
  border-color: rgba(217,177,111,.38);
  background: linear-gradient(180deg, rgba(217,177,111,.075), rgba(255,255,255,.025));
}
.map-marker-admin-item[hidden] {
  display: none !important;
}
.map-marker-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(217,177,111,.12);
}
.map-marker-admin-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.map-marker-admin-heading > strong {
  color: #f0e5d3;
  font-size: 17px;
  line-height: 1.25;
}
.map-marker-type-badge,
.map-marker-visibility {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
}
.map-marker-type-badge {
  color: #e8c98e;
  border: 1px solid rgba(217,177,111,.22);
  background: rgba(217,177,111,.075);
}
.map-marker-visibility {
  gap: 6px;
  color: rgba(239,231,219,.76);
  border: 1px solid rgba(239,231,219,.12);
  background: rgba(255,255,255,.025);
}
.map-marker-visibility::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(239,231,219,.35);
  box-shadow: 0 0 0 2px rgba(239,231,219,.06);
}
.map-marker-visibility.is-visible::before {
  background: #9fc884;
  box-shadow: 0 0 0 2px rgba(159,200,132,.12);
}
.map-marker-visibility.is-hidden::before {
  background: #b77d73;
  box-shadow: 0 0 0 2px rgba(183,125,115,.12);
}
.map-marker-admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: rgba(239,231,219,.64);
  font-size: 12px;
}
.map-marker-admin-meta > span {
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(0,0,0,.14);
}
.map-marker-admin-meta b {
  color: #d9b16f;
  font-weight: 800;
}
.map-marker-card-link {
  margin: 0;
  color: rgba(239,231,219,.82);
  line-height: 1.45;
}
.map-marker-card-link > span {
  color: #d9b16f;
  font-weight: 700;
}
.map-marker-card-link em {
  color: rgba(239,231,219,.48);
  font-style: normal;
}
.map-marker-sound-note {
  color: rgba(192,217,167,.78);
}
.map-marker-direct-link {
  color: rgba(239,231,219,.54);
  overflow-wrap: anywhere;
}
.map-marker-direct-link code {
  color: rgba(239,231,219,.72);
}
.map-marker-edit-details {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(217,177,111,.12);
}
.map-marker-edit-details > summary {
  cursor: pointer;
  color: #e7c990;
  font-weight: 800;
  user-select: none;
}
.map-marker-edit-details[open] > summary {
  margin-bottom: 12px;
}
.map-marker-search-empty {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px dashed rgba(217,177,111,.22);
  border-radius: 12px;
  text-align: center;
}
@media (max-width: 720px) {
  .map-marker-admin-item { padding: 12px; }
  .map-marker-admin-head { align-items: stretch; }
  .map-marker-visibility { align-self: flex-start; }
  .map-marker-admin-heading > strong { font-size: 16px; }
}


/* ===== System broadcasts / site updates ===== */
.broadcast-compose-form textarea { min-height: 180px; resize: vertical; }
.broadcast-admin-list { display: grid; gap: 14px; margin-top: 16px; }
.broadcast-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(217,177,111,.20);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.035), rgba(0,0,0,.10));
}
.broadcast-admin-image { width: 150px; height: 110px; object-fit: cover; border-radius: 13px; border: 1px solid rgba(217,177,111,.20); }
.broadcast-admin-copy { min-width: 0; display: grid; gap: 9px; }
.broadcast-admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.broadcast-admin-head strong { color: #f5dfb5; font-size: 17px; }
.broadcast-admin-head span, .broadcast-admin-copy small { color: rgba(239,231,219,.55); font-size: 12px; }
.broadcast-admin-copy p { margin: 0; color: rgba(239,231,219,.78); line-height: 1.55; }
.broadcast-admin-stats { display: flex; gap: 9px; flex-wrap: wrap; }
.broadcast-admin-stats span { padding: 6px 9px; border-radius: 999px; background: rgba(217,177,111,.08); color: rgba(244,227,194,.72); font-size: 12px; }
.broadcast-admin-delete { align-self: center; }
.site-updates-list { gap: 14px; }
.site-update-item { display: grid; gap: 8px; overflow: hidden; }
.site-update-item.is-unread { border-color: rgba(224,181,107,.52); box-shadow: 0 0 0 1px rgba(217,177,111,.08), 0 12px 34px rgba(0,0,0,.20); }
.site-update-image { display: block; width: min(680px,100%); max-height: 380px; object-fit: cover; border-radius: 14px; border: 1px solid rgba(217,177,111,.20); margin-top: 4px; }
.site-update-preview { margin: 2px 0 0; color: rgba(239,231,219,.72); line-height: 1.55; }
.site-update-body { margin-top: 3px; padding: 13px 14px; border-left: 2px solid rgba(217,177,111,.46); border-radius: 0 12px 12px 0; background: rgba(217,177,111,.055); color: rgba(247,236,216,.88); line-height: 1.65; }
.site-update-open { justify-self: start; margin-top: 3px; }
@media (max-width: 820px) {
  .broadcast-admin-item { grid-template-columns: 1fr; }
  .broadcast-admin-image { width: 100%; height: min(220px, 42vw); }
  .broadcast-admin-delete { justify-self: start; }
  .broadcast-admin-head { align-items: flex-start; flex-direction: column; gap: 4px; }
}


/* ===== Update 38: account bookmarks + configurable map label plates ===== */
.account-bookmarks-card{overflow:hidden}
.account-bookmark-list{display:grid;gap:10px}
.account-bookmark-item{
  position:relative;display:grid;grid-template-columns:54px minmax(0,1fr) 26px;align-items:center;gap:14px;
  min-height:76px;padding:12px 16px 12px 12px;border:1px solid rgba(255,255,255,.065);border-radius:18px;
  background:rgba(255,255,255,.022);color:inherit;text-decoration:none;transition:.18s ease;
}
.account-bookmark-item:hover{transform:translateY(-1px);border-color:rgba(217,177,111,.28);background:rgba(217,177,111,.045)}
.account-bookmark-number{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;font:700 20px/1 Georgia,serif;color:#e4bd7a;background:linear-gradient(145deg,rgba(217,177,111,.16),rgba(128,86,39,.13));border:1px solid rgba(217,177,111,.12);box-shadow:inset 0 1px rgba(255,255,255,.035)}
.account-bookmark-copy{min-width:0;display:grid;gap:4px}
.account-bookmark-copy small{color:rgba(239,231,219,.55);font-size:11px;text-transform:uppercase;letter-spacing:.055em}
.account-bookmark-copy strong{color:#f4ead9;font-size:18px;line-height:1.25;overflow-wrap:anywhere}
.account-bookmark-ribbon{justify-self:end;width:15px;height:23px;border-radius:2px 2px 1px 1px;background:linear-gradient(180deg,#f3c879,#b9752a);box-shadow:0 0 0 1px rgba(255,226,170,.24),0 0 14px rgba(217,177,111,.24);clip-path:polygon(0 0,100% 0,100% 100%,50% 73%,0 100%)}
.hidden-book-access-card{margin-top:2px}
.map-label-style-box{border:1px solid rgba(216,178,102,.16);border-radius:14px;padding:13px;background:rgba(8,7,6,.28);display:grid;gap:10px}
.map-label-style-box>strong{color:#ead6aa}.map-label-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.map-label-opacity-line{display:grid;gap:7px}.map-label-opacity-line label{display:flex;justify-content:space-between;gap:12px;align-items:center}.map-label-opacity-line output{color:#e4bd7a;font-weight:700}
@media(max-width:620px){.account-bookmark-item{grid-template-columns:48px minmax(0,1fr) 20px;padding-right:13px}.account-bookmark-number{width:44px;height:44px;font-size:18px}.account-bookmark-copy strong{font-size:16px}.map-label-style-grid{grid-template-columns:1fr}}

/* Music library picker: reusable multi-track selector in admin forms. */
.admin-audio-picker{grid-column:1/-1;min-width:0}
.admin-audio-picker>label{display:block;margin-bottom:7px}
.admin-audio-picker details{border:1px solid rgba(215,179,104,.24);border-radius:14px;background:rgba(12,10,8,.42);overflow:hidden}
.admin-audio-picker summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;cursor:pointer;font-weight:800;color:#ead4a0;list-style:none}
.admin-audio-picker summary::-webkit-details-marker{display:none}
.admin-audio-picker summary:after{content:'⌄';opacity:.72;font-size:17px}
.admin-audio-picker details[open] summary:after{transform:rotate(180deg)}
.admin-audio-picker-count{margin-left:auto;font-size:12px;font-weight:700;color:#c7aa72;white-space:nowrap}
.admin-audio-picker-body{padding:0 12px 12px}
.admin-audio-picker-search{width:100%;margin-bottom:10px}
.admin-audio-track-list{display:grid;gap:7px;max-height:360px;overflow:auto;padding-right:3px}
.admin-audio-track{display:flex;align-items:flex-start;gap:10px;padding:9px 10px;border:1px solid rgba(215,179,104,.14);border-radius:11px;background:rgba(255,255,255,.018);cursor:pointer}
.admin-audio-track:hover{border-color:rgba(215,179,104,.32);background:rgba(202,147,68,.06)}
.admin-audio-track input{width:18px!important;min-width:18px;height:18px!important;margin:2px 0 0!important;padding:0!important;flex:0 0 18px;border-radius:4px;accent-color:#c9964d}
.admin-audio-track span{display:grid;gap:2px;min-width:0}
.admin-audio-track strong{font-size:13px;overflow-wrap:anywhere}
.admin-audio-track small{font-size:11px;color:#9f927c;overflow-wrap:anywhere}
.admin-audio-track[hidden]{display:none!important}

/* A hidden archive action must stay physically hidden even when .btn is flex. */
[data-map-preview-link][hidden]{display:none!important}

/* ===== UPDATE 42: only the opened archive card keeps the full image ===== */
/* Lists, related cards and archive thumbnails use their original compact cover style. */
/* Only the large image inside the opened archive card is shown without cropping. */
.archive-detail-image {
  width: min(100%, 820px);
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
  background: rgba(0,0,0,.18);
}

/* ===== UPDATE 43: ornate archive preview cards + rising runes ===== */
.archive-term-card{
  isolation:isolate;
  overflow:visible;
  box-shadow:
    0 26px 86px rgba(0,0,0,.64),
    0 0 0 1px rgba(116,67,34,.34),
    inset 0 0 0 1px rgba(238,193,111,.06),
    inset 0 0 46px rgba(166,94,42,.05);
}
.archive-term-card::before,
.archive-term-card::after{
  content:"";
  position:absolute;
  pointer-events:none;
  background:url('/assets/archive-knot-corner.svg?v=2') center/contain no-repeat;
  filter:drop-shadow(0 6px 9px rgba(0,0,0,.62)) drop-shadow(0 0 10px rgba(187,113,50,.12));
}
/* Upper-left rim: a narrow woven border that follows the card edge. */
.archive-term-card::before{
  z-index:4;
  left:-10px;
  top:-10px;
  width:190px;
  height:190px;
  transform:rotate(180deg);
  opacity:.94;
}
/* Lower-right rim: same braid, kept on the border instead of covering content. */
.archive-term-card::after{
  z-index:4;
  right:-10px;
  bottom:-10px;
  width:184px;
  height:184px;
  opacity:.82;
}
.archive-term-card > :not(.archive-rune-field){position:relative;z-index:3}
.archive-term-card > .archive-term-close{position:absolute;z-index:7}
.archive-term-card > .archive-rune-field{position:absolute}

/* Invisible outer zone: particles exist only in the transparent ring around the card. */
.archive-rune-field{
  z-index:1;
  inset:-92px -78px -104px;
  padding:104px 78px 104px;
  pointer-events:none;
  overflow:hidden;
  opacity:0;
  transition:opacity .25s ease;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
}
.archive-rune-field.is-active{opacity:1}
.archive-rune-particle{
  position:absolute;
  display:block;
  color:#d7a55e;
  font-family:"Segoe UI Symbol","Noto Sans Runic","Noto Sans Symbols 2",serif;
  line-height:1;
  opacity:0;
  text-shadow:0 0 7px rgba(213,145,70,.32),0 0 16px rgba(122,64,30,.22);
  filter:blur(.08px);
  will-change:transform,opacity;
  animation:archiveRuneRise linear infinite;
}
@keyframes archiveRuneRise{
  0%{opacity:0;transform:translate3d(0,24px,0) rotate(var(--rune-rot-start)) scale(.82)}
  12%{opacity:calc(var(--rune-alpha) * .72)}
  38%{opacity:var(--rune-alpha)}
  72%{opacity:calc(var(--rune-alpha) * .72)}
  100%{opacity:0;transform:translate3d(var(--rune-drift),calc(-1 * var(--rune-rise)),0) rotate(var(--rune-rot-end)) scale(1.08)}
}

@media(max-width:680px){
  .archive-term-card::before{left:-8px;top:-8px;width:138px;height:138px}
  .archive-term-card::after{right:-8px;bottom:-8px;width:134px;height:134px;opacity:.78}
  .archive-rune-field{inset:-58px -40px -74px;padding:74px 40px 74px}
}
@media(prefers-reduced-motion:reduce){
  .archive-rune-field{display:none!important}
}

/* ===== UPDATE 46: full-screen archive runes + rune button bursts ===== */
.archive-term-modal .archive-rune-field-screen{
  position:absolute!important;
  inset:0!important;
  z-index:1!important;
  padding:0!important;
  width:100%!important;
  height:100%!important;
  pointer-events:none;
  overflow:hidden;
  opacity:0;
  transition:opacity .25s ease;
  -webkit-mask:none!important;
  mask:none!important;
}
.archive-term-modal .archive-rune-field-screen.is-active{opacity:1}
.archive-term-modal .archive-rune-field-screen .archive-rune-particle{
  position:absolute;
  bottom:auto;
}

.site-rune-burst-layer{
  position:fixed;
  inset:0;
  z-index:20080;
  pointer-events:none;
  overflow:hidden;
  contain:layout style paint;
}
.site-rune-burst{
  position:absolute;
  display:block;
  color:#d7a55e;
  font-family:"Segoe UI Symbol","Noto Sans Runic","Noto Sans Symbols 2",serif;
  line-height:1;
  opacity:0;
  text-shadow:0 0 7px rgba(213,145,70,.42),0 0 16px rgba(122,64,30,.28);
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.55));
  transform:translate(-50%,-50%);
  will-change:transform,opacity;
  animation:siteRuneBurst ease-out forwards;
}
@keyframes siteRuneBurst{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.58) rotate(0deg)}
  13%{opacity:var(--burst-alpha);transform:translate(-50%,-50%) scale(1) rotate(calc(var(--burst-rot) * .18))}
  100%{opacity:0;transform:translate(calc(-50% + var(--burst-x)),calc(-50% + var(--burst-y))) scale(.82) rotate(var(--burst-rot))}
}
@media(prefers-reduced-motion:reduce){
  .site-rune-burst-layer{display:none!important}
}

/* ===== UPDATE 46: chapter-based rulers for archive subsections ===== */
.archive-category-ruler-box{display:grid;gap:12px}
.archive-category-ruler-list{display:grid;gap:10px}
.archive-category-ruler-row{
  display:grid;
  grid-template-columns:minmax(180px,.9fr) minmax(240px,1.45fr) minmax(170px,.8fr) auto;
  gap:10px;
  align-items:end;
  padding:12px;
  border:1px solid rgba(220,170,90,.14);
  border-radius:14px;
  background:rgba(255,255,255,.025);
}
.archive-category-ruler-row > div{min-width:0}
.archive-category-ruler-row label{display:block;margin-bottom:6px}
@media(max-width:980px){
  .archive-category-ruler-row{grid-template-columns:1fr 1fr}
}
@media(max-width:640px){
  .archive-category-ruler-row{grid-template-columns:1fr}
}

/* ===== UPDATE 51: reader experience / PWA / first visit / photo runes ===== */
.login-remember{
  margin-top:2px;
  align-items:center;
  gap:10px;
}
.login-remember input{width:auto!important;min-width:18px;height:18px;margin:0;accent-color:#b98343}
.login-remember-note{display:block;margin-top:-6px;line-height:1.45}

.first-visit-admin-box{
  margin-top:8px;
  padding:16px;
  border:1px solid rgba(202,150,83,.28);
  border-radius:16px;
  background:linear-gradient(145deg,rgba(144,94,41,.10),rgba(255,255,255,.025));
}
.first-visit-admin-box .admin-header-inline{align-items:flex-start;margin-bottom:12px}
.first-visit-admin-box .admin-header-inline>div{display:grid;gap:4px}

.first-visit-modal,
.install-help-modal{
  position:fixed;inset:0;z-index:1200000;display:grid;place-items:center;padding:20px;
  opacity:0;visibility:hidden;transition:opacity .22s ease,visibility .22s ease;
}
.first-visit-modal.is-visible,
.install-help-modal.is-visible{opacity:1;visibility:visible}
.first-visit-backdrop,
.install-help-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.78);backdrop-filter:blur(8px)}
.first-visit-card,
.install-help-card{
  position:relative;z-index:1;width:min(760px,calc(100vw - 32px));max-height:min(86vh,760px);overflow:auto;
  border:1px solid rgba(217,177,111,.34);border-radius:22px;
  background:linear-gradient(155deg,rgba(28,23,18,.985),rgba(10,9,8,.985));
  box-shadow:0 28px 90px rgba(0,0,0,.72),0 0 40px rgba(178,116,51,.10);
}
.first-visit-card{display:grid;grid-template-columns:minmax(0,42%) minmax(0,58%)}
.first-visit-image{width:100%;height:100%;min-height:310px;object-fit:cover;border-radius:21px 0 0 21px}
.first-visit-copy{padding:32px;display:flex;flex-direction:column;justify-content:center;gap:12px}
.first-visit-copy h2,.install-help-card h2{margin:0;color:#f2dfbf;font-size:clamp(26px,4vw,40px)}
.first-visit-copy p,.install-help-card p{margin:0;color:#d0c5b7;line-height:1.7;white-space:pre-line}
.first-visit-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px}
.first-visit-close,.install-help-close{
  position:absolute;top:12px;right:12px;z-index:3;width:42px;height:42px;border-radius:50%;
  border:1px solid rgba(255,255,255,.14);background:rgba(0,0,0,.64);color:#fff;font-size:26px;cursor:pointer;
}
.install-help-card{padding:30px;width:min(520px,calc(100vw - 32px));display:grid;gap:14px}
.install-help-mark{font-size:34px;color:#c79352}

.guide-page{min-height:100vh;background:radial-gradient(circle at 50% 0%,rgba(160,104,49,.11),transparent 38%),#0a0908}
.guide-hero{position:relative;padding:76px 22px 42px;border-bottom:1px solid rgba(217,177,111,.13)}
.guide-hero-inner{position:relative;z-index:1;max-width:980px;margin:0 auto;text-align:center}
.guide-hero h1{margin:4px 0 14px;font-size:clamp(42px,7vw,78px)}
.guide-hero p:not(.eyebrow){max-width:780px;margin:0 auto 18px;color:#cfc4b6;line-height:1.7}
.guide-shell{width:min(1080px,calc(100% - 32px));margin:28px auto 64px;display:grid;gap:14px}
.guide-card{
  display:grid;grid-template-columns:74px 1fr;gap:18px;align-items:start;padding:22px;
  border:1px solid rgba(217,177,111,.15);border-radius:18px;background:rgba(255,255,255,.028)
}
.guide-number{font-size:30px;font-weight:800;color:#bd8545;letter-spacing:.06em}
.guide-card h2,.guide-install-card h2{margin:0 0 8px;color:#f0dcc0}
.guide-card p,.guide-install-card p{margin:0;color:#c6bdb1;line-height:1.72}
.guide-install-card{
  display:grid;grid-template-columns:1.05fr .95fr;gap:24px;padding:28px;margin-top:12px;
  border:1px solid rgba(217,177,111,.30);border-radius:20px;background:linear-gradient(135deg,rgba(128,80,34,.12),rgba(255,255,255,.025))
}
.guide-install-manual{padding:20px;border-radius:16px;background:rgba(0,0,0,.22);display:grid;gap:10px}
.guide-install-manual p{font-size:14px}

.photo-lightbox-rune-layer{
  position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:1;
}
.photo-lightbox-rune{
  position:absolute;display:block;color:#d7a55e;font-family:"Segoe UI Symbol","Noto Sans Runic","Noto Sans Symbols 2",serif;line-height:1;
  text-shadow:0 0 7px rgba(213,145,70,.32),0 0 16px rgba(122,64,30,.22);
  will-change:transform,opacity;
  animation:photoRuneRise linear infinite;
}
@keyframes photoRuneRise{
  0%{transform:translate3d(0,18vh,0) rotate(0deg) scale(.86);opacity:0}
  12%{opacity:.52}
  72%{opacity:.31}
  100%{transform:translate3d(var(--photo-rune-x,0px),-125vh,0) rotate(var(--photo-rune-rot,40deg)) scale(1.12);opacity:0}
}
.lightbox>#lightboxImage,.lightbox>img{position:relative;z-index:2}
.lightbox>.lightbox-status{position:relative;z-index:3}

@media(max-width:720px){
  .first-visit-card{grid-template-columns:1fr}
  .first-visit-image{height:min(38vh,280px);min-height:0;border-radius:21px 21px 0 0}
  .first-visit-copy{padding:24px 20px}
  .guide-card{grid-template-columns:52px 1fr;padding:18px}
  .guide-number{font-size:24px}
  .guide-install-card{grid-template-columns:1fr;padding:20px}
}
@media(prefers-reduced-motion:reduce){
  .photo-lightbox-rune-layer{display:none!important}
}


/* ===== UPDATE 52: living cards, map fog, crests, chapter/bookmark effects ===== */
/* Subtle copper-gold light sweep on archive and book cards. */
.archive-card,
.book-card{position:relative;isolation:isolate}
.archive-card::after,
.book-card::after{
  content:"";
  position:absolute;
  z-index:8;
  inset:-35% -70%;
  pointer-events:none;
  opacity:0;
  background:linear-gradient(112deg,transparent 38%,rgba(255,221,155,.04) 45%,rgba(244,190,101,.30) 50%,rgba(255,237,197,.54) 52%,rgba(194,116,49,.20) 55%,transparent 62%);
  transform:translateX(-48%) rotate(1deg);
  mix-blend-mode:screen;
  will-change:transform,opacity;
}
.archive-card:hover::after,
.archive-card:focus-visible::after,
.archive-card.card-light-touch::after,
.book-card:hover::after,
.book-card:focus-within::after,
.book-card.card-light-touch::after{animation:cardMetalSweep .86s ease-out both}
@keyframes cardMetalSweep{
  0%{opacity:0;transform:translateX(-52%) rotate(1deg)}
  18%{opacity:.88}
  72%{opacity:.58}
  100%{opacity:0;transform:translateX(52%) rotate(1deg)}
}

/* The existing Norse rim gets a rare, quiet light pulse while its mini-card is open. */
.archive-term-card::before{animation:archiveKnotLivingLight 9.4s ease-in-out infinite}
.archive-term-card::after{animation:archiveKnotLivingLight 9.4s 1.15s ease-in-out infinite}
@keyframes archiveKnotLivingLight{
  0%,58%,100%{filter:drop-shadow(0 6px 9px rgba(0,0,0,.62)) drop-shadow(0 0 10px rgba(187,113,50,.12));opacity:.88}
  64%{filter:drop-shadow(0 6px 9px rgba(0,0,0,.62)) drop-shadow(0 0 15px rgba(214,145,63,.22));opacity:.94}
  69%{filter:brightness(1.28) saturate(1.08) drop-shadow(0 0 18px rgba(244,191,91,.38));opacity:1}
  75%{filter:drop-shadow(0 6px 9px rgba(0,0,0,.62)) drop-shadow(0 0 13px rgba(187,113,50,.16));opacity:.9}
}

/* Reader-controlled atmospheric fog. Kept strictly inside the map viewport. */
.world-map-fog{
  position:absolute;
  inset:0;
  z-index:2;
  overflow:hidden;
  pointer-events:none;
  opacity:0;
  transition:opacity .55s ease;
  contain:paint;
}
.world-map-fog.is-visible{opacity:1}
.world-map-fog[hidden]{display:none!important}
.world-map-fog span{
  position:absolute;
  left:-28%;
  width:150%;
  height:28%;
  border-radius:50%;
  pointer-events:none;
  opacity:.68;
  filter:blur(22px);
  background:
    radial-gradient(ellipse at 12% 50%,rgba(232,237,235,.11) 0 12%,rgba(224,230,227,.07) 24%,transparent 48%),
    radial-gradient(ellipse at 36% 46%,rgba(235,239,237,.15) 0 10%,rgba(210,219,215,.08) 28%,transparent 52%),
    radial-gradient(ellipse at 62% 58%,rgba(231,236,233,.13) 0 13%,rgba(207,216,212,.07) 30%,transparent 54%),
    radial-gradient(ellipse at 86% 44%,rgba(239,242,240,.11) 0 11%,rgba(213,221,217,.06) 27%,transparent 50%),
    linear-gradient(90deg,transparent 0%,rgba(220,227,223,.035) 10%,rgba(235,239,237,.085) 34%,rgba(218,226,222,.065) 62%,rgba(237,240,238,.075) 82%,transparent 100%);
  -webkit-mask-image:linear-gradient(180deg,transparent 0%,#000 20%,#000 78%,transparent 100%);
  mask-image:linear-gradient(180deg,transparent 0%,#000 20%,#000 78%,transparent 100%);
  will-change:transform,opacity;
}
.world-map-fog span:nth-child(1){top:4%;opacity:.62;animation:worldFogRibbonA 68s ease-in-out infinite alternate}
.world-map-fog span:nth-child(2){top:31%;left:-36%;width:165%;height:32%;opacity:.52;filter:blur(26px);animation:worldFogRibbonB 82s ease-in-out infinite alternate}
.world-map-fog span:nth-child(3){top:66%;left:-20%;width:145%;height:27%;opacity:.46;filter:blur(24px);animation:worldFogRibbonC 94s ease-in-out infinite alternate}
@keyframes worldFogRibbonA{
  from{transform:translate3d(-10%,0,0) scaleX(1.02) scaleY(.92)}
  to{transform:translate3d(17%,5%,0) scaleX(1.08) scaleY(1.06)}
}
@keyframes worldFogRibbonB{
  from{transform:translate3d(14%,-3%,0) scaleX(1.08) scaleY(1.04)}
  to{transform:translate3d(-13%,5%,0) scaleX(1.01) scaleY(.94)}
}
@keyframes worldFogRibbonC{
  from{transform:translate3d(-7%,4%,0) scaleX(1.03) scaleY(.96)}
  to{transform:translate3d(13%,-5%,0) scaleX(1.10) scaleY(1.05)}
}
.world-map-actions [data-map-fog-toggle].is-active{color:#22170b;background:#d7a75d;border-color:#e5bd78}

/* A rare glint crosses the crest without moving the crest itself. */
.world-map-preview-crest{overflow:hidden}
.world-map-preview-crest::after{
  content:"";
  position:absolute;
  z-index:5;
  top:-28%;
  bottom:-28%;
  width:28%;
  left:-55%;
  pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(255,235,186,.78),transparent);
  transform:skewX(-18deg);
  opacity:0;
  animation:crestLivingGlint 7.8s 1.6s ease-in-out infinite;
}
.world-map-preview-crest img{position:relative;z-index:2}
@keyframes crestLivingGlint{
  0%,70%{left:-55%;opacity:0}
  74%{opacity:.16}
  79%{opacity:.82}
  84%{left:125%;opacity:.14}
  86%,100%{left:125%;opacity:0}
}

/* Chapter transition: a brief hand-forged open-book symbol, then navigation continues. */
.chapter-transition-overlay{
  position:fixed;
  inset:0;
  z-index:120500;
  display:grid;
  place-items:center;
  pointer-events:none;
  background:radial-gradient(circle at center,rgba(12,9,6,.30),rgba(0,0,0,.76));
  opacity:0;
  transition:opacity .16s ease;
  backdrop-filter:blur(2px);
}
.chapter-transition-overlay.is-visible{opacity:1}
.chapter-transition-symbol{display:grid;justify-items:center;gap:13px;transform:translateY(7px) scale(.94);animation:chapterTransitionEnter .48s ease-out both}
.chapter-transition-symbol small{color:rgba(235,209,160,.68);font-size:11px;letter-spacing:.18em;text-transform:uppercase;text-shadow:0 2px 12px #000}
.chapter-transition-book{position:relative;display:block;width:92px;height:62px;filter:drop-shadow(0 12px 20px rgba(0,0,0,.72)) drop-shadow(0 0 18px rgba(203,137,59,.18))}
.chapter-transition-book::before,
.chapter-transition-book::after{
  content:"";
  position:absolute;
  top:4px;
  width:45px;
  height:54px;
  border:1px solid rgba(227,180,95,.78);
  background:linear-gradient(145deg,rgba(176,112,50,.24),rgba(33,23,15,.96) 35%,rgba(8,7,6,.98));
  box-shadow:inset 0 0 16px rgba(226,169,79,.09),0 0 10px rgba(202,134,57,.12);
}
.chapter-transition-book::before{left:1px;border-radius:8px 2px 3px 12px;transform:perspective(160px) rotateY(8deg)}
.chapter-transition-book::after{right:1px;border-radius:2px 8px 12px 3px;transform:perspective(160px) rotateY(-8deg)}
.chapter-transition-book i{position:absolute;z-index:4;left:50%;top:50%;transform:translate(-50%,-50%);font-style:normal;color:#e0ad61;font-family:"Segoe UI Symbol","Noto Sans Runic",serif;font-size:22px;text-shadow:0 0 12px rgba(224,162,76,.46)}
@keyframes chapterTransitionEnter{0%{opacity:0;transform:translateY(12px) scale(.88)}45%{opacity:1}100%{opacity:1;transform:translateY(0) scale(1)}}

/* Bookmark confirmation gets its own richer flash, in addition to the site's general click runes. */
#bookmarkToggle.bookmark-saved-flash,
#bookmarkToggleWide.bookmark-saved-flash{animation:bookmarkButtonFlash .76s ease-out both}
@keyframes bookmarkButtonFlash{
  0%{transform:scale(1);box-shadow:inherit}
  28%{transform:scale(1.055);border-color:rgba(244,196,101,.88);color:#ffe5a6;box-shadow:0 0 0 3px rgba(213,151,65,.12),0 0 26px rgba(222,156,67,.36)}
  100%{transform:scale(1);box-shadow:inherit}
}
.bookmark-celebration-layer{position:fixed;inset:0;z-index:120600;pointer-events:none;overflow:hidden}
.bookmark-celebration-spark{
  position:absolute;
  color:#e4b664;
  line-height:1;
  opacity:0;
  text-shadow:0 0 7px rgba(226,167,73,.48),0 0 14px rgba(120,65,28,.28);
  transform:translate(-50%,-50%);
  animation:bookmarkSparkFly .82s ease-out forwards;
}
@keyframes bookmarkSparkFly{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.55) rotate(0)}
  15%{opacity:.94;transform:translate(-50%,-50%) scale(1.08) rotate(8deg)}
  100%{opacity:0;transform:translate(calc(-50% + var(--bookmark-x)),calc(-50% + var(--bookmark-y))) scale(.68) rotate(var(--bookmark-rot))}
}
.chapter-bookmark-indicator.bookmark-indicator-pop{animation:bookmarkIndicatorPop .78s cubic-bezier(.2,.9,.25,1.3) both}
@keyframes bookmarkIndicatorPop{0%{transform:scale(.45);filter:brightness(1)}45%{transform:scale(1.35);filter:brightness(1.65) drop-shadow(0 0 8px rgba(231,176,79,.72))}100%{transform:scale(1);filter:brightness(1)}}

@media(max-width:700px){
  .world-map-fog span{filter:blur(20px);opacity:.48}
  .chapter-transition-book{width:78px;height:54px;transform:scale(.92)}
}
@media(prefers-reduced-motion:reduce){
  .archive-card::after,.book-card::after,.archive-term-card::before,.archive-term-card::after,.world-map-preview-crest::after{animation:none!important}
  .world-map-fog span{animation:none!important}
  .chapter-transition-overlay,.bookmark-celebration-layer{display:none!important}
}

/* ===== UPDATE 55: cleaned Valdraken Gothic + stable chapter drop cap ===== */
@font-face {
  font-family: "Valdraken Gothic Clean";
  src: url("/assets/fonts/ValdrakenGothic-Clean-v0.4.woff2?v=1") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.valdraken-site-title {
  font-family: "Valdraken Gothic Clean", Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.02;
  font-kerning: normal;
  font-synthesis: none;
}

/* Буквица теперь реальный span, а не ::first-letter: одинаково работает в Chrome/Safari/PWA. */
.chapter-dropcap {
  font-family: "Valdraken Gothic Clean", Georgia, "Times New Roman", serif;
  float: left;
  display: block;
  font-weight: 400;
  font-size: 4.05em;
  line-height: .76;
  margin: .10em .13em .02em 0;
  padding: .02em 0 0;
  color: #d7a35f;
  font-kerning: normal;
  font-synthesis: none;
  text-shadow:
    0 1px 0 rgba(255,225,166,.28),
    0 0 12px rgba(193,126,52,.22),
    0 4px 14px rgba(0,0,0,.52);
}
.chapter-opening-text::after { content:""; display:table; clear:both; }

@media (max-width: 640px) {
  .chapter-dropcap {
    font-size: 3.55em;
    line-height: .78;
    margin-right: .11em;
  }
}
