/* Bách khoa văn hóa. Fonts: Noto Serif and Noto Sans, subset to Latin + Vietnamese, bundled (SIL OFL).
   Not Georgia: it lacks the stacked Vietnamese accents and splits ề into ê + ` . */
@font-face { font-family: "EncSerif"; src: url(fonts/NotoSerif-Regular.woff) format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EncSerif"; src: url(fonts/NotoSerif-Italic.woff) format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EncSerif"; src: url(fonts/NotoSerif-Bold.woff) format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "EncSans"; src: url(fonts/NotoSans-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EncSans"; src: url(fonts/NotoSans-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "EncSans"; src: url(fonts/NotoSans-Bold.woff) format("woff"); font-weight: 700; font-display: swap; }

:root {
  --paper: #f7f2e8; --paper2: #efe7d6; --card: #fffdf8; --ink: #1f1b16; --ink2: #5b5249; --ink3: #8a7f72;
  --line: #e2d8c6; --accent: #9c2f22; --accent2: #7d241a; --focus-ring: #1c140d;
  --serif: "EncSerif", "Noto Serif", "Times New Roman", serif;
  --sans: "EncSans", "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(60,40,20,.06), 0 6px 18px rgba(60,40,20,.07);
  --wrap: 1240px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring, #1c140d); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.005em; line-height: 1.25; margin: 0; }
.hide { display: none !important; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px max(16px, calc((100vw - var(--wrap)) / 2)); background: rgba(247,242,232,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand #mark { display: flex; }
.bt { display: flex; flex-direction: column; line-height: 1.15; }
.bt b { font: 700 17px var(--serif); }
.bt small { color: var(--ink3); font-size: 12px; }
.tsearch { position: relative; flex: 1; max-width: 460px; margin-left: 8px; }
.tsearch input, .bigsearch input { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 999px; font: inherit; color: var(--ink); }
.tsearch input { height: 40px; padding: 0 40px 0 38px; }
.tsearch .si, .bigsearch .si { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink3); display: flex; pointer-events: none; }
.tsearch kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }   /* the Kbd itself: src/nav/nav.css .kbd */
body[data-view="home"] .tsearch { visibility: hidden; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { display: flex; align-items: center; gap: 6px; text-decoration: none; padding: 8px 11px; border-radius: 10px; color: var(--ink2); font-weight: 600; font-size: 14px; }
.nav a:hover { background: var(--paper2); color: var(--ink); }
.nav a.on { color: var(--accent); background: #f4e3d8; }
.nav a { white-space: nowrap; }
@media (min-width: 721px) { .tsearch { min-width: 200px; } }
/* eight destinations since Food and Festivals joined (Day-241): between phone and wide desktop, only the active one
   keeps its label; the rest are icons with the label as a tooltip (app.js sets title) */
@media (min-width: 721px) and (max-width: 1480px) { .nav a:not(.on) .lbl { display: none; } .nav a { padding: 8px 9px; } }
.lang { flex: none; height: 36px; min-width: 44px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; }

/* ---------- search dropdown ---------- */
.drop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(40,25,10,.18); padding: 6px; z-index: 30; max-height: min(70vh, 560px); overflow: auto; min-width: 300px; }
.dh { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); padding: 8px 10px 4px; display: flex; justify-content: space-between; }
.dr { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; text-decoration: none; }
.dr:hover, .dr.on { background: var(--paper2); }
.dt { width: 46px; height: 46px; flex: none; border-radius: 8px; overflow: hidden; }
.dt img { width: 100%; height: 100%; object-fit: cover; }
.dt .tile .gicon { width: 26px; height: 26px; }
.dt .tile .tcap, .dt .tile .tq { display: none; }
.dx { display: flex; flex-direction: column; min-width: 0; }
.dx b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx small { color: var(--ink3); }
.dall { display: flex; align-items: center; gap: 6px; padding: 10px; font-weight: 600; color: var(--accent); text-decoration: none; border-top: 1px solid var(--line); margin-top: 4px; }
.dnone { padding: 14px 10px; color: var(--ink2); }

/* ---------- main ---------- */
main { max-width: var(--wrap); margin: 0 auto; padding: 20px 16px 48px; outline: none; min-height: 70vh; }
main:focus, main:focus-visible { outline: none; }
.loading-page { display: grid; place-items: center; height: 50vh; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { border-top: 1px solid var(--line); color: var(--ink3); font-size: 12px; text-align: center; padding: 18px 16px 28px; }
.foot p { margin: 4px 0; }

/* ---------- tiles: the designed placeholder ---------- */
.tile { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.16' stroke-width='1.6'%3E%3Cpath d='M0 28a14 14 0 0 1 28 0M28 28a14 14 0 0 1 28 0M-14 14a14 14 0 0 1 28 0M14 14a14 14 0 0 1 28 0M42 14a14 14 0 0 1 28 0M4 28a10 10 0 0 1 20 0M32 28a10 10 0 0 1 20 0M-10 14a10 10 0 0 1 20 0M18 14a10 10 0 0 1 20 0M46 14a10 10 0 0 1 20 0'/%3E%3C/g%3E%3C/svg%3E");
  position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff;
  background: var(--wave) 0 100% / 56px 28px repeat-x, radial-gradient(120% 90% at 80% 0%, color-mix(in srgb, var(--g) 70%, #fff) 0%, transparent 60%), linear-gradient(160deg, var(--g), color-mix(in srgb, var(--g) 62%, #000));
  background-size: 56px 28px, auto, auto; background-repeat: repeat, no-repeat, no-repeat; overflow: hidden; }
.tile .gicon { opacity: .92; filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }
.tile .tcap { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .82; text-align: center; padding: 0 8px; }
.tile.verse { justify-content: center; padding: 14px 18px; background-color: color-mix(in srgb, var(--g) 18%, #fbf5e8); background-image: none; color: var(--ink); border-top: 4px solid var(--g); }
.tile.verse .tq { font: italic 400 17px/1.45 var(--serif); text-align: center; color: color-mix(in srgb, var(--g) 70%, #000); }
.tile.verse .tq::before { content: "“"; display: block; font-size: 34px; line-height: .8; color: var(--g); opacity: .6; }
.tile.verse .tmini { position: absolute; right: 10px; bottom: 8px; color: var(--g); opacity: .55; }
.tile.big .tcap { font-size: 14px; }
.tile.verse.big .tq { font-size: 24px; }

/* ---------- cards ---------- */
.card { display: flex; flex-direction: column; text-decoration: none; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.035); transition: transform .15s, box-shadow .15s; min-width: 0; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(60,40,20,.08), 0 12px 28px rgba(60,40,20,.12); }
.vis { position: relative; aspect-ratio: 4 / 3; background: var(--paper2); overflow: hidden; }
.vis img { width: 100%; height: 100%; object-fit: cover; }
.b3d { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; background: rgba(31,27,22,.78); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.cb { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.glab { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--g, var(--accent)); }
.glab time { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink2); }
.card h3 { font-size: 17px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hook { margin: 0; color: var(--ink2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .hook { font: italic 15px/1.45 var(--serif); color: var(--ink); }
.meta { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 4px; color: var(--ink3); font-size: 12px; min-width: 0; }
.meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta svg { flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; }
.row > * { scroll-snap-align: start; }
.sh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.sh h2 { font-size: 25px; }
.more { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.shelf, .block { margin: 44px 0 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: #cdbfa6; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pri:hover { background: var(--accent2); }
.ghost { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.ghost:hover { background: var(--paper2); }
.ghost.wide { width: 100%; justify-content: center; margin-top: 14px; border: 1px dashed var(--line); padding: 12px; }
.n { font: 600 14px var(--sans); color: var(--ink3); margin-left: 4px; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 36px; align-items: center; padding: 18px 0 6px; }
.kick { margin: 0 0 10px; color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.hero h1 { font-size: clamp(28px, 3.3vw, 42px); line-height: 1.2; margin-bottom: 22px; }
.bigsearch { position: relative; }
.bigsearch input { height: 58px; padding: 0 20px 0 48px; font-size: 17px; box-shadow: var(--shadow); }
.bigsearch .si { left: 17px; }
.try { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--ink3); font-size: 13px; }
.try a { text-decoration: none; padding: 4px 10px; border-radius: 999px; background: var(--paper2); color: var(--ink2); font-weight: 600; }
.try a:hover { background: #e6dbc5; }
.stats { display: flex; gap: 28px; margin: 26px 0 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font: 700 25px var(--serif); }
.stats dd { margin: 0; color: var(--ink3); font-size: 13px; }
.feat { position: relative; display: block; border-radius: 20px; overflow: hidden; text-decoration: none; box-shadow: 0 18px 50px rgba(50,30,10,.22); aspect-ratio: 4 / 3.6; background: var(--ink); }
.feat .vis { position: absolute; inset: 0; aspect-ratio: auto; }
.feat .fb { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 24px 22px; color: #fff; background: linear-gradient(transparent, rgba(20,12,6,.86) 42%); display: flex; flex-direction: column; gap: 6px; }
.feat .glab { color: #f3d9a4; }
.feat h2 { font-size: 26px; }
.feat p { margin: 0; color: #f1e9dc; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feat .meta { color: #d8cbb6; }
.ftag { position: absolute; top: 16px; left: 16px; z-index: 1; background: #f3d9a4; color: #4a2a10; font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 999px; }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; border-radius: 16px; text-decoration: none; color: #fff; min-height: 128px; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--g) 70%, #fff) 0%, transparent 55%), linear-gradient(160deg, var(--g), color-mix(in srgb, var(--g) 65%, #000)); transition: transform .15s; }
.theme:hover { transform: translateY(-2px); }
.theme b { font: 700 16px/1.25 var(--serif); }
.theme span { position: absolute; right: 14px; top: 14px; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.2); padding: 1px 8px; border-radius: 999px; }
.theme .gicon { opacity: .9; }

.cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.city { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.cv { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.cv img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.cv:hover img { transform: scale(1.04); }
.cv .cn { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 12px; color: #fff; font: 700 22px var(--serif); background: linear-gradient(transparent, rgba(20,12,6,.75)); }
.cbx { padding: 12px 16px 14px; font-size: 14px; }
.cbx p { margin: 0 0 6px; color: var(--ink2); }
.must { font-size: 13px; }
.clinks { display: flex; gap: 6px; margin-top: 10px; }
.clinks a { flex: 1; text-align: center; padding: 8px 0; border-radius: 9px; background: var(--paper2); text-decoration: none; font-weight: 600; font-size: 13px; }
.clinks a:hover { background: #e6dbc5; }

.hint { margin: -8px 0 14px; color: var(--ink3); font-size: 13px; }
.flips { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.flip { position: relative; perspective: 1200px; display: flex; flex-direction: column; gap: 8px; }
.fi { position: relative; display: block; width: 100%; height: 300px; border: 0; padding: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,.7,.2,1); text-align: left; border-radius: var(--r); }
.flip.turned .fi { transform: rotateY(180deg); }
.front, .back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.front { background: var(--card); }
.fv { height: 58%; display: block; }
.fv img { width: 100%; height: 100%; object-fit: cover; }
.fq { padding: 12px 14px 0; font: 700 17px/1.3 var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fhint { margin-top: auto; padding: 0 14px 12px; display: flex; align-items: center; gap: 6px; color: var(--g); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.back { transform: rotateY(180deg); background: linear-gradient(165deg, color-mix(in srgb, var(--g) 14%, #fffdf8), #fffdf8); border-top: 5px solid var(--g); padding: 18px 16px 14px; }
.ftxt { font-size: 14.5px; line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; }
.fplace { margin-top: auto; display: flex; align-items: center; gap: 4px; color: var(--ink3); font-size: 12px; }
.fgo { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; text-decoration: none; font-size: 14px; padding: 4px 2px; }

.vtile { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 220px; padding: 22px 20px 16px; text-decoration: none; border-radius: var(--r); background: linear-gradient(170deg, color-mix(in srgb, var(--g) 13%, #fffaf0), #fffdf8 70%); border: 1px solid color-mix(in srgb, var(--g) 22%, var(--line)); box-shadow: var(--shadow); position: relative; }
.vtile::before { content: "“"; position: absolute; right: 16px; top: -6px; font: 400 92px/1 var(--serif); color: var(--g); opacity: .18; }
.vtile blockquote { margin: 0; font: italic 400 17px/1.6 var(--serif); }
.vtile blockquote span { display: block; }
.vmeta { font-size: 12px; color: var(--g); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.verses .row { grid-auto-columns: minmax(260px, 300px); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.teaser { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; padding: 18px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; }
.teaser h2 { font-size: 22px; margin-bottom: 6px; }
.teaser p { margin: 0 0 12px; color: var(--ink2); font-size: 14px; }
.teaser .btn { pointer-events: none; }
.tm svg { width: 100%; height: auto; display: block; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 8px; background: var(--paper2); border-radius: 12px; }
.bars span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.bars i { display: block; width: 100%; height: var(--h); min-height: 3px; background: linear-gradient(var(--accent), #c77a3b); border-radius: 4px 4px 1px 1px; }
.bars em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink2); order: -1; }

/* ---------- country map ---------- */
.cmap { width: 100%; height: auto; display: block; }
.cmap .prov path { fill: #e8dfcd; stroke: #fff; stroke-width: 3; stroke-linejoin: round; }
.cmap .prov path.hasc { fill: #dccdb0; }
.cmap .isl { font: 600 34px var(--sans); fill: var(--ink3); }
.cmap .cb circle:first-child { fill: rgba(156,47,34,.18); stroke: var(--accent); stroke-width: 3; transition: fill .15s; }
.cmap .cb .dot { fill: var(--accent); }
.cmap .cb:hover circle:first-child, .cmap .cb.on circle:first-child { fill: rgba(156,47,34,.35); }
.cmap .cn { font: 700 46px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 10px; }
.cmap .cc { font: 600 32px var(--sans); fill: var(--accent); paint-order: stroke; stroke: var(--paper); stroke-width: 8px; }
.cmap.small .isl { font-size: 46px; }
.cmap.small .cn { font-size: 64px; }
.cmap.small .cc { font-size: 46px; }

/* ---------- city map ---------- */
.citymap { position: relative; width: 100%; height: 100%; background: #ebe3d2; border-radius: var(--r); overflow: hidden; touch-action: none; }
.citymap svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
.citymap svg:active { cursor: grabbing; }
.land { fill: #f8f3e8; stroke: #cdbfa5; stroke-width: 2; vector-effect: non-scaling-stroke; }
.park path { fill: #dfe7cc; }
.wet path { fill: #b9d3df; }
.wline path { fill: none; stroke: #b9d3df; stroke-linecap: round; stroke-linejoin: round; }
.pin { cursor: pointer; }
.pin circle { r: calc(var(--k, 6) * var(--pr) * 1px); stroke: #fff; stroke-width: 1.6; vector-effect: non-scaling-stroke; transition: opacity .15s; }
.pin.empty circle { opacity: .7; }
.pin .pl { font: 600 calc(var(--k, 6) * 12px) var(--sans); fill: var(--ink); paint-order: stroke; stroke: rgba(255,255,255,.92); stroke-width: calc(var(--k, 6) * 3.5px); transform: translate(calc(var(--k, 6) * (var(--pr) + 4) * 1px), calc(var(--k, 6) * 4px)); display: none; pointer-events: none; }
svg.near .pin .pl, .pin.major .pl { display: block; }
.pin.hov circle, .pin:hover circle, .pin:focus circle { stroke: var(--ink); stroke-width: 2.5; }
.pin.hov .pl, .pin:hover .pl, .pin.sel .pl { display: block; }
.pin.sel circle { stroke: var(--ink); stroke-width: 3; r: calc(var(--k, 6) * (var(--pr) + 4) * 1px); }
.pin.dim { opacity: .14; pointer-events: none; }
.mapctl { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.mapctl button { width: 44px; height: 44px; border: 0; border-bottom: 1px solid var(--line); background: var(--card); font-size: 20px; cursor: pointer; }
.mapctl button:last-child { border-bottom: 0; font-size: 16px; }
.credit { position: absolute; right: 8px; bottom: 6px; font-size: 10px; color: var(--ink3); background: rgba(255,255,255,.7); padding: 0 5px; border-radius: 4px; }
.mini { width: 100%; height: auto; display: block; border-radius: 12px; background: #ebe3d2; }
.mini .ctx { fill: #a59a8a; }
.mini .own { fill: var(--accent); stroke: #fff; }
.mini .ml { font-family: var(--sans); font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: rgba(255,255,255,.95); }
.minilink { position: relative; display: block; text-decoration: none; }
.mlo { position: absolute; right: 8px; bottom: 8px; background: rgba(255,253,248,.92); color: var(--accent); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; box-shadow: var(--shadow); }

/* ---------- entry ---------- */
.crumb { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--ink3); margin: 0 0 14px; }
.crumb a, .crumb span { text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }
.crumb > * + *::before { content: "›"; margin-right: 6px; color: #c0b39f; }
.eh { max-width: 820px; margin-bottom: 18px; }
.eh h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 6px 0 4px; }
.alt { margin: 0; color: var(--ink2); font: italic 17px var(--serif); }
.conf { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.conf.sourced { color: #2f6a3a; background: #e8f1e3; border-color: #bcd5b2; }
.conf.disputed { color: #8a5a10; background: #fbf0d9; border-color: #ead1a0; }
.conf.estimate { color: #5b5249; background: #eee8dc; border-color: #d8ccb7; }
.egrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.ehero { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--paper2); box-shadow: var(--shadow); }
.ehero img { width: 100%; height: 100%; object-fit: cover; }
.ehero.noimg { aspect-ratio: 21 / 9; }
.tile.hookt { flex-direction: row; justify-content: flex-start; align-items: center; gap: 26px; padding: 28px 40px; text-align: left; }
.tile.hookt .gicon { flex: none; }
.tile.hookt .th1 { font: 700 clamp(20px, 2.4vw, 30px)/1.3 var(--serif); max-width: 34ch; text-shadow: 0 1px 8px rgba(0,0,0,.2); }
.tile.hookt .tcap { position: absolute; left: 40px; top: 18px; }
.ehero .cap { position: absolute; left: 12px; bottom: 12px; background: rgba(20,12,6,.7); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.lede { font-size: 17.5px; line-height: 1.7; margin: 22px 0 18px; max-width: 70ch; }
.il { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(156,47,34,.35); text-underline-offset: 3px; }
.il:hover { text-decoration-color: currentColor; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.sec { margin-top: 38px; }
.sec h2 { font-size: 22px; margin-bottom: 14px; }
.sec .row { padding-bottom: 8px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pcard .vis { aspect-ratio: 16 / 10; }
.pcard h3 { font-size: 16px; }
.src { margin-top: 38px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 0 18px; }
.src summary { cursor: pointer; padding: 14px 0; font: 700 17px var(--serif); list-style: none; display: flex; align-items: center; gap: 6px; }
.src summary::-webkit-details-marker { display: none; }
.src summary::after { content: "+"; margin-left: auto; font: 400 22px var(--sans); color: var(--ink3); }
.src[open] summary::after { content: "−"; }
.src ol { margin: 0 0 16px; padding-left: 20px; font-size: 14px; }
.src li { margin: 6px 0; overflow-wrap: anywhere; }
.src li a { color: var(--accent); }
.sk { font-size: 11px; color: var(--ink3); background: var(--paper2); padding: 1px 7px; border-radius: 999px; }
.note { font-size: 14px; color: var(--ink2); background: var(--paper); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.pn a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: var(--card); min-width: 0; }
.pn a:last-child { text-align: right; }
.pn small { color: var(--ink3); }
.pn b { font-family: var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info { position: sticky; top: 76px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; border-top: 4px solid var(--g); }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 14px 4px 4px; font-size: 14px; }
.info dt { color: var(--ink3); }
.info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.info dd a { color: var(--accent); text-decoration: none; }
.info dd a:hover { text-decoration: underline; }
.aimg { margin-top: 12px; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
.aimg img { width: 100%; height: 100%; object-fit: cover; }

/* the verse, set as type */
.verse { position: relative; margin: 0; padding: 44px 48px 30px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--g) 12%, transparent), transparent 60%), linear-gradient(175deg, #fffaf0, #f6eddb); border: 1px solid color-mix(in srgb, var(--g) 25%, var(--line)); box-shadow: var(--shadow); }
.verse::before { content: "“"; position: absolute; left: 22px; top: 2px; font: 400 110px/1 var(--serif); color: var(--g); opacity: .22; }
.verse blockquote { margin: 0; font: italic 400 clamp(21px, 2.3vw, 28px)/1.62 var(--serif); color: #2a211a; }
.verse blockquote span { display: block; }
.verse blockquote span:nth-child(even) { padding-left: 1.6em; }
.verse figcaption { margin-top: 18px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--g); }
.seal { position: absolute; right: 26px; bottom: 22px; width: 52px; height: 52px; display: grid; place-items: center; border: 2.5px solid var(--accent); color: var(--accent); border-radius: 8px; font: 700 26px "MS Mincho", "SimSun", serif; transform: rotate(-6deg); opacity: .78; background: rgba(156,47,34,.05); }

/* ---------- place ---------- */
.pgrid2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.pstage { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #efe7d6; box-shadow: var(--shadow); }
.pstage > img, .pstage > .tile { width: 100%; height: 100%; object-fit: cover; }
.gl { position: absolute; inset: 0; }
.gl canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.gl.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.stagebar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: rgba(255,253,248,.92); font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: var(--shadow); }
.seg.on { background: var(--ink); color: #fff; }
.shint { margin-left: auto; font-size: 12px; color: var(--ink2); background: rgba(255,253,248,.85); padding: 3px 10px; border-radius: 999px; }
.phead h1 { font-size: clamp(28px, 3.4vw, 38px); margin: 6px 0 6px; }
.phead .glab { color: var(--g); }
.pmeta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink2); margin: 0 0 14px; font-size: 14px; }
.pverse { margin: 0 0 16px; padding: 14px 16px; border-left: 3px solid var(--g); background: var(--card); border-radius: 0 12px 12px 0; font: italic 18px/1.55 var(--serif); }
.pverse span { display: block; }
.pverse a { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font: 600 12px var(--sans); color: var(--accent); text-decoration: none; text-transform: uppercase; letter-spacing: .05em; }
.phead .mm { margin-top: 16px; }
.gh { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.gh .gicon { color: var(--g); }
.empty { padding: 26px; background: var(--card); border-radius: 16px; text-align: center; }

/* ---------- browse ---------- */
.browse { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; align-items: start; }
.facets { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
.fhd { display: none; }
.facets h3 { font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); margin: 18px 0 6px; }
.facets h3:first-of-type { margin-top: 0; }
.fo { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 9px; text-decoration: none; font-size: 14px; color: var(--ink2); }
.fo span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fo i { width: 10px; height: 10px; border-radius: 3px; background: var(--g); flex: none; }
.fo em { font-style: normal; font-size: 12px; color: var(--ink3); }
.fo:hover { background: var(--paper2); color: var(--ink); }
.fo.on { background: var(--ink); color: #fff; }
.fo.on em { color: #d8cbb6; }
.rh { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.rh h1 { font-size: 30px; }
.cnt { margin: 2px 0 0; color: var(--ink3); font-size: 14px; }
.rctl { display: flex; gap: 8px; align-items: center; }
.fbtn { display: none; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink3); }
.sort select { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: inherit; color: var(--ink); padding: 0 10px; }
.activ { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 16px; }
.chipx { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; }
.chipx svg { width: 14px; height: 14px; }
.clear { font-size: 13px; color: var(--accent); margin-left: 4px; }
.emptyst { text-align: center; padding: 60px 16px; color: var(--ink2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.emptyst .gicon { color: var(--accent); }

/* ---------- map view ---------- */
.mapc { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.mapcopy h1 { font-size: 36px; margin-bottom: 8px; }
.mapcopy p { color: var(--ink2); }
.cities.col { grid-template-columns: 1fr; gap: 10px; }
.cityrow { display: grid; grid-template-columns: 64px 1fr auto; grid-template-rows: auto auto; column-gap: 14px; padding: 10px 16px 10px 10px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; align-items: center; }
.cityrow b { font: 700 19px var(--serif); }
.cityrow b { grid-column: 2; align-self: end; }
.cityrow > span:not(.crt) { grid-row: 2; grid-column: 2; color: var(--ink3); font-size: 13px; align-self: start; }
.crt { grid-row: 1 / 3; grid-column: 1; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; }
.crt img { width: 100%; height: 100%; object-fit: cover; }
.crt .tile .tcap { display: none; }
.crt .tile .gicon { width: 30px; height: 30px; }
.cityrow > svg { grid-row: 1 / 3; grid-column: 3; color: var(--accent); }
.cmapwrap { max-width: 560px; justify-self: center; width: 100%; }
body[data-view="map"] main { max-width: none; padding: 0; }
body[data-view="map"] .foot { display: none; }
.mapv { display: flex; flex-direction: column; height: calc(100vh - 61px); }
.mapc { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px; }
.mapbar { padding: 10px 16px 8px; border-bottom: 1px solid var(--line); }
.mapbar .crumb { margin-bottom: 8px; }
.mchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mc { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 13px; font-weight: 600; color: var(--ink2); }
.mc i { width: 9px; height: 9px; border-radius: 50%; background: var(--g); }
.mc.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.mapbody { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.mapholder { position: relative; padding: 12px; min-height: 0; }
.mapholder .citymap { height: 100%; }
.loadmap { display: grid; place-items: center; height: 100%; color: var(--ink3); }
.plist { overflow: auto; border-left: 1px solid var(--line); padding: 10px; background: var(--paper); }
.plist .cnt { padding: 0 6px 6px; }
.prow { display: flex; gap: 10px; align-items: center; padding: 7px; border-radius: 12px; text-decoration: none; }
.prow:hover, .prow.sel { background: var(--card); box-shadow: var(--shadow); }
.prow.sel { outline: 2px solid var(--g); }
.pt { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex: none; }
.pt img { width: 100%; height: 100%; object-fit: cover; }
.pt .tile .gicon { width: 28px; height: 28px; }
.pt .tile .tcap { display: none; }
.px { display: flex; flex-direction: column; min-width: 0; }
.px b { font-weight: 600; font-size: 14px; line-height: 1.3; }
.px small { color: var(--ink3); }
.sheet { position: fixed; left: 24px; bottom: 24px; width: 360px; background: var(--card); border-radius: 18px; box-shadow: 0 20px 50px rgba(40,25,10,.28); overflow: hidden; z-index: 15; display: flex; flex-direction: column; }
.sheet[hidden] { display: none; }
.sv { display: block; height: 170px; }
.sv img { width: 100%; height: 100%; object-fit: cover; }
.sb { padding: 12px 16px 16px; }
.sb h3 { font-size: 20px; }
.sb h3 a { text-decoration: none; }
.sb ul { list-style: none; margin: 0 0 12px; padding: 0; }
.sb li a { display: flex; align-items: center; gap: 8px; padding: 5px 0; text-decoration: none; font-size: 14px; }
.sb li i { width: 8px; height: 8px; border-radius: 50%; background: var(--g); flex: none; }
.sb li a:hover { color: var(--accent); }
.sx { position: absolute; right: 8px; top: 8px; background: rgba(255,253,248,.92); z-index: 2; width: 40px; height: 40px; justify-content: center; }

/* ---------- timeline ---------- */
.th h1 { font-size: 34px; }
.th p { color: var(--ink2); margin: 6px 0 12px; }
.th .mchips { margin-bottom: 8px; flex-wrap: wrap; }
.spine { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 22px 0 10px; position: sticky; top: var(--apphead-h, 61px); z-index: 5; background: var(--paper); padding: 10px 0; border-bottom: 1px solid var(--line); }
.era-b { display: flex; flex-direction: column; gap: 3px; text-decoration: none; padding: 6px; border-radius: 10px; }
.era-b:hover { background: var(--paper2); }
.stack { height: 64px; display: flex; align-items: flex-end; border-bottom: 2px solid var(--line); }
.sfill { width: 100%; display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden; }
.sfill i { display: block; min-height: 2px; }
.era-b b { font: 700 18px var(--serif); }
.era-b em { font-style: normal; font-weight: 600; font-size: 13px; line-height: 1.25; }
.era-b small { color: var(--ink3); font-size: 12px; }
.era { margin-top: 34px; scroll-margin-top: 200px; }
.eh2 { display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.eh2 h2 { font-size: 24px; }
.eh2 .span { color: var(--accent); font-weight: 700; font-size: 14px; }
.eh2 p { margin: 0; color: var(--ink2); font-size: 14px; }

/* ---------- hover preview ---------- */
.pv { position: fixed; z-index: 40; width: 320px; background: var(--card); border-radius: 14px; box-shadow: 0 16px 40px rgba(40,25,10,.25); overflow: hidden; pointer-events: none; }
.pvv { height: 150px; }
.pvv img { width: 100%; height: 100%; object-fit: cover; }
.pvb { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.pvb b { font: 700 16px var(--serif); }
.pvb p { margin: 0; font-size: 13px; color: var(--ink2); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .egrid { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero, .pgrid2, .mapc { grid-template-columns: 1fr; }
  /* phone and tablet: the fact card comes right after the summary, before the long sections */
  .egrid { display: flex; flex-direction: column; gap: 0; }
  .emain { display: contents; }
  .emain > * { order: 5; }
  .emain > .ehero, .emain > .verse, .emain > .j3steps, .emain > .lede, .emain > .acts { order: 1; }
  .info { position: static; order: 2; margin-top: 18px; }
  .browse { grid-template-columns: 1fr; }
  .facets { position: fixed; inset: 0 0 0 auto; width: min(340px, 88vw); max-height: none; background: var(--paper); z-index: 40; padding: 16px; transform: translateX(105%); transition: transform .2s; box-shadow: -10px 0 40px rgba(0,0,0,.2); }
  .facets.open { transform: none; }
  .fhd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .fbtn { display: inline-flex; }
  .mapbody { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 36%; }
  .plist { border-left: 0; border-top: 1px solid var(--line); }
  .spine { grid-template-columns: repeat(7, minmax(84px, 1fr)); overflow-x: auto; }
}
@media (max-width: 720px) {
  body { font-size: 15px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .top { gap: 10px; padding: 8px 12px; backdrop-filter: none; background: var(--paper); } /* a backdrop-filter would trap the fixed bottom nav */
  .bt small { display: none; }
  .bt b { font-size: 16px; }
  .tsearch { margin-left: 0; }
  .tsearch kbd { display: none; }
  body[data-view="home"] .tsearch { display: none; }
  body[data-view="home"] .langsw { margin-left: auto; }
  body[data-view="home"] .tsearch-btn { display: none !important; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 25; background: rgba(255,253,248,.97); border-top: 1px solid var(--line); justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; min-width: 60px; min-height: 52px; justify-content: center; }
  .nav a.on { background: transparent; }
  main { padding: 14px 16px 36px; }
  .hero { gap: 22px; }
  .hero h1 { font-size: 26px; }
  .stats { gap: 18px; flex-wrap: wrap; }
  .stats dt { font-size: 21px; }
  .feat { aspect-ratio: 4 / 4.2; }
  .feat h2 { font-size: 22px; }
  .sh h2 { font-size: 21px; }
  .themes { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .theme { min-height: 110px; padding: 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card h3 { font-size: 15.5px; }
  .hook { font-size: 13px; }
  .cb { padding: 10px 11px 12px; }
  .row { grid-auto-columns: 72%; }
  .verses .row { grid-auto-columns: 82%; }
  .flips { grid-template-columns: 1fr; }
  .fi { height: 270px; }
  .teaser { grid-template-columns: 1fr; }
  .tm { max-width: 220px; }
  .verse { padding: 38px 22px 26px; }
  .verse blockquote span:nth-child(even) { padding-left: .8em; }
  .seal { width: 42px; height: 42px; font-size: 21px; right: 16px; bottom: 16px; }
  .lede { font-size: 16.5px; }
  .ehero.noimg { aspect-ratio: auto; min-height: 180px; }
  .tile.hookt { padding: 40px 20px 20px; gap: 14px; }
  .tile.hookt .gicon { width: 40px; height: 40px; }
  .tile.hookt .tcap { left: 20px; top: 14px; }
  .pn { grid-template-columns: 1fr; }
  .pn a:last-child { text-align: left; }
  .mapv { height: calc(100vh - var(--apphead-h, 57px) - 64px); height: calc(100dvh - var(--apphead-h, 57px) - 64px); }
  .sheet { left: 8px; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); width: auto; flex-direction: row; max-height: 46vh; }
  .sv { width: 38%; height: auto; flex: none; }
  .sb { padding: 10px 12px; overflow: auto; }
  .sb h3 { font-size: 17px; padding-right: 34px; }
  .sb ul { display: none; }
  .eh2 { grid-template-columns: 1fr; gap: 2px; }
  .rh h1 { font-size: 24px; }
  .sort span { display: none; }
  .shint { display: none; }
}

/* Design review: at 390 px and below, on every view but Tra cứu, the search pill folds to a 44 px icon in
   the family of Share, VI and the avatar, so the app's name stays whole; on Tra cứu the page's own field is the search */
.tsearch-btn { display: none; }
@media (max-width: 390px) {
  body:not([data-view="home"]) .tsearch { display: none; }
  body:not([data-view="home"]) .tsearch-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 36px;
    margin-left: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
  body:not([data-view="home"]) header .appshare { margin-left: 0; }
  .tsearch-btn:focus-visible { outline: 2px solid var(--focus-ring, #1c140d); outline-offset: 2px; }
}

/* ---------- J3 (the design file, page 10): look something up ---------- */
/* the library's light button (Mantine light, red): the entry's map and timeline steps, the empty state's ways out */
.btn.lite { background: #f6e7e1; border-color: transparent; color: #963f25; }
.btn.lite:hover { background: #f0d8ce; border-color: transparent; }
/* the clear button inside the Tra cứu field */
.bigsearch .si { top: 29px; }   /* the field's middle, also when the results list grows under it */
.sclear { position: absolute; right: 8px; top: 29px; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer; }
.sclear[hidden] { display: none; }
.sclear:hover { background: var(--paper2); }
/* J3·1 results as rows, under the field, as you type (a phone's Tra cứu view) */
.drop.inline { position: static; min-width: 0; max-height: none; overflow: visible; margin: 12px -16px 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.lr { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; border-radius: 0; background: var(--card); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.lr:first-child { border-top: 1px solid var(--line); }
.lr::before { content: ""; align-self: stretch; width: 3px; border-radius: 2px; background: var(--g, var(--accent)); flex: none; }
.lr .lx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lr .lx b { font: 600 15px/1.4 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr .lx small { font-size: 13px; color: var(--ink2); }
.lr > svg { flex: none; color: var(--ink); }
.drop.inline .dall { border-top: 0; padding: 14px 16px; }
body.searching .hero .kick, body.searching .hero h1, body.searching .hero .try, body.searching .hero .stats, body.searching .hero .feat,
body.searching main > section:not(.hero) { display: none; }
body.searching .hero { display: block; padding-top: 4px; }
/* J3·2 nothing matched */
.j3empty { display: flex; flex-direction: column; gap: 16px; padding: 4px 0 24px; }
.drop.inline .j3empty { padding: 4px 16px 24px; }
.j3card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 20px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.j3ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--paper2); color: var(--ink2); }
.j3ic svg { width: 26px; height: 26px; }
.j3card h2 { margin: 6px 0 0; font: 700 18px/1.45 var(--serif); }
.j3card p { margin: 0 0 6px; color: var(--ink2); font-size: 14px; }
.j3browse { display: flex; flex-wrap: wrap; gap: 8px; }
.results .j3empty { max-width: 520px; margin: 24px auto; }
/* J3·3 the entry's picture says what kind of picture it is */
.ehero { margin: 0; }
.ehero .pkind { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: #b4553a; color: #fff; font: 600 12px/1.4 var(--sans); }
.ehero.k-drawing .pkind, .ehero.k-draft .pkind { background: #6b5a10; }
.ehero.k-map .pkind { background: var(--ink2); }
.ehero .emap, .ehero .emap > * { width: 100%; height: 100%; }
.ehero.k-map { aspect-ratio: 16 / 9; }
.ehero.k-drawing .cap, .ehero.k-draft .cap { background: rgba(60,48,8,.78); }
/* J7·3: text shown in English to a French or Japanese reader is marked as English */
.langmark { display: inline-block; margin: 18px 0 -10px; padding: 2px 10px; border-radius: 999px; background: #ece5dc; color: #4e463d; font: 600 12px/1.6 var(--sans); }
.emain > .langmark { order: 1; }
.j3steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.j3steps:not(:has(a)) { display: none; }
/* J3·4 the timeline: the marked entry; a phone reads each era as one list of years */
.row.tl .card.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.tlist { display: none; }
@media (max-width: 720px) {
  .ehero .cap { position: static; display: block; margin: 0; padding: 10px 14px; border-radius: 0; background: var(--card); color: var(--ink2); font-size: 12px; }
  .ehero.k-drawing .cap, .ehero.k-draft .cap { background: var(--card); color: #6b5a10; }
  .ehero { aspect-ratio: auto; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); }
  .ehero > img { aspect-ratio: 16 / 10; height: auto; }
  .ehero.k-map { aspect-ratio: auto; }
  .ehero.k-map .emap { aspect-ratio: 16 / 10; height: auto; }
  .j3steps { flex-wrap: nowrap; }
  .j3steps .btn { flex: 0 1 auto; min-width: 0; padding: 0 12px; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .j3steps .btn svg { width: 18px; height: 18px; flex: none; }
  .th .mchips { flex-wrap: nowrap; }
  .timev .spine { position: static; }   /* sticky, it would cover a third of a phone's list */
  .timev .row.tl { display: none; }
  .tlist { display: block; list-style: none; margin: 0; padding: 12px 16px 12px 18px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
  .tlist li { position: relative; padding: 0 0 0 22px; }
  .tlist li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink3); background: var(--card); }
  .tlist li::after { content: ""; position: absolute; left: 7px; top: 20px; bottom: -6px; width: 1px; background: var(--line); }
  .tlist li:last-child::after { display: none; }
  .tlist li.on::before { left: 1px; top: 6px; width: 12px; height: 12px; border: 0; background: var(--accent); }
  .tlist a { display: flex; flex-direction: column; padding: 4px 0 12px; text-decoration: none; color: var(--ink); }
  .tlist time { font-size: 12px; font-weight: 600; color: var(--ink2); }
  .tlist li.on time { color: var(--accent); }
  .tlist span { font-size: 15px; line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* J10: a place with no picture shows its small map in the picture slot; a drawing says it is one */
.pstage .psnap { width: 100%; height: 100%; display: grid; place-items: center; background: #ebe3d2; }
.pstage .psnap .minilink, .pstage .psnap svg { width: 100%; height: 100%; }
.pstage .pchip { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: #655c51; color: #fff; font: 600 12px/1.4 var(--sans); }
.pnote { margin: 4px 0 0; font-size: 14px; color: var(--ink2); }
.pgrid2.textonly { grid-template-columns: minmax(0, 1fr); }

/* J11·3: a page whose data could not load (the Error State look) */
.emptyst.failst h1 { font-size: 20px; }
.emptyst.failst p { max-width: 34ch; }

/* an article whose place has a published model: the hero is the live 3D stage (4:3, the place page's), caption on top */
.ehero.k-live { aspect-ratio: auto; overflow: visible; box-shadow: none; background: none; width: 100%; align-self: stretch; }
.ehero.k-live .pstage { width: 100%; }
.ehero.k-live .cap { top: 12px; bottom: auto; z-index: 3; }

/* the 3D entry points (anh RULE-0255-3b759a): home, province page, province cards */
.cta3d { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.prov3d { margin: 4px 0 18px; }
.prov3d .row { margin-top: 10px; }
.clinks a.go3d { background: var(--ink); color: #fff; }

/* anh RULE-0255-a18c9d: a back button above the breadcrumb on every page below home */
.eback { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: 0 0 6px -6px; padding: 0 12px 0 6px; border: 0; border-radius: 999px;
  background: none; color: var(--accent, #b4553a); font: 700 14px/1 "EncSans", "Noto Sans", sans-serif; cursor: pointer; }
.eback:hover { background: rgba(180, 85, 58, .08); }
.eback:focus-visible { outline: 2px solid var(--focus-ring, #1c140d); outline-offset: 2px; }
/* ...and on a phone the article's action rows scroll sideways as a carousel instead of running off the screen */
@media (max-width: 720px) {
  .j3steps, .acts { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    min-width: 0; max-width: calc(100vw - 16px); margin-right: -16px; padding-right: 32px;   /* the row stays the screen's width and scrolls, it does not grow */ mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .j3steps::-webkit-scrollbar, .acts::-webkit-scrollbar { display: none; }
  .j3steps .btn, .acts .btn { flex: none; scroll-snap-align: start; overflow: visible; text-overflow: clip; }
}

/* the new Thời gian (HoaN KP-J2 77:913): era rail, cover, cards where there is something to see, folds for the rest */
.tlv { max-width: 720px; margin: 0 auto; }
.tl-from { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: #b4553a12; font-size: 13px; color: #4e463d; }
.tl-from a { font-weight: 700; color: var(--accent, #b4553a); }
.tl-rail { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 10px 16px; background: var(--paper, #f6f0e6); }
.tl-rail::-webkit-scrollbar { display: none; }
.tl-era { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid #dcd5cc; border-radius: 999px; background: #fff;
  color: #1c140d; font: 600 13px/1 "EncSans", "Noto Sans", sans-serif; text-decoration: none; white-space: nowrap; }
.tl-era.on { background: #1c140d; border-color: #1c140d; color: #fff; }
.tl-era.empty { opacity: .45; }
.tl-filters { display: flex; gap: 8px; margin: 2px 0 14px; }
.tl-sel { position: relative; display: inline-flex; }
.tl-sel select { appearance: none; -webkit-appearance: none; min-height: 34px; padding: 0 30px 0 12px; border: 1px solid #dcd5cc; border-radius: 10px; background: #fff;
  font: 600 13px/1 "EncSans", "Noto Sans", sans-serif; color: #1c140d; cursor: pointer; }
.tl-sel::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.tl-sel.on select { border-color: var(--accent, #b4553a); background: #b4553a12; color: var(--accent, #b4553a); }
.tl-cover h1 { margin: 0; font: 700 28px/1.2 "EncSerif", "Noto Serif", serif; }
.tl-span { margin: 4px 0 0; color: var(--accent, #b4553a); font: 700 14px/1.3 "EncSans", "Noto Sans", sans-serif; }
.tl-sent { margin: 8px 0 0; color: #4e463d; font-size: 14.5px; line-height: 1.5; }
.tl-counts { margin: 8px 0 16px; font: 600 13px/1.4 "EncSans", "Noto Sans", sans-serif; color: #1c140d; }
.tl-counts a { color: var(--accent, #b4553a); }
.tl-list { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.tl-list::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: #dcd5cc; }
.tl-it { position: relative; margin: 0 0 14px; }
.tl-it::before { content: ""; position: absolute; left: -21px; top: 18px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #9a8f84; background: var(--paper, #f6f0e6); }
.tl-card { border: 1px solid #dcd5cc; border-radius: 14px; overflow: hidden; background: #fff; }
.tl-card.here { border: 2px solid var(--accent, #b4553a); }
.tl-card.here::before, .tl-rows li.here::before { border-color: var(--accent, #b4553a); background: var(--accent, #b4553a); }
.tl-here { position: absolute; z-index: 2; right: 10px; top: 10px; padding: 3px 8px; border-radius: 6px; background: var(--accent, #b4553a); color: #fff; font: 700 11.5px/1.2 "EncSans", "Noto Sans", sans-serif; }
.tl-pic { position: relative; aspect-ratio: 16 / 10; background: #ebe4da; }
.tl-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-pic[data-model] { cursor: pointer; }
.tl-pic canvas { width: 100% !important; height: 100% !important; display: block; }
.tl-pic.loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(0,0,0,.15); border-top-color: var(--accent, #b4553a); animation: tlspin .8s linear infinite; }
@keyframes tlspin { to { transform: rotate(360deg); } }
.tl-3d { position: absolute; left: 10px; top: 10px; padding: 2px 7px; border-radius: 6px; background: #1c140dcc; color: #fff; font: 700 11px/1.3 "EncSans", "Noto Sans", sans-serif; }
.tl-body { display: grid; gap: 3px; padding: 12px 14px 14px; text-decoration: none; color: inherit; }
.tl-year { font: 700 24px/1 "EncSerif", "Noto Serif", serif; color: var(--accent, #b4553a); }
.tl-when { font: 700 13px/1.2 "EncSans", "Noto Sans", sans-serif; color: var(--accent, #b4553a); }
.tl-body b { font: 700 17px/1.3 "EncSerif", "Noto Serif", serif; }
.tl-body small { color: #6d6256; font-size: 12.5px; }
.tl-fold { border-radius: 12px; background: #efe8de; }
.tl-fold::before { top: 14px; width: 8px; height: 8px; left: -20px; }
.tl-fh { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; background: none; font: 600 13px/1.3 "EncSans", "Noto Sans", sans-serif; color: #1c140d; text-align: left; cursor: pointer; }
.tl-fh b { margin-left: auto; color: var(--accent, #b4553a); }
.tl-dots { color: #9a8f84; letter-spacing: -2px; font-size: 10px; }
.tl-rows { display: none; list-style: none; margin: 0; padding: 0 12px 10px; }
.tl-fold.open .tl-rows { display: block; }
.tl-rows li { position: relative; border-top: 1px solid #e0d8cd; }
.tl-rows li.more { display: none; }
.tl-rows li.here { background: #b4553a14; border-radius: 6px; }
.tl-rows a { display: flex; gap: 12px; padding: 8px 2px; text-decoration: none; color: inherit; }
.tl-rows time { flex: none; min-width: 44px; font: 700 13px/1.3 "EncSans", "Noto Sans", sans-serif; color: var(--accent, #b4553a); }
.tl-rows b { display: block; font-weight: 600; font-size: 14px; line-height: 1.35; }
.tl-rows small { color: #6d6256; font-size: 12px; }
.tl-morebtn { padding: 8px 2px 0; font-size: 13px; color: #9a8f84; }
.tl-morebtn button { border: 0; background: none; padding: 0; color: var(--accent, #b4553a); font: 700 13px/1.3 "EncSans", "Noto Sans", sans-serif; cursor: pointer; }
.tl-end { margin: 6px 0 10px; color: #6d6256; font-size: 12.5px; }
.tl-next { display: grid; gap: 4px; margin: 0 0 24px; padding: 16px; border-radius: 14px; background: #1c140d; color: #fff; text-decoration: none; }
.tl-next small { color: #d8cfc4; font-size: 12px; }
.tl-next b { font: 700 22px/1.2 "EncSerif", "Noto Serif", serif; }
.tl-next span { color: #d8cfc4; font-size: 13px; }
.tl-next em { margin-top: 6px; font: 700 13px/1 "EncSans", "Noto Sans", sans-serif; font-style: normal; }
.tl-none { list-style: none; color: #6d6256; padding: 10px 0; }

/* ===== province page, HoaN KP-J3 (APL-VH27 109:9501) ===== */
.provp { max-width: 1080px; margin: 0 auto; padding: 4px 16px 28px; }
.provp h1 { font: 700 30px/1.15 var(--serif, "EncSerif", serif); margin: 6px 0 4px; }
.pvlead { margin: 0 0 14px; color: var(--muted, #6d6256); font-size: 15px; line-height: 1.45; }
.pvup { display: inline-block; margin: 6px 0 2px; color: #b4553a; font-weight: 700; text-decoration: none; }
.pvmap { display: inline-block; background: #fbeee9; color: #9c3b22; font-weight: 700; font-size: 15px; padding: 11px 16px; border-radius: 10px; text-decoration: none; margin-bottom: 14px; }
.pvchips { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; margin: 0 -16px 6px; background: var(--bg, #f6f0e4); scrollbar-width: none; }
.pvchips::-webkit-scrollbar { display: none; }
.pvchips a { flex: none; padding: 8px 13px; border: 1px solid #d9cdb8; border-radius: 999px; background: #fff; color: #2b2520; font-size: 14px; text-decoration: none; white-space: nowrap; }
.pvchips a em { font-style: normal; }
.pvchips a.on { background: #2b2520; border-color: #2b2520; color: #fff; }
.pvs { margin: 18px 0 8px; scroll-margin-top: 64px; }
.pvs .sh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.pvs .sh h2 { font: 700 21px var(--serif, "EncSerif", serif); margin: 0; }
.pvs .more { color: #b4553a; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.pvs .row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.pvs .row::-webkit-scrollbar { display: none; }
.pvc { flex: none; width: 172px; scroll-snap-align: start; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid #e3d8c4; text-decoration: none; color: #2b2520; }
.pvc .vis { position: relative; height: 150px; background: #ece4d6; }
.pvc .vis img, .pvc .vis .tile { width: 100%; height: 100%; object-fit: cover; display: block; }
.pvc .b3d { position: absolute; left: 10px; top: 10px; background: rgba(43, 37, 32, .85); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.pvc .cb { padding: 10px 12px 12px; min-height: 74px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.pvc h3 { font: 700 15px/1.3 var(--serif, "EncSerif", serif); margin: 0; }
.pvc .meta { font-size: 12px; color: #8a7d6c; }
.pvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.pvgrid .pvc { width: auto; }
.pvtrips { display: grid; gap: 10px; }
.pvtrip { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid #e3d8c4; border-radius: 14px; background: #fff; color: #2b2520; text-decoration: none; }
.pvchip { align-self: flex-start; background: #fbe9e4; color: #b4553a; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.pvtrip b { font: 700 18px var(--serif, "EncSerif", serif); } .pvtl { font-size: 14px; color: #6d6256; } .pvtm { font-size: 13px; font-weight: 700; }
.pvrows { display: grid; }
.pvrow { display: grid; grid-template-columns: 60px 1fr; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e3d8c4; color: #2b2520; text-decoration: none; }
.pvrow .pvth { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; background: #ece4d6; display: block; }
.pvrow .pvth img, .pvrow .pvth .tile { width: 100%; height: 100%; object-fit: cover; display: block; }
.pvrow b { display: block; font-size: 16px; font-weight: 600; } .pvrow small { font-size: 13px; color: #8a7d6c; }
.pvallbtn { display: block; text-align: center; margin: 16px 0 6px; padding: 13px; border: 1px solid #b4553a; border-radius: 10px; color: #b4553a; font-weight: 700; text-decoration: none; }
.pvquiz { display: flex; flex-direction: column; gap: 8px; margin: 22px 0 8px; padding: 20px; border-radius: 16px; background: #ad882e; color: #fff; text-decoration: none; }
.pvquiz b { font: 700 22px var(--serif, "EncSerif", serif); } .pvquiz span { font-size: 14px; }
.pvquiz .pvplay { align-self: flex-start; margin-top: 6px; background: #fff; color: #9c3b22; font-weight: 700; padding: 10px 18px; border-radius: 10px; }

/* one colour per trip theme (anh, Day-255: "we need different colours for trip tag"); white text >= 4.5:1 on each */
[data-theme="lich-su"] { --tc: #7a2e3a; }
[data-theme="kien-truc"] { --tc: #806010; }
[data-theme="tam-linh"] { --tc: #6b4c8a; }
[data-theme="am-thuc"] { --tc: #a0436a; }
[data-theme="thien-nhien"] { --tc: #2e6e4a; }
[data-theme="bao-tang"] { --tc: #1f5f8b; }
[data-theme="chien-tich"] { --tc: #5c6326; }
[data-theme="lang-nghe"] { --tc: #7a5a3a; }
[data-theme="kham-pha"] { --tc: #4b5563; }
[data-theme="best"] { --tc: #b0472c; }
.tq-pill[data-theme], .pvchip[data-theme] { color: #fff; background: var(--tc, #b4553a); }
