@font-face {
  font-family: 'Hoa Lu Menu';
  src: url('/assets/fonts/hoalu-serif-bold.woff') format('woff');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --font-display: 'Playfair Display', 'Charm', Georgia, serif;
  --font-sub: 'Srisakdi', 'Charm', Georgia, serif;
  --font-serif: 'Charm', 'Lora', Georgia, serif;
  --font-sans: 'Charm', 'Be Vietnam Pro', system-ui, sans-serif;
  --guide-top-height: 52px;
  --guide-bottom-height: 56px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #09151b;
  color: #f8fafc;
  font-family: var(--font-sans);
  user-select: none;
}

/* =========================================================
   MOBILE GATE (CHỈ CHO ĐIỆN THOẠI TRUY CẬP)
   ========================================================= */
.mobile-app-root {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: #09151b;
}

.loading-boot-screen {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #09151b;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.boot-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(245, 158, 11, 0.25);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.desktop-blocker-screen {
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top, #132a23 0%, #070d12 100%);
}

.blocker-card {
  max-width: 440px;
  width: 100%;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.blocker-icon {
  font-size: 2.6rem;
  margin-bottom: 6px;
}

.blocker-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.blocker-card h1 {
  font-size: 1.3rem;
  color: #f8fafc;
  margin-bottom: 10px;
}

.blocker-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #94a3b8;
  margin-bottom: 18px;
}

.blocker-desc strong {
  color: #fbbf24;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.qr-image {
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
}

.blocker-hint {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 14px;
}

.sim-launch-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.desktop-simulator-stage {
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #070b12;
  gap: 10px;
}

.simulator-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.exit-sim-btn {
  background: #334155;
  color: #f8fafc;
  border: none;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  cursor: pointer;
}

.phone-bezel-frame {
  position: relative;
  width: 390px;
  height: 844px;
  max-height: 90dvh;
  border-radius: 44px;
  border: 10px solid #1e293b;
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  background: #09151b;
}

.phone-notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 20px;
  background: #05080d;
  border-radius: 999px;
  z-index: 60;
  pointer-events: none;
}

.phone-screen-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* =========================================================
   1. NEXT.JS SHELL (TOP HEADER, PDF & SHARE)
   ========================================================= */
.top-shell {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 12px 12px 8px;
  background: linear-gradient(
    to bottom,
    rgba(9, 21, 27, 0.95) 0%,
    rgba(9, 21, 27, 0.75) 75%,
    transparent 100%
  );
}

.top-bar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-emblem {
  font-size: 1.4rem;
}

.brand-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fbbf24;
}

.brand-sub {
  font-size: 0.68rem;
  color: #cbd5e1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shell-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 10px;
  cursor: pointer;
}

.shell-btn.pdf-btn {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.shell-btn.share-btn {
  background: rgba(2, 132, 199, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
}

.hotspot-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 2px 4px;
  scrollbar-width: none;
}

.hotspot-chips-bar::-webkit-scrollbar {
  display: none;
}

.spot-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font-size: 0.73rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.spot-chip.is-active {
  background: var(--chip-color, #f59e0b);
  border-color: #ffffff;
  color: #ffffff;
  font-weight: 700;
}

.chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
}

/* =========================================================
   2. SƠ ĐỒ THAM QUAN ĐỀN THỜ VUA ĐINH TIÊN HOÀNG (bg1.jpg + stf__wrapper)
   ========================================================= */
.sodo1-page {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f8f5ec;
}

.dth-stf-stage {
  background: repeating-linear-gradient(
    -45deg,
    #888888 0px,
    #888888 1.5px,
    #9e9e9e 1.5px,
    #9e9e9e 4.5px
  );
}

.dth-stf-stage .stf__wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding-bottom: 0 !important;
}

.dth-stf-stage .stf__block {
  position: relative;
  width: 100%;
  height: 100%;
}

.dth-stf-stage .pf.stf__item {
  overflow: hidden;
  background: #f8f5ec;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.dth-stf-stage .pc {
  position: absolute;
  top: 0;
  left: 0;
  width: 539px;
  height: 1078px;
  transform-origin: 0 0;
}

.dth-stf-stage .bi.w1.h1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 539px;
  height: 1078px;
  display: block;
  pointer-events: none;
}

.dth-stf-stage .pc1 .t {
  position: absolute;
  white-space: pre;
  line-height: 1.15;
  z-index: 6;
  cursor: pointer;
  font-family: var(--font-sans);
}

.dth-stf-stage .pc1 .t:active {
  opacity: 0.7;
}

.dth-stf-stage .pc1 .t.yc,
.dth-stf-stage .pc1 .t.yd,
.dth-stf-stage .pc1 .t.ye {
  cursor: default;
  pointer-events: none;
}

.dth-stf-stage .pc1 .ff1 {
  font-family: var(--font-serif);
  font-weight: 700;
}

.dth-stf-stage .pc1 .ff2 {
  font-family: var(--font-serif);
  font-weight: 400;
}

.dth-stf-stage .pc1 .t.yd,
.dth-stf-stage .pc1 .t.ye {
  font-family: var(--font-display);
  font-weight: 700;
}

.dth-stf-stage .pc1 .fs0 {
  font-size: 16px;
}

.dth-stf-stage .pc1 .fs1 {
  font-size: 12.5px;
}

.dth-stf-stage .pc1 .fs2 {
  font-size: 22px;
}

.dth-stf-stage .pc1 .fc0 {
  color: #d4282f;
}

.dth-stf-stage .pc1 .fc1 {
  color: #58585a;
}

.dth-stf-stage .pc1 .fc2 {
  color: #6c0000;
}

.dth-stf-stage .pc1 .ls1 {
  letter-spacing: -0.15px;
}

.dth-stf-stage .pc1 .ls2 {
  letter-spacing: 0.4px;
}

.dth-stf-stage .pc1 .x1 {
  left: 50px;
}

.dth-stf-stage .pc1 .x2 {
  left: 64px;
}

.dth-stf-stage .pc1 .x3 {
  left: 239px;
}

