/* Cao Tốc — phong cách "biển chỉ dẫn cao tốc". Token riêng, không dùng chung với EV MAP. */
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-vietnamese-700-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 400; font-display: swap; src: url(/fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 400; font-display: swap; src: url(/fonts/be-vietnam-pro-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 600; font-display: swap; src: url(/fonts/be-vietnam-pro-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 600; font-display: swap; src: url(/fonts/be-vietnam-pro-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --sign: #00703C;          /* xanh biển chỉ dẫn */
  --plate: #00703C;         /* nền tấm biển có chữ trắng (header, nút, thanh tab) */
  --sign-ink: #FFFFFF;
  --accent: #FFC20E;        /* vàng nhấn */
  --accent-ink: #1A1A1A;
  --ring: #D7262E;          /* viền biển tốc độ */
  --bg: #F2F5F1;
  --surface: #FFFFFF;
  --ink: #0F1A14;
  --muted: #56675D;
  --line: #D5DED8;
  --strip: #00703C;
  --link: #005C31;
  --ok: #00703C; --warn: #A15C00; --na: #6B7570;
  --r: 6px;
  --r-sm: 4px;
  --font-h: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-b: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tab-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sign: #2FA36B; --plate: #1F7A4D; --bg: #0E1A14; --surface: #16261D; --ink: #EAF2EC; --muted: #9DB0A4; --line: #2A3D32;
    --strip: #2FA36B; --link: #7FD3A8; --ring: #FF4D55; --ok: #5ED39A; --warn: #F2B35A; --na: #8C9A92; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sign: #2FA36B; --plate: #1F7A4D; --bg: #0E1A14; --surface: #16261D; --ink: #EAF2EC; --muted: #9DB0A4; --line: #2A3D32;
  --strip: #2FA36B; --link: #7FD3A8; --ring: #FF4D55; --ok: #5ED39A; --warn: #F2B35A; --na: #8C9A92; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font-b); padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--font-h); font-weight: 700; line-height: 1.15; letter-spacing: .01em; }
h1 { font-size: 2rem; margin: .2em 0 .35em; }
h2 { font-size: 1.5rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.15rem; margin: 0; }
main { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px; z-index: 99; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.nodata { color: var(--na); font-style: italic; font-size: .92em; }
.unv { color: var(--warn); font-style: normal; font-size: .85em; font-weight: 600; }

/* header: tấm biển xanh */
.hdr { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--plate); color: var(--sign-ink); padding: 8px 16px; box-shadow: inset 0 -3px 0 rgba(255,255,255,.85); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo { width: 36px; height: 36px; } .logo rect:first-child { fill: rgba(0,0,0,.18); }
.brand-name { font: 700 1.45rem/1 var(--font-h); letter-spacing: .06em; }
.theme-btn { width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.8); border-radius: var(--r); background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.ic { width: 22px; height: 22px; }

/* nút */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: var(--r);
  background: var(--plate); color: #fff; font: 700 1.1rem var(--font-h); letter-spacing: .03em; text-decoration: none; border: 2px solid var(--plate); cursor: pointer; }
.btn-ghost { background: transparent; color: var(--sign); }
.btn-evmap { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.more { margin: 16px 0; display: flex; gap: 8px; flex-wrap: wrap; }

.hero { padding: 16px 0 4px; }
.hero p { margin: 0 0 .8em; }
.hero-plate { background: var(--plate); color: #fff; margin: 12px -16px 0; padding: 16px 16px 12px; border-top: 3px solid #fff; border-bottom: 3px solid #fff; }
.hero-plate a { color: #fff; }
.plate-code { display: inline-block; margin: 0; padding: 0 8px; background: var(--accent); color: var(--accent-ink); font: 700 1rem var(--font-h); border-radius: var(--r-sm); }
.crumbs { font-size: .85rem; color: var(--muted); padding-top: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r); border: 2px solid var(--sign); color: var(--sign); font: 700 1.05rem var(--font-h); text-decoration: none; }
.chip.on { background: var(--plate); border-color: var(--plate); color: #fff; }

/* nguồn */
.src { display: inline-block; font-size: .78rem; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin: 2px 0; }
.src::before { content: '↗ '; }
.src-none { border-style: dashed; }
.src-none::before { content: ''; }

/* ---------- Vé tổng phí ---------- */
.ticket { display: grid; grid-template-columns: minmax(0, 1fr); margin: 16px 0; background: var(--surface); border-radius: var(--r); position: relative;
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--accent); overflow: hidden; }
.tk-main, .tk-stub { padding: 16px; }
.tk-stub { border-top: 2px dashed var(--line); position: relative; }
.tk-stub::before, .tk-stub::after { content: ''; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); }
.tk-stub::before { left: -13px; } .tk-stub::after { right: -13px; }
.tk-label { margin: 0; font: 600 .95rem var(--font-h); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tk-amt { margin: 2px 0; font: 700 3.2rem/1.05 var(--font-h); font-variant-numeric: tabular-nums; }
.tk-amt .nodata { font: italic 400 1.2rem var(--font-b); }
.tk-route { margin: 0 0 10px; font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.seg-b { min-height: 48px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); border-radius: var(--r-sm); font: 700 1rem var(--font-h); cursor: pointer; }
.seg-b.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tk-hint { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.tk-src { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.tk-io { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.tk-io label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.tk-io select { width: 100%; min-width: 0; min-height: 48px; font: 600 1rem var(--font-b); border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); padding: 0 8px; }
.tk-est { font: 700 1.5rem var(--font-h); margin: 4px 0; font-variant-numeric: tabular-nums; }

/* ---------- Sơ đồ tuyến dạng dải ---------- */
.route { position: relative; margin: 8px 0 16px; }
.route-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 60px; z-index: 5; background: var(--bg); padding: 8px 0; }
.route-dir { margin: 0; font-size: 1.35rem; }
.legend { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 0 0 8px; }
.lg { display: inline-block; width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; border: 3px solid var(--strip); border-radius: 50%; background: #fff; }
.lg-toll { border: 0; border-radius: 2px; background: var(--accent); }
.lg-p { border: 0; border-radius: 3px; background: #1d5fbf; color: #fff; font: 700 11px/14px var(--font-h); text-align: center; }
.lg-sign { border-color: var(--ring); }

.strip { list-style: none; margin: 0; padding: 0 0 0 0; display: flex; flex-direction: column; position: relative; }
.strip.rev { flex-direction: column-reverse; }
.strip::before { content: ''; position: absolute; left: 92px; top: 10px; bottom: 10px; width: 10px; background: var(--strip); border-radius: 5px; }
.st { position: relative; display: grid; grid-template-columns: 76px 24px 1fr; column-gap: 8px; align-items: start; padding: 6px 0; min-height: 52px; }
.st-km { font: 700 1.05rem/1.2 var(--font-h); text-align: right; padding-top: 12px; font-variant-numeric: tabular-nums; }
.st-km-na { color: var(--na); }
.st-dot { position: relative; z-index: 1; margin: 10px 0 0 -1px; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 5px solid var(--strip); }
.st-dot-has-toll { box-shadow: 0 0 0 3px var(--accent); }
.st-dot-toll { border-radius: 4px; border: 0; background: var(--accent); width: 22px; height: 22px; margin: 12px 0 0 1px; }
.st-dot-p { border: 0; border-radius: 5px; background: #1d5fbf; color: #fff; font: 700 15px/26px var(--font-h); text-align: center; }
.st-dot-sign { width: 16px; height: 16px; margin: 16px 0 0 4px; border: 4px solid var(--ring); }
.st-dot-sm { width: 12px; height: 12px; margin: 14px 0 0 6px; border-width: 3px; }
.st-end .st-dot { width: 30px; height: 30px; margin-left: -3px; border-width: 7px; }
.st-card, .st-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.st-card summary { list-style: none; cursor: pointer; padding: 10px 12px; min-height: 48px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.st-card summary::-webkit-details-marker { display: none; }
.st-card summary::after { content: '›'; margin-left: auto; font: 700 1.4rem/1 var(--font-h); color: var(--muted); transition: transform .15s; }
.st-card[open] summary::after { transform: rotate(90deg); }
.st-card[open] { border-color: var(--sign); box-shadow: 0 0 0 1px var(--sign); }
.st-card dl, .st-card > p { margin: 0; padding: 0 12px 10px; }
.st-title { font: 700 1.2rem/1.2 var(--font-h); }
.st-sub { font-size: .85rem; color: var(--muted); }
.st-note { font-size: .88rem; color: var(--muted); }
.st-speed { display: flex; gap: 12px; padding: 10px 12px; border-left: 4px solid var(--ring); }
.st-speed p { margin: 0 0 2px; }
.st-signs { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.st-rec { display: flex; gap: 8px; align-items: center; padding: 6px 10px; font-size: .85rem; background: transparent; border-style: dashed; }
.st-rec p { margin: 0; }
.st-muted .st-card { opacity: .82; }
.kv { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.kv dt { color: var(--muted); font-size: .88rem; } .kv dd { margin: 0; }
.badge { display: inline-block; font: 700 .8rem/1.5 var(--font-h); letter-spacing: .04em; padding: 0 6px; border-radius: 3px; text-transform: uppercase; }
.b-toll { background: var(--accent); color: var(--accent-ink); }
.b-ok { background: var(--plate); color: #fff; }
.hero-plate .badge { background: #fff; color: #0F1A14; border: 0; } .b-warn { background: var(--warn); color: #fff; } .b-muted { border: 1px solid var(--muted); color: var(--muted); }

/* biển tốc độ */
.sign { flex: none; }
.sign-bg { fill: #fff; }
.sign-ring { stroke: var(--ring); }
.sign-num { font-family: var(--font-h); font-weight: 700; fill: #111; }
.sign-na .sign-ring { stroke: #9aa3a0; stroke-dasharray: 8 6; }
.sign-na .sign-num { fill: #6b7570; }
.float-sign { position: fixed; right: 12px; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); z-index: 15; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); transition: opacity .2s; opacity: 0; pointer-events: none; }
.float-sign.on { opacity: 1; }

/* thẻ, bảng */
.cards { list-style: none; padding: 0; display: grid; gap: 8px; }
.card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 64px; }
.card b { font: 700 1.25rem var(--font-h); } .card span:last-child { grid-column: 2; font-size: .88rem; color: var(--muted); }
.plate { grid-row: span 2; background: var(--plate); color: #fff; font: 700 1rem var(--font-h); padding: 8px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--sign); }
.plate-p { background: #1d5fbf; box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px #1d5fbf; min-width: 36px; text-align: center; }
.facts, .tbl-wrap { overflow-x: auto; }
.kvs { margin: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
.tbl th, .tbl td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font: 700 .95rem var(--font-h); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tbl td:first-child { white-space: nowrap; }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.old td { color: var(--muted); }
.tbl .fee-h { text-transform: none; letter-spacing: 0; font: 600 1rem var(--font-b); color: var(--ink); background: var(--bg); }
.tbl-fee .num { text-align: right; font-weight: 600; }
.tbl tr.note td { font-size: .8rem; color: var(--muted); padding-top: 0; }
ul.plain { padding-left: 18px; margin: 4px 0; }
.cta-ev { margin: 20px 0; padding: 16px; border-radius: var(--r); border: 2px dashed var(--accent); background: var(--surface); }
.cta-ev p { margin: 0 0 10px; }
.faq-i { border-bottom: 1px solid var(--line); }
.faq-i summary { cursor: pointer; padding: 12px 0; min-height: 48px; list-style: none; }
.faq-i summary::-webkit-details-marker { display: none; }
.faq-i summary h3 { display: inline; font-size: 1.15rem; }
.faq-i p { margin: 0 0 10px; }
.prose ul { padding-left: 20px; }
.srcs { font-size: .9rem; }

/* footer + tab bar */
.ftr { max-width: 760px; margin: 32px auto 0; padding: 16px; border-top: 3px solid var(--sign); font-size: .88rem; color: var(--muted); }
.ftr .upd { font-weight: 600; color: var(--ink); }
.ftr-links a, .ftr-cross a { color: var(--link); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--plate); box-shadow: inset 0 3px 0 rgba(255,255,255,.85); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: rgba(255,255,255,.82); text-decoration: none; font: 600 .95rem var(--font-h); letter-spacing: .03em; }
.tab.on { color: var(--accent); }
.tab.on .ic { stroke-width: 2.6; }

/* bản đồ */
.page-map main { max-width: none; padding: 0; }
.page-map .ftr { display: none; }
.map { height: calc(100vh - 56px - var(--tab-h) - 52px); height: calc(100dvh - 56px - var(--tab-h) - 52px); background: var(--line); }
.map-note { font-size: .8rem; color: var(--muted); padding: 6px 16px; margin: 0; }
.map-empty { padding: 16px; }

@media (min-width: 720px) {
  h1 { font-size: 2.6rem; }
  .ticket { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .tk-stub { border-top: 0; border-left: 2px dashed var(--line); }
  .tk-stub::before { top: -13px; left: -13px; } .tk-stub::after { top: auto; bottom: -13px; left: -13px; right: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
