/* Giao diện theo bộ thiết kế app Tay Phượt (Figma "正＿Tay Phượt", màn SCR-LTM-003a/003b):
   font Manrope, màu chính #079455, thẻ trắng bo 16, chip bo tròn, nút bo 12, bảng dưới bo 24 có tay nắm. */
@import url("fonts.css");

:root {
  /* token đặt theo tên biến trong Figma */
  --primary: #079455;            /* Primary color */
  --primary-soft: #d2ffeb;
  --on-primary: #ffffff;
  --text: #181d27;               /* Primary text */
  --text-2: #535862;             /* secondary text */
  --hint: #888888;               /* Text color/Hint text */
  --bg: #f5f5f5;                 /* Background color */
  --card: #ffffff;
  --chip: #f1f1f1;               /* BGR/BGR 50 */
  --line: #ebebeb;               /* BGR/BGR 100 */
  --stroke: #e9eaeb;             /* stroke */
  --error: #d92d20; --error-bg: #fef3f2;
  --yellow: #f79009; --blue: #342ed9; --me: #3478f5;
  --route: #079455;
  --logo: #518e11;               /* màu logo (bộ nhận diện) */
  --handle: #181214;
  --shadow: 0 4px 16px rgba(0, 0, 0, .12);
  --a: var(--me); --b: var(--error);
}
:root[data-theme="night"] {
  --primary: #17b26a;            /* Success/500 — sáng hơn để đọc được trên nền tối */
  --primary-soft: #0c3b26;
  --on-primary: #ffffff;
  --text: #f2f3f5; --text-2: #a4a7ae; --hint: #7d828c;
  --bg: #12161d; --card: #1b2029; --chip: #262c37; --line: #2c323d; --stroke: #2c323d;
  --error-bg: #3a1714; --route: #32d583; --logo: #ffe48d; --handle: #a4a7ae;
  --shadow: 0 4px 16px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 14px/20px "Manrope", -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
#map { position: absolute; inset: 0; }

#panel {
  position: absolute; top: 16px; left: 16px; width: 375px; max-height: calc(100% - 32px); overflow: auto;
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 8px 16px 16px; z-index: 2;
}
.handle { display: none; justify-content: center; padding: 0 0 6px; }
.handle span { width: 50px; height: 3px; border-radius: 2px; background: var(--handle); }