.dth-stf-stage .pc1 .x4 {
  left: 252px;
}

.dth-stf-stage .pc1 .x5 {
  left: 117px;
}

.dth-stf-stage .pc1 .x6 {
  left: 88px;
}

.dth-stf-stage .pc1 .yd {
  top: 156px;
}

.dth-stf-stage .pc1 .ye {
  top: 185px;
}

.dth-stf-stage .pc1 .yc {
  top: 662px;
}

.dth-stf-stage .pc1 .y1 {
  top: 705px;
}

.dth-stf-stage .pc1 .y2 {
  top: 728px;
}

.dth-stf-stage .pc1 .y3 {
  top: 760px;
}

.dth-stf-stage .pc1 .y4 {
  top: 784px;
}

.dth-stf-stage .pc1 .y5 {
  top: 822px;
}

.dth-stf-stage .pc1 .y6 {
  top: 845px;
}

.dth-stf-stage .pc1 .y7 {
  top: 867px;
}

.dth-stf-stage .pc1 .y8 {
  top: 904px;
}

.dth-stf-stage .pc1 .y9 {
  top: 927px;
}

.dth-stf-stage .pc1 .ya {
  top: 965px;
}

.dth-stf-stage .pc1 .yb {
  top: 988px;
}

.sodo1-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}

/* Vùng chạm trong suốt khớp vị trí 9 lá cờ đỏ có sẵn trên ảnh bg1.jpg */
.sodo1-flags-hitlayer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.sodo1-flag-hit {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: auto;
}

/* Tiêu đề góc phải trên (nằm cạnh mái đền góc trái trên của bg1.jpg) */
.sodo1-title-block {
  position: absolute;
  top: 9.5%;
  left: 33%;
  right: 3%;
  z-index: 6;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sodo1-title-line {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 1.04rem;
  font-weight: 800;
  color: #a61c1c;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

/* Khối danh mục nằm ở phần nền trắng vân mây phía dưới sơ đồ (y: 62% -> 94%) */
.sodo1-bottom-section {
  position: absolute;
  top: 62.2%;
  left: 5%;
  right: 4%;
  bottom: 6%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}

.sodo1-bottom-section::-webkit-scrollbar {
  display: none;
}

.sodo1-instruction {
  text-align: center;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 12.5px;
  color: #58585a;
  margin-bottom: 10px;
}

.sodo1-columns {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  column-gap: 14px;
}

.sodo1-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sodo1-entry {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.sodo1-entry:active {
  background: rgba(212, 40, 47, 0.1);
}

.sodo1-vi {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: #d4282f;
  line-height: 1.25;
}

.sodo1-en {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 400;
  font-size: 14.5px;
  color: #d4282f;
  padding-left: 14px;
  line-height: 1.25;
}

/* Nút mở lại Mục lục (3 gạch) và Trang bìa ở góc dưới */
.sodo1-nav-Corner {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 1%;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.sodo1-menu-trigger {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
}

.sodo1-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 20px;
}

.sodo1-bars i {
  display: block;
  height: 2.5px;
  width: 100%;
  background: #ffffff;
  border-radius: 2px;
}

.sodo1-home-trigger {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fef08a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* =========================================================
   3 & 4. MODAL PANORAMA 360° (PANNELLUM / ẢNH THỰC ĐỊA)
   ========================================================= */
.pano-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #050a0f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pano-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(
    to bottom,
    rgba(5, 10, 15, 0.9) 0%,
    rgba(5, 10, 15, 0.5) 75%,
    transparent 100%
  );
}

.pano-back-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.pano-spot-meta {
  text-align: right;
}

.pano-spot-pill {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 2px;
}

.pano-spot-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fef08a;
}

.pano-side-controls {
  position: absolute;
  top: 72px;
  right: 12px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pano-tool-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  color: #f8fafc;
  font-size: 0.95rem;
  cursor: pointer;
}

.pano-tool-btn.is-on {
  border-color: #fbbf24;
  background: rgba(217, 119, 6, 0.85);
}

.pano-viewer-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 55%;
}

.pannellum-mount {
  width: 100%;
  height: 100%;
}

