:root {
  color-scheme: light;
  --ink: #2f241f;
  --secondary: #665649;
  --paper: #f3eee4;
  --panel: #fffaf1;
  --line: #dfd2bf;
  --hero: #391d1b;
  --bronze: #a27543;
  --accent: #8f3c2c;
  --accent-deep: #6f2d23;
  --forest: #2c584a;
  --plum: #635273;
  --slate: #31566b;
  --ochre: #745923;
  --indigo: #3c4867;
  --focus: #225f86;
  --gutter: clamp(1rem, 4.2vw, 3rem);
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.58 var(--sans);
}
button, input, select { font: inherit; }
button, select, input[type="range"], summary { cursor: pointer; }
a { color: var(--accent-deep); text-underline-offset: .2em; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
figure, h1, h2, h3, p, ul { margin: 0; }
.container { max-width: 75rem; margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  z-index: 10; position: absolute; top: .75rem; left: 1rem;
  transform: translateY(-200%);
  padding: .6rem 1rem; background: var(--panel); border-radius: .3rem;
}
.skip-link:focus { transform: none; }

.masthead {
  color: #fff4dc;
  background: radial-gradient(ellipse at 80% 45%, #633b27, transparent 48%), var(--hero);
  overflow: hidden;
}
:root[data-view="embed"] .masthead { display: none; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4rem; border-bottom: 1px solid #efd1a73b;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .65rem;
  color: #ffefcd; text-decoration: none; font-size: .85rem; font-weight: 750; letter-spacing: .16em;
  white-space: nowrap;
}
.seal {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem;
  background: #a44936; color: #ffedce; border: 1px solid #ecd0aa85; border-radius: .19rem;
  font: 1.15rem/1 var(--serif);
}
.topbar nav { display: flex; gap: clamp(.85rem, 3vw, 2rem); }
.topbar nav a { color: #f3e1c4; text-decoration: none; font-size: .9rem; }
.topbar nav a:hover, .topbar nav a:focus-visible { text-decoration: underline; }
.masthead :focus-visible { outline-color: #ffd397; }
.hero {
  isolation: isolate; position: relative; min-height: 14rem;
  display: flex; align-items: center;
  padding-block: 1.8rem 2rem;
}
.hero-copy { position: relative; z-index: 1; max-width: 43rem; }
.hero h1 {
  font: 500 clamp(2.65rem, 5.8vw, 5.25rem)/1.05 var(--serif);
  letter-spacing: -.045em; text-wrap: balance;
}
.hero p { max-width: 33rem; margin-top: 1rem; color: #f0ddc5; font-size: 1.05rem; }
.drum {
  position: absolute; right: 0; top: 0; bottom: 0; width: 26rem;
  display: flex; justify-content: flex-end; align-items: flex-end;
}
.drum img {
  position: absolute; top: -4.4rem; right: -.2rem; width: 24rem; height: auto;
  opacity: .67; filter: sepia(1) saturate(1.45); mix-blend-mode: screen;
  mask-image: linear-gradient(95deg, transparent 4%, #000 40% 100%);
  pointer-events: none;
}
.drum figcaption { position: relative; z-index: 2; margin-bottom: .7rem; }
.drum a {
  display: block; padding: .2rem .55rem;
  border-radius: .2rem; background: #352119d9; color: #f8e8ca; font-size: .75rem;
}

.main-content { padding-top: 1.4rem; padding-bottom: 2.8rem; }
:root[data-view="embed"] .main-content { padding-top: .8rem; }
.content-search {
  margin-bottom: .75rem; padding: .7rem clamp(.8rem, 2.9vw, 1.5rem) .85rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: .9rem;
}
.content-search label {
  display: block; margin-bottom: .25rem; color: var(--secondary);
  font-size: .875rem; font-weight: 700;
}
.content-search-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }
.content-search-controls input, .content-search-controls button, #content-search-more {
  min-height: 2.75rem; padding: .35rem .7rem; border: 1px solid #cbbba5; border-radius: .43rem;
}
.content-search-controls input { min-width: 0; width: 100%; color: var(--ink); background: #fffdf8; }
.content-search-controls input::placeholder { color: var(--secondary); opacity: 1; }
.content-search-controls button {
  padding-inline: .95rem; border-color: var(--accent-deep);
  color: #fff9f0; background: var(--accent-deep); font-weight: 700;
}
.content-search-controls button:hover { background: var(--accent); }
.content-search-results { margin-top: .55rem; }
.content-search-status { margin-bottom: .3rem; color: var(--secondary); font-size: .875rem; }
.content-search-list {
  max-height: min(25rem, 48vh); overflow: auto; list-style: none; padding: 0 .25rem;
}
.content-search-list li + li { border-top: 1px solid var(--line); }
.content-search-hit {
  display: block; width: 100%; min-height: 2.75rem; padding: .55rem .5rem;
  border: 0; border-radius: .35rem; background: transparent; color: var(--ink);
  text-align: start; line-height: 1.35; overflow-wrap: anywhere;
}
.content-search-hit:hover { background: #f5ecdf; }
.content-search-hit:focus-visible { outline-offset: -3px; }
.content-search-hit strong, .content-search-hit small { display: block; }
.content-search-hit small { margin-top: .18rem; color: var(--secondary); }
#content-search-more {
  margin-top: .35rem; background: #f5ecdf; color: var(--accent-deep); font-weight: 680;
}
#content-search-more:hover { background: #ecdec9; }
.content-search-target { scroll-margin-top: 1rem; }
.content-search-target:focus { outline: 2px solid var(--focus); outline-offset: 3px; }
.timeline {
  --topic-accent: var(--accent-deep);
  padding: clamp(1.15rem, 3.1vw, 2rem);
  padding-bottom: .5rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: .9rem;
  box-shadow: 0 3px 10px #55351708;
}
.timeline[data-topic="doi-song"] { --topic-accent: var(--forest); }
.timeline[data-topic="my-thuat"] { --topic-accent: var(--plum); }
.timeline[data-topic="giai-tri"] { --topic-accent: var(--slate); }
.timeline[data-topic="tieu-dung"] { --topic-accent: var(--ochre); }
.timeline[data-topic="sach"] { --topic-accent: var(--indigo); }
.timeline[data-topic="kien-truc-noi-that"] { --topic-accent: #386163; }
.timeline[data-topic="media"] { --topic-accent: #454b66; }
.topic-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem 1rem;
  margin-bottom: .7rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line);
}
.topic-options { display: flex; flex-wrap: wrap; gap: .35rem; }
.topic-options button {
  min-height: 2.65rem; padding: .43rem .82rem; border: 1px solid #d4c3ac; border-radius: .45rem;
  background: #f5ecdf; color: var(--ink); font-size: .94rem; font-weight: 720;
}
.topic-options button:hover { background: #ecdec9; }
.topic-options button[aria-pressed="true"], .quick-years button[aria-pressed="true"],
.architecture-style-options button[aria-pressed="true"] {
  background: var(--topic-accent); border-color: var(--topic-accent); color: #fff9f0;
}
.lookup-options {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; margin-inline-start: auto;
  min-width: 0;
}
.language-options {
  display: inline-flex; flex-shrink: 0; gap: .2rem; padding: .15rem;
  border: 1px solid #d4c3ac; border-radius: .45rem; background: #f5ecdf;
}
.language-options a {
  display: flex; align-items: center; min-height: 2.1rem; padding: .15rem .55rem; border-radius: .3rem;
  color: var(--ink); white-space: nowrap; text-decoration: none; font-size: .83rem; font-weight: 650;
}
.language-options a:hover { text-decoration: underline; }
.language-options a[aria-current="page"] { color: #fff9f0; background: var(--accent-deep); }
.topic-filter { display: flex; align-items: center; gap: .55rem; color: var(--secondary); font-size: .875rem; font-weight: 650; }
.topic-filter select {
  appearance: none; min-height: 2.65rem; padding: .38rem 1.55rem .38rem .62rem; border: 1px solid #cbbba5;
  border-radius: .37rem; background: #fffdf8; color: var(--ink); font-weight: 500;
}
.architecture-styles { margin: 0 0 1rem; }
.architecture-style-options { display: flex; flex-wrap: wrap; gap: .38rem; margin-top: .45rem; }
.architecture-style-options button {
  min-height: 2.65rem; padding: .38rem .73rem; border: 1px solid #d4c3ac; border-radius: .45rem;
  background: #f7efe3; color: var(--ink); font-size: .875rem; font-weight: 680;
}
.architecture-style-options button:hover:not([aria-pressed="true"]) { background: #ecdec9; }
.timeline-heading {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1.2rem;
}
.eyebrow {
  color: var(--secondary); text-transform: uppercase; letter-spacing: .1em;
  font: 750 .86rem/1.25 var(--sans);
}
.year-line { margin-top: .2rem; display: flex; align-items: baseline; gap: .55rem; }
.year-display {
  display: inline-block; color: var(--accent-deep); font: 500 clamp(3.2rem, 6.3vw, 4.9rem)/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.06em;
}
.year-era { color: var(--accent-deep); font-weight: 750; font-size: .86rem; }
.year-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .65rem 1rem; }
.step-controls, .form-controls { display: flex; align-items: center; gap: .38rem; }
.step-controls button, .year-form input, .year-form select, .year-form button {
  height: 2.65rem; border: 1px solid #cbbba5; border-radius: .38rem;
  color: var(--ink); background: #fffdf8;
}
.step-controls button { min-width: 2.6rem; font-weight: 700; }
.step-controls button:hover:not(:disabled) { background: #f1e5d4; }
.year-form label { display: block; margin-bottom: .25rem; color: var(--secondary); font-size: .875rem; font-weight: 650; }
.year-form input { cursor: text; width: 5.5rem; padding: 0 .55rem; font-variant-numeric: tabular-nums; }
.year-form input[aria-invalid="true"] { border-color: #a23d29; box-shadow: 0 0 0 1px #a23d29; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; width: .42rem; height: .42rem; top: 1rem; right: .65rem;
  transform: rotate(45deg); border: solid currentColor; border-width: 0 1.5px 1.5px 0; pointer-events: none;
}
.year-form select { appearance: none; padding: 0 1.45rem 0 .58rem; }
.year-form button { padding-inline: .8rem; color: #fff8ef; background: var(--accent-deep); border-color: var(--accent-deep); font-weight: 700; white-space: nowrap; }
.year-form button:hover { background: var(--accent); }
.year-message { margin-top: .55rem; color: #8a3527; font-size: .9rem; }

.ruler { position: relative; margin-top: .65rem; padding-bottom: 1.25rem; --thumb: 1.7rem; }
.ruler-bands {
  position: absolute; z-index: 0; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); top: 1rem;
  height: .54rem; display: flex; background: #dfd0b9; border-radius: 1rem;
  overflow: hidden; pointer-events: none; box-shadow: inset 0 0 0 1px #3a281016;
}
.band { height: 100%; border-right: 2px solid var(--panel); }
.band:last-child { border: 0; }
.ruler input {
  appearance: none; position: relative; display: block; z-index: 2;
  width: 100%; height: 2.55rem; padding: 0; margin: 0;
  background: transparent; border: 0; border-radius: .5rem; touch-action: pan-y;
}
.ruler input::-webkit-slider-runnable-track { height: .54rem; background: transparent; }
.ruler input::-moz-range-track { height: .54rem; background: transparent; }
.ruler input::-moz-range-progress { background: transparent; }
.ruler input::-webkit-slider-thumb {
  appearance: none;
  width: var(--thumb); height: var(--thumb); margin-top: -.58rem;
  border: 3px solid #fffaf1; border-radius: 50%;
  background: #873b2c; box-shadow: 0 0 0 1px #914f3c, 0 2px 5px #4a2a2655;
  cursor: grab;
}
.ruler input::-moz-range-thumb {
  width: calc(var(--thumb) - 6px); height: calc(var(--thumb) - 6px);
  border: 3px solid #fffaf1; border-radius: 50%;
  background: #873b2c; box-shadow: 0 0 0 1px #914f3c, 0 2px 5px #4a2a2655;
  cursor: grab;
}
.ruler input:active { cursor: grabbing; }
.ruler-ticks {
  position: absolute; inset: 1.8rem calc(var(--thumb) / 2) 0;
  color: #665649; pointer-events: none;
}
.ruler-tick {
  display: flex; flex-direction: column; align-items: center;
  white-space: nowrap; position: absolute; transform: translateX(-50%); top: .17rem;
  font-size: .82rem; line-height: 1.3; font-variant-numeric: tabular-nums;
}
.ruler-tick::before { content: ""; width: 1px; height: .38rem; margin-bottom: .3rem; background: #a99377; }
.ruler-tick:first-child { transform: none; align-items: flex-start; }
.ruler-tick:last-child { transform: translateX(-100%); align-items: flex-end; }
.milestone-picker[open] { flex-basis: 100%; }
.milestone-picker summary {
  width: fit-content; max-width: 100%; padding: .38rem .68rem;
  border: 1px solid #d4c3ac; border-radius: .4rem; background: #f5ecdf;
  color: var(--topic-accent); font-size: .875rem; font-weight: 720;
}
.milestone-picker summary:hover { background: #ecdec9; }
.quick-years { display: flex; flex-wrap: wrap; gap: .42rem; margin-top: .5rem; }
.quick-heading { color: var(--secondary); font-size: .875rem; font-weight: 700; }
.quick-years button {
  min-height: 2.4rem; max-width: 100%; padding: .34rem .69rem; border: 1px solid #d4c3ac; border-radius: .33rem;
  background: #f7efe3; color: #4c3427;
  font-size: .875rem; font-weight: 730; text-align: left;
}
.quick-years button span { margin-left: .12rem; font-weight: 520; }
.quick-years button:hover:not([aria-pressed="true"]) { background: #f0e1cb; border-color: #a9845d; }

.results { padding-top: .65rem; overflow-anchor: none; }
.results[data-topic="doi-song"] { --culture-accent: var(--forest); }
.results[data-topic="my-thuat"] { --culture-accent: var(--plum); }
.results[data-topic="giai-tri"] { --culture-accent: var(--slate); }
.results[data-topic="tieu-dung"] { --culture-accent: var(--ochre); }
.results[data-topic="sach"] { --culture-accent: var(--indigo); }
.results[data-topic="kien-truc-noi-that"] { --culture-accent: #386163; }
.results[data-topic="media"] { --culture-accent: #454b66; }
.culture-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); gap: .85rem; }
.culture-card {
  min-width: 0; padding: .95rem 1rem 1.05rem; border: 1px solid var(--line);
  border-top: 3px solid var(--culture-accent); border-radius: .6rem; background: #fffaf1;
}
.culture-card h3 { margin-bottom: .32rem; font: 600 clamp(1.3rem, 2.5vw, 1.62rem)/1.2 var(--serif); }
.culture-category { color: var(--culture-accent); font-weight: 760; font-size: .875rem; }
.culture-stamp { color: var(--secondary); font-weight: 600; font-size: .875rem; }
.culture-value {
  margin-top: .65rem; padding: .45rem .65rem; border-left: 3px solid var(--culture-accent);
  background: #f2eada; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums;
}
.culture-description { margin-top: .6rem; }
.media-original {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .32rem .65rem;
  margin-top: .72rem; color: var(--secondary); font-size: .85rem;
}
.media-action {
  padding: .42rem .64rem; border-radius: .35rem; background: var(--culture-accent);
  color: #fff9f0; text-decoration: none; font-weight: 700;
}
.media-action:hover { text-decoration: underline; }
.media-video {
  display: block; width: 100%; max-width: 29rem; aspect-ratio: 4 / 3;
  object-fit: contain; margin-top: .72rem; border-radius: .42rem; background: #1e1a16;
}
.media-video-credit { margin-top: .35rem; }
.film-access { margin-top: .8rem; color: var(--secondary); min-width: 0; }
.film-access--player {
  padding: .7rem; border: 1px solid var(--line); border-radius: .55rem;
  background: rgba(255, 255, 255, .38);
}
.film-status { color: var(--ink); font-weight: 700; font-size: .85rem; }
.film-note { margin-top: .35rem; font-size: .85rem; overflow-wrap: anywhere; }
.film-embed {
  display: block; width: 100%; aspect-ratio: 16 / 9; min-height: 200px;
  margin-top: .55rem; border: 0; border-radius: .42rem; background: #211b17;
}
.film-access .media-video { max-width: 100%; margin-top: .55rem; }
.culture-research {
  margin-top: .65rem; border: 1px solid var(--line); border-radius: .42rem;
  background: #f7efe3;
}
.culture-research summary {
  padding: .5rem .65rem; color: var(--culture-accent); font-size: .9rem; font-weight: 720;
}
.culture-research summary:hover { background: #efe3d1; }
.culture-research-record { padding: .65rem .75rem; border-top: 1px solid var(--line); }
.culture-research-record h4 { margin: 0 0 .22rem; font-size: .97rem; line-height: 1.3; }
.culture-research-record .source-list { margin-top: .45rem; padding-top: 0; border-top: 0; }
.culture-research-record .source-list a { overflow-wrap: anywhere; }
.artifact-figure {
  max-inline-size: 29rem; margin-top: .8rem; overflow: hidden; border: 1px solid var(--line);
  border-radius: .45rem; background: #f5ecdf;
}
.artifact-frame { display: block; aspect-ratio: 4 / 3; background: #e7dfd2; }
.artifact-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.artifact-newspaper .artifact-frame { aspect-ratio: auto; }
.artifact-newspaper .artifact-frame img { height: auto; }
.artifact-preview .artifact-frame { display: grid; place-items: center; aspect-ratio: auto; padding: .65rem; }
.artifact-preview .artifact-frame img { width: auto; height: auto; max-width: 100%; }
.artifact-frame:focus-visible { outline-offset: -3px; }
.artifact-caption { padding: .65rem .75rem .75rem; }
.artifact-name { display: block; line-height: 1.35; }
.artifact-note { margin-top: .28rem; font-size: .875rem; color: var(--secondary); }
.artifact-caption dl {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .22rem .6rem;
  margin: .45rem 0 0; font-size: .875rem; line-height: 1.4;
}
.artifact-caption dt { color: var(--secondary); font-weight: 680; }
.artifact-caption dd { margin: 0; overflow-wrap: anywhere; }
.artifact-at-source { border-left: 3px solid var(--culture-accent); }
.culture-card .source-list { margin-top: .7rem; padding-top: .55rem; border-top: 1px solid var(--line); font-size: .88rem; }
.culture-card .source-list li + li { margin-top: .35rem; }
.culture-nearby {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .55rem;
  margin-bottom: .85rem; padding: .68rem .78rem; border: 1px solid var(--line); border-radius: .42rem;
  color: var(--secondary); background: #efe5d6;
}
.culture-jump {
  min-height: 2.35rem; padding: .3rem .55rem; border: 1px solid var(--culture-accent); border-radius: .35rem;
  color: var(--culture-accent); background: #fffaf1; font-size: .9rem; font-weight: 700;
}
.culture-jump:hover { color: #fffaf1; background: var(--culture-accent); }
.nearby-heading { margin-bottom: .5rem; color: var(--secondary); font: 600 1.22rem/1.2 var(--serif); }
.result-header { border-bottom: 1px solid #d4c3ac; padding-bottom: .5rem; margin-bottom: .55rem; }
.culture-result-header { padding: 0; border: 0; }
.period-meta {
  color: #6c4738; font-size: .875rem; font-weight: 700;
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem;
}
.period-meta span + span::before { content: "·"; padding-right: .55rem; color: #8b7865; }
.result-header h2 {
  font: 500 clamp(1.85rem, 3.6vw, 3rem)/1.12 var(--serif); letter-spacing: -.025em;
  max-width: 58rem; margin-top: .2rem;
}
.result-summary { color: var(--secondary); }
.contexts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .8rem; }
.context {
  --tone: var(--accent);
  min-width: 0; padding: .9rem 1rem 1.05rem;
  background: #fffaf2; border: 1px solid var(--line); border-top: 3px solid var(--tone); border-radius: .55rem;
}
.context[data-tone="north"] { --tone: var(--forest); }
.context[data-tone="south"] { --tone: #8c5b20; }
.context[data-tone="parallel"] { --tone: #635273; }
.context-label { color: var(--tone); font-size: .83rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.context h3 { margin-top: .3rem; font: 500 clamp(1.2rem, 2.4vw, 1.65rem)/1.2 var(--serif); }
.context p:last-child { color: var(--secondary); margin-top: .42rem; }
.period-note { color: #5e4c3b; border-left: 3px solid #b19166; padding: .26rem .75rem; font-size: .92rem; }

.result-detail {
  display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(14rem, 1fr);
  align-items: start; gap: 1rem;
}
.history-background { min-width: 0; display: grid; gap: .75rem; }
.detail-panel { min-width: 0; padding: 1rem 1.08rem 1.1rem; background: #f9f4ea; border: 1px solid var(--line); border-radius: .6rem; }
.events-panel { padding-top: .65rem; }
.detail-panel h3 { font: 600 1.22rem/1.3 var(--serif); }
.detail-panel h3 + ul { margin-top: .55rem; }
.events-panel h3 { font: 700 .875rem/1.3 var(--sans); }
.events-panel h3.visually-hidden + ul { margin-top: 0; }
.event-list, .source-list, .regional-list { list-style: none; padding: 0; }
.event-list li { display: grid; grid-template-columns: 6.3rem minmax(0, 1fr); gap: .5rem; padding: .6rem 0; }
.event-list li:first-child { padding-top: 0; }
.event-list li + li, .regional-list li + li { border-top: 1px solid #e6dac9; }
.event-list > li > .artifact-figure { grid-column: 2; margin-top: .3rem; }
.event-list > li > .kdc-record-rights { grid-column: 1 / -1; }
.event-date { color: var(--accent-deep); font-weight: 750; font-size: .875rem; }
button.event-date {
  align-self: start; justify-self: start; text-align: left;
  min-height: 2rem; padding: .17rem .4rem; margin-inline-start: -.15rem;
  background: #fffaf0; border: 1px solid #d7c3ad; border-radius: .25rem;
}
button.event-date:hover { background: #f1e2cf; }
.event-title { font-weight: 700; }
.event-detail { color: var(--secondary); margin-top: .17rem; }
.regional-list li { padding-block: .5rem; }
.regional-list p { margin-top: .12rem; color: var(--secondary); }
.detail-panel .source-list li { padding-block: .3rem; }
.source-list a { color: var(--accent-deep); text-decoration: underline; text-decoration-color: #a77d64; }
.source-list small { display: block; color: var(--secondary); font-size: .81rem; }

.reference-sections { margin-top: 1.45rem; }
.reference-sections details { background: #fbf7ef; border: 1px solid var(--line); border-radius: .55rem; }
.reference-sections details + details { margin-top: .65rem; }
.reference-sections summary { padding: .75rem 1rem; font-weight: 720; color: #553b2d; }
.reference-inner { border-top: 1px solid #e6dac9; padding: 1rem; }
.reference-inner > p { max-width: 59rem; color: var(--secondary); margin-bottom: .65rem; }
.period-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: .85rem; }
.index-group { min-width: 0; }
.index-group h3 { color: #533b2a; font: 650 1.1rem/1.25 var(--serif); margin-block: .35rem; }
.index-group ul { list-style: none; padding: 0; }
.index-group button {
  width: 100%; text-align: left; background: transparent; color: var(--ink);
  border: 0; border-bottom: 1px solid #ebe1d1; padding: .45rem .3rem;
}
.index-group button:hover { background: #f1e6d7; }
.index-group small { display: block; color: var(--secondary); font-size: .84rem; }
#all-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .55rem 1rem; }
.page-footer { background: #e8dfd1; border-top: 1px solid #d4c3ac; color: #5a4739; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 3.6rem; font-size: .9rem; }

@media (max-width: 830px) {
  .drum { right: -2rem; width: 20rem; }
  .drum img { width: 19.5rem; top: -2.15rem; opacity: .42; }
  .hero-copy { max-width: 37rem; }
  .result-detail { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .topbar { min-height: 3.4rem; }
  .hero { min-height: 11.5rem; align-items: center; padding-block: 1.55rem; }
  .hero h1 { font-size: clamp(2.35rem, 9.6vw, 3.35rem); }
  .hero p { max-width: 24rem; margin-top: .65rem; font-size: 1rem; }
  .drum { right: -3.4rem; width: 15rem; }
  .drum img { width: 15rem; top: -.85rem; opacity: .28; mask-image: linear-gradient(95deg, transparent 6%, #000 70%); }
  .drum figcaption { display: none; }
  .main-content { padding-top: .85rem; }
  .topic-options { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-options button { padding-inline: .38rem; font-size: .875rem; line-height: 1.25; }
  .lookup-options { width: 100%; justify-content: space-between; gap: .45rem .55rem; }
  .topic-filter { flex-basis: 100%; flex-wrap: wrap; }
  .timeline-heading { align-items: stretch; flex-direction: column; gap: .5rem; }
  .year-selection { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem .75rem; }
  .year-line { margin-top: 0; }
  .year-display { font-size: 2.65rem; }
  .year-controls { justify-content: space-between; flex-wrap: nowrap; gap: .45rem; }
  .step-controls { gap: .25rem; }
  .step-controls button { min-width: 2rem; padding: 0 .2rem; }
  .year-form input { width: 4rem; }
  .year-form button { padding-inline: .5rem; }
  .year-form select { padding-left: .35rem; padding-right: 1.15rem; }
  .select-wrap::after { right: .38rem; }
  .form-controls { gap: .25rem; }
  .ruler-tick { font-size: .74rem; }
  .ruler-tick.is-secondary { display: none; }
  .quick-years { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-years button { min-height: 2.75rem; padding-inline: .52rem; line-height: 1.25; }
  .quick-years button span { display: block; margin-left: 0; }
  .result-header h2 { font-size: clamp(1.35rem, 4.7vw, 1.85rem); }
  .event-list li { grid-template-columns: 5.4rem minmax(0, 1fr); }
  .event-list > li > .artifact-figure { grid-column: 1 / -1; }
}

@media (max-width: 430px) {
  .topic-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topic-options button { font-size: .81rem; }
  .topic-options button[data-topic="kien-truc-noi-that"] { grid-column: span 2; }
}

@media (max-width: 350px) {
  .container { padding-inline: .68rem; }
  .timeline { padding-inline: .7rem; }
  .language-options a { padding-inline: .4rem; }
  .topbar nav { gap: .65rem; }
  .topbar nav a { font-size: .82rem; }
  .year-display { font-size: 2.3rem; }
  .year-controls { flex-wrap: wrap; }
  .step-controls button { min-width: 1.8rem; }
  .year-form input { width: 3.6rem; }
  .year-form label { margin-bottom: .12rem; }
  .culture-result-header .period-meta { line-height: 1.35; }
  .culture-card { padding-top: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* KDC rights information */
.kdc-record-rights{margin-top:1rem;padding-top:.7rem;border-top:1px solid var(--line,#ddd);font-size:.82rem;line-height:1.6;overflow-wrap:anywhere}.kdc-record-rights summary{cursor:pointer}.kdc-record-rights dl{display:grid;grid-template-columns:minmax(110px,1fr) 2fr;gap:.35rem .7rem}.kdc-record-rights dd{margin:0}.kdc-record-rights p{margin:.7rem 0}.kdc-copyright{padding-top:1rem;padding-bottom:1.5rem;font-size:.78rem;line-height:1.65}.kdc-copyright p{max-width:90ch}.kdc-table-scroll{overflow-x:auto}.kdc-policy table{width:100%;border-collapse:collapse;font-size:.85rem}.kdc-policy th,.kdc-policy td{padding:.7rem;border-bottom:1px solid #ddd;text-align:left;vertical-align:top}.kdc-policy td:first-child{white-space:nowrap}.kdc-policy p{line-height:1.7}

/* Source-hosted archival audio */
.audio-player{margin:1rem 0;padding:1rem;border:1px solid var(--line,#dfd8cc);border-radius:10px;background:rgba(255,255,255,.38);min-width:0}
.audio-status{margin:0 0 .6rem;font-size:.8rem;font-weight:700;color:var(--ink,#391d1b)}
.audio-track+.audio-track{margin-top:.8rem}.audio-track-label{margin:.3rem 0;font-size:.8rem}.media-audio{display:block;width:100%;height:54px}
.audio-note,.audio-error{font-size:.8rem;line-height:1.6;margin:.7rem 0 0;overflow-wrap:anywhere}.audio-error{color:#853a2d}.audio-error[hidden]{display:none}
.audio-embed{display:block;border:0;width:100%;border-radius:6px;background:transparent}
.audio-player--youtube .audio-embed{aspect-ratio:16/9;min-height:180px}
.audio-player--gallica .audio-embed{height:360px}.audio-player--bandcamp .audio-embed{height:120px}
.audio-player--apple-album .audio-embed{height:450px}.audio-player--apple-song .audio-embed{height:175px}
@media(max-width:430px){.audio-player{padding:.75rem}.audio-player--gallica .audio-embed{height:280px}}

.audio-player--spotify .audio-embed{height:152px}
