/* Cội nguồn · styles adapted from the supplied OriginStory and OriginArtwork modules. */
.g5o-origin-shell {
  --reading-size: 17px;
  position: relative;
  background:
    radial-gradient(circle at 15% 10%, rgba(235, 198, 120, 0.25), transparent 40%),
    radial-gradient(circle at 88% 25%, rgba(44, 102, 71, 0.08), transparent 45%),
    linear-gradient(180deg, #faf2dc 0%, #fffaf0 22%, #f9f0d8 68%, #f3e6c6 100%);
  color: #2d3026;
  padding-bottom: 64px;
}

.g5o-origin-shell button:focus-visible,
.g5o-origin-shell a:focus-visible,
.g5o-contents-dialog button:focus-visible,
.g5o-contents-dialog input:focus-visible {
  outline: 3px solid #b57b29;
  outline-offset: 4px;
}

.g5o-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.g5o-intro-band {
  position: relative;
  overflow: hidden;
  padding: 48px 0 0;
  border-bottom: 4px solid #b68a45;
  background:
    radial-gradient(circle at 77% 25%, rgba(213, 169, 82, 0.16), transparent 34%),
    radial-gradient(circle at 0% 95%, rgba(94, 137, 93, 0.16), transparent 35%),
    linear-gradient(125deg, #10291e 0%, #183c2c 53%, #10291e 100%);
}

.g5o-intro-band::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: repeating-linear-gradient(110deg, transparent 0 42px, rgba(228, 195, 129, .16) 43px, transparent 44px);
  pointer-events: none;
}

.g5o-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: 570px;
  padding-bottom: 42px;
}

.g5o-intro-copy {
  max-width: 560px;
  padding-bottom: 10px;
}

.g5o-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #e2bd75;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2.3px;
}

.g5o-hero-eyebrow-line {
  width: 26px;
  height: 1px;
  background: #e2bd75;
}

.g5o-intro-copy h1 {
  font-family: 'Charm', cursive;
  font-weight: 700;
  font-size: clamp(42px, 4.3vw, 64px);
  line-height: 1.3;
  color: #fff7df;
  margin: 28px 0 22px;
  text-wrap: balance;
  text-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}

.g5o-intro-copy h1 em {
  color: #e5bd70;
  font-style: normal;
}

.g5o-intro-copy p {
  color: #d6dec9;
  font-size: 16px;
  line-height: 1.8;
  margin: 0;
}

.g5o-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.g5o-hero-primary, .g5o-hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 11px;
  padding: 13px 20px;
  font-size: 13px;
  font-weight: 900;
  transition: transform .2s ease, background .2s ease;
}

.g5o-hero-primary {
  border: 1px solid #e9c37a;
  background: #e9c37a;
  color: #173727;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.g5o-hero-secondary {
  border: 1px solid rgba(240, 220, 170, .5);
  background: rgba(255, 255, 255, .05);
  color: #fff4d9;
}