.pano-loading-mask {
  position: absolute;
  inset: 0;
  z-index: 44;
  background: rgba(9, 21, 27, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.82rem;
  color: #fde68a;
}

.pano-gesture-hint {
  position: absolute;
  top: 68px;
  left: 12px;
  z-index: 44;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.68rem;
  padding: 5px 10px;
  border-radius: 999px;
  pointer-events: none;
}

/* =========================================================
   5. AUDIO NARRATOR (GIỌNG ĐỌC ĐỒNG BỘ PHỤ ĐỀ)
   ========================================================= */
.narrator-panel {
  position: relative;
  z-index: 46;
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 22px 22px 0 0;
  padding: 6px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
}

.narrator-grab-bar {
  display: flex;
  justify-content: center;
  padding: 4px 0;
  cursor: pointer;
}

.grab-indicator {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.subtitle-teleprompter {
  max-height: 118px;
  overflow-y: auto;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subtitle-item {
  display: flex;
  gap: 8px;
  font-size: 0.81rem;
  line-height: 1.45;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subtitle-item.is-past {
  color: #94a3b8;
}

.subtitle-item.is-active {
  color: #fef08a;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.14);
  padding: 5px 8px;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
}

.sub-timestamp {
  font-size: 0.68rem;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  flex-shrink: 0;
}

.subtitle-single-line {
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
  color: #fef08a;
  font-size: 0.78rem;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.narrator-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-code {
  font-size: 0.68rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}

.narrator-range {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  appearance: none;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
  cursor: pointer;
}

.narrator-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fbbf24;
  cursor: pointer;
}

.narrator-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.narrator-transport {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transport-play-btn {
  border: none;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.transport-step-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.narrator-minor-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* =========================================================
   PDF MODAL & TOAST
   ========================================================= */
.shell-toast {
  position: absolute;
  top: 98px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: #10b981;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 65;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pdf-modal-card {
  width: 100%;
  max-width: 360px;
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pdf-modal-header h3 {
  font-size: 0.86rem;
  color: #fde68a;
}

.pdf-close-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.95rem;
  cursor: pointer;
}

.pdf-modal-body {
  padding: 14px 16px;
  max-height: 52dvh;
  overflow-y: auto;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.pdf-intro {
  margin-bottom: 10px;
  color: #94a3b8;
}

.pdf-spot-list {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdf-spot-list strong {
  color: #fbbf24;
}

.pdf-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pdf-download-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: #d97706;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
}


/* =========================================================
   MÀN HÌNH BÌA TRANG CHỦ & MỤC LỤC THAM QUAN
   ========================================================= */
.home-cover-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b2a5b;
}

/* Ảnh bìa mới (trọn bộ: banner, tiêu đề, ảnh đền, mã QR) */
.home-cover-art {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: url('/images/home/cover-art.jpg') center top / 100% 100% no-repeat;
}

.home-header-img,
.home-title-img {
  display: block;
  width: 100%;
  height: auto;
}

.home-header-img {
  margin-top: 44px;
}

.home-title-wrap {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  pointer-events: none;
}

.home-title-wrap .home-title-img {
  animation: homeTitleSlide 2.6s ease-in-out both;
}

@keyframes homeTitleSlide {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(110%); }
  100% { transform: translateX(0); }
}

.home-footer-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
}

.home-footer-img {
  display: block;
  width: 100%;
  height: auto;
}

/* Thanh điều khiển dưới cùng: Mục lục (trái) + Phần tiếp theo (phải) */
.home-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--guide-bottom-height);
  z-index: 18;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  background: rgba(3, 12, 24, 0.92);
}

.home-bar-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
}

.home-bar-btn:active {
  opacity: 0.6;
}

.home-bar-icon {
  width: 22px;
  height: 22px;
  color: #fff;
  display: block;
}

/* Vùng bấm trên vòng tròn QR trong ảnh footer */
.home-qr-hotspot-btn {
  position: absolute;
  left: 78%;
  top: 86%;
  width: 20%;
  height: 12%;
  z-index: 18;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
/* Sơ đồ và chuyên đề. */
.toc-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(32, 9, 13, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInToc 0.2s ease-out;
}

@keyframes fadeInToc {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toc-parchment-sheet {
  position: relative;
  width: 100%;
  max-width: 510px;
  height: 100%;
  background: var(--red-main);
  overflow: hidden;
  box-shadow: 0 0 32px rgba(29, 14, 5, 0.32);
}

.toc-scroll-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  background: radial-gradient(ellipse at top, var(--red-light), var(--red-main) 420px, var(--red-deep) 100%);
  display: flex;
  flex-direction: column;
}

.toc-header-banner {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--red-deep);
  border-bottom: 1px solid var(--guide-line);
}

.toc-top-close-btn,
.visit-menu-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--guide-line);
  border-radius: 9px;
  background: transparent;
  color: var(--gold-light);
  font: 24px/1 system-ui, sans-serif;
  cursor: pointer;
}

.toc-top-close-btn:focus-visible,
.visit-menu-close:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.toc-title {
  margin: 0;
  color: var(--guide-cream);
  font: 700 clamp(16px, 4.7vw, 22px)/1.3 'Hoa Lu Menu', Georgia, serif;
}

.toc-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
  padding: 16px 16px 0;
}

.toc-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--guide-line);
  border-radius: 12px;
  background: var(--red-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.toc-card:focus-visible,
.toc-close-pill-btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.toc-card:active .toc-card-thumb-wrap {
  transform: scale(0.97);
}

.toc-card-thumb-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-bottom: 1px solid var(--guide-line);
  overflow: hidden;
  background: var(--red-main);
  transition: transform 0.15s ease;
}

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

.toc-card-label {
  padding: 8px 8px 10px;
  font: 700 clamp(13px, 3.8vw, 15px)/1.4 'Hoa Lu Menu', Georgia, serif;
  color: var(--guide-cream);
  white-space: pre-line;
}

.toc-footer-lotus {
  display: flex;
  justify-content: center;
  padding: 18px 16px;
  margin-top: auto;
  flex-shrink: 0;
}

.toc-close-pill-btn {
  min-height: 44px;
  padding: 0 28px;
  border: 1px solid var(--gold);
  border-radius: 9px;
  background: var(--gold-light);
  color: var(--red-deep);
  font: 700 14px/1.3 system-ui, sans-serif;
  cursor: pointer;
}

