/* The app's one navigation and its one header (src/nav/nav.js). The header is the design library's component (the design library's
   "Header" Root below 992 px, "Top Bar" from 992 px) and sets every size, font and colour itself, so it looks the same
   whether the page loads src/style.css (map, fly-over) or src/encyclopedia/style.css (the others).
   Desktop (>= 992 px): the five tabs are text in the Top Bar. Phone and narrow web (< 992 px): a bottom bar of five
   targets >= 44 px; the page's own content ends above it (body padding), so nothing the page draws is covered. */
@font-face { font-family: "EncSans"; src: url(../encyclopedia/fonts/NotoSans-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EncSans"; src: url(../encyclopedia/fonts/NotoSans-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "EncSans"; src: url(../encyclopedia/fonts/NotoSans-Bold.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "EncSerif"; src: url(../encyclopedia/fonts/NotoSerif-Bold.woff) format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
:root {
  --nav-font: "EncSans", "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --nav-accent: var(--enc-accent, #9c2f22);
  --nav-ink: var(--ink, #1f1b16);
  --nav-ink2: #5b5249;
  --nav-line: var(--line, #e2d8c6);
  --nav-card: var(--card, #fffdf8);
  --nav-on: #f4e3d8;
  /* the design library's focus/ring (follows text/default): 2 px solid, offset 2, on every interactive part of every page */
  --focus-ring: #1c140d;
  /* the design library's tokens the shared parts read (SegmentedControl, PageBar, Language Switch; src/nav/parts.js, src/i18n) */
  --apl-text: #1c140d;            /* text/default */
  --apl-text-secondary: #4e463d;  /* text/secondary */
  --apl-text-dimmed: #655c51;     /* text/dimmed */
  --apl-border: #dcd5cc;          /* border/default */
  --apl-surface: #fff;            /* bg/surface */
  --apl-sunken: #eee8e1;          /* bg/sunken */
  --apl-red-filled: #b4553a;      /* accent/red/filled */
  --apl-red-text: #963f25;        /* accent/red/text */
  --apl-red-light: #fff4f1;       /* accent/red/light: an Outline button's hover */
  --apl-hover-menu: var(--apl-sunken);  /* the language trigger's and its rows' hover: bg/sunken */
  --appnav-h: 60px;
  --apphead-h: 56px;   /* the header's height (Root); the Top Bar's is 64 (below), for pages that stick things under it */
}
@media (min-width: 992px) { :root { --apphead-h: 64px; } }
:focus-visible { outline: 2px solid var(--focus-ring, #1c140d); outline-offset: 2px; }

/* ---------- THE HEADER (src/nav/nav.js renderHead): one markup, one stylesheet, every page ----------
   the design library's "Header", variant Root (phone and narrow web): 56 px, white, a 1 px line under it, 16 px sides, 4 px gaps;
   the tab's name as h2 (Noto Serif 700 26/1.35), then 44 px targets: search, Share, the language, Me (the avatar).
   the design library's "Top Bar" (from the md breakpoint, 992 px): 64 px, 32 px sides, 24 px gaps (16 below 1280); the app's name
   (Noto Serif 700 18, red text), the five destinations as text, a space, the search field (44 high, radius full, up to
   420 wide), Share, the language switch, the avatar (36). The custom properties are re-set on the header so the
   language switch (src/i18n, which reads --line and --accent) draws the same on every page. */
header.apphead {
  --line: #dcd5cc; --card: #fff; --ink: #1c140d; --accent: #963f25;
  position: sticky; top: 0; z-index: 30; box-sizing: border-box; display: flex; align-items: center; gap: 4px;
  width: 100%; height: 56px; margin: 0; padding: 0 16px; background: #fff; border: 0; border-bottom: 1px solid #dcd5cc;
  font: 400 14px/1.45 var(--nav-font); color: #1c140d; text-align: left; letter-spacing: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none; filter: none; transform: none; }   /* a filter would trap the fixed bottom bar */
header.apphead *, header.apphead *::before, header.apphead *::after { box-sizing: border-box; }
header.apphead > * { margin: 0 !important; flex: none; }
header.apphead > .appname { display: none; }
header.apphead > .apphead-title { flex: 1 1 auto; min-width: 0; font: 700 26px/1.35 "EncSerif", "Noto Serif", serif; color: #1c140d;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }
header.apphead > .apphead-space { display: none; }
header.apphead .apphead-search { display: flex; align-items: center; min-width: 0; }
header.apphead .apphead-search .tsearch { display: none; }
/* search: an icon on a phone; on a desktop the field (the encyclopedia's live search, elsewhere a field that opens Tra cứu) */
header.apphead .apphead-find { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 10px; background: none; color: #1c140d; text-decoration: none; }
header.apphead .apphead-find svg { width: 24px; height: 24px; flex: none; stroke-width: 2; }
header.apphead .apphead-find .ph { display: none; }
/* Tra cứu is the search itself: its own field is on the page, so the header's search stands aside, its place kept */
body[data-view="home"] header.apphead .apphead-find.has-own { visibility: hidden; }
header.apphead .apphead-find:focus-visible { outline: 2px solid var(--focus-ring, #1c140d); outline-offset: 2px; }

/* Share and the language: 44 px targets (Root); Me is the avatar */
header.apphead .appshare { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; min-width: 44px; width: 44px; padding: 0;
  border: 0; background: none; color: #1c140d; border-radius: 10px; font: 600 14px/1 var(--nav-font); cursor: pointer; }
header.apphead .appshare[hidden] { display: none; }
header.apphead .appshare svg { width: 24px; height: 24px; flex: none; }
header.apphead .appshare .lbl { display: none; }
header.apphead .appshare:hover, header.apphead .apphead-find:hover { background: #f3ece4; }
/* the language: the design library's Language Switch, Kind=Menu: bg/surface, 1 px border/default, radius 8, min 44 high, padding
   0 12, gap 6; the globe (18), the code (Noto Sans 600 14, --mantine-color-text), a chevron (16). On a phone the code
   alone, without the globe, in a 44 px square. */
header.apphead .langsw .langsw-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; min-height: 44px; width: 44px;
  min-width: 44px; padding: 0; border: 1px solid var(--apl-border); border-radius: 8px; background: var(--apl-surface); color: var(--apl-text); font: 600 14px/normal var(--nav-font); }
@media (hover: hover) { header.apphead .langsw .langsw-b:hover { background: var(--apl-hover-menu); } }
header.apphead .langsw .langsw-b svg { display: none; }
header.apphead .appme { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
  color: #4e463d; text-decoration: none; }
header.apphead .appme svg { width: 36px; height: 36px; padding: 6px; border-radius: 50%; background: #eee8e1; border: 0; }
header.apphead .appme:hover svg { color: #1c140d; }
header.apphead .appme[aria-current="page"] svg { background: var(--nav-accent); color: #fff; }
.appnav a:focus-visible, header .appshare:focus-visible, header .appme:focus-visible, .appname:focus-visible { outline: 2px solid var(--focus-ring, #1c140d); outline-offset: 2px; }

/* the app's name (shown by the Top Bar as text; the mark is kept for a page outside the shared header) */
.appname { display: inline-flex; align-items: center; min-height: 44px; flex: none; min-width: 0; text-decoration: none; color: var(--nav-ink);
  font: 700 17px/1.2 "EncSerif", "Noto Serif", serif; white-space: nowrap; }
.appname .short { display: none; }
.appname .appmark { display: inline-flex; margin-right: 10px; flex: none; }
.appname:hover { color: var(--nav-accent); }

/* the five tabs: on a desktop the Top Bar's text destinations (the icons are for the phone's bottom bar) */
.appnav { display: flex; gap: 4px; align-items: center; font-family: var(--nav-font); }
.appnav a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 10px 14px; border-radius: 10px; text-decoration: none;
  color: #4e463d; font: 600 14px/1.45 var(--nav-font); white-space: nowrap; }
.appnav a svg { width: 20px; height: 20px; flex: none; }
.appnav a:hover { background: rgba(0,0,0,.05); color: #1c140d; }
.appnav a[aria-current="page"] { color: #963f25; background: #fff4f1; }

@media (min-width: 992px) {
  header.apphead { height: 64px; padding: 0 32px; gap: 16px; }
  header.apphead > .appname { display: inline-flex; min-height: 44px; font: 700 18px/1.45 "EncSerif", "Noto Serif", serif; color: #963f25; }
  header.apphead > .appname .full, header.apphead > .appname .appmark { display: none; }
  header.apphead > .appname .short { display: inline; }
  header.apphead > .apphead-title { display: none; }
  header.apphead > .appnav a svg { display: none; }
  header.apphead > .apphead-space { display: block; flex: 1 1 0; min-width: 0; }
  header.apphead > .apphead-search { flex: 0 1 420px; min-width: 44px; }
  header.apphead .apphead-search .tsearch { display: block; position: relative; flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; }
  header.apphead .apphead-search .tsearch input { width: 100%; height: 44px; padding: 0 40px 0 44px; border: 1px solid #dcd5cc; border-radius: 999px; background: #fff;
    font: 400 16px/1.55 var(--nav-font); color: #1c140d; box-shadow: 0 1px 1px rgba(44,30,18,.1), 0 1px 1.5px rgba(44,30,18,.05); }
  header.apphead .apphead-search .tsearch .si { left: 14px; color: #1c140d; }
  header.apphead .apphead-find { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 6px 0 14px; border: 1px solid #dcd5cc; border-radius: 999px;
    background: #fff; box-shadow: 0 1px 1px rgba(44,30,18,.1), 0 1px 1.5px rgba(44,30,18,.05); }
  header.apphead .apphead-find:hover { background: #fff; border-color: #a59a8a; }
  header.apphead .apphead-find svg { width: 20px; height: 20px; }
  header.apphead .apphead-find .ph { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font: 400 16px/1.55 var(--nav-font); color: #655c51; }
  header.apphead .apphead-find.has-own { display: none; }
  header.apphead .appshare { width: auto; height: 36px; padding: 0 12px; border: 1px solid #dcd5cc; background: #fff; font-size: 13px; }
  header.apphead .appshare svg { width: 16px; height: 16px; }
  header.apphead .langsw .langsw-b { width: auto; padding: 0 12px; }
  header.apphead .langsw .langsw-b svg { display: block; flex: none; }
  header.apphead .langsw .langsw-b .langsw-g svg { width: 18px; height: 18px; }
  header.apphead .langsw .langsw-b .langsw-v svg { width: 16px; height: 16px; }
  /* the avatar is 36 px (the Top Bar) inside a 44 px target, as everywhere a reader taps */
}
@media (min-width: 1280px) {
  header.apphead { gap: 24px; }
  header.apphead .appshare .lbl { display: inline; }
}

/* the app's toast, the design's Toast: white, a 3 px accent, one line (link copied, the language changed) */
.apptoast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); z-index: 90; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 10px 16px 10px 14px;
  border-radius: 14px; background: #fff; color: #1c140d; border: 1px solid #dcd5cc; border-left: 4px solid #2e7d6b; font: 400 14px/1.45 var(--nav-font);
  box-shadow: 0 10px 25px -5px rgba(44,30,18,.15); opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; }
.apptoast.on { opacity: 1; transform: translate(-50%, 0); }
.apptoast[hidden] { display: none; }

/* a destination's own views, under the header (Explore: Tra cứu · Chủ đề · Thời gian, a SegmentedControl; Play: the
   passport's numbers, a status chip and not a Page Bar: it has no title) */
.subbar { max-width: var(--wrap, 1240px); margin: 0 auto; padding: 14px 16px 0; }
.subbar.pbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.subbar.pbar .lbtabs { margin: 0 auto 0 0; border-bottom: 0; }   /* the tabs left, the streak and points right, one row */
/* anh Day-256: the tabs are the full-width segmented control on a phone, so the streak and points take a row below */
@media (max-width: 991px) { .subbar.pbar { flex-wrap: wrap; row-gap: 6px; } .subbar.pbar .lbtabs { flex: 1 1 100%; margin: 0; } }
.subbar.pbar .pstat { margin: 0; }

/* ---------- SegmentedControl (src/nav/parts.js): the design library's Tabs, Kind=Segmented ----------
   Two, three or four segments ("Hiện tab 3" / "Hiện tab 4"). Track: bg/sunken, a 1 px border/default line (so it reads
   on the sunken Page Bar), 3 px inside it, gap 2, radius full. Segment: padding 7 14, radius full, Label/sm (Noto Sans
   600 14/1.45), text/secondary; the current one bg/surface, text/default, shadow 0 1 2 / 0 1 3 rgba(44,30,18,.1/.05).
   Device=Desktop (from 992 px): 34 px segments in a 40 px control, hugging its content. Device=Phone: 44 px segments in
   a 50 px control, full width. (the library draws the line inside the frame, so the 3 px are 1 px of line and 2 px of padding.)
   The segments are links (Explore's views are addresses) or tabs (the map's views, the fly-over's modes). */
.segctl { display: flex; align-items: stretch; gap: 2px; width: max-content; max-width: 100%; margin: 0; padding: 2px; box-sizing: border-box;
  border: 1px solid var(--apl-border); border-radius: 999px; background: var(--apl-sunken); font-family: var(--nav-font); }
.segctl > a, .segctl > button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 0; margin: 0;
  height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--apl-text-secondary); font: 600 14px/1.45 var(--nav-font);
  letter-spacing: 0; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: none; }
.segctl > a:hover, .segctl > button:hover { color: var(--apl-text); }
.segctl > [aria-selected="true"], .segctl > [aria-current="page"], .segctl > .on, .segctl > [aria-pressed="true"] { background: var(--apl-surface); color: var(--apl-text);
  box-shadow: 0 1px 2px rgba(44,30,18,.1), 0 1px 3px rgba(44,30,18,.05); }
.segctl > :focus-visible { outline: 2px solid var(--focus-ring, #1c140d); outline-offset: 2px; }
@media (max-width: 991px) {
  .segctl { width: 100%; }
  .segctl > a, .segctl > button { flex: 1 1 0; height: 44px; padding: 0 8px; }
}

/* ---------- Kbd (src/nav/parts.js): the design library's Kbd, a keyboard shortcut hint, desktop only (from 992 px) ----------
   20 px tall, at least 20 wide, padding 0 5, bg/surface, 1 px border/default, radius 4, Noto Sans 600 12/16, text/secondary.
   A hint, not a button: the shortcut works without it. (/ in search; 1 and 2 on the fly-over's Bay / Đi bộ.) */
kbd.kbd { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 20px; min-width: 20px; margin: 0;
  padding: 0 5px; border: 1px solid var(--apl-border); border-radius: 4px; background: var(--apl-surface); color: var(--apl-text-secondary);
  font: 600 12px/16px var(--nav-font); letter-spacing: 0; text-align: center; box-shadow: none; }
@media (max-width: 991px) { kbd.kbd { display: none; } }

/* ---------- PageBar (src/nav/parts.js): the design library's Page Bar, Device=Phone below 992 px, Device=Desktop from 992 ----------
   bg/sunken with a 1 px border/default line under it. Lead: optional back, the title (Noto Sans 600 16), optional
   caption (Noto Sans 400 13, text/dimmed), gap 12; a SegmentedControl may stand in the lead in place of the title (the map).
   Actions: up to three Buttons variant=default (outline --mantine-color-red-filled #b4553a, text --mantine-color-red-text
   #963f25, Label/sm, radius --mantine-radius-md 10, padding 0 14, 36 high; 44 on a phone), gap 8.
   Desktop: one row, 56 high, padding 8 32, gap 16, the actions at the right. Phone: a column, padding 10 16, gap 8, the
   actions wrapped under the title. */
.pagebar { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; box-sizing: border-box;
  width: 100%; min-width: 0; margin: 0; padding: 10px 16px; background: var(--apl-sunken); border: 0; border-bottom: 1px solid var(--apl-border);
  font: 400 14px/1.45 var(--nav-font); color: #1c140d; }
.pagebar *, .pagebar *::before, .pagebar *::after { box-sizing: border-box; }
.pagebar-lead { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; overflow: hidden; }
.pagebar-title { flex: 0 1 auto; min-width: 0; margin: 0; font: 600 16px/normal var(--nav-font); color: var(--apl-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pagebar .pagebar-caption { flex: 0 1 auto; min-width: 0; font: 400 13px/normal var(--nav-font); color: var(--apl-text-dimmed); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pagebar-space { display: none; }
.pagebar-actions { display: flex; align-items: flex-start; gap: 8px; min-width: 0; max-width: 100%; }
.pagebar .pagebar-act, .pagebar .pagebar-back { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; height: 44px;
  min-height: 0; margin: 0; padding: 0 14px; border: 1px solid var(--apl-red-filled); border-radius: 10px; background: transparent; color: var(--apl-red-text);
  font: 600 14px/1.45 var(--nav-font); letter-spacing: 0; white-space: nowrap; text-decoration: none; cursor: pointer; box-shadow: none; }
.pagebar .pagebar-act:hover, .pagebar .pagebar-back:hover { background: var(--apl-red-light); }
.pagebar .pagebar-act[aria-expanded="true"] { background: var(--apl-red-light); }
.pagebar .pagebar-act[hidden], .pagebar .pagebar-back[hidden] { display: none; }
.pagebar .pagebar-act:focus-visible, .pagebar .pagebar-back:focus-visible { outline: 2px solid var(--focus-ring, #1c140d); outline-offset: 2px; }
.pagebar-actions:not(:has(> :not([hidden]))) { display: none; }
/* the map: the SegmentedControl is the lead, full width on a phone, and the caption goes under it */
.pagebar-lead:has(> .segctl) { flex-wrap: wrap; row-gap: 8px; width: 100%; }
@media (max-width: 991px) {
  /* on a phone back is the map's own control (the fly-over: the Bản đồ tab under the view) */
  .pagebar .pagebar-back { display: none; }
  .pagebar-lead:has(> .segctl) .pagebar-caption { flex-basis: 100%; }
  /* an instance may leave a part out on a phone (the component's booleans): the map keeps its whole height for the map */
  .pagebar .pagebar-wide { display: none; }
}
@media (min-width: 992px) {
  .pagebar { flex-direction: row; align-items: center; gap: 16px; height: 56px; padding: 8px 32px; }
  .pagebar-lead { flex: 0 1 auto; }
  .pagebar-lead:has(> .segctl) { flex-wrap: nowrap; width: auto; }
  .pagebar-space { display: block; flex: 1 0 0; min-width: 1px; height: 1px; }
  .pagebar .pagebar-act, .pagebar .pagebar-back { height: 36px; }
}

/* phone and narrow web (below the Top Bar's 992 px): the five tabs are the bottom bar */
@media (max-width: 991px) {
  .appnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0; gap: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); /* one equal column per tab, however many the release ships (anh RULE-0255-3eee52: 3 tabs sat left in 5 columns) */
    height: calc(var(--appnav-h) + env(safe-area-inset-bottom)); padding: 0 2px env(safe-area-inset-bottom);
    background: var(--nav-card); border-top: 1px solid var(--nav-line); box-shadow: 0 -2px 12px rgba(40,25,10,.06); }
  .appnav a { position: relative; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; min-height: 44px; height: calc(var(--appnav-h) - 1px); /* the bar's top border takes 1 px (J8·1: the target ended 1 px below the screen) */
    padding: 4px 2px; border-radius: 0; font-size: 11.5px; line-height: 1.15; text-align: center; white-space: normal; overflow-wrap: anywhere; }
  .appnav a svg { width: 24px; height: 24px; }   /* the library: 24 in the bars */
  .appnav a[aria-current="page"] { background: transparent; }
  .appnav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--nav-accent); }
  .appnav a:hover { background: transparent; }
  body.has-appnav { padding-bottom: calc(var(--appnav-h) + env(safe-area-inset-bottom)) !important; }
  .apptoast { bottom: calc(var(--appnav-h) + 16px + env(safe-area-inset-bottom)); }
  .play .pstat .xp { display: none; }
  .subbar { padding: 10px 12px 0; }
}

/* J7·1: the language menu; on a phone the Bottom Sheet, with its title, the same four 44 px rows as the desktop menu (one
   column, the current one 600 in accent/red/text with the check) and its note (the switcher injects its own styles after
   this file, so these rules are one class more specific) */
.langsw-m .langsw-h, .langsw-m .langsw-n { display: none; }
@media (max-width: 991px) {
  .langsw-m { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; z-index: 95 !important;
    width: auto !important; min-width: 0 !important; display: block; padding: 18px 0 calc(20px + env(safe-area-inset-bottom)) !important;
    border-radius: 16px 16px 0 0 !important; border: 0 !important; box-shadow: 0 -10px 40px rgba(0,0,0,.25), 0 0 0 100vmax rgba(28,20,13,.35) !important; }
  .langsw-m[hidden] { display: none; }
  /* a header that is a grid item with a z-index is its own stacking context: lift it while the sheet is open */
  header:has(.langsw-m:not([hidden])) { z-index: 100 !important; }
  .langsw-m .langsw-h { display: block; margin: 0 16px 6px; font: 700 18px/1.45 "EncSerif", "Noto Serif", serif; color: var(--apl-text); }
  .langsw-m .langsw-n { display: block; margin: 8px 16px 0; font: 600 13px/1.4 "EncSerif", "Noto Serif", serif; color: var(--apl-text-secondary); }
}
@media (prefers-reduced-motion: reduce) { .apptoast { transition: none; } }

/* a page heading equal to the header title is said once: by the header on a phone, by the page from 992 px */
@media (max-width: 991px) { h1.dup-title { display: none; } }

/* Giới thiệu, the footer link to the About page (GT-J1: "liên kết Giới thiệu ở chân trang"; nav.js renderAboutLink) */
.foot .appabout { margin: 8px 0 0; }
.foot .appabout a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: #963f25; font-weight: 600; font-size: 14px; text-decoration: none; }
@media (hover: hover) { .foot .appabout a:hover { text-decoration: underline; } }
/* a long tab name (more than 8 letters) gets a smaller size on a phone, so it is read in full, not cut (Day-255) */
@media (max-width: 480px) { header.apphead > .apphead-title.long { font-size: 20px; } }

/* ===== Cài như ứng dụng, HoaN CI-J1 (APL-VH27 93:2722) ===== */
.ci-hint { position: fixed; left: 16px; right: 16px; bottom: calc(var(--appnav-h, 72px) + 14px + env(safe-area-inset-bottom)); z-index: 55; display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: auto auto; gap: 4px 14px; align-items: center;
  background: #fff; border-radius: 16px; padding: 16px 14px 14px 16px; box-shadow: 0 6px 24px rgba(40, 30, 20, .16); font-family: "EncSans", "Noto Sans", sans-serif; }
.ci-hint .ci-icon { grid-row: 1 / 3; border-radius: 12px; }
.ci-ht { display: flex; flex-direction: column; gap: 3px; padding-right: 22px; } .ci-ht b { font-size: 15px; color: #1c140d; } .ci-ht span { font-size: 13px; color: #6d6256; }
.ci-how { grid-column: 3; grid-row: 2; justify-self: end; border: 0; background: #fbeee9; color: #b4553a; font: 700 15px "EncSans", "Noto Sans", sans-serif; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.ci-x { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: #6d6256; padding: 6px; cursor: pointer; }
.ci-wrap { position: fixed; inset: 0; z-index: 95; }
.ci-scrim { position: absolute; inset: 0; background: rgba(30, 24, 18, .4); }
.ci-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 90vh; overflow-y: auto; box-sizing: border-box; background: #fff; border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); font-family: "EncSans", "Noto Sans", sans-serif; color: #1c140d; }
.ci-grip { display: block; width: 36px; height: 5px; border: 0; padding: 0; border-radius: 3px; background: #e2d7c3; margin: 0 auto 14px; cursor: pointer; }
.ci-h { font: 700 24px/1.25 "EncSerif", "Noto Serif", serif; margin: 0; } .ci-sub { margin: 4px 0 18px; font-size: 14px; color: #6d6256; }
.ci-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ci-step { display: flex; align-items: center; gap: 12px; } .ci-st { font: 600 16px/1.3 "EncSans", "Noto Sans", sans-serif; }
.ci-n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: #b4553a; color: #fff; display: grid; place-items: center; font: 700 14px "EncSans", "Noto Sans", sans-serif; }
.ci-pic { padding-left: 40px; }
.ci-chip { display: inline-flex; align-items: center; gap: 6px; background: #f6f0e4; border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.ci-bar { display: flex; align-items: center; justify-content: space-between; background: #f6f0e4; border-radius: 10px; padding: 8px 18px; color: #6d6256; font-style: normal; }
.ci-bar i { font-style: normal; font-size: 18px; } .ci-share { width: 34px; height: 34px; border-radius: 50%; background: #f1d9cf; color: #b4553a; display: grid; place-items: center; }
.ci-row { display: flex; align-items: center; justify-content: space-between; border: 2px solid #b4553a; border-radius: 10px; padding: 10px 14px; background: #f6f0e4; font-size: 15px; }
.ci-home { margin: 18px 0; background: #1f2b24; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; font: 600 13px "EncSans", "Noto Sans", sans-serif; }
.ci-home .ci-icon { border-radius: 14px; width: 60px; height: 60px; }
.ci-btn { display: block; width: 100%; border: 0; border-radius: 10px; background: #b4553a; color: #fff; font: 700 16px "EncSans", "Noto Sans", sans-serif; padding: 14px; cursor: pointer; margin-top: 8px; }
.ci-or { text-align: center; font-size: 13px; color: #6d6256; margin: 14px 0 8px; } .ci-or b { color: #1c140d; }
.ci-and { display: flex; flex-direction: column; align-items: center; text-align: center; } .ci-and .ci-icon { border-radius: 16px; margin-bottom: 14px; } .ci-and .ci-sub { margin-bottom: 18px; }
.me-install { width: 100%; border: 0; background: none; color: #b4553a; font: inherit; text-align: left; cursor: pointer; }

/* CI-J1 93:9611: title and line across the card, Xem cách below at the right */
.ci-hint .ci-ht { grid-column: 2 / 4; grid-row: 1; } .ci-hint .ci-how { grid-column: 3; grid-row: 2; } .ci-ht b { white-space: nowrap; }

/* HoaN, from anh's screenshot: five icons cut the page title to "Khám …" on a phone; a smaller title there */
@media (max-width: 480px) { header.apphead > .apphead-title { font-size: 22px; } }

/* ===== Đồng ý một chạm, HoaN DY-J1 (APL-VH27 98:3124): phone sheet 98:9911, desktop corner card 98:10018 ===== */
.cs-wrap { position: fixed; z-index: 120; font-family: "EncSans", "Noto Sans", sans-serif; }
.cs-phone { inset: 0; }
.cs-scrim { position: absolute; inset: 0; background: rgba(30, 24, 18, .4); }
.cs-sheet { position: absolute; box-sizing: border-box; background: #fff; color: #1c140d; }
.cs-phone .cs-sheet { left: 0; right: 0; bottom: 0; border-radius: 22px 22px 0 0; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); }
.cs-desk { right: 16px; bottom: 16px; width: 380px; max-width: calc(100vw - 32px); }
.cs-desk .cs-sheet { position: static; border-radius: 14px; padding: 18px 18px 14px; box-shadow: 0 6px 24px rgba(40, 30, 20, .16); }
.cs-t { margin: 0 0 18px; font-size: 16px; line-height: 1.5; }
.cs-desk .cs-t { font-size: 14px; margin-bottom: 14px; }
.cs-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cs-b { min-height: 48px; border: 1px solid #b4553a; border-radius: 10px; background: #fff; color: #9c3b22; font: 700 16px "EncSans", "Noto Sans", sans-serif; cursor: pointer; }
.cs-desk .cs-b { min-height: 40px; font-size: 14px; }
.cs-b:focus-visible { outline: 2px solid #1f5f8b; outline-offset: 2px; }
.cs-more { display: block; width: max-content; margin: 16px auto 0; color: #b4553a; font-size: 14px; font-weight: 600; text-decoration: none; }
.cs-desk .cs-more { margin-top: 12px; font-size: 13px; }
body.cs-open .ci-hint { display: none; }

/* anh Day-256: line breaks are designed on every page, not only Đố vui (the width sweep found one-word last lines on
   Khám phá and Giới thiệu at every width up to 440). The style longhands only: the text-wrap shorthand would also reset
   the wrap mode and undo nowrap. */
main h1, main h2, main h3, #view h1, #view h2, #view h3, article h1, article h2, article h3 { text-wrap-style: balance; }
main p, #view p, article p, main li, #view li, main dd, #view dd, main small, #view small { text-wrap-style: pretty; }
/* the header title never truncates (HoaN GT-J2, anh Day-256): a size step on narrow phones */
/* GT-J2 + the width sweep: below 375 px the feedback button leaves the header (Thông tin on Tôi and Giới thiệu hold it),
   the language button stays; the title steps down so it never truncates (measured: 'Giới thiệu' needs 102 px at 24 px) */
@media (max-width: 374px) { header.apphead .fb-open-btn { display: none; } header.apphead > .apphead-title { font-size: 24px; } }
@media (max-width: 339px) { header.apphead { padding-left: 12px; padding-right: 12px; } }   /* 'Giới thiệu' was 6 px short at 320 (it is already 20 px there); 8 px of margin, not a smaller title */