.g5o-hero-primary:hover, .g5o-hero-secondary:hover { transform: translateY(-3px); }
.g5o-hero-primary:hover { background: #ffdb90; }
.g5o-hero-secondary:hover { background: rgba(255, 255, 255, .12); }

.g5o-hero-facts {
  display: flex;
  gap: 26px;
  margin-top: 49px;
  padding-top: 22px;
  border-top: 1px solid rgba(231, 199, 139, .3);
}

.g5o-hero-facts span { display: flex; flex-direction: column; }
.g5o-hero-facts strong { color: #f4d28c; font: 700 28px/1 'Baloo 2', sans-serif; }
.g5o-hero-facts small { color: #b6c8ad; font-size: 11px; font-weight: 800; }

.g5o-journey-panel {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(236, 203, 141, .52);
  border-radius: 28px;
  padding: 19px 21px 13px;
  background: linear-gradient(145deg, #e5cf9b, #f6ead0 50%, #d9bd80);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .3), inset 0 0 0 7px rgba(255, 249, 226, .32);
  transform: none;
}

.g5o-journey-panel::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(104, 76, 36, .22);
  border-radius: 20px;
  pointer-events: none;
}

.g5o-journey-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #614b2c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.g5o-journey-top { padding: 2px 8px 0; }
.g5o-journey-top span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.g5o-map-canvas-frame {
  position: relative;
  height: clamp(300px, 26vw, 370px);
  margin: 12px 0 10px;
  overflow: hidden;
  border: 1px solid rgba(76, 106, 76, .34);
  border-radius: 16px;
  background: #e7edda;
}
.g5o-map-land-canvas, .g5o-map-route-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.g5o-map-route-canvas { pointer-events: none; }
.g5o-map-north {
  position: absolute;
  left: 13px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #40644b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.g5o-map-north span { font-size: 16px; color: #a46236; }
.g5o-map-sea {
  position: absolute;
  right: 7%;
  top: 44%;
  color: rgba(49, 102, 111, .56);
  font-family: 'Charm', cursive;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  writing-mode: vertical-rl;
}
.g5o-map-stops {
  display: flex;
  overflow-x: auto;
  scrollbar-width: thin;
  gap: 5px;
  margin-top: 13px;
  padding-bottom: 3px;
}
.g5o-map-stop {
  display: flex;
  flex-direction: column;
  flex: 0 0 110px;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(94, 85, 55, .26);
  border-radius: 9px;
  background: rgba(255, 251, 236, .6);
  color: #3b4d3b;
  text-align: left;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.g5o-map-stop:hover, .g5o-map-stop:focus-visible { transform: translateY(-2px); background: #fff9e7; border-color: #a15b37; }
.g5o-map-stop-active { background: #204b35; border-color: #204b35; color: #fff7dd; }
.g5o-map-stop-active:hover { background: #2a6044; color: #fff7dd; }
.g5o-map-stop-number { color: #a34c31; font: 800 17px/1 'Baloo 2', sans-serif; }
.g5o-map-stop-active .g5o-map-stop-number { color: #e7c379; }
.g5o-map-stop strong { display: block; font-size: 11px; line-height: 1.2; }
.g5o-map-place-legend { display: flex; flex-wrap: wrap; gap: 5px 10px; margin: -2px 1px 2px; }
.g5o-map-place-legend span { display: inline-flex; align-items: center; gap: 4px; color: #4b6049; font-size: 9px; font-weight: 800; }
.g5o-map-place-legend b { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #fff4d8; border: 1px solid #a23c2d; color: #8b3328; font-size: 9px; }
.g5o-map-scene-body {
  padding: 12px 3px 3px;
  color: #40503d;
}
.g5o-map-scene-kicker { color: #9b5432; font-size: 9px; font-weight: 900; letter-spacing: 1.5px; }
.g5o-map-evidence {
  display: inline-block;
  margin-left: 8px;
  color: #2f6447;
  font-size: 9px;
  font-weight: 900;
}
.g5o-map-scene-body h2 { color: #214832; font: 700 21px/1.25 'Baloo 2', sans-serif; margin: 3px 0 5px; }
.g5o-map-scene-body > p { color: #5e614d; font-size: 11px; line-height: 1.5; margin: 0 0 9px; }
.g5o-map-scene-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  counter-reset: map-fact;
}
.g5o-map-scene-facts-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g5o-map-scene-facts li {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(106, 112, 75, .2);
  border-radius: 7px;
  background: rgba(255, 252, 240, .68);
  color: #4b5b42;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 800;
}
.g5o-map-scene-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.g5o-map-scene-foot small { color: #806d50; font-size: 9px; line-height: 1.3; }
.g5o-map-scene-foot button { flex: 0 0 auto; border: 0; background: none; color: #9a3229; font-size: 10px; font-weight: 900; padding: 4px 0; }
.g5o-map-scene-foot button:hover { text-decoration: underline; }
.g5o-journey-panel > p { color: #766145; font-size: 10px; font-weight: 800; text-align: center; margin: 9px 0 0; }
.g5o-journey-panel > p a { color: #3c654b; text-decoration: underline; }

.g5o-progress-dock {
  position: sticky;
  top: var(--site-header-height);
  z-index: 25;
  background: rgba(250, 242, 220, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e4d4b0;
}

.g5o-slide-nav-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.g5o-icon-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #d9c7a0;
  background: #fffdf7;
  color: #1d4a33;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}

.g5o-icon-circle-btn:hover:not(:disabled) {
  background: #f3e4c3;
  border-color: #b79657;
}

.g5o-icon-circle-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.g5o-story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  padding-top: 40px;
}

.g5o-chapters-column {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.g5o-chapter-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  outline: none;
}

.g5o-chapter-surface {
  background: rgba(255, 253, 247, 0.95);
  border: 1px solid #e5d6b4;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 8px 30px rgba(58, 43, 18, 0.04);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.g5o-chapter-surface-active {
  border-color: #c79545;
  box-shadow: 0 8px 32px rgba(34, 62, 43, 0.07);
}

.g5o-chapter-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.g5o-chapter-kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #9e6521;
}

.g5o-chapter-location-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf3e5;
  color: #24573b;
  font-size: 11px;
  font-weight: 800;
}

.g5o-chapter-title {
  font-family: 'Charm', cursive;
  font-weight: 700;
  font-size: clamp(28px, 2.7vw, 38px);
  line-height: 1.4;
  color: #163e2b;
  margin: 12px 0 18px;
  text-wrap: pretty;
}

.g5o-chapter-illustration {
  margin: 8px 0 22px;
  padding: 8px;
  border: 1px solid #ded2b6;
  border-radius: 14px;
  background: #f6edd7;
}


.g5o-chapter-period {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #961f1d;
}

.g5o-chapter-context-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
.g5o-chapter-evidence {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d9e3ce;
  border-radius: 999px;
  background: #f2f7ec;
  color: #315e41;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 900;
}

.g5o-poem-box {
  background: linear-gradient(135deg, #fbf3df, #f5e9cb);
  border-left: 4px solid #b57a25;
  border-radius: 0 14px 14px 0;
  padding: 15px 18px;
  margin: 0 0 16px;
}

.g5o-poem-text {
  font-family: 'Charm', cursive;
  font-size: calc(var(--reading-size, 17px) + 6px);
  line-height: 1.6;
  color: #204632;
  white-space: pre-line;
  margin: 0 0 6px;
}

.g5o-poem-author {
  font-size: 11px;
  font-weight: 800;
  color: #886c3b;
}

.g5o-chapter-summary {
  font-size: var(--reading-size, 17px);
  line-height: 1.85;
  color: #3f4339;
  margin-bottom: 14px;
}

.g5o-oral-box {
  background: #f3f6ec;
  border: 1px solid #dbe4cf;
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 14px;
}

.g5o-oral-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  color: #295a3d;
  margin-bottom: 5px;
}

.g5o-oral-box p {
  margin: 0;
  font-size: calc(var(--reading-size, 17px) - 2px);
  line-height: 1.8;
  color: #465342;
}

.g5o-chapter-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 17px;
}
.g5o-chapter-details > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #e5d7b7;
  border-radius: 10px;
  background: #fcf7e9;
}
.g5o-chapter-details span {
  display: block;
  margin-bottom: 3px;
  color: #a2662e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .5px;
}
.g5o-chapter-details strong {
  display: block;
  color: #274b35;
  font-size: 11px;
  line-height: 1.4;
}

.g5o-branch-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.g5o-branch-btn {
  text-align: left;
  border: 1px solid #e3d3b1;
  background: #faf3e1;
  border-radius: 13px;
  padding: 11px 12px;
  transition: all 0.2s ease;
}

.g5o-branch-btn:hover,
.g5o-branch-btn-active {
  border-color: #961f1d;
  background: #fff9eb;
  box-shadow: 0 8px 20px rgba(150, 31, 29, 0.1);
}

.g5o-branch-btn strong {
  display: block;
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  color: #163e2b;
  line-height: 1.2;
}

.g5o-branch-btn span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #9c6825;
  margin: 2px 0 4px;
}

.g5o-branch-btn small {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  color: #676051;
}

.g5o-branch-detail {
  position: relative;
  overflow: hidden;
  margin: -2px 0 16px;
  padding: 18px 20px;
  border: 1px solid #d5bc83;
  border-radius: 16px;
  background: linear-gradient(125deg, #1b4b34, #123723);
  color: #f7edd6;
  box-shadow: 0 12px 28px rgba(24, 63, 42, .16);
}
.g5o-branch-detail::after {
  content: '枝';
  position: absolute;
  right: 8px;
  bottom: -37px;
  color: rgba(237, 208, 143, .12);
  font: 700 140px/1 'Charm', cursive;
  pointer-events: none;
}
.g5o-branch-detail span { color: #e7bd6e; font-size: 10px; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; }
.g5o-branch-detail h3 { position: relative; color: #fff5dd; font-size: 23px; margin: 4px 0 5px; }
.g5o-branch-detail p { position: relative; max-width: 60ch; font-size: 13px; line-height: 1.65; margin: 0; }
.g5o-branch-detail .g5o-branch-place { display: flex; align-items: center; gap: 5px; color: #e6cc98; font-weight: 800; margin-bottom: 8px; }

.g5o-chronicle-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.g5o-chronicle-item {
  background: #fcf6e7;
  border: 1px solid #e7d9ba;
  border-radius: 13px;
  padding: 12px;
}

.g5o-chronicle-item strong {
  display: block;
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  line-height: 1;
  color: #961f1d;
  margin-bottom: 5px;
}

.g5o-chronicle-item span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #1d4a33;
  margin-bottom: 4px;
}

.g5o-chronicle-item p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: #6b6455;
}

.g5o-live-numbers-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.g5o-live-stat-card {
  background: linear-gradient(145deg, #1b4b33, #133825);
  color: #faeccb;
  border: 1px solid #d4b169;
  border-radius: 14px;
  padding: 13px 10px;
  text-align: center;
}

.g5o-live-stat-card strong {
  display: block;
  font-family: 'Baloo 2', sans-serif;
  font-size: 30px;
  line-height: 1;
  color: #f3cc7a;
}

.g5o-live-stat-card span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-top: 4px;
  color: #e6ddc4;
}

.g5o-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 12px;
}

.g5o-source-foot {
  font-size: 11px;
  font-weight: 700;
  color: #8c806a;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.g5o-source-foot > span { flex: 1 1 220px; }
.g5o-source-foot button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  color: #285c3d;
  padding: 3px 0;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.g5o-source-foot button:hover, .g5o-source-foot button:focus-visible { text-decoration: underline; }

/* Chapter artwork stays beside the reader on desktop. */
.g5o-stage-column {
  position: sticky;
  top: calc(var(--site-header-height) + 96px);
  min-width: 0;
}

.g5o-stage-frame {
  position: relative;
  border-radius: 18px;
  border: 1px solid #decba2;
  background: #f6edd7;
  box-shadow: 0 10px 35px rgba(42, 34, 16, 0.07);
  overflow: hidden;
  padding: 18px 18px 16px;
}

.g5o-stage-top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 16px;
}

.g5o-stage-chapter-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(23, 59, 42, 0.92);
  color: #f8e5b4;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
}

.g5o-stage-hint {
  font-size: 11px;
  font-weight: 800;
  color: #7c6742;
}

.g5o-stage-caption-bar {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 252, 244, 0.88);
  border: 1px solid #e4d4b0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.g5o-stage-caption-text {
  min-width: 0;
}

.g5o-stage-caption-text strong {
  display: block;
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  color: #163e2b;
  line-height: 1.2;
}

.g5o-stage-caption-text span {
  display: block;
  font-size: 12px;
  color: #6b6352;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g5o-stage-nav-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.g5o-artwork-nav-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #cfb785;
  border-radius: 50%;
  background: #fffcf3;
  color: #315e4c;
  cursor: pointer;
}
.g5o-artwork-nav-button:hover:not(:disabled) { background: #e8eedb; }
.g5o-artwork-nav-button:focus-visible { outline: 2px solid #315e4c; outline-offset: 3px; }
.g5o-artwork-nav-button:disabled { opacity: .35; cursor: default; }

@media (min-width: 961px) {
  .g5o-chapter-illustration { display: none; }
}

@media (min-width: 961px) and (max-height: 850px) {
  .g5o-stage-frame { padding: 14px; }
  .g5o-stage-top-bar { padding-bottom: 12px; }
  .g5o-stage-caption-bar { padding: 9px 12px; }
  .g5o-stage-column { max-height: calc(100dvh - var(--site-header-height) - 108px); overflow-y: auto; scrollbar-width: thin; }
}

@media (max-width: 960px) {
  .g5o-hero-grid { grid-template-columns: 1fr; padding-bottom: 30px; }
  .g5o-intro-copy { max-width: 760px; }
  .g5o-journey-panel { width: min(680px, 100%); margin: 0 auto; transform: none; }
  .g5o-map-canvas-frame { height: 370px; }
  .g5o-story-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .g5o-stage-column {
    position: sticky;
    top: calc(var(--site-header-height) + 48px);
    z-index: 18;
    order: -1;
    background: #faf2dc;
    padding-top: 6px;
    padding-bottom: 10px;
  }
  .g5o-chapter-card {
    min-height: 0;
    padding: 8px 0;
  }
}

@media (max-width: 620px) {
  .g5o-intro-band {
    padding-top: 46px;
  }
  .g5o-intro-copy h1 { font-size: clamp(43px, 11vw, 64px); margin: 20px 0 14px; }
  .g5o-intro-copy p { font-size: 14px; }
  .g5o-hero-facts { gap: 18px; margin-top: 32px; }
  .g5o-hero-facts strong { font-size: 23px; }
  .g5o-hero-facts small { font-size: 10px; }
  .g5o-journey-panel { padding: 15px 14px 12px; border-radius: 20px; }
  .g5o-map-canvas-frame { height: 320px; }
  .g5o-map-stop { flex: 0 0 93px; padding: 7px; }
  .g5o-map-stop-number { font-size: 14px; }
  .g5o-map-stop strong { font-size: 10px; }
  .g5o-map-scene-facts, .g5o-map-scene-facts-four { grid-template-columns: 1fr; }
  .g5o-map-scene-foot { align-items: flex-start; flex-direction: column; }
  .g5o-chapter-surface {
    padding: 20px 18px;
    border-radius: 16px;
  }
  .g5o-branch-cards,
  .g5o-chronicle-list,
  .g5o-live-numbers-row,
  .g5o-chapter-details {
    grid-template-columns: 1fr;
  }
  .g5o-stage-frame {
    padding: 12px;
    border-radius: 18px;
  }
  .g5o-stage-caption-text span {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g5o-hero-primary, .g5o-hero-secondary, .g5o-map-stop { transition: none; }
}

/* Reading controls stay compact while the chapter itself keeps the full viewport. */
.g5o-hero-source { display: flex; align-items: center; gap: 11px; color: #bdcbb8; font-size: 12px; line-height: 1.6; margin-top: 26px; }
.g5o-hero-source svg { flex-shrink: 0; color: #d2ae6b; }
.g5o-restart-link { display: flex; align-items: center; gap: 7px; background: none; border: 0; color: #e3d1a4; font-size: 12px; padding: 14px 0 0; }
.g5o-journey-ribbon { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; border-top: 1px solid #ffffff24; color: #d8cba9; }
.g5o-journey-ribbon > span { display: inline-flex; align-items: center; gap: 10px; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.g5o-journey-ribbon > div { display: flex; align-items: center; gap: 16px; font-size: 12px; }
.g5o-journey-ribbon > div svg { opacity: .5; }
.g5o-journey-ribbon > button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #e5bd7045; border-radius: 50%; background: transparent; color: #e5bd70; }
.g5o-reader-toolbar { display: flex; align-items: center; gap: 24px; min-height: 74px; padding: 12px 0; }
.g5o-contents-trigger { display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; min-height: 42px; padding: 8px 14px; border: 1px solid #d8c6a1; border-radius: 10px; background: #fffdf6; color: #214b35; font-size: 13px; font-weight: 800; }
.g5o-contents-trigger:hover { background: #efe4ca; }
.g5o-contents-count { display: grid; place-items: center; min-width: 23px; height: 23px; background: #eee5d0; border-radius: 5px; font-size: 11px; color: #716349; }
.g5o-reading-position { min-width: 0; flex: 1; border-left: 1px solid #dfd3b8; padding-left: 24px; }
.g5o-reading-position > span { display: block; color: #8c652d; font-size: 10px; font-weight: 900; letter-spacing: 1.3px; }
.g5o-reading-position > span span { color: #8a8270; }
.g5o-reading-position strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; line-height: 1.5; color: #244a35; }
.g5o-reading-tools { display: flex; align-items: center; gap: 4px; }
.g5o-reader-tool { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; background: transparent; color: #5d634f; font-size: 12px; font-weight: 800; white-space: nowrap; }
.g5o-reader-tool:hover:not(:disabled) { background: #eae3cf; color: #214b35; }
.g5o-reader-tool[aria-pressed='true'] { background: #214b35; color: #fff5dc; }
.g5o-reader-tool:disabled { opacity: .55; cursor: default; }
.g5o-text-size-dots { letter-spacing: 1px; min-width: 14px; font-size: 11px; }
.g5o-reading-progress { width: 100%; height: 3px; background: #e5d9be; }
.g5o-reading-progress > span { display: block; height: 100%; background: #9a3f30; transition: width .15s linear; }
.g5o-reader-toolbar .g5o-icon-circle-btn { width: 38px; height: 38px; }
.g5o-next-chapter-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; padding: 20px 28px 0; border: 0; background: none; text-align: left; color: #375c44; }
.g5o-next-chapter-link > span { color: #8b7653; font-size: 9px; letter-spacing: 1.4px; }
.g5o-next-chapter-link strong { display: block; color: #375c44; font-size: 13px; letter-spacing: 0; margin-top: 3px; }
.g5o-next-chapter-link:hover strong { text-decoration: underline; }
.g5o-atlas-tabs { display: flex; align-items: center; gap: 4px; width: fit-content; margin: 0 auto 14px; padding: 4px; border: 1px solid #dacbae; border-radius: 10px; background: #ede5d1; }
.g5o-atlas-tabs button { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 7px; background: transparent; color: #706b59; padding: 8px 18px; font-size: 12px; font-weight: 800; }
.g5o-atlas-tabs button[aria-pressed='true'] { background: #fffaf0; color: #264f37; box-shadow: 0 2px 5px #4e3d1b10; }
.g5o-reader-map { padding: 20px; border: 1px solid #dacaab; border-radius: 18px; background: #f8f0db; }
.g5o-reader-map-heading { display: flex; align-items: center; gap: 8px; color: #2d553d; font-size: 11px; font-weight: 800; }
.g5o-reader-map .g5o-map-canvas-frame { height: min(39vh, 350px); min-height: 230px; }
.g5o-reader-map .g5o-map-scene-body h2 { font-size: 18px; }
.g5o-map-disclaimer { color: #756d58; font-size: 11px; line-height: 1.6; margin-top: 12px; }
.g5o-reader-note { display: flex; align-items: flex-start; gap: 10px; padding: 20px 14px 10px; color: #756b55; }
.g5o-reader-note svg { flex-shrink: 0; margin-top: 3px; color: #9b7840; }
.g5o-reader-note p { font-size: 12px; line-height: 1.7; margin: 0; }
.g5o-atlas-source-link { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 41px; border: 0; background: none; color: #365a40; font-size: 12px; font-weight: 800; }
.g5o-atlas-source-link:hover { text-decoration: underline; }
.g5o-story-closing { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 28px 50px; margin-top: 56px; border-top: 1px solid #d8c7a2; background: radial-gradient(ellipse at center, #fffbef, transparent 70%); }
.g5o-closing-emblem { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 24px; border-radius: 50%; border: 1px solid #cfba87; color: #386348; background: #e8e9d5; }
.g5o-story-closing h2 { color: #244b34; font-size: clamp(28px, 3vw, 40px); margin: 15px 0; }
.g5o-story-closing > p { max-width: 550px; color: #6a6855; font-size: 15px; line-height: 1.8; }
.g5o-closing-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.g5o-back-to-beginning { margin-top: 24px; border: 0; background: none; color: #827251; text-decoration: underline; text-underline-offset: 4px; font-size: 12px; padding: 10px; }

.g5o-contents-dialog { position: fixed; inset: 0; margin: auto; width: min(580px, calc(100% - 32px)); max-height: min(800px, calc(100dvh - 48px)); padding: 0; border: 1px solid #d6c39c; border-radius: 20px; color: #294533; background: #fffbf1; box-shadow: 0 24px 100px #10291e40; overflow: auto; overscroll-behavior: contain; }
.g5o-contents-dialog::backdrop { background: #14291fd1; backdrop-filter: blur(5px); }
.g5o-contents-panel { padding: 26px; }
.g5o-contents-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.g5o-contents-header > div { min-width: 0; }
.g5o-contents-header h2 { margin: 7px 0 0; font-size: 29px; color: #204831; }
.g5o-contents-header > button { flex-shrink: 0; width: 36px; height: 36px; }
.g5o-contents-search { display: flex; align-items: center; gap: 10px; padding: 0 13px; min-height: 48px; border: 1px solid #daceb2; border-radius: 10px; background: #fffdf8; color: #8b7854; }
.g5o-contents-search:focus-within { border-color: #52785a; box-shadow: 0 0 0 3px #52785a18; }
.g5o-contents-search input { width: 100%; min-width: 0; padding: 12px 0; background: transparent; border: 0; color: #2e4a36; font-size: 14px; outline: none !important; }
.g5o-contents-search button { border: 0; background: transparent; display: grid; place-items: center; color: #756a51; padding: 5px; }
.g5o-contents-hint { font-size: 12px; color: #7a725f; margin: 14px 0; }
.g5o-contents-list { display: grid; gap: 5px; }
.g5o-contents-item { display: flex; align-items: center; width: 100%; gap: 14px; padding: 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #416047; text-align: left; }
.g5o-contents-item > span:nth-child(2) { flex: 1; min-width: 0; }
.g5o-contents-item strong { display: block; font-size: 14px; line-height: 1.4; }
.g5o-contents-item small { display: block; color: #847963; font-size: 11px; line-height: 1.5; margin-top: 2px; }
.g5o-contents-item > svg { flex-shrink: 0; }
.g5o-contents-number { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid #ded2b7; border-radius: 8px; color: #92713f; font-size: 14px; font-weight: 800; }
.g5o-contents-item:hover { background: #f1ebd9; }
.g5o-contents-item-active { background: #eaf0e2; border-color: #c9d7bf; }
.g5o-contents-item-active .g5o-contents-number { background: #315b3e; border-color: #315b3e; color: #fff4d9; }
.g5o-contents-empty { padding: 28px 10px; text-align: center; color: #7a725f; line-height: 1.8; font-size: 14px; }
.g5o-contents-footer { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #e7dcc5; color: #8d7a56; font-size: 11px; }

@media (max-width: 1100px) {
  .g5o-reader-toolbar { gap: 14px; }
  .g5o-reading-position { padding-left: 14px; }
  .g5o-stage-hint { display: none; }
  .g5o-story-layout { gap: 24px; }
  .g5o-chapter-surface { padding: 26px; }
}
@media (max-width: 960px) {
  .g5o-intro-band { padding-top: 36px; }
  .g5o-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .g5o-intro-copy h1 { font-size: 44px; }
  .g5o-hero-facts { gap: 18px; margin-top: 28px; }
  .g5o-hero-facts strong { font-size: 24px; }
  .g5o-hero-facts small { font-size: 10px; }
  .g5o-journey-panel { padding: 15px; }
  .g5o-journey-top { font-size: 9px; letter-spacing: 1px; }
  .g5o-journey-top > span:last-child { display: none; }
  .g5o-map-scene-facts { display: none; }
  .g5o-map-scene-foot small { display: none; }
  .g5o-journey-ribbon > span { display: none; }
  .g5o-story-layout { grid-template-columns: minmax(0, 1fr); max-width: 740px; }
  .g5o-stage-column { display: none; }
  .g5o-chapter-card { padding: 0; }
  .g5o-reading-tools .g5o-reader-tool > span:not(.g5o-text-size-dots) { display: none; }
}
@media (max-width: 620px) {
  .g5o-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .g5o-intro-copy h1 { font-size: clamp(38px, 10.3vw, 56px); margin: 20px 0 16px; }
  .g5o-hero-eyebrow { font-size: 9px; letter-spacing: 1.5px; }
  .g5o-hero-eyebrow-line { width: 20px; flex-shrink: 0; }
  .g5o-hero-facts { justify-content: space-between; gap: 12px; margin-top: 28px; }
  .g5o-hero-source { margin-top: 20px; font-size: 11px; }
  .g5o-hero-primary, .g5o-hero-secondary { font-size: 12px; padding: 12px 16px; min-height: 44px; }
  .g5o-journey-panel { border-radius: 16px; }
  .g5o-journey-ribbon { padding: 18px 0; gap: 10px; }
  .g5o-journey-ribbon > div { gap: 8px; font-size: 10px; flex-wrap: wrap; }
  .g5o-journey-ribbon > button { flex-shrink: 0; }
  .g5o-reader-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 12px; padding: 9px 0; }
  .g5o-contents-trigger { padding: 7px 9px; min-height: 38px; gap: 6px; font-size: 12px; }
  .g5o-contents-count { display: none; }
  .g5o-reading-position { padding-left: 10px; }
  .g5o-reading-position strong { font-size: 12px; }
  .g5o-reading-position > span { font-size: 9px; }
  .g5o-reading-tools { grid-row: 2; grid-column: 1 / -1; justify-content: center; gap: 12px; border-top: 1px solid #e7ddc7; padding-top: 5px; }
  .g5o-reading-tools .g5o-reader-tool > span:not(.g5o-text-size-dots) { display: inline; }
  .g5o-reader-tool { min-height: 36px; padding: 7px 10px; font-size: 11px; }
  .g5o-reader-toolbar .g5o-slide-nav-mini { grid-column: 3; grid-row: 1; gap: 4px; }
  .g5o-reader-toolbar .g5o-icon-circle-btn { width: 34px; height: 38px; border-radius: 9px; }
  .g5o-story-layout { padding-top: 24px; }
  .g5o-chapters-column { gap: 24px; }
  .g5o-chapter-surface { padding: 22px 18px; border-radius: 14px; }
  .g5o-chapter-kicker { font-size: 10px; letter-spacing: 1.4px; }
  .g5o-chapter-title { margin: 12px 0 18px; font-size: 30px; }
  .g5o-chapter-location-pill { padding: 0; border-radius: 0; background: transparent; line-height: 1.6; }
  .g5o-chapter-location-pill svg { flex-shrink: 0; }
  .g5o-chapter-details { gap: 0; border: 1px solid #e5d7b7; border-radius: 10px; overflow: hidden; }
  .g5o-chapter-details > div { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 12px; border: 0; border-bottom: 1px solid #e5d7b7; border-radius: 0; padding: 12px; }
  .g5o-chapter-details > div:last-child { border-bottom: 0; }
  .g5o-chapter-details strong { font-size: 12px; }
  .g5o-branch-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5o-branch-btn { padding: 12px; }
  .g5o-branch-btn strong { font-size: 14px; line-height: 1.4; }
  .g5o-live-numbers-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .g5o-live-stat-card strong { font-size: 25px; }
  .g5o-live-stat-card span { font-size: 10px; }
  .g5o-poem-box { padding: 14px; }
  .g5o-next-chapter-link { padding: 18px 18px 0; }
  .g5o-story-closing { margin-top: 32px; padding: 44px 6px 24px; }
  .g5o-story-closing h2 { font-size: 30px; }
  .g5o-contents-panel { padding: 20px 15px; }
  .g5o-contents-header h2 { font-size: 25px; }
  .g5o-contents-item { padding: 10px 8px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .g5o-origin-shell *, .g5o-contents-dialog * { scroll-behavior: auto !important; transition: none !important; }
}

.g5a-artwork {
  width: 100%;
  color: #234d3c;
  font-family: 'Baloo 2', sans-serif;
  font-size: 14px;
  line-height: 1.4;
}
.g5a-landscape { margin: 0; }
.g5a-scene { overflow: hidden; border-radius: 12px; border: 1px solid #d6c9a9; }
.g5a-scene > svg { display: block; width: 100%; height: auto; }
.g5a-landscape figcaption { padding: 15px 4px 5px; }
.g5a-place-pair { display: grid; grid-template-columns: 1.2fr 20px 1fr; gap: 8px; align-items: center; text-align: center; }
.g5a-place-pair strong, .g5a-place-pair small { display: block; }
.g5a-place-pair strong { font-size: 14px; line-height: 1.3; }
.g5a-place-pair small { color: #74664d; font-size: 12px; margin-top: 4px; }
.g5a-scene-caption { display: grid; text-align: center; gap: 3px; }
.g5a-scene-caption strong { font-size: 18px; }
.g5a-scene-caption span { color: #70644e; font-size: 13px; }
.g5a-provenance { margin: 12px 0 0; font-size: 11px; color: #766b56; text-align: center; line-height: 1.5; }
.g5a-voyage-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; }
.g5a-voyage-legend > div + div { border-left: 1px solid #daceb1; }
.g5a-voyage-legend strong { font-size: 24px; line-height: 1; display: block; font-weight: 600; margin-bottom: 7px; }
.g5a-voyage-legend > div:last-child strong { color: #9a4d37; }
.g5a-voyage-legend span { font-size: 12px; display: block; }
.g5a-settlement-labels { display: flex; justify-content: center; align-items: center; gap: 12px; }
.g5a-settlement-labels strong { font-size: 14px; }
.g5a-settlement-labels svg { flex-shrink: 0; color: #987b48; }
.g5a-diagram { padding: 25px 4px 10px; }
.g5a-tree-root { width: 148px; margin: 0 auto; padding: 17px 12px; border: 1px solid #496c50; border-radius: 12px; display: grid; justify-items: center; gap: 5px; background: #2c5643; color: #fff4d6; position: relative; }
.g5a-tree-root strong { font-size: 20px; }
.g5a-tree-root span { font-size: 12px; color: #e0d6b7; }
.g5a-tree-root::after { content: ''; position: absolute; width: 1px; height: 27px; background: #b39558; left: 50%; bottom: -28px; }
.g5a-tree-children { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding-top: 53px; }
.g5a-tree-node { position: relative; padding: 17px 6px 13px; border: 1px solid #b6c0a1; background: #f7f8ec; border-radius: 9px; text-align: center; display: flex; align-items: center; flex-direction: column; gap: 5px; }
.g5a-tree-node::before { content: ''; position: absolute; left: 50%; width: 1px; height: 27px; background: #b39558; top: -28px; }
.g5a-tree-node::after { content: ''; position: absolute; left: calc(-50% - 10px); right: 50%; height: 1px; background: #b39558; top: -28px; }
.g5a-tree-node:first-child::after { display: none; }
.g5a-tree-node strong { font-size: 14px; }
.g5a-tree-node > span:last-child { font-size: 12px; color: #6f6752; line-height: 1.4; }
.g5a-node-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #b39558; left: calc(50% - 3px); top: -4px; }
.g5a-uncertain { border-style: dashed; background: #f6efdf; }
.g5a-uncertain strong { color: #87633e; }
/* Content-level line–star–line; do not modify genealogy diagram connectors. */
.g5a-diagram-note {
  position:relative;
  border-top:0;
  padding-top:42px;
  margin:22px 3px 0;
  font-size:12px;
  color:#70644e;
  text-align:center;
  line-height:1.6;
}
.g5a-diagram-note::before {
  content:"";
  position:absolute;
  inset-inline:0;
  top:0;
  height:24px;
  pointer-events:none;
  background-image:url("ornamental-star.svg"),linear-gradient(#caa45e,#caa45e),linear-gradient(#caa45e,#caa45e);
  background-repeat:no-repeat;
  background-position:center center,left center,right center;
  background-size:24px 24px,calc(50% - 24px) 1px,calc(50% - 24px) 1px;
}
.g5a-migration { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.g5a-migration li { display: flex; align-items: flex-start; gap: 12px; position: relative; }
.g5a-migration li:first-child::after { content: ''; width: 1px; background: #b39558; position: absolute; top: 36px; bottom: -20px; left: 17px; }
.g5a-route-number { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; border: 1px solid #a38b56; color: #f9edcf; background: #315e4c; font-size: 13px; }
.g5a-migration strong { font-size: 16px; }
.g5a-migration strong small { font-size: 12px; font-weight: 400; color: #76634d; }
.g5a-migration p { margin: 4px 0 0; font-size: 13px; color: #6e624b; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.g5a-migration p svg { flex-shrink: 0; }
.g5a-group-label { font-size: 11px; letter-spacing: 1.1px; color: #847044; margin: 24px 0 10px; font-weight: 700; }
.g5a-affiliations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.g5a-affiliations > button, .g5a-affiliations > div { font: inherit; text-align: left; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #c6c9ac; border-radius: 9px; background: #fbf8ec; color: #31543f; min-width: 0; }
.g5a-affiliations > button { cursor: pointer; }
.g5a-affiliations > button:hover { background: #eef0dd; }
.g5a-affiliations > button:focus-visible { outline: 2px solid #315e4c; outline-offset: 3px; }
.g5a-affiliations > button[aria-pressed='true'] { background: #315e4c; color: #fff4d6; border-color: #315e4c; }
.g5a-affiliations svg { flex-shrink: 0; }
.g5a-affiliations strong, .g5a-affiliations small { display: block; }
.g5a-affiliations strong { font-size: 15px; }
.g5a-affiliations small { font-size: 11px; line-height: 1.4; }
.g5a-comparison { display: grid; grid-template-columns: 1fr 80px 1fr; align-items: center; text-align: center; }
.g5a-comparison > div { display: grid; justify-items: center; }
.g5a-comparison svg { width: 90px; height: 100px; }
.g5a-comparison strong { font-size: 17px; }
.g5a-comparison-mark { font-size: 12px; padding: 7px 0; border-top: 1px dashed #b69a62; border-bottom: 1px dashed #b69a62; color: #8a6a3c; }
.g5a-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 25px; text-align: center; }
.g5a-metrics > div { background: #f9f4e6; border: 1px solid #d9cbb0; border-radius: 10px; padding: 13px 8px; }
.g5a-metrics strong, .g5a-metrics span { display: block; }
.g5a-metrics strong { font-size: 31px; line-height: 1.2; font-weight: 600; }
.g5a-metrics span { font-size: 12px; color: #71634b; margin-top: 5px; }
.g5a-chronicles { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.g5a-chronicles li { display: flex; align-items: center; gap: 15px; }
.g5a-chronicles svg { width: 70px; height: 74px; flex-shrink: 0; }
.g5a-chronicles li > div { display: grid; gap: 2px; }
.g5a-chronicles li > div > span { color: #9b5135; font-size: 22px; line-height: 1.2; font-weight: 600; }
.g5a-chronicles strong { font-size: 15px; }
.g5a-chronicles small { font-size: 12px; color: #73654f; }
.g5a-digital-header { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; font-size: 12px; }
.g5a-digital-header svg { color: #927843; }
.g5a-digital-tree { width: 100%; height: auto; display: block; }
@media (min-width: 961px) and (max-height: 850px) {
  .g5a-scene { max-width: 360px; margin-inline: auto; }
  .g5a-landscape figcaption { padding-top: 11px; }
  .g5a-diagram { padding-top: 12px; padding-bottom: 4px; }
  .g5a-diagram-note { margin-top: 14px; padding-top: 38px; }
  .g5a-digital-tree { max-height: 145px; }
  .g5a-digital-header { margin-bottom: 10px; }
  .g5a-metrics { margin-top: 14px; }
  .g5a-metrics > div { padding: 10px 8px; }
  .g5a-metrics strong { font-size: 27px; }
  .g5a-chronicles { gap: 10px; }
}
@media (max-width: 380px) {
  .g5a-place-pair strong, .g5a-settlement-labels strong { font-size: 12px; }
  .g5a-settlement-labels { gap: 7px; }
  .g5a-diagram { padding: 18px 0 8px; }
  .g5a-tree-children { gap: 6px; }
  .g5a-tree-node { padding-inline: 3px; }
  .g5a-tree-node strong { font-size: 12px; }
  .g5a-tree-node > span:last-child { font-size: 11px; }
  .g5a-tree-node::after { left: calc(-50% - 7px); }
  .g5a-migration strong { font-size: 14px; }
  .g5a-migration p { font-size: 12px; }
  .g5a-affiliations > button, .g5a-affiliations > div { padding: 9px 8px; gap: 6px; }
}

.g5h-archive{padding:62px 0 6px;color:#344936}
.g5h-archive [id]{scroll-margin-top:104px}
.g5h-heading{max-width:760px;margin-bottom:27px}
.g5h-heading h2{margin:7px 0 12px}
.g5h-heading p,.g5h-archive article p,.g5h-branches>p,.g5h-ritual>p{line-height:1.75;color:#665e4e}
.g5h-heading p{font-size:15px}
.g5h-contents{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 30px}
.g5h-contents button{border:1px solid #decda9;background:#fffaf0;border-radius:8px;padding:8px 13px;color:#36543c;font-size:12px;font-weight:800}
.g5h-contents button:hover,.g5h-contents button:focus-visible{background:#eaf1dc;border-color:#9db28b}
.g5h-two-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:19px;margin:0 0 20px}
.g5h-card,.g5h-story,.g5h-branches,.g5h-connection,.g5h-tradition,.g5h-details,.g5h-ritual{border:1px solid #e6d8b6;border-radius:18px;background:#fffdf7;box-shadow:0 9px 28px rgba(75,55,24,.055)}
.g5h-card{padding:25px;min-height:280px}
.g5h-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;background:#ecf2e4;color:#2e7144;margin-bottom:16px}
.g5h-card:nth-child(2) .g5h-icon{background:#faecdc;color:#af6330}
.g5h-source{display:block;color:#a46b25;font-size:11px;letter-spacing:.3px;font-weight:900;line-height:1.45}
.g5h-archive h3{font-family:'Baloo 2',sans-serif;color:#204d32;font-size:25px;line-height:1.2;margin:6px 0 11px}
.g5h-card p,.g5h-story p,.g5h-tradition p,.g5h-branches>p,.g5h-ritual>p{font-size:14px;margin:0 0 11px}
.g5h-card p:last-child,.g5h-story p:last-child,.g5h-tradition p:last-child{margin-bottom:0}
.g5h-story{display:grid;grid-template-columns:minmax(0,1fr) 210px;gap:28px;align-items:center;padding:28px;margin-bottom:20px;background:linear-gradient(115deg,#fffdf7,#f4ebd2)}
.g5h-story-mark{min-height:180px;border-radius:50%;background:#e7ebd4;color:#376b47;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;text-align:center}
.g5h-story-mark span{font-family:'Charm',cursive;font-size:22px;font-weight:700}
.g5h-branches{padding:27px;margin-bottom:20px}
.g5h-section-head{display:flex;gap:12px;align-items:center;color:#a96435}
.g5h-section-head h3{margin-bottom:0}
.g5h-branch-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-top:20px}
.g5h-branch{background:#f9f2e2;border:1px solid #e9d9b7;border-radius:12px;padding:16px}
.g5h-branch h4{font-family:'Baloo 2',sans-serif;color:#265839;font-size:19px;margin:0 0 5px}
.g5h-branch span{display:flex;gap:4px;align-items:flex-start;font-size:11px;color:#986b35;font-weight:800;line-height:1.4}
.g5h-branch span svg{flex:none;margin-top:1px}
.g5h-branch p{font-size:12px!important;line-height:1.6!important;margin:10px 0 0!important}
.g5h-connection{padding:27px 30px;margin-bottom:20px;background:#f0f3e8}
.g5h-connection p{font-size:14px;line-height:1.75;color:#665e4e;margin:0}
.g5h-tradition{padding:27px 30px;margin-bottom:20px;border-left:5px solid #a5742e;background:#f8efd9}
.g5h-details{padding:0;overflow:hidden}
.g5h-details summary{list-style:none;cursor:pointer;padding:22px 25px;min-height:112px;display:flex;align-items:center}
.g5h-details summary::-webkit-details-marker{display:none}
.g5h-details summary:after{content:'+';margin-left:auto;font-size:26px;color:#956b34}
.g5h-details[open] summary:after{content:'−'}
.g5h-details summary strong{display:block;font-family:'Baloo 2',sans-serif;font-size:24px;color:#204d32;line-height:1.15;margin:5px 0}
.g5h-details summary small{font-size:12px;color:#756c5b}
.g5h-details[open] summary{border-bottom:1px solid #ebdec4}
.g5h-poem{display:flex;flex-direction:column;gap:4px;padding:22px 25px 3px;font-family:'Charm',cursive;font-size:17px;line-height:1.4!important;color:#36513b!important}
.g5h-poem span{display:block}
.g5h-note{font-size:12px!important;color:#887e6e!important;padding:0 25px 20px;margin:0!important}
.g5h-rules{padding:22px 34px 10px 46px;margin:0;color:#625e50;font-size:14px;line-height:1.7}
.g5h-rules li{margin-bottom:9px}
.g5h-ritual{padding:28px;margin-top:5px}
.g5h-ritual>p{max-width:840px}
.g5h-search{display:flex;align-items:center;gap:9px;max-width:450px;border:1px solid #d9c7a2;background:#fff;border-radius:10px;padding:0 12px;margin-top:18px;color:#997944}
.g5h-search:focus-within{outline:2px solid #9bad7c;outline-offset:2px}
.g5h-search input{height:43px;min-width:0;width:100%;border:0;outline:0;background:transparent;color:#314638}
.g5h-result-count{font-size:12px;color:#817562;font-weight:800;margin:13px 0 9px}
.g5h-ritual-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;max-height:350px;overflow:auto;padding:2px 3px 2px 0}
.g5h-ritual-entry{min-width:0;border:1px solid #ebe0c7;background:#faf6eb;border-radius:8px;padding:9px 10px;display:flex;flex-direction:column;gap:4px}
.g5h-ritual-entry span{font-size:12px;font-weight:800;color:#39503c;overflow-wrap:anywhere}
.g5h-ritual-entry small{font-size:10px;color:#94866d}
.g5h-no-results{grid-column:1/-1;color:#8a7d69;font-size:13px}
@media(max-width:900px){.g5h-branch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.g5h-ritual-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.g5h-archive{padding-top:39px}.g5h-two-columns{grid-template-columns:1fr;gap:13px}.g5h-card{min-height:0}.g5h-story{grid-template-columns:1fr;padding:22px}.g5h-story-mark{display:none}.g5h-branches,.g5h-connection,.g5h-ritual{padding:21px}.g5h-branch-grid{gap:8px}.g5h-branch{padding:12px}.g5h-branch h4{font-size:17px}.g5h-branch span{font-size:10px}.g5h-branch p{font-size:11px!important}.g5h-ritual-list{grid-template-columns:1fr;max-height:360px}.g5h-details summary{padding:18px 20px;min-height:92px}.g5h-poem{padding:18px 20px 3px;font-size:16px}}


.g5o-origin-shell,.g5h-archive{--site-header-height:var(--header-height,0px);font-family:'Nunito Sans',Arial,sans-serif;overflow-wrap:anywhere}
.g5o-origin-shell *,.g5h-archive *{box-sizing:border-box}
.g5o-wrap{width:min(1180px,calc(100% - 44px));margin-inline:auto;min-width:0}
.g5o-origin-shell [hidden],.g5h-archive [hidden]{display:none!important}
.g5o-origin-shell button,.g5h-archive button{cursor:pointer;font-family:inherit}
.g5o-origin-shell button:disabled{cursor:default}
.g5o-origin-shell a,.g5h-archive a{text-decoration:none}
.g5o-origin-shell button,.g5o-origin-shell a,.g5h-archive button,.g5h-archive a{touch-action:manipulation}
.g5o-icon{display:inline-block;vertical-align:-.17em;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none;pointer-events:none}
.g5o-intro-copy h1,.g5o-chapter-title,.g5o-poem-text,.g5o-map-sea,.g5h-story-mark span{font-family:'Charm',Georgia,serif}
.g5o-intro-band,.g5o-origin-shell .g5o-story-closing{display:block;width:auto;height:auto}
.g5o-origin-shell .g5o-story-closing{display:flex;width:min(1180px,calc(100% - 44px))}
.g5o-chapter-summary p,.g5o-chapter-summary li{font-size:inherit;line-height:inherit}
.g5o-chapter-summary img,.g5h-group img{max-width:100%;height:auto}
.g5o-chapter-summary p:last-child{margin-bottom:0}
.g5o-chapter-card:focus-visible .g5o-chapter-surface{outline:2px solid #b57b29;outline-offset:3px}
.g5o-chapter-card,.g5o-supplement{scroll-margin-top:calc(var(--site-header-height) + 106px)}
.g5o-origin-shell .g5o-intro-copy h1 em{color:#e5bd70}
.g5o-down{display:grid;place-items:center;width:36px;height:36px;flex:none;border:1px solid #e5bd7055;border-radius:50%;color:#e5bd70}
.g5o-journey-ribbon a{color:inherit}
.g5o-button,.g5o-source-foot a,.g5o-edit,.g5h-contents a{display:inline-flex;align-items:center;gap:7px}
.g5o-button{color:#31553b;background:#fffbef;font:800 13px/1.45 'Nunito Sans',Arial,sans-serif;padding:9px 14px;border:1px solid #d3c19a;border-radius:9px;text-decoration:none}
.g5o-button:hover,.g5h-contents a:hover{background:#edf0df}
.g5o-button.g5o-primary{background:#932d26;color:#fff8e8;border-color:#932d26}
.g5o-source-foot a,.g5o-edit{font-size:12px;font-weight:800;color:#8b4e2f}
.g5o-edit{margin:8px 10px 0 0}
.g5o-supplement{margin-top:18px;color:#36543c}
.g5o-supplement>a,.g5o-supplement summary{display:inline-flex;gap:8px;align-items:center;color:inherit;font-size:14px;font-weight:800;cursor:pointer}
.g5o-supplement summary:before{content:'+'}.g5o-supplement details[open]>summary:before{content:'−'}
.g5o-supplement article{margin:10px 0}
.g5o-size-options{display:flex;align-items:center;gap:8px;margin-top:12px;color:#665b47;font-size:12px}
.g5o-size-options button{border:1px solid #d4c8ac;border-radius:6px;background:#fffaf0;color:#35533b;padding:6px 10px}
.g5o-contents-search input[type=search]{appearance:none;min-height:40px}
.g5o-contents-search input::-webkit-search-cancel-button{display:none}
.g5o-map-canvas-frame{background:linear-gradient(130deg,#fbf5de,#e0ebd9);isolation:isolate}
.g5o-map-vector{position:absolute;inset:0;width:100%;height:100%;display:block}
.g5o-map-north,.g5o-map-sea{pointer-events:none}
.g5o-map-place-legend button{display:inline-flex;align-items:center;gap:4px;background:transparent;border:0;color:#4a5e49;font-size:10px;font-weight:800;padding:3px;cursor:pointer}
.g5o-map-place-legend button[aria-pressed=true],.g5o-pin[aria-pressed=true] circle{outline:1px solid #a65a39;outline-offset:2px}
.g5o-pin{cursor:pointer}.g5o-pin:focus-visible circle{stroke:#0e4628;stroke-width:3}
.g5o-map-inset{position:absolute;right:9px;bottom:9px;max-width:38%;max-height:42%;overflow:auto;display:grid;gap:3px;padding:7px 9px;border:1px solid #b59667;background:#fff9e6ed;border-radius:7px;pointer-events:none;color:#36543b;font:700 10px/1.3 Arial,sans-serif}
.g5o-map-inset strong{font-size:10px;color:#83522c}.g5o-map-inset img{width:65px;max-height:40px;object-fit:cover;border-radius:3px}
[data-place-detail]{display:block;font-size:11px;font-weight:700;color:#65523b}
.g5o-map-vector:focus-visible{outline:2px solid #315e4c}
.g5a-scene img{display:block;width:100%;height:auto}.g5a-comparison img{width:90px;height:100px}
.g5a-chronicles img{width:70px;height:74px;flex:none}
.g5a-place-pair{grid-auto-flow:row;align-items:center}.g5a-settlement-labels{flex-wrap:wrap}
.g5a-tree-children{grid-template-columns:repeat(auto-fit,minmax(min(100%,75px),1fr))}
.g5a-tree-node{min-width:0}
.g5o-branch-btn[aria-pressed=true]{background:#2b523c;color:#fff9df}.g5o-branch-btn[aria-pressed=true] strong,.g5o-branch-btn[aria-pressed=true] span{color:inherit}
.g5h-group{margin-top:24px;scroll-margin-top:calc(var(--header-height,0px) + 18px)}
.g5h-archive{padding-bottom:48px}.g5h-heading h2{font-family:'Baloo 2',Georgia,serif;color:#234d34;font-size:clamp(26px,3vw,38px)}
.g5h-contents a{border:1px solid #decda9;background:#fffaf0;border-radius:8px;padding:8px 13px;color:#36543c;font-size:12px;font-weight:800}
.g5h-group .g5h-group-title{font-size:18px;color:#615a44;margin:0 0 12px}
.g5h-full-text{padding:18px 24px;line-height:1.7}
.g5h-attachment{max-width:100%;max-height:240px;object-fit:contain;display:block;margin:12px 0}
.g5h-form label{display:grid;gap:5px;margin:10px 0;font-weight:700;font-size:14px}
.g5h-form input:not([type=hidden]),.g5h-form textarea{padding:10px;max-width:100%;width:100%;border:1px solid #d4c7ad;border-radius:8px;font:inherit}
.g5o-static *{scroll-behavior:auto!important;animation:none!important;transition:none!important}
@keyframes g5o-trace{from{stroke-dasharray:1;stroke-dashoffset:1}to{stroke-dasharray:1;stroke-dashoffset:0}}
@media(max-width:620px){.g5o-wrap{width:calc(100% - 30px)}.g5o-map-inset{font-size:9px;max-width:34%}.g5o-story-layout{max-width:100%}}
@media(prefers-reduced-motion:reduce){.g5o-map-vector *{animation:none!important}}
.g5o-map-inset[data-artwork=timeline]{right:auto;left:9px}
.g5o-map-inset:is([data-artwork=branches],[data-artwork=dispersion],[data-artwork=migration]) span{padding-left:10px;position:relative}
.g5o-map-inset:is([data-artwork=branches],[data-artwork=dispersion],[data-artwork=migration]) span::before{content:'';position:absolute;left:0;top:.45em;width:5px;height:5px;border-radius:50%;background:#a64a32}
.g5o-supplement .g5a-chronicles{margin:15px 0 20px}
.g5o-supplement details + a{margin-top:8px}


/* v0.99.0 — mobile atlas parity, per-chapter illustration/map switch. */
.g5o-mobile-atlas-tabs{display:flex;align-items:center;justify-content:center;gap:5px;margin:0 auto 12px;padding:4px;border:1px solid #dacbae;border-radius:12px;background:#ede5d1;width:fit-content;max-width:100%}
.g5o-mobile-atlas-tabs button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:37px;padding:7px 13px;border:0;border-radius:9px;background:transparent;color:#706b59;font-size:12px;font-weight:800;cursor:pointer}
.g5o-mobile-atlas-tabs button[aria-pressed="true"]{background:#fffaf0;color:#264f37;box-shadow:0 2px 5px #4e3d1b10}
.g5o-mobile-atlas-tabs button:focus-visible{outline:2px solid #315e4c;outline-offset:2px}
.g5o-mobile-map{min-width:0;max-width:100%;overflow:hidden;border:1px solid #d9caac;border-radius:13px;background:#f9f2e1;padding:12px}
.g5o-mobile-map[hidden],.g5o-mobile-atlas [data-mobile-art][hidden]{display:none!important}
.g5o-mobile-map .g5o-map-canvas-frame{height:auto;min-height:0;aspect-ratio:4/3;width:100%;max-height:400px}
.g5o-mobile-map .g5o-map-vector{width:100%;height:100%;max-width:100%;display:block}
.g5o-mobile-map .g5o-map-scene-body{padding:10px 4px 2px}
.g5o-mobile-map .g5o-map-scene-body h2{font-size:17px}
.g5o-mobile-map .g5o-map-place-legend{display:flex;flex-wrap:wrap;gap:7px;margin-top:7px}
.g5o-source-original-link{display:inline-flex;align-items:center;gap:5px;color:#245b47;font-weight:800;font-size:12px;text-decoration:underline;text-underline-offset:2px}
.g5o-source-foot{flex-wrap:wrap}
.g5a-tree-node-action{font:inherit;color:inherit;text-align:left;width:100%;cursor:pointer}
.g5a-tree-node-action[aria-pressed="true"]{outline:2px solid #b78945;outline-offset:1px;background:#fff8e8}
.g5a-tree-node-action:hover,.g5a-tree-node-action:focus-visible{border-color:#b78945}
@media (min-width:961px){.g5o-mobile-atlas-tabs,.g5o-mobile-map{display:none!important}}
@media (max-width:960px){.g5o-mobile-atlas{display:block;max-width:100%}.g5o-chapter-illustration{padding:12px}}
@media (prefers-reduced-motion: reduce){.g5o-mobile-atlas-tabs button,.g5a-tree-node-action{transition:none!important}}

/* v1.0.0 — source HeritageArchive section icons, metadata and document search. */
.g5h-archive .g5h-heading-emblem{display:grid;place-items:center;width:54px;height:54px;color:#275a3b;background:#eaf1dc;border-radius:14px;margin-bottom:15px}
.g5h-archive .g5h-contents a{display:inline-flex!important;align-items:center;gap:8px}
.g5h-archive .g5h-contents svg,.g5h-archive .g5h-group-title svg,.g5h-archive .g5h-branch h4 svg{vertical-align:middle;flex:none}
.g5h-archive .g5h-group-title{display:flex;align-items:center;gap:9px;padding-bottom:8px;border-bottom:1px solid #e7d8b7}
.g5h-archive .g5h-group-title svg{color:#9d6534}
.g5h-archive .g5h-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;background:#ecf2e4;color:#2e7144;margin-bottom:16px}
.g5h-archive .g5h-card:nth-child(2) .g5h-icon{background:#faecdc;color:#af6330}
.g5h-archive .g5h-branch h4{display:flex;align-items:center;gap:6px}
.g5h-archive .g5h-details summary>span>svg{vertical-align:middle;color:#a56d34;margin-right:9px}
.g5h-archive .g5h-document-controls{display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between;margin:0 0 16px}
.g5h-archive .g5h-document-controls .g5h-search{flex:1 1 260px;margin:0}
.g5h-archive .g5h-document-controls [data-document-count]{color:#776953;font-size:12px;font-weight:800}
.g5h-archive .g5h-attachment{max-width:100%;height:auto;border-radius:9px;margin:11px 0}
@media(prefers-reduced-motion:no-preference){.g5h-archive .g5h-card,.g5h-archive .g5h-branch{transition:border-color .2s ease,box-shadow .2s ease}.g5h-archive .g5h-card:hover,.g5h-archive .g5h-branch:hover{border-color:#cbb18a;box-shadow:0 9px 24px rgba(56,44,22,.09)}}


/* v1.0.1 — HeritageArchive.tsx / HeritageArchive.module.css source-faithful composition.
   No hardcoded Huỳnh Tấn history or Tiếu thư names are imported. */
.g5h-reference-layout{width:min(1100px,calc(100% - 36px));max-width:1100px;margin:0 auto;padding:60px 0 50px!important;min-width:0;}
.g5h-reference-layout .g5h-heading{max-width:800px;margin-bottom:27px}
.g5h-reference-layout .g5h-heading h2{font-family:'Baloo 2','Nunito Sans',sans-serif;font-weight:800;font-size:clamp(30px,3.25vw,43px);line-height:1.16;letter-spacing:-.02em;color:#204d32;margin:9px 0 13px}
.g5h-reference-layout .g5h-heading p{font-size:15px;line-height:1.75;color:#665e4e;margin:0 0 14px}
.g5h-reference-layout .g5h-to-origin{margin-top:4px;min-height:42px}
.g5h-reference-layout .g5h-contents{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 30px;max-width:100%}
.g5h-reference-layout .g5h-contents a{display:inline-flex;align-items:center;justify-content:center;border:1px solid #decda9;background:#fffaf0;color:#36543c;font-size:12px;font-weight:800;padding:9px 13px;line-height:1.2;border-radius:999px;transition:background .15s,border-color .15s}
.g5h-reference-layout .g5h-contents a:hover,.g5h-reference-layout .g5h-contents a:focus-visible,.g5h-reference-layout .g5h-contents a[aria-current=location]{background:#eaf1dc;border-color:#9db28b;outline-offset:3px}
.g5h-reference-layout .g5h-source-section{min-width:0;scroll-margin-top:calc(var(--header-height,68px) + 22px);margin:0 0 20px}
.g5h-reference-layout .g5h-source-section .g5h-card,.g5h-reference-layout .g5h-source-section .g5h-story,.g5h-reference-layout .g5h-source-section .g5h-connection,.g5h-reference-layout .g5h-source-section .g5h-tradition,.g5h-reference-layout .g5h-reading-panels .g5h-details{margin:0 0 18px}
.g5h-reference-layout .g5h-preface-grid,.g5h-reference-layout .g5h-reading-panels{align-items:start;grid-template-columns:repeat(2,minmax(0,1fr));gap:19px;margin-bottom:20px}
.g5h-reference-layout .g5h-preface-grid .g5h-card{height:100%;min-height:270px}
.g5h-reference-layout .g5h-card,.g5h-reference-layout .g5h-story,.g5h-reference-layout .g5h-branches,.g5h-reference-layout .g5h-connection,.g5h-reference-layout .g5h-tradition,.g5h-reference-layout .g5h-details,.g5h-reference-layout .g5h-ritual{box-shadow:0 9px 28px rgba(75,55,24,.055);border-color:#e6d8b6;border-radius:18px}
.g5h-reference-layout .g5h-story{padding:28px;grid-template-columns:minmax(0,1fr) 210px;gap:25px;background:linear-gradient(115deg,#fffdf7,#f4ebd2)}
.g5h-reference-layout .g5h-story-mark{width:185px;min-height:185px;height:185px;justify-self:center}
.g5h-reference-layout .g5h-branches{padding:27px}
.g5h-reference-layout .g5h-branches .g5h-section-head{display:flex;align-items:center;gap:12px;color:#a96435}
.g5h-reference-layout .g5h-branches .g5h-section-head h3{margin:2px 0 0}
.g5h-reference-layout .g5h-branches>p{color:#665e4e;font-size:14px;line-height:1.7}
.g5h-reference-layout .g5h-branch-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.g5h-reference-layout .g5h-branch h4{display:block;margin:0 0 5px;line-height:1.3;font-size:19px}
.g5h-reference-layout .g5h-branch span{display:flex;align-items:start;gap:4px}
.g5h-reference-layout .g5h-branch-notes{margin-top:20px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.g5h-reference-layout .g5h-reading-panels>.g5h-source-section{margin:0;min-width:0}
.g5h-reference-layout .g5h-reading-panels .g5h-details{margin:0 0 14px;min-height:110px}
.g5h-reference-layout .g5h-details summary{gap:10px}
.g5h-reference-layout .g5h-details summary>span>svg{color:#a56d34}
.g5h-reference-layout .g5h-details .g5h-full-text{padding:20px 24px;line-height:1.75;color:#665e4e}
.g5h-reference-layout .g5h-poem-body{font-family:'Charm',Georgia,serif;font-size:17px;color:#36513b;line-height:1.65;white-space:pre-line}
.g5h-reference-layout .g5h-ritual{padding:28px}
.g5h-reference-layout .g5h-ritual-list{grid-template-columns:repeat(3,minmax(0,1fr));max-height:350px}
.g5h-reference-layout .g5h-no-results{display:block;min-width:0;padding:14px;color:#846f52}
.g5h-reference-layout .g5h-added-documents{margin-top:38px;padding-top:24px;border-top:1px solid #e8dac0}
.g5h-reference-layout .g5h-supplement-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.g5h-reference-layout .g5h-supplement-head h3{margin:6px 0;font-size:29px}
.g5h-reference-layout .g5h-supplement-head p{margin:0;color:#665e4e;font-size:14px;line-height:1.65}
.g5h-reference-layout .g5h-document-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px}
.g5h-reference-layout .g5h-document-card{background:#fffdf7;border:1px solid #e6d8b6;border-radius:17px;overflow:hidden;display:flex;flex-direction:column;min-width:0;box-shadow:0 6px 20px #4b371810}
.g5h-reference-layout .g5h-document-media{height:163px;display:grid;place-items:center;background:#f3efdf;color:#4e7755;overflow:hidden}
.g5h-reference-layout .g5h-document-media>svg{width:52px;height:52px}
.g5h-reference-layout .g5h-document-media>img{display:block;width:100%;height:100%;object-fit:cover}
.g5h-reference-layout .g5h-document-body{padding:17px;display:flex;flex-direction:column;gap:8px;flex:1;min-width:0}
.g5h-reference-layout .g5h-document-body h3{font-size:21px;line-height:1.25;margin:0;color:#204d32}
.g5h-reference-layout .g5h-document-body p{margin:0;font-size:13px;line-height:1.6;color:#665e4e;overflow-wrap:anywhere}
.g5h-reference-layout .g5h-document-meta{display:flex;align-items:flex-start;gap:6px}
.g5h-reference-layout .g5h-document-meta svg{flex:none;margin-top:3px}
.g5h-reference-layout .g5h-document-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:auto;padding-top:10px}
.g5h-reference-layout .g5h-document-actions a{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:#8d3c24;font-weight:800;text-decoration:none}
.g5h-reference-layout .g5h-document-actions a:hover{text-decoration:underline}
.g5h-reference-layout .g5h-document-controls{margin:15px 0 18px}
.g5h-reference-layout .g5h-supplement-empty{text-align:center;background:#fffdf7;border:1px solid #e6d8b6;border-radius:18px;padding:35px 20px;color:#37543d}
.g5h-reference-layout .g5h-supplement-empty svg{width:45px;height:45px}
.g5h-reference-layout .g5h-supplement-empty h4{font-family:'Baloo 2',sans-serif;font-size:22px;margin:7px 0}
.g5h-reference-layout .g5h-supplement-empty p{font-size:14px;color:#756a58}
.g5h-reference-layout .g5h-manage-documents{margin-top:14px}
.g5h-reference-layout .g5h-notice{padding:10px 15px;background:#eaf1dc;color:#234d32;border-radius:9px}
@media(max-width:900px){
 .g5h-reference-layout .g5h-branch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .g5h-reference-layout .g5h-document-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
 .g5h-reference-layout{width:calc(100% - 28px);padding:38px 0 42px!important}
 .g5h-reference-layout .g5h-preface-grid,.g5h-reference-layout .g5h-reading-panels,.g5h-reference-layout .g5h-branch-notes{grid-template-columns:1fr;gap:14px}
 .g5h-reference-layout .g5h-preface-grid .g5h-card{min-height:0;height:auto}
 .g5h-reference-layout .g5h-contents{gap:7px;margin-bottom:23px}
 .g5h-reference-layout .g5h-story{grid-template-columns:1fr;padding:22px}
 .g5h-reference-layout .g5h-story-mark{display:none}
 .g5h-reference-layout .g5h-branches,.g5h-reference-layout .g5h-ritual{padding:21px}
 .g5h-reference-layout .g5h-branch-grid{gap:8px}
 .g5h-reference-layout .g5h-branch{padding:12px}
 .g5h-reference-layout .g5h-branch h4{font-size:17px}
 .g5h-reference-layout .g5h-supplement-head{align-items:flex-start;flex-direction:column}
 .g5h-reference-layout .g5h-document-grid{grid-template-columns:1fr;gap:14px}
 .g5h-reference-layout .g5h-ritual-list{grid-template-columns:1fr;max-height:360px}
}
@media(prefers-reduced-motion:reduce){.g5h-reference-layout .g5h-contents a{transition:none!important}}


/* v1.0.3 — section-level separators for Cội nguồn and Tư liệu.
   Preserve all structural borders on cards, maps, navigation and fields. */
.g5o-origin-shell .g5o-intro-band {border-bottom:0!important;padding-bottom:24px}
.g5o-origin-shell .g5o-intro-band::after {
  content:"";
  position:absolute;
  inset-inline:clamp(14px,3vw,48px);
  bottom:0;
  height:24px;
  pointer-events:none;
  background-image:url("ornamental-star.svg"),linear-gradient(#caa45e,#caa45e),linear-gradient(#caa45e,#caa45e);
  background-repeat:no-repeat;
  background-position:center center,left center,right center;
  background-size:24px 24px,calc(50% - 24px) 1px,calc(50% - 24px) 1px;
 }
.g5o-origin-shell .g5o-hero-facts,
.g5o-origin-shell .g5o-journey-ribbon,
.g5o-origin-shell .g5o-story-closing,
.g5h-reference-layout .g5h-added-documents {
  border-top:0!important;
  position:relative;
}
.g5o-origin-shell .g5o-hero-facts {padding-top:39px}
.g5o-origin-shell .g5o-journey-ribbon {padding-top:48px}
.g5o-origin-shell .g5o-story-closing {padding-top:88px}
.g5h-reference-layout .g5h-added-documents {padding-top:55px}
.g5o-origin-shell .g5o-hero-facts::before,
.g5o-origin-shell .g5o-journey-ribbon::before,
.g5o-origin-shell .g5o-story-closing::before,
.g5h-reference-layout .g5h-added-documents::before {
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:24px;
  pointer-events:none;
  background-image:url("ornamental-star.svg"),linear-gradient(#caa45e,#caa45e),linear-gradient(#caa45e,#caa45e);
  background-repeat:no-repeat;
  background-position:center center,left center,right center;
  background-size:24px 24px,calc(50% - 24px) 1px,calc(50% - 24px) 1px;
 }
@media(max-width:620px) {
  .g5o-origin-shell .g5o-story-closing {padding-top:64px}
  .g5o-origin-shell .g5o-journey-ribbon {padding-top:42px}
  .g5h-reference-layout .g5h-added-documents {padding-top:48px}
}