@media (min-width: 640px) {
  .toc-parchment-sheet {
    max-height: 90%;
    border: 1px solid var(--guide-line);
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toc-modal-backdrop { animation: none; }
  .toc-card-thumb-wrap { transition: none; }
}

.qr-modal-body {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-size: 0.8rem;
  color: #cbd5e1;
}


/* =========================================================
   SƠ ĐỒ THAM QUAN ĐỀN THỜ VUA LÊ ĐẠI HÀNH (bg-den-le.jpg - 539x1078)
   ========================================================= */
.ldh-top-intro {
  position: absolute;
  top: 42px;
  left: 34px;
  right: 34px;
  z-index: 6;
  display: flex;
  flex-direction: column;
}

.ldh-heading-group {
  margin-left: 195px;
  text-align: center;
  margin-bottom: 10px;
}

.ldh-sub-script {
  display: block;
  font-family: var(--font-sub);
  font-style: italic;
  font-size: 20px;
  color: #6c0000;
}

.ldh-main-heading {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: #6c0000;
  letter-spacing: 0.4px;
}

.ldh-intro-paragraph {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.44;
  color: #1e293b;
  text-align: justify;
  margin-top: 38px;
}

.ldh-dropcap {
  float: left;
  font-family: var(--font-sub);
  font-size: 46px;
  font-weight: 800;
  line-height: 0.85;
  color: #6c0000;
  padding-right: 8px;
  padding-top: 3px;
}

/* Chữ số 1..8 đặt khớp vào giữa các lá cờ đỏ của bg-den-le.jpg */
.ldh-flag-num-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  width: 34px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

/* Khối danh mục dưới của Đền Vua Lê (y: 71.5% -> 98% trên khung 539x1078) */
.ldh-bottom-section {
  position: absolute;
  top: 768px;
  left: 38px;
  right: 28px;
  bottom: 18px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ldh-sketch-title-vi {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  color: #6c0000;
  letter-spacing: 0.3px;
}

.ldh-sketch-title-en {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: #d4282f;
  margin-top: 2px;
  margin-bottom: 4px;
}

.ldh-instruction {
  margin-bottom: 10px;
  font-size: 12.5px;
}


/* =========================================================
   CÁC TRANG BÀI VIẾT TRONG KHUNG SÁCH LẬT (539x1078)
   ========================================================= */
.codo-intro-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f9f6ee;
  color: #1e293b;
  overflow: hidden;
}

.codo-cloud-bg {
  position: absolute;
  inset: 0;
  width: 539px;
  height: 1078px;
  object-fit: cover;
  opacity: 0.92;
  pointer-events: none;
}

.codo-page-card {
  position: relative;
  z-index: 5;
  width: 539px;
  height: 1078px;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  padding-bottom: 20px;
  overflow-y: auto;
  scrollbar-width: none;
}

.codo-page-card::-webkit-scrollbar {
  display: none;
}

.codo-top-banner {
  position: relative;
  width: 100%;
  flex-shrink: 0;
}

.codo-roof-img {
  width: 100%;
  height: auto;
  display: block;
}

.codo-header-titles {
  position: absolute;
  top: 26%;
  left: 34%;
  right: 4%;
  text-align: center;
}

.codo-sub-label {
  display: block;
  font-family: var(--font-sub);
  font-style: italic;
  font-size: 19px;
  color: #6c0000;
  margin-bottom: 4px;
}

.codo-main-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6c0000;
  line-height: 1.25;
  letter-spacing: 0.4px;
}

.codo-article-body {
  padding: 12px 34px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.codo-article-body.page2-body {
  padding-top: 42px;
}

.codo-p {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.5;
  color: #1e293b;
  text-align: justify;
}

.codo-dropcap {
  float: left;
  font-family: var(--font-sub);
  font-size: 48px;
  font-weight: 800;
  line-height: 0.85;
  color: #6c0000;
  padding-right: 8px;
  padding-top: 4px;
}

.codo-media-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.codo-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #d4a351;
  background: #000000;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.codo-video-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.codo-media-caption {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15.5px;
  font-weight: 600;
  color: #854d0e;
}

.codo-photos-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.codo-photo-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.codo-photo-box img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #d4a351;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.codo-page-number {
  margin-top: auto;
  text-align: right;
  padding-right: 34px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #6c0000;
  padding-top: 8px;
}

.codo-pager-group {
  pointer-events: auto;
  display: flex;
  gap: 6px;
}

.codo-page-btn {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.codo-page-btn.is-active {
  background: #b45309;
  border-color: #fde68a;
  color: #ffffff;
}


.codo-portrait-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.codo-portrait-frame {
  width: 74%;
  max-width: 360px;
  aspect-ratio: 1 / 0.96;
  border-radius: 14px;
  border: 2.5px solid #d4a351;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(62, 34, 6, 0.28);
  background: #1c1108;
}

.codo-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.codo-side-float-wrap {
  display: block;
}

.codo-float-thumb {
  float: right;
  width: 44%;
  max-width: 210px;
  aspect-ratio: 1 / 1.05;
  margin: 4px 0 10px 16px;
  border-radius: 12px;
  border: 2px solid #d4a351;
  overflow: hidden;
  box-shadow: 0 5px 14px rgba(62, 34, 6, 0.25);
  background: #1c1108;
}

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

.codo-poem-quote {
  padding: 8px 16px;
  border-left: 3px solid #b45309;
  background: rgba(217, 119, 6, 0.08);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 16.5px;
  color: #7c2d12;
  line-height: 1.45;
}

/* Thanh dưới cùng ở các trang nội dung */
.home-bottom-bar.bottom-bar-center {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}

.bottom-bar-side {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.bottom-bar-side .home-bar-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.bottom-bar-side-right {
  justify-content: flex-end;
}

.bottom-bar-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pager-arrow-btn {
  width: 26px;
  height: 34px;
  flex-shrink: 0;
}

.bottom-bar-page {
  width: 136px;
  max-width: 36vw;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #b1b1b1;
  border-radius: 2px;
  text-align: center;
  color: #ffffff;
  font-size: 0.95rem;
}

/* =========================================================
   THANH ĐIỀU KHIỂN TRÊN CÙNG (#topControl - Home + 4 cờ ngôn ngữ)
   ========================================================= */
.top-control-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--guide-top-height);
  z-index: 35;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  background: rgba(12, 16, 22, 0.85);
}

.top-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.top-control-btn:active {
  opacity: 0.7;
}

.top-home-icon {
  width: 24px;
  height: 24px;
  color: #ffffff;
  display: block;
}

.top-flag-btn svg {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: block;
  transition: width 0.15s ease, height 0.15s ease;
}

.top-flag-btn.is-active svg {
  width: 30px;
  height: 30px;
}


/* =========================================================
   HÌNH ẢNH CHUYỂN ĐỘNG TƯƠNG TÁC CỔ TRANG + GIỌNG ĐỌC KARAOKE
   ========================================================= */
.royal-story-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding-top: 44px;
  padding-bottom: 48px;
  background: linear-gradient(180deg, #f9eed2 0%, #fbefd4 52%, #fceed4 100%);
  color: #5f1410;
}

.royal-bg-header-art {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  width: 100%;
  height: 146px;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, #000000 66%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000000 66%, transparent 100%);
}