/* đầu trang: logo Tay Phượt (Figma node 267608:18588) — vẽ bằng mask để đổi màu theo giao diện */
header { display: flex; align-items: center; gap: 10px; padding: 6px 0 12px; }
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.logo-mark, .logo-word { display: block; background: var(--logo); -webkit-mask: var(--m) no-repeat center / contain; mask: var(--m) no-repeat center / contain; }
.logo-mark { --m: url(img/logo-mark.svg); width: 30px; height: 35px; }
.logo-word { --m: url(img/logo-word.svg); width: 122px; height: 35px; }
.product { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-left: 10px; border-left: 1px solid var(--line); }
.product .tag { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--on-primary); background: var(--primary); border-radius: 100px; padding: 1px 8px; }
.product .muted { font-size: 11px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.muted { color: var(--text-2); }

button { font: inherit; cursor: pointer; border: 0; background: var(--chip); color: var(--text); border-radius: 8px; padding: 6px 10px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
button.icon { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; font-size: 16px; color: var(--text-2); }
button.link { background: none; color: var(--primary); padding: 0 4px; font-size: 13px; font-weight: 600; }

/* ô tìm kiếm (SCR-LTM-003a) */
.search { position: relative; margin-bottom: 12px; }
input { font: inherit; width: 100%; color: var(--text); background: none; border: 0; }
#q { height: 48px; padding: 0 16px 0 44px; border-radius: 100px; background: var(--chip); font-size: 15px; font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 16px center; }
#q::placeholder, .pt input::placeholder { color: var(--hint); font-weight: 400; }
#results { position: absolute; left: 0; right: 0; top: 54px; margin: 0; padding: 4px 0; list-style: none; background: var(--card);
  border-radius: 16px; box-shadow: var(--shadow); z-index: 5; max-height: 340px; overflow: auto; }
#results li { padding: 10px 16px; cursor: pointer; font-size: 15px; font-weight: 600; line-height: 22px; border-bottom: 1px solid var(--line); }
#results li:last-child { border-bottom: 0; }
#results li:hover, #results li[aria-selected="true"] { background: var(--chip); }
#results .sub { display: block; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-2); }
#results .note { color: var(--primary); }

/* thẻ điểm đi · đến (SCR-LTM-003b "Thẻ điểm đi · dừng · đến") */
.points { border: 1px solid var(--stroke); border-radius: 16px; padding: 0 12px 0 16px; }
.pt { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.pt + .pt { border-top: 1px solid var(--line); }
.pt img { width: 18px; height: 18px; flex: none; }
.pt input { flex: 1; min-width: 0; height: 36px; font-size: 16px; font-weight: 500; text-overflow: ellipsis; }
.pt .x { width: 28px; height: 28px; background: none; font-size: 18px; }

.pt .kind { flex: none; border: 1px solid var(--stroke); background: none; border-radius: 100px; padding: 2px 8px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.pt .kind[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); }
.pt.empty input::placeholder { color: var(--primary); }
.sub-actions { margin-top: 8px; }
button.ghost, label.ghost { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px;
  border-radius: 12px; background: var(--chip); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; }

/* kiểu tuyến (LT-05) + tránh */
.seg { display: flex; background: var(--chip); border-radius: 100px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; background: none; border-radius: 100px; padding: 6px 10px; font-weight: 700; color: var(--text-2); }
.seg button[aria-checked="true"] { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.opts button { border: 1px solid #d9d9d9; background: none; border-radius: 100px; padding: 6px 12px 6px 10px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-2); }
.opts button::before { content: "＋ "; }
.opts button[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.opts button[aria-pressed="true"]::before { content: "✓ "; }
:root[data-theme="night"] .opts button { border-color: var(--stroke); }

/* chặng, phân tích tuyến */
.legs { list-style: none; margin: 10px 0 0; padding: 0; }
.legs li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.legs li b { font-weight: 700; }
.analysis { display: grid; gap: 6px; }
.analysis .item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-radius: 12px; background: var(--chip); font-size: 13px; line-height: 18px; }
.analysis .item .ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.analysis .item .ic.pass { background: var(--blue); } .analysis .item .ic.curve { background: var(--yellow); } .analysis .item .ic.fuel { background: var(--primary); } .analysis .item .ic.speed { background: var(--text-2); }
.analysis .item a { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 600; }
.analysis .item .muted { font-size: 12px; }
#steps li .km { float: right; color: var(--text-2); font-size: 12px; padding-left: 8px; }
#steps li.piece { list-style: none; margin-left: -24px; font-weight: 700; color: var(--primary); border-bottom: 0; }

/* phương tiện (tab có biểu tượng, như app) */
.modes-row { display: flex; align-items: flex-end; gap: 6px; margin: 14px 0 8px; border-bottom: 1px solid var(--line); }
.modes { flex: 1; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.modes::-webkit-scrollbar { display: none; }
.modes button { flex: none; background: none; border-radius: 0; padding: 6px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-2); font-size: 12px; font-weight: 600; border-bottom: 3px solid transparent; position: relative; }
.modes button .ic { font-size: 20px; line-height: 24px; filter: grayscale(1); opacity: .75; }
.modes button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.modes button[aria-selected="true"] .ic { filter: none; opacity: 1; }
.modes button:disabled { opacity: .55; }
.modes .soon { position: absolute; top: 0; right: -2px; font-size: 9px; line-height: 12px; padding: 0 4px; border-radius: 6px; background: var(--yellow); color: #fff; }
.opts-btn { margin-bottom: 6px; color: var(--text); }
.opts-btn[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.opts button.locked { border-style: dashed; cursor: default; }
.opts button.locked::before { content: "🔒 "; }
.small { font-size: 12px; margin: 6px 0 0; }

/* bảng tuỳ chọn (như màn "Dẫn đường" của app) */
.sheet { margin: 4px 0 12px; padding: 12px; border-radius: 16px; background: var(--chip); }
.sheet-title { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.sheet-title .icon { background: var(--card); }
.sheet-label { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .02em; }
.sheet .seg { background: var(--card); margin-bottom: 0; }
.sheet .seg button[aria-checked="true"] { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.toggles { display: grid; gap: 2px; background: var(--card); border-radius: 12px; overflow: hidden; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.toggle .ti { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; color: #fff; flex: none; }
.toggle .tl { flex: 1; } .toggle .tl small { display: block; font-weight: 400; color: var(--text-2); font-size: 12px; }
.switch { width: 46px; height: 28px; border-radius: 100px; background: #d9d9db; padding: 0; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { left: 21px; }
.switch:disabled { opacity: .6; }

/* thẻ tuyến: nhanh nhất / đường lớn / đường phượt */
.cards { display: grid; gap: 8px; margin: 4px 0 10px; }
.card { text-align: left; background: var(--card); border: 1.5px solid var(--stroke); border-radius: 16px; padding: 10px 12px; display: grid; gap: 2px; color: var(--text); }
.card[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.card .tag2 { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 100px; background: var(--chip); color: var(--text-2); }
.card[aria-pressed="true"] .tag2 { background: var(--primary); color: var(--on-primary); }
.card .t { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--primary); }
.card .t small { font-size: 13px; font-weight: 600; color: var(--text-2); margin-left: 6px; }
.card .why { font-size: 13px; color: var(--text-2); line-height: 18px; }
.cards .hint { font-size: 13px; color: var(--text-2); padding: 4px 2px; }
.actions { margin-bottom: 4px; flex-wrap: wrap; }
.actions button { min-width: 0; }
.bubble { background: var(--card); color: var(--text); border-radius: 10px; padding: 4px 8px; font: 700 13px/16px "Manrope", sans-serif; box-shadow: var(--shadow); cursor: pointer; white-space: nowrap; }
.bubble small { display: block; font-weight: 600; font-size: 11px; color: var(--text-2); }
.bubble.on { background: var(--primary); color: var(--on-primary); }
.bubble.on small { color: var(--on-primary); opacity: .9; }

/* chip phương tiện */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chips button { padding: 8px 14px; font-size: 14px; line-height: 20px; font-weight: 600; border-radius: 100px; background: var(--chip); color: var(--text-2); }
.chips button[aria-checked="true"] { background: var(--primary); color: var(--on-primary); }

/* nút thao tác */
.row { display: flex; gap: 12px; }
button.primary { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 12px;
  background: var(--primary); color: var(--on-primary); font-size: 16px; line-height: 22px; font-weight: 700; }
button.primary img { width: 18px; height: 18px; }
button.square { width: 50px; height: 50px; border-radius: 12px; font-size: 18px; color: var(--text); padding: 0; flex: none; }

/* thông tin tuyến */
#out { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
#summary .time { display: block; font-size: 24px; line-height: 34px; font-weight: 700; color: var(--primary); }
#summary .dist { display: block; font-size: 14px; font-weight: 500; }
#summary .muted { font-size: 13px; line-height: 18px; margin-top: 2px; }
.note { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--chip); font-size: 13px; line-height: 18px; }
#chart { margin: 12px 0 4px; height: 120px; position: relative; }
#chart svg { width: 100%; height: 100%; display: block; }
#chart text { font-family: "Manrope", sans-serif; }
#chart .tip { position: absolute; top: 0; font-size: 12px; font-weight: 600; background: var(--card); border-radius: 6px; box-shadow: var(--shadow);
  padding: 1px 6px; pointer-events: none; white-space: nowrap; }
h3 { font-size: 16px; line-height: 24px; font-weight: 700; margin: 16px 0 8px; display: flex; align-items: center; gap: 4px; }
#warnings { list-style: none; margin: 0; padding: 0; }
#warnings li { padding: 8px 12px; margin-bottom: 6px; border-radius: 12px; background: #fff0db; color: #93370d; cursor: pointer;
  border-left: 4px solid var(--yellow); font-size: 13px; line-height: 18px; font-weight: 500; }
#warnings li.doc_dai { background: #dbeafe; color: #1e1a8a; border-left-color: var(--blue); }
:root[data-theme="night"] #warnings li { background: #3a2a10; color: #fdb022; }
:root[data-theme="night"] #warnings li.doc_dai { background: #1d2045; color: #a4a8f5; }
#steps { margin: 0; padding-left: 24px; }
#steps li { padding: 6px 0; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 14px; }
#steps li::marker { color: var(--primary); font-weight: 700; }
#steps li button { background: none; padding: 0 0 0 6px; color: var(--text-2); }
#msg { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--primary); min-height: 1em; }
footer { margin-top: 10px; font-size: 12px; line-height: 18px; }
footer a { color: var(--text-2); }

/* popup trên bản đồ */
.maplibregl-popup-content { background: var(--card); color: var(--text); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; font-family: "Manrope", sans-serif; }
.maplibregl-popup-tip { border-top-color: var(--card) !important; border-bottom-color: var(--card) !important; }
.popup b { display: block; margin-bottom: 2px; font-size: 14px; }
.popup .muted { font-size: 12px; }
.popup .row { margin-top: 8px; gap: 8px; }
.popup button { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 100px; }
.popup button:last-child { background: var(--primary); color: var(--on-primary); }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--shadow) !important; }

@media (max-width: 640px) {
  #panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 58%; border-radius: 24px 24px 0 0; padding: 8px 16px 16px; }
  .handle { display: flex; }
  #results { max-height: 220px; }
}

/* nút lớp bản đồ + chú thích cung */
.layer-ctl { position: relative; }
.layer-ctl .layer-btn { display: grid; place-items: center; width: 29px; height: 29px; color: #333; background: #fff; }
.layer-ctl .layer-btn[aria-expanded="true"] { color: var(--primary); }
.layer-panel { position: absolute; right: 36px; top: 0; width: 240px; background: var(--card); color: var(--text); border-radius: 14px;
  box-shadow: var(--shadow); padding: 10px 12px; font: 13px/18px "Manrope", sans-serif; text-align: left; }
.layer-panel b { display: block; margin-bottom: 6px; font-size: 14px; }
.layer-panel .lyr { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.layer-panel .lyr small { display: block; color: var(--text-2); font-size: 11px; line-height: 14px; }
.layer-panel input { accent-color: var(--primary); width: 16px; height: 16px; }
.layer-panel p { font-size: 11px; line-height: 15px; margin: 6px 0 0; }
.sw { flex: none; width: 28px; height: 8px; border-radius: 4px; }
.sw-phuot { background: #3fbf7a; opacity: .7; height: 10px; }
.sw-trekking { background: repeating-linear-gradient(90deg, #e3b22c 0 4px, transparent 4px 9px); height: 4px; }
.layer-panel b.sec { margin-top: 10px; }
.sw-hs { background: linear-gradient(135deg, #fff 0%, #b9ad97 55%, #6b5a3a 100%); height: 14px; width: 28px; }
.sw-ct { background: repeating-linear-gradient(0deg, transparent 0 3px, #9c7a4a 3px 4px); height: 14px; width: 28px; }
.sw-offroad { background: repeating-linear-gradient(90deg, #9a6a3a 0 9px, transparent 9px 13px); height: 4px; }
.cung-card { display: grid; gap: 3px; }
.kind-badge { justify-self: start; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 100px; color: #fff; }
.kb-phuot { background: #22a06b; } .kb-trekking { background: #c9971a; } .kb-offroad { background: #9a6a3a; }
.cung-card .src { font-size: 11px; color: var(--text-2); font-style: italic; }
.warn-mini { margin: 6px 0 0; font-size: 12px; color: #93370d; background: #fff0db; border-radius: 8px; padding: 4px 8px; }
:root[data-theme="night"] .warn-mini { background: #3a2a10; color: #fdb022; }
:root[data-theme="night"] .layer-ctl .layer-btn { background: var(--card); color: var(--text); }

[hidden] { display: none !important; }

/* ---------- Dẫn đường (bản thử G4) — theo Figma SCR-LTM-002 */
.nav-start { width: 100%; margin-top: 8px; }
body.navigating #panel { display: none; }
body.navigating .maplibregl-ctrl-top-right { display: none; }
/* Ghi nguồn OSM luôn thấy khi dẫn đường (Ghi nhớ #4): nâng khối ghi nguồn lên trên thanh dưới (--nv-h đặt trong app.js) */
body.navigating .maplibregl-ctrl-bottom-right, body.navigating .maplibregl-ctrl-bottom-left { bottom: var(--nv-h, 100px); }
#nav[hidden] { display: none; }
#nav { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#nav > *, #nav button, #nav select { pointer-events: auto; }
#nav [hidden] { display: none !important; }
.nv-top { position: absolute; top: 8px; left: 4px; right: 4px; max-width: 520px; pointer-events: none; }
.nv-banner { position: relative; z-index: 2; display: flex; gap: 12px; align-items: center; background: #079455; color: #fff;
  border-radius: 12px; padding: 12px 16px 12px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.18); pointer-events: auto; }
.nv-ic { display: grid; justify-items: center; gap: 2px; min-width: 64px; }
.nv-arrow svg { width: 48px; height: 48px; display: block; }
.nv-dist { font-size: 17px; font-weight: 800; line-height: 20px; white-space: nowrap; }
.nv-main { min-width: 0; display: block; line-height: 1.15; }
.nv-verb { font-size: 14px; font-weight: 600; opacity: .95; margin-right: 6px; }
.nv-street { font-size: 26px; font-weight: 700; letter-spacing: -.2px; overflow-wrap: anywhere; }
.nv-then { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; margin-top: -10px; padding: 16px 14px 8px;
  background: #078a50; color: #fff; border-radius: 0 0 12px 12px; font-size: 18px; font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.nv-then-ic svg { width: 26px; height: 26px; display: block; }
.nv-then-d { font-size: 13px; opacity: .9; }
.nv-then.close { background: #e04f16; } /* chỗ rẽ sau sát chỗ rẽ trước: đổi màu cho dễ thấy */
.nv-chip { position: absolute; left: 12px; right: 12px; max-width: 420px; top: 190px; border-radius: 10px; padding: 8px 12px; font-weight: 600;
  font-size: 13px; box-shadow: var(--shadow); }
.nv-warn { background: #fffaeb; color: #93370d; border: 1px solid #fedf89; }
.nv-off { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); top: 236px; }
/* la bàn · tìm điểm dừng · về vị trí: cột phải, ngay trên nút cảnh báo (như Google Maps) */
.nv-right { position: absolute; right: 20px; bottom: 204px; display: grid; gap: 12px; justify-items: end; }
.nv-round { width: 48px; height: 48px; border-radius: 50%; border: none; background: #fff; color: #181d27; display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); cursor: pointer; }
.nv-round.north { outline: 2px solid #079455; }
.nv-recenter { display: none; }
/* đã kéo/phóng bản đồ: nút GPS thành nút "Về giữa" */
.nv-round.free { width: auto; border-radius: 24px; padding: 0 16px 0 12px; display: flex; gap: 8px; color: #079455; font-weight: 700; font-size: 15px; }
.nv-round.free .nv-recenter { display: inline; }
.nv-q { width: 100%; box-sizing: border-box; border: 1px solid #d5d7da; border-radius: 12px; padding: 11px 14px; font: inherit; font-size: 16px; }
.nv-quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.nv-quick button { border: 1px solid #e9eaeb; background: #f5f5f5; border-radius: 18px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.nv-res { list-style: none; margin: 6px 0 0; padding: 0; max-height: 40vh; overflow: auto; }
.nv-res li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #ebebeb; }
.nv-res li > span { flex: 1; min-width: 0; } .nv-res b { display: block; font-size: 15px; } .nv-res small { color: #535862; font-size: 13px; }
.nv-res li button { border: none; background: #079455; color: #fff; border-radius: 18px; padding: 7px 12px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; flex: none; }
.nv-res .muted { color: #535862; justify-content: center; }
.nav-flag { width: 40px; height: 48px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); cursor: default; }
.nv-speed { position: absolute; left: 14px; bottom: 132px; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: #181d27;
  display: grid; place-content: center; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.18); line-height: 1; }
.nv-speed b { font-size: 17px; font-weight: 600; } .nv-speed small { font-size: 9px; color: #535862; }
.nv-speed.fast { color: #fff; background: #d92d20; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #d92d20; }
.nv-speed.fast small { color: #fff; }
/* biển giới hạn tốc độ (vòng đỏ) ngay trên ô tốc độ; "theo luật" = không có biển trên dữ liệu */
.nv-limit { position: absolute; left: 14px; bottom: 194px; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: #181d27;
  border: 5px solid #d92d20; box-sizing: border-box; display: grid; place-items: center; align-content: center; line-height: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.nv-limit b { font-size: 18px; font-weight: 800; letter-spacing: -.5px; }
.nv-limit small { font-size: 7.5px; color: #535862; margin-top: 1px; }
.nv-limit.over { animation: nvPulse 1s ease-in-out infinite; }
@keyframes nvPulse { 50% { transform: scale(1.12); } }
.nv-sig { display: inline-block; vertical-align: -3px; margin-right: 5px; }
.nv-rep-h { margin: 4px 0 8px; font-weight: 600; color: #414651; }
.nv-signs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; justify-items: center; }
.nv-signs button { width: 58px; height: 58px; border-radius: 50%; border: 6px solid #d92d20; background: #fff; color: #181d27;
  font: inherit; font-size: 19px; font-weight: 800; cursor: pointer; }
.nv-signs button:active { transform: scale(.94); }
.nv-btns button.on { background: #fee4e2; border-color: #d92d20; color: #b42318; }
.nv-fab { position: absolute; right: 16px; bottom: 132px; width: 56px; height: 56px; border-radius: 50%; border: none; background: #f79009;
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(247,144,9,.45); cursor: pointer; }
.nv-bottom { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; color: #181d27; border-radius: 20px 20px 0 0;
  box-shadow: 0 -2px 14px rgba(0,0,0,.12); padding: 18px 12px calc(14px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; }
.nv-grip { position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #e9eaeb; }
.nv-circle { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid #252b37; background: #fff; color: #252b37; display: grid;
  place-items: center; cursor: pointer; flex: none; }
.nv-sum { flex: 1; text-align: center; min-width: 0; }
.nv-sum1 { display: inline-flex; align-items: center; gap: 8px; }
.nv-min { font-size: 24px; font-weight: 700; color: #079455; }
.nv-sum2 { font-size: 15px; color: #535862; margin-top: 2px; }
.nv-mini { width: 26px; height: 26px; border-radius: 50%; border: none; background: #f1f1f1; color: #252b37; display: grid; place-items: center; cursor: pointer; }
.nv-mini.muted-on { color: #d92d20; }
.nv-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; background: #fff; color: #181d27; border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.18); padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.nv-sheet-h { display: flex; align-items: center; justify-content: center; position: relative; padding: 10px 0 14px; font-size: 18px; }
.nv-x { position: absolute; right: 0; width: 32px; height: 32px; border-radius: 50%; border: none; background: #f1f1f1; font-size: 20px; cursor: pointer; }
.nv-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 0; border: none; border-top: 1px solid #ebebeb; background: none;
  text-align: left; cursor: pointer; font: inherit; color: inherit; }
.nv-item b { display: block; font-size: 16px; } .nv-item small { color: #535862; font-size: 14px; } .nv-item i { margin-left: auto; font-size: 24px; color: #535862; font-style: normal; }
.nv-tile { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 800; flex: none; }
.nv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #ebebeb; }
.nv-row select, .nv-btns button { border: 1px solid #e9eaeb; background: #f1f1f1; border-radius: 10px; padding: 7px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.nv-btns { display: inline-flex; gap: 6px; }
.nv-toast { position: absolute; top: 14px; left: 14px; right: 14px; max-width: 500px; z-index: 4; display: flex; align-items: center; gap: 12px;
  background: #fef3f2; color: #181d27; border: 1.5px solid #fda29b; border-radius: 12px; padding: 10px 44px 10px 10px; box-shadow: var(--shadow); }
.nv-toast .nv-x { right: 8px; background: none; }
.nv-toast-ic { width: 40px; height: 40px; border-radius: 8px; background: #d92d20; color: #fff; display: grid; place-items: center; font-size: 20px; flex: none; }
.nav-car { width: 64px; height: 64px; display: grid; place-items: center; }
.nav-car svg { width: 64px; height: 64px; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.nav-car.off svg path.body { fill: #d92d20; }
@media (min-width: 641px) { .nv-top { left: 12px; } .nv-bottom { left: 50%; right: auto; width: 560px; margin-left: -280px; } }
@media (max-width: 380px) { .nv-street { font-size: 22px; } }

/* ---------- Lớp Flycam (tham khảo theo OSM) */
.sw-fly { background: repeating-linear-gradient(45deg, rgba(217,45,32,.35) 0 4px, rgba(217,45,32,.12) 4px 8px); border: 1.5px dashed #d92d20; height: 14px; width: 28px; }
.fly-note { margin: 2px 0 6px; }
.fly-link { display: inline-block; margin-top: 4px; color: #d92d20; font-weight: 700; text-decoration: none; font-size: 12px; }
.fly-link:hover { text-decoration: underline; }
.kb-fly { background: #fef3f2; color: #d92d20; }
/* 30/11/2026 — báo tình trạng đường (10 loại của backend) + thẻ "Vẫn còn?" */
.nv-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 4px; margin-bottom: 12px; }
.nv-type { display: flex; flex-direction: column; align-items: center; gap: 4px; border: none; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 12px; line-height: 1.2; color: #414651; text-align: center; }
.nv-type .nv-tile { width: 44px; height: 44px; font-size: 20px; }
.nv-type:active .nv-tile { transform: scale(.94); }
.nv-back { border: none; background: none; color: #414651; font: inherit; font-weight: 600; padding: 12px 0 0; cursor: pointer; }
.nv-still { position: absolute; left: 12px; right: 12px; bottom: 112px; max-width: 520px; margin: 0 auto; z-index: 4; display: flex;
  align-items: center; gap: 10px; background: #fff; color: #181d27; border-radius: 14px; padding: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.22); }
.nv-still-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 19px; font-weight: 800; flex: none; }
.nv-still-t { flex: 1; min-width: 0; } .nv-still-t b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; line-height: 1.25; }
.nv-still-t small { color: #535862; font-size: 13px; }
.nv-still button { border: none; border-radius: 10px; padding: 10px 9px; font: inherit; font-weight: 700; cursor: pointer; background: #079455; color: #fff; flex: none; }
.nv-still button.no { background: #f1f1f1; color: #252b37; }
#navReportSheet { max-height: calc(100% - 24px); overflow-y: auto; }