.royal-bg-footer-art {
  position: absolute;
  bottom: 48px;
  left: 0;
  right: 0;
  width: 100%;
  height: 112px;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to top, #000000 72%, transparent 100%);
  mask-image: linear-gradient(to top, #000000 72%, transparent 100%);
}

.royal-story-container {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 14px 50px;
}

/* Nút vuông đỏ viền vàng PDF ở góc trên bên phải */
.royal-pdf-square-btn {
  position: absolute;
  top: 7px;
  right: 12px;
  z-index: 16;
  width: 38px;
  height: 38px;
  padding: 2px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(145deg, #fce29c 0%, #c6811f 50%, #f1c96e 100%);
  box-shadow: 0 3px 9px rgba(88, 22, 10, 0.32);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.royal-pdf-square-btn:active {
  transform: scale(0.93);
}

.royal-pdf-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: radial-gradient(
    circle at 50% 20%,
    #cb2c28 0%,
    #8e1512 62%,
    #630a08 100%
  );
  box-shadow: inset 0 1px 1.5px rgba(255, 232, 195, 0.48);
}

.royal-pdf-svg {
  width: 22px;
  height: 24px;
  display: block;
}

/* Cụm Tiêu đề Đỏ Trầm 2 Dòng + Hoa văn Vàng dưới Tiêu đề */
.royal-story-header {
  flex-shrink: 0;
  padding: 23px 6px 1px;
  text-align: center;
}

.royal-story-heading {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-family: 'Playfair Display', 'Lora', Georgia, serif;
  font-size: clamp(1rem, 4.35vw, 1.24rem);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #611310;
  text-shadow: 0 1px 2px rgba(255, 250, 236, 0.92);
}

.royal-divider-wrap {
  display: flex;
  justify-content: center;
  margin: 2px auto 5px;
}

.royal-flourish-svg {
  width: 214px;
  height: 15px;
  display: block;
}

/* Khung Tranh Hoàng Gia Viền Vàng 4 Góc Hoa Văn Cổ Trang */
.royal-portrait-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 3px;
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    #f6cf7a 0%,
    #be7a1d 34%,
    #fce19c 68%,
    #99580d 100%
  );
  box-shadow:
    0 8px 22px rgba(84, 38, 6, 0.24),
    0 0 0 1px rgba(154, 92, 18, 0.45);
  cursor: pointer;
  user-select: none;
}

.royal-portrait-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 11px;
  overflow: hidden;
  background: #270e08;
  border: 1px solid rgba(255, 236, 182, 0.65);
}

.royal-frame-corner {
  position: absolute;
  width: 42px;
  height: 42px;
  z-index: 12;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(45, 16, 2, 0.45));
}

.royal-frame-corner.corner-tl {
  top: 2px;
  left: 2px;
}

.royal-frame-corner.corner-tr {
  top: 2px;
  right: 2px;
  transform: scaleX(-1);
}

.royal-frame-corner.corner-bl {
  bottom: 2px;
  left: 2px;
  transform: scaleY(-1);
}

.royal-frame-corner.corner-br {
  bottom: 2px;
  right: 2px;
  transform: scale(-1, -1);
}

.royal-artwork-layer {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  will-change: transform, opacity;
}

.royal-artwork-layer.is-prev-layer {
  z-index: 1;
}

.royal-artwork-layer.is-current-layer {
  z-index: 2;
}

.royal-artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Chuyển động điện ảnh Ken Burns + hòa tan êm mượt */
.royal-artwork-layer.is-current-layer.kb-zoom-in-right {
  animation:
    royalCrossFade 0.85s ease-out both,
    kbZoomInRight 22s ease-out forwards;
}

.royal-artwork-layer.is-current-layer.kb-pan-left {
  animation:
    royalCrossFade 0.85s ease-out both,
    kbPanLeft 22s ease-in-out forwards;
}

.royal-artwork-layer.is-current-layer.kb-pan-up {
  animation:
    royalCrossFade 0.85s ease-out both,
    kbPanUp 22s ease-out forwards;
}

.royal-artwork-layer.is-current-layer.kb-zoom-out {
  animation:
    royalCrossFade 0.85s ease-out both,
    kbZoomOut 22s ease-out forwards;
}

@keyframes royalCrossFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes kbZoomInRight {
  0% {
    transform: scale(1) translate3d(-1.2%, 0.5%, 0);
  }
  100% {
    transform: scale(1.11) translate3d(1.5%, -1.2%, 0);
  }
}

@keyframes kbPanLeft {
  0% {
    transform: scale(1.08) translate3d(2.2%, 0, 0);
  }
  100% {
    transform: scale(1.11) translate3d(-2.2%, -0.8%, 0);
  }
}

@keyframes kbPanUp {
  0% {
    transform: scale(1.05) translate3d(0, 1.8%, 0);
  }
  100% {
    transform: scale(1.12) translate3d(0, -1.8%, 0);
  }
}

@keyframes kbZoomOut {
  0% {
    transform: scale(1.13) translate3d(0, -0.8%, 0);
  }
  100% {
    transform: scale(1.01) translate3d(0, 0.4%, 0);
  }
}

.royal-inner-shadow {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  box-shadow: inset 0 0 22px rgba(36, 12, 3, 0.36);
}

/* Hạt bụi ánh vàng bay nhẹ trong khung tranh */
.royal-particles {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.royal-particle-dot {
  position: absolute;
  bottom: 12%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fff3b0 0%,
    #f59e0b 70%,
    transparent 100%
  );
  box-shadow: 0 0 7px rgba(251, 191, 36, 0.82);
  opacity: 0;
  animation: floatGoldenDust 8.6s linear infinite;
}

@keyframes floatGoldenDust {
  0% {
    transform: translate3d(0, 30px, 0) scale(0.7);
    opacity: 0;
  }
  22% {
    opacity: 0.72;
  }
  80% {
    opacity: 0.5;
  }
  100% {
    transform: translate3d(14px, -290px, 0) scale(1.1);
    opacity: 0;
  }
}

.royal-paused-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 9, 4, 0.18);
  pointer-events: none;
}

.royal-paused-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fce097;
  background: rgba(114, 20, 16, 0.84);
  color: #fff6dc;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.royal-video-badge-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 11;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1.5px solid #f7d688;
  background: linear-gradient(135deg, #9f1b17, #6e0e0b);
  color: #fff5db;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* Khung Phụ đề Karaoke Cổ trang + Sóng âm Vàng Đối xứng */
.royal-caption-card {
  position: relative;
  flex-shrink: 0;
  margin-top: 8px;
  padding: 10px 14px 8px;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 244, 0.94) 0%,
    rgba(253, 243, 219, 0.92) 100%
  );
  border: 1.5px solid #deb05b;
  box-shadow:
    0 4px 14px rgba(130, 80, 16, 0.12),
    inset 0 0 0 2px rgba(255, 250, 238, 0.82);
  cursor: pointer;
  user-select: none;
}

.caption-corner-curl {
  position: absolute;
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.caption-corner-curl.curl-tl {
  top: 2px;
  left: 2px;
}

.caption-corner-curl.curl-tr {
  top: 2px;
  right: 2px;
  transform: scaleX(-1);
}

.caption-corner-curl.curl-bl {
  bottom: 2px;
  left: 2px;
  transform: scaleY(-1);
}

.caption-corner-curl.curl-br {
  bottom: 2px;
  right: 2px;
  transform: scale(-1, -1);
}

.royal-caption-text {
  margin: 0;
  text-align: center;
  font-family: 'Lora', 'Be Vietnam Pro', Georgia, serif;
  font-size: clamp(0.88rem, 3.75vw, 0.99rem);
  line-height: 1.54;
  color: #74221b;
  font-weight: 600;
}

.royal-phrase {
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.royal-phrase.is-highlighted {
  background: linear-gradient(
    180deg,
    rgba(244, 206, 130, 0.78) 0%,
    rgba(235, 184, 92, 0.86) 100%
  );
  color: #4d0e0a;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 6px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.royal-waveform-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  height: 16px;
  padding: 0 6px;
}

.royal-wave-dots {
  flex: 1;
  height: 0;
  border-bottom: 2px dotted #dda94b;
  opacity: 0.82;
}

.royal-wave-eq {
  display: inline-flex;
  align-items: center;
  gap: 2.2px;
  height: 16px;
}

.royal-wave-stick {
  display: block;
  width: 2px;
  height: var(--bar-h, 6px);
  border-radius: 2px;
  background: linear-gradient(180deg, #e8b455 0%, #c47f1e 100%);
  transform-origin: center center;
}

.royal-wave-eq.is-speaking .royal-wave-stick {
  animation: royalWavePulse 0.85s ease-in-out infinite;
  animation-delay: var(--bar-delay, 0s);
}

.royal-wave-eq.is-paused .royal-wave-stick {
  transform: scaleY(0.45);
  opacity: 0.62;
  transition: transform 0.25s ease;
}

@keyframes royalWavePulse {
  0%,
  100% {
    transform: scaleY(0.48);
  }
  50% {
    transform: scaleY(1.08);
  }
}

/* Modal xem Video Tư liệu phong cách Cổ trang */
.royal-video-backdrop {
  position: absolute;
  inset: 0;
  z-index: 32;
  background: rgba(20, 10, 4, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 60px;
}

.royal-video-dialog {
  width: 100%;
  max-width: 360px;
  background: #fbf1d8;
  border: 2px solid #d49836;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.6);
}

.royal-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b1510;
}

.royal-video-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #d49836;
  background: #fff8e7;
  color: #6b1510;
  font-weight: 700;
  cursor: pointer;
}

.royal-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #d49836;
  background: #000000;
}

.royal-video-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* =========================================================
   CHẾ ĐỘ XEM LẠI CÁC TRANG PDF LẬT NGUYÊN BẢN NHƯ CŨ (FlipbookPage)
   ========================================================= */
.classic-pdf-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.classic-pdf-back-btn {
  position: absolute;
  top: 50px;
  right: 10px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid #fbbf24;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(6px);
  color: #fef08a;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.48);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.classic-pdf-back-btn:hover {
  background: rgba(30, 41, 59, 0.96);
}

.classic-pdf-back-btn:active {
  transform: scale(0.95);
}


/* =========================================================
   TAB "GOC CHUP DEP NHAT"
   ========================================================= */
.photo-spots-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f6e9c8 url('/images/article-cloud-bg.jpg') center / cover no-repeat;
}

.photo-spots-body {
  position: absolute;
  inset: var(--guide-top-height) 0 var(--guide-bottom-height);
  overflow-y: auto;
  padding: 28px 20px 90px;
  z-index: 5;
}

.photo-spots-title {
  margin: 0 0 22px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7a1f1a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.photo-spots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  justify-items: center;
}

.photo-spots-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2.5px solid #d5a24a;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(92, 54, 12, 0.22);
  background: #271709;
}

.photo-spots-frame-wide {
  grid-column: 1 / -1;
  width: 50%;
  aspect-ratio: 4 / 5;
}

.photo-spots-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-spots-socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.photo-spots-social {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  font-family: var(--font-serif);
}

.photo-spots-lotus {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--guide-bottom-height);
  width: 100%;
  height: auto;
  pointer-events: none;
  z-index: 4;
}


/* =========================================================
   SO DO THAM QUAN (anh moi + chu thich dang 2 cot)
   ========================================================= */
.mapv-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 26px 24px 0;
  text-align: center;
  z-index: 6;
}

.mapv-title-vi {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.2;
  color: #7a1f1a;
}

.mapv-title-en {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  color: #5b3a1a;
}

.mapv-image-wrap {
  position: absolute;
  left: 0;
  width: 539px;
  z-index: 5;
}

.mapv-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mapv-pin-hit {
  position: absolute;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.mapv-legend {
  position: absolute;
  left: 14px;
  right: 14px;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 8px;
  padding: 16px 14px;
  background: rgba(255, 249, 232, 0.96);
  border: 2px solid #d5a24a;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(92, 54, 12, 0.2);
}

.mapv-legend-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mapv-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.mapv-badge {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #c4262e, #8f1018);
  border: 2.5px solid #d5a24a;
  color: #fff;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}

.mapv-legend-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mapv-legend-vi {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  color: #8f1018;
  text-transform: uppercase;
}

.mapv-legend-en {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  line-height: 1.15;
  color: #33415c;
}


/* =========================================================
   THEME THANH NGON NGU (tren) + THANH MENU (duoi): nau do - vang dong
   ========================================================= */
.top-control-bar {
  background: linear-gradient(180deg, #5a1a14 0%, #3f100d 100%);
  border-bottom: 2px solid #d5a24a;
  box-shadow: 0 2px 8px rgba(40, 10, 6, 0.35);
}

.top-home-icon {
  color: #f3d58b;
}

.top-flag-btn {
  padding: 3px;
  border-radius: 50%;
}

.top-flag-btn svg {
  width: 24px;
  height: 24px;
  border: 1.5px solid rgba(243, 213, 139, 0.55);
  opacity: 0.8;
  box-sizing: border-box;
}

.top-flag-btn.is-active svg {
  width: 30px;
  height: 30px;
  opacity: 1;
  border: 2.5px solid #f3d58b;
  box-shadow: 0 0 8px rgba(243, 213, 139, 0.65);
}

.home-bottom-bar {
  background: linear-gradient(180deg, #4a140f 0%, #34100c 100%);
  border-top: 2px solid #d5a24a;
  box-shadow: 0 -2px 8px rgba(40, 10, 6, 0.3);
}

.home-bar-icon {
  color: #f3d58b;
}

.bottom-bar-page {
  background: #f7e9c6;
  color: #5f1410;
  border: 1.5px solid #d5a24a;
  border-radius: 14px;
  font-weight: 600;
}


/* =========================================================
   GIAO DIEN CHU DAO: DO DUN (vuong quyen Dinh - Le)
   ========================================================= */
html,
body,
.mobile-app-root,
.loading-boot-screen {
  background-color: var(--red-main);
}

/* Nen quanh trang sach: son mai do dun, hoa van cheo nhe */
.dth-stf-stage {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(0, 0, 0, 0.1) 0px,
      rgba(0, 0, 0, 0.1) 1.5px,
      rgba(0, 0, 0, 0) 1.5px,
      rgba(0, 0, 0, 0) 5px
    ),
    radial-gradient(ellipse at center, var(--red-light) 0%, var(--red-main) 60%, var(--red-deep) 100%);
}

.top-control-bar {
  padding: 0;
  background: var(--red-deep);
  border-bottom: 1px solid var(--guide-line);
}

.home-bottom-bar {
  padding: 0;
  background: var(--red-deep);
  border-top: 1px solid var(--guide-line);
}

/* ---- Nut vao tham quan tren trang bia ---- */
.home-enter-btn {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  z-index: 20;
  min-width: 62%;
  padding: 13px 22px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, var(--red-light) 0%, var(--red-deep) 100%);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.home-enter-btn:active {
  transform: translateX(-50%) scale(0.97);
}


/* Vung bam nut 3 gach (muc luc) nam san tren anh bia */
.home-menu-hotspot-btn {
  position: absolute;
  left: 1%;
  top: 91%;
  width: 14%;
  height: 7%;
  z-index: 18;
  background: transparent;
  border: none;
  cursor: pointer;
}


/* =========================================================
   TAB KIEN TRUC
   ========================================================= */
.arch-card {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 64px;
  bottom: 90px;
  z-index: 6;
  padding: 26px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 252, 240, 0.97);
  border: 2px solid #d5a24a;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(92, 54, 12, 0.2);
}

.arch-title {
  width: 100%;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid #d5a24a;
  text-align: center;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.22;
  color: #7a1f1a;
}

.arch-title span {
  display: block;
}

.arch-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.arch-photo {
  margin: 0;
  border: 3px solid #d5a24a;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(92, 54, 12, 0.3);
  background: #271709;
}

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

.arch-row .arch-photo {
  aspect-ratio: 110 / 94;
}

.arch-photo-wide {
  width: 72%;
  aspect-ratio: 234 / 166;
}

.arch-caption {
  margin: 8px 0 16px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.25;
  color: #6b4a2a;
}

/* Trang nội dung điểm di tích (nhúng trang gốc) */
.spot-content-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--red-main);
}

.spot-content-frame {
  position: absolute;
  top: var(--guide-top-height);
  left: 0;
  right: 0;
  bottom: var(--guide-bottom-height);
  width: 100%;
  height: calc(100% - var(--guide-top-height) - var(--guide-bottom-height));
  border: 0;
  display: block;
}

.spot-content-loading {
  position: absolute;
  inset: var(--guide-top-height) 0 var(--guide-bottom-height);
  display: grid;
  place-items: center;
  color: #f0d7ab;
  font-size: 14px;
}

/* Sơ đồ tham quan nhúng trang gốc (dth/so-do & ldh/so-do) */
.sodo-iframe-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--red-main);
}

.sodo-iframe {
  position: absolute;
  top: var(--guide-top-height);
  left: 0;
  right: 0;
  bottom: var(--guide-bottom-height);
  width: 100%;
  height: calc(100% - var(--guide-top-height) - var(--guide-bottom-height));
  border: 0;
  display: block;
}

/* Desktop layout shares the same tour content and QR access as mobile. */
.experience-layout, .experience-stage { position: relative; width: 100%; height: 100%; min-width: 0; }
.desktop-nav, .desktop-home { display: none; }

@media (min-width: 769px) {
  .experience-layout { display: flex; background: var(--red-main); }
  .experience-stage { flex: 1; overflow: hidden; }
  .desktop-nav { display: flex; flex: 0 0 246px; flex-direction: column; height: 100%; padding: 28px 15px 18px; background: var(--red-deep); color: var(--guide-cream); border-right: 1px solid var(--guide-line); }
  .desktop-brand { display: flex; align-items: center; gap: 12px; padding: 0 4px 28px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
  .desktop-brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #bb955b; border-radius: 50%; color: #e7c78e; font: 600 15px Georgia, serif; }
  .desktop-brand strong, .desktop-brand small { display: block; }
  .desktop-brand strong { font: 600 15px Georgia, serif; letter-spacing: .08em; }
  .desktop-brand small { margin-top: 4px; color: #c8a87b; font-size: 9px; letter-spacing: .2em; }
  .desktop-nav-heading { padding: 18px 10px 10px; border-top: 1px solid #654039; color: #c39e74; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
  .desktop-nav-list { overflow-y: auto; min-height: 0; }
  .desktop-nav-list button { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 11px 10px; border: 0; border-radius: 5px; background: transparent; color: #e2d0bc; font-size: 12px; line-height: 1.4; text-align: left; cursor: pointer; }
  .desktop-nav-list button:hover, .desktop-nav-list button.is-active { background: var(--red-light); color: var(--guide-cream); }
  .desktop-nav-number { color: #c8a26e; font: 11px Georgia, serif; }
  .desktop-nav-footer { margin: auto 10px 0; padding-top: 16px; color: #af8d70; font-size: 9px; letter-spacing: .14em; }
  .home-cover-screen { display: none; }
  .desktop-home { display: block; height: 100%; overflow: auto; background: #f5f1e8; color: #392722; user-select: text; }
  .desktop-home-header { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0 clamp(24px, 4vw, 64px); border-bottom: 1px solid #e3d9ca; color: #8d7768; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
  .desktop-languages { display: flex; gap: 4px; }
  .desktop-languages button { padding: 7px; border: 0; border-radius: 3px; background: transparent; color: #826b5b; font-size: 11px; cursor: pointer; }
  .desktop-languages button.is-active { background: #6c2921; color: white; }
  .desktop-home-content { max-width: 1400px; margin: auto; padding: 30px clamp(24px, 4vw, 64px) 64px; }
  .desktop-hero { display: flex; align-items: center; min-height: 350px; padding: 40px clamp(30px, 5vw, 72px); background: linear-gradient(90deg, rgba(31, 21, 18, .92) 0%, rgba(44, 28, 22, .75) 40%, rgba(44, 28, 22, .1) 100%), url('/images/menu/item-3-co-do.png') center 48% / cover; color: #fff6e6; }
  .desktop-hero-copy { max-width: 480px; }
  .desktop-eyebrow { color: #bd9864; font-size: 10px; font-weight: 700; letter-spacing: .18em; }
  .desktop-hero h1 { margin: 18px 0; font: 400 clamp(45px, 5vw, 72px)/.98 Georgia, serif; letter-spacing: -.03em; }
  .desktop-hero h1 em { color: #efcf9d; font-weight: 400; }
  .desktop-hero p { max-width: 390px; color: #eee0cc; font-size: 14px; line-height: 1.7; }
  .desktop-hero button { display: inline-flex; gap: 28px; align-items: center; margin-top: 18px; padding: 13px 18px; border: 0; background: #e5c58f; color: #38231c; font-weight: 700; cursor: pointer; }
  .desktop-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 48px 0 22px; }
  .desktop-section-heading h2 { margin: 8px 0 0; font: 400 30px Georgia, serif; color: #50261f; }
  .desktop-section-count { color: #9a8778; font-size: 10px; letter-spacing: .12em; }
  .desktop-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 20px; }
  .desktop-card { padding: 0; border: 0; background: none; color: #422c25; text-align: left; cursor: pointer; }
  .desktop-card-image { display: block; position: relative; aspect-ratio: 1.65; overflow: hidden; background: #e2d6c5; }
  .desktop-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
  .desktop-card:hover img { transform: scale(1.04); }
  .desktop-card-image > span { position: absolute; left: 12px; top: 12px; padding: 6px 8px; background: #f7f0e3; color: #6a3e2e; font: 12px Georgia, serif; }
  .desktop-card-title { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #d9cbbc; font: 16px/1.35 Georgia, serif; }
  .desktop-card-title span { color: #a0744c; }
}

@media (min-width: 769px) and (max-width: 1050px) {
  .desktop-nav { flex-basis: 210px; }
  .desktop-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.guide-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 850px;
  height: 100%;
  margin: 0 auto;
  padding-inline: clamp(8px, 3vw, 20px);
}

.guide-languages {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  gap: 2px;
}

.guide-languages .top-flag-btn {
  flex: 0 1 44px;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
}

.top-flag-btn img { width: 23px; height: 23px; border-radius: 50%; object-fit: cover; }
.guide-languages .top-flag-btn.is-active { border-color: var(--gold); background-color: rgba(242, 214, 164, .17); }
.top-home-btn { min-width: 44px; height: 44px; flex: 0 0 auto; gap: 9px; border-radius: 8px; color: var(--guide-cream); }
.top-home-icon { width: 21px; height: 21px; color: var(--gold-light); }
.guide-home-label { display: none; font: 600 13px/1.25 system-ui, sans-serif; }
.guide-back-icon { font: 29px/1 system-ui, sans-serif; }

.guide-index-button,
.guide-step-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--guide-line);
  border-radius: 9px;
  color: var(--guide-cream);
  background: transparent;
  cursor: pointer;
}

.guide-index-button { padding: 0 11px; font: 700 13px/1 system-ui, sans-serif; }
.guide-index-button span { color: var(--gold-light); font-size: 17px; }
.guide-pagination { display: flex; align-items: center; gap: 4px; }
.guide-step-button { width: 44px; padding: 0 0 3px; font: 26px/1 system-ui, sans-serif; }
.guide-step-button:disabled { opacity: .35; cursor: default; }
.guide-page-count { min-width: 55px; text-align: center; color: var(--gold-light); font: 600 13px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }

@media (hover: hover) {
  .guide-languages button:hover,
  .top-home-btn:hover,
  .guide-index-button:hover,
  .guide-step-button:enabled:hover { background-color: rgba(242, 214, 164, .14); }
}

.guide-bar-inner button:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: -2px;
}

@media (min-width: 550px) {
  .guide-home-label { display: inline; }
  .top-home-btn { padding-inline: 8px; }
}
