/* Một màn hình bản đồ toàn trang; thanh tên trên cùng, thẻ thông tin trượt lên từ dưới.
   Màu theo tranh Spark: nét hoạt hình ấm, viền nâu, biển xanh nhạt. Một bộ màu cố định, sáng. */
:root {
  --sea: #cfe6ee;
  --land: #f3ead2;
  --land-hover: #ece0bf;
  --open: #8cc49a;
  --open-edge: #3f7d55;
  --edge: #9a7a58;
  --ink: #3b2a1e;
  --muted: #7a6656;
  --card: #fffaf0;
  --pick: #e9b44c;
  --accent: #2f6b4f;
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--sea);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  padding-bottom: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--card);
  border-bottom: 2px solid var(--edge);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.crumb a { color: var(--accent); text-decoration: none; }
.crumb { font-size: .9rem; color: var(--muted); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map { position: fixed; inset: 0; touch-action: none; }
#svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; -webkit-user-select: none; }
#svg:active { cursor: grabbing; }
.prov { fill: var(--land); stroke: var(--edge); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; cursor: pointer; }
.prov.open { fill: var(--open); stroke: var(--open-edge); stroke-width: 1.6; }
/* nét dày cùng màu để lấp khe hở giữa ranh giới Natural Earth và ranh giới Việt Nam (hai nguồn lệch nhau vài trăm mét) */
.prov.ngoai { fill: #dcd8cf; stroke: #dcd8cf; stroke-width: 10; stroke-linejoin: round; pointer-events: none; }
.lbl.ngoai-name { fill: #8a7f70; font-weight: 600; letter-spacing: .08em; }
.prov.ctx { fill: #e6e1d6; stroke: #c4b7a4; pointer-events: none; }
.prov.dalat { fill: #c9e2cf; stroke: var(--open-edge); }
.prov.ward { fill: #ead9b4; }
.prov.picked { fill: var(--pick); }
.lbl { font-family: var(--f-body); font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-linejoin: round; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.lbl.open { fill: #1f4d33; font-weight: 700; }
.lbl.sea { font-style: italic; fill: #3d6f86; stroke: var(--sea); font-weight: 600; }
.lbl.ctx { fill: #9a8c7a; font-weight: 500; }
/* tầng đường */
.prov.w-on { fill: #eef2dc; stroke: var(--open-edge); stroke-width: 2; pointer-events: none; }
.water path { fill: #a9d3e3; stroke: #6fa9c0; stroke-width: .8; vector-effect: non-scaling-stroke; }
.road-casing path, .road-fill path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.road-casing .r1 { stroke: #9a7a58; stroke-width: 6; }
.road-casing .r2 { stroke: #9a7a58; stroke-width: 5; }
.road-casing .r3 { stroke: #b39a7c; stroke-width: 4; }
.road-fill .r1 { stroke: #f6c76b; stroke-width: 4; }
.road-fill .r2 { stroke: #fbe3a4; stroke-width: 3.2; }
.road-fill .r3 { stroke: #fffaf0; stroke-width: 2.4; }
.road-fill .r4 { stroke: #fffdf6; stroke-width: 1.6; }
.road-fill .r5 { stroke: #d8cdb8; stroke-width: 1; stroke-dasharray: 3 3; }
.lbl.road-name { font-weight: 500; fill: #4a3626; text-anchor: middle; dominant-baseline: auto; }
.lbl.road-name.r1, .lbl.road-name.r2 { font-weight: 700; }
.lbl.moc { fill: #7a4a14; font-weight: 500; text-anchor: start; }
.lbl.ward-name { fill: #2f6b4f; font-weight: 700; }
.pin { cursor: pointer; }
.pin-body { fill: #d9534f; stroke: #fffaf0; stroke-width: 2; }
.pin-dot { fill: #fffaf0; }
.pin-label { font-family: var(--f-body); font-size: 13px; font-weight: 700; fill: #8a2f2c; paint-order: stroke; stroke: #fffaf0; stroke-width: 3.5px; stroke-linejoin: round; }
.pin-ico { color: #d9534f; font-size: .7rem; }
.sw.road { background: #fbe3a4; border-color: #9a7a58; }
.sw.water { background: #a9d3e3; border-color: #6fa9c0; }
.hl path { fill: none; stroke: #d9534f; stroke-width: 7; stroke-opacity: .55; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.lbl[hidden] { display: none; }
.legend {
  position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: grid; gap: 4px; padding: 8px 10px; font-size: .75rem; color: var(--ink);
  background: color-mix(in srgb, var(--card) 90%, transparent); border: 1.5px solid var(--edge); border-radius: 10px;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 10px; border-radius: 3px; border: 1.5px solid var(--edge); display: inline-block; }
.sw.open { background: var(--open); border-color: var(--open-edge); }
.sw.soon { background: var(--land); }
.sw.dalat { background: #c9e2cf; border-color: var(--open-edge); }
.sw.ward { background: #ead9b4; }
.star { font-style: normal; color: #b5651d; width: 14px; text-align: center; }
.zoom {
  position: fixed; right: max(12px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 66px);
  display: grid; gap: 6px;
}
.zoom button, .src-btn, .close, .go {
  font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--edge); border-radius: 10px; cursor: pointer;
}
.zoom button { width: 42px; height: 42px; font-size: 1.3rem; line-height: 1; }
.src-btn { position: fixed; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); padding: 6px 10px; font-size: .78rem; }
button:focus-visible { outline: 3px solid var(--pick); outline-offset: 2px; }
.loading { position: fixed; inset: 50% 0 auto; text-align: center; color: var(--muted); margin: 0; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  max-height: 70vh; overflow-y: auto;
  padding-top: 18px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  background: var(--card); border-top: 2px solid var(--edge); border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 24px rgba(59, 42, 30, .18);
  display: grid; gap: 10px;
}
@media (min-width: 700px) {
  .sheet { left: auto; right: 16px; bottom: 16px; width: 380px; border: 2px solid var(--edge); border-radius: 16px; }
}
.sheet.full { max-height: 88vh; }
.sheet .banner.none { aspect-ratio: 2 / 1; display: grid; place-items: center; color: var(--muted); background: #efe6cf; font-size: .9rem; }
.sheet .banner { width: 100%; border-radius: 12px; border: 2px solid var(--edge); display: block; }
.sheet h3 { margin: 6px 0 0; font-size: 1.02rem; }
.sheet .muted { color: var(--muted); font-weight: 500; font-size: .85rem; }
.places { margin: 0; padding-left: 1.3em; display: grid; gap: 12px; }
.places li { display: grid; gap: 2px; line-height: 1.45; }
.places .addr { font-size: .85rem; color: var(--muted); }
.mini { font: inherit; font-size: .82rem; font-weight: 600; color: var(--accent); background: none; border: 1.5px solid var(--edge); border-radius: 8px; padding: 4px 10px; justify-self: start; cursor: pointer; margin-top: 2px; }
.place-dot { fill: #e9b44c; stroke: #8a2f2c; stroke-width: 3; }
.place-dot.uoc { fill: rgba(233, 180, 76, .45); stroke-dasharray: 4 3; }
/* lịch trình */
.lich-btn { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 70px); z-index: 4;
  font: inherit; font-weight: 700; color: #fffaf0; background: var(--accent); border: 2px solid #1f4d33; border-radius: 999px; padding: 8px 16px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.lich { display: grid; gap: 8px; }
.lich h3 { margin: 6px 0 0; }
.lich ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lich .chang { display: grid; grid-template-columns: 76px 1fr; column-gap: 8px; align-items: start; line-height: 1.45; }
.lich .chang > span:last-child { grid-column: 2; color: var(--muted); font-size: .9rem; }
.lich .buoi { grid-row: span 2; font-size: .78rem; font-weight: 700; background: #f6e2c0; color: #7a4a14; border-radius: 999px; padding: 2px 8px; text-align: center; }
.lich .ten-pho { font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.lich .di-bo { padding-left: 84px; font-size: .82rem; color: var(--muted); }
.lich-duong path { fill: none; stroke: #2f6b4f; stroke-width: 5; stroke-dasharray: 2 8; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* chuyện của phố */
.chuyen { display: grid; gap: 10px; margin-top: 6px; }
.chuyen h3 { margin: 0; }
.ten-cu { font-size: .95rem; }
.moc-nam { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 3px solid #e2c48c; display: grid; gap: 10px; }
.moc-nam li { display: grid; gap: 2px; line-height: 1.45; }
.moc-nam b { color: #8a2f2c; }
.mau-chuyen { display: grid; gap: 2px; padding: 10px 12px; background: #fff6e3; border-radius: 10px; line-height: 1.5; }
.chuyen .src { font-size: .78rem; color: var(--muted); }
/* bản đồ phố minh hoạ */
.bd-pho-vien { fill: none; stroke: #8a2f2c; stroke-opacity: .55; stroke-linecap: round; stroke-linejoin: round; }
.bd-pho { fill: none; stroke: #ff9d2e; stroke-linecap: round; stroke-linejoin: round; }
.bd-ten-duong { font-family: var(--f-body); font-weight: 700; fill: #3a2616; paint-order: stroke; stroke: #fff8e4; stroke-linejoin: round; text-anchor: middle; }
.bd-moc { font-family: var(--f-body); font-weight: 700; fill: #5a2a14; paint-order: stroke; stroke: #fff6e3; stroke-linejoin: round; dominant-baseline: central; }
.bd-moc-cham { fill: #5a2a14; stroke: #fff6e3; stroke-width: 2; }
.bd-noi { stroke: #8a2f2c; stroke-opacity: .8; }
.bd-goc { fill: #8a2f2c; }
.bd-cham { cursor: pointer; }
.bd-cham circle { fill: #d9534f; stroke: #fffaf0; }
.bd-cham circle.uoc { fill: #e58a86; stroke-dasharray: 3 2; }
.bd-cham text { font-family: var(--f-body); font-weight: 700; fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.bd-ghichu { margin: 0; padding: 8px 10px; background: var(--card); font-size: .82rem; color: var(--muted); }
.bd-list { list-style: none; margin: 0; padding: 4px 8px 8px; background: var(--card); display: grid; gap: 4px; }
.bd-list > li > button { width: 100%; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid #eadfca; padding: 6px 2px; cursor: pointer; }
.bd-list .so { width: 24px; height: 24px; border-radius: 50%; background: #d9534f; color: #fff; font-weight: 700; font-size: .8rem; display: grid; place-items: center; align-self: center; }
.bd-list .so.none { background: #cfc6b4; }
.bd-list small { color: var(--muted); }
/* sơ đồ phố kiểu game */
.so-do { margin: 4px 0; border-radius: 12px; overflow: hidden; border: 2px solid var(--edge); background: #93c26c; }
.so-do .note { padding: 8px 10px; background: var(--card); }
.so-do-svg { display: block; width: 100%; height: auto; }
.sd-le { fill: none; stroke: #b5543a; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.sd-nhua { fill: none; stroke: #4b4b52; stroke-width: 26; stroke-linecap: round; stroke-linejoin: round; }
.sd-vach { fill: none; stroke: #f4f0e4; stroke-width: 1.6; stroke-dasharray: 8 8; }
.sd-cat { fill: none; stroke: #d9c9a3; stroke-width: 14; stroke-linecap: butt; stroke-linejoin: round; }
.sd-ten-cat { font: 600 9px var(--f-body); fill: #4a3626; paint-order: stroke; stroke: #fffaf0; stroke-width: 3px; text-anchor: middle; }
.sd-moc { font: 600 9px var(--f-body); fill: #7a4a14; paint-order: stroke; stroke: #fffaf0; stroke-width: 3px; }
.sd-loi { stroke: #fffaf0; stroke-width: 1.5; stroke-dasharray: 2 3; }
.sd-nha { cursor: pointer; }
.sd-nha:focus { outline: none; }
.sd-nha:focus .sd-ten, .sd-nha:hover .sd-ten { fill: #8a2f2c; }
.sd-moc-dot { fill: #fff6e3; stroke: #8a2f2c; stroke-width: 2.5; }
.sd-moc-ico { font: 700 14px var(--f-body); fill: #8a2f2c; text-anchor: middle; }
.sd-uoc { fill: none; stroke: #fffaf0; stroke-width: 1.5; stroke-dasharray: 4 3; }
.sd-ten { font: 700 9.5px var(--f-body); fill: #3b2a1e; paint-order: stroke; stroke: #fffaf0; stroke-width: 3.5px; stroke-linejoin: round; text-anchor: middle; }
.sd-nguon { font: 500 7px var(--f-body); fill: #fffaf0; text-anchor: end; }
.quan-card { position: relative; display: grid; gap: 4px; padding: 12px 44px 12px 12px; border: 2px solid var(--edge); border-radius: 12px; background: #fff6e3; line-height: 1.45; }
.quan-card .close { top: 8px; right: 8px; width: 32px; height: 32px; }
.quan-card .addr { font-size: .85rem; color: var(--muted); }
details.all summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.places .src.warn { color: #9a6a12; }
.places .src { font-size: .8rem; color: var(--muted); }
.sheet h2 { margin: 0; font-size: 1.3rem; line-height: 1.25; padding-right: 36px; text-wrap: balance; }
.sheet p { margin: 0; line-height: 1.5; }
.sheet ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; line-height: 1.45; font-size: .9rem; }
.sheet a { color: var(--accent); word-break: break-word; }
.close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; font-size: 1.3rem; line-height: 1; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #f6e2c0; color: #7a4a14; }
.tag.open { background: #dcefe1; color: #1f4d33; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.go { padding: 10px 14px; font-weight: 600; text-align: center; }
.go[disabled] { opacity: .6; cursor: default; }
.note { font-size: .8rem; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .sheet:not([hidden]) { animation: up .18s ease-out; }
  @keyframes up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
}

/* Trang mỗi nơi: 3 phần địa lý · lịch sử · nay có gì */
.dac-trung { margin: -4px 0 4px; color: var(--muted); font-weight: 500; }
.phan { margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.08); }
.phan > h3 { margin: 0 0 8px; font-size: 1.12rem; }
.phan h4 { margin: 14px 0 6px; font-size: .98rem; }
.phan .facts { margin-top: 10px; }
.chuyen .src.warn, .ten-cu .src.warn, .quan-card .src.warn { color: #9a6a12; display: block; }
.ten-cu .src.warn { display: inline; font-size: .78rem; }

/* Ghi công OpenStreetMap luôn thấy trên bản đồ (điều kiện giấy phép ODbL) */
.osm-credit { position: fixed; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 50px);
  margin: 0; padding: 2px 6px; font-size: .68rem; color: var(--muted); background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 6px; }
.osm-credit a { color: inherit; }

/* Ít chữ, nhiều hình: ô biểu tượng, dòng thời gian, chuyện gập */
.o-bt { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.o-bt span { padding: 5px 10px; border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, #f3e3c3); border: 1px solid rgba(0,0,0,.08); font-size: .88rem; line-height: 1.3; }
.ten-xua { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 10px; }
.ten-xua .nhan, .chuyen-the .nhan { width: 100%; font-size: .78rem; color: var(--muted); }
.chip-ten { font: inherit; color: var(--ink); cursor: pointer; padding: 3px 9px; border-radius: 8px; background: #fbf1dc; border: 1px solid #e6d3a8; font-weight: 600; font-size: .9rem; }
.mui { color: var(--muted); }
.dong-tg { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 3px solid #d9b56a; display: grid; gap: 2px; }
.dong-tg li { position: relative; }
.dong-tg li::before { content: ''; position: absolute; left: -23px; top: 11px; width: 11px; height: 11px; border-radius: 50%; background: #b5562f; border: 2px solid #fff8ea; }
.dong-tg summary, .mau-chuyen summary, .doc-them summary { cursor: pointer; list-style: none; padding: 6px 0; }
.dong-tg summary::-webkit-details-marker, .mau-chuyen summary::-webkit-details-marker, .doc-them summary::-webkit-details-marker { display: none; }
.dong-tg .nam { display: block; color: #9b3d1f; font-size: 1.02rem; }
.dong-tg details p, .mau-chuyen p, .doc-them p { margin: 2px 0 6px; font-size: .9rem; }
.chuyen-the { display: grid; gap: 6px; margin-top: 12px; }
details.mau-chuyen { padding: 2px 10px; border-radius: 10px; background: #fbf1dc; }
.chua-chac { font-style: normal; display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; background: #f1d9a6; color: #8a5a10; font-size: .7rem; margin-left: 4px; }
.doc-them summary { color: var(--muted); font-size: .88rem; text-decoration: underline; }

/* Tầng Việt Nam giống bản đồ game Gọn Phố (Spark đợt 36): đất xanh phẳng, bờ biển nâu đậm có quầng trắng, biển xanh có sóng,
   biểu tượng mốc tỉnh; ranh giới vẫn là dữ liệu thật, tên tỉnh vẫn là chữ của trang */
.map.nen-spark { background-color: #4ec3cf;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='90'%3E%3Cg fill='none' stroke='%23e9fbfc' stroke-width='2.2' stroke-linecap='round' opacity='.75'%3E%3Cpath d='M10 20q6-6 12 0t12 0'/%3E%3Cpath d='M70 62q6-6 12 0t12 0'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 90px; }
.nen-spark .bo-hao { fill: #fff; stroke: #fff; stroke-width: 9; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
.nen-spark .bo-net { fill: #2b1a12; stroke: #2b1a12; stroke-width: 4; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
.nen-spark .prov { fill: #bad76e; stroke: #8fae4f; stroke-width: 1; }
.nen-spark .prov.open { fill: #d9ec8f; stroke: #3f7d2a; stroke-width: 2.4; }
.nen-spark .prov.ngoai { fill: #efe6cc; stroke: #efe6cc; stroke-width: 8; }
.nen-spark .prov.picked { fill: var(--pick); }
.nen-spark .lbl { paint-order: stroke; stroke: #f6fbe6; }
.nen-spark .lbl.sea { fill: #0f4f5e; stroke: #dff6f8; }
.nen-spark .lbl.ngoai-name { fill: #a8987c; stroke: #efe6cc; }
.moc image { filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); cursor: pointer; }
.moc-ten { font-family: var(--f-body); font-size: 11px; font-weight: 800; fill: #2b1a12; text-anchor: middle; paint-order: stroke; stroke: #fffaf0; stroke-width: 3.5px; stroke-linejoin: round; cursor: pointer; }
.moc.mo .moc-ten { fill: #1f5a2c; font-size: 12.5px; }
.nen-spark .sw.open { background: #d9ec8f; border-color: #3f7d2a; }
.nen-spark .sw.soon { background: #bad76e; }
.deco { pointer-events: none; } .deco image { opacity: .92; }
/* Tầng tỉnh (Lâm Đồng) cùng nét: tỉnh láng giềng xanh nhạt, phường có phố xanh sáng, phường Đà Lạt khác xanh vừa */
.nen-spark .prov.ctx { fill: #dfe6c4; stroke: #c3cc9f; }
.nen-spark .prov.ward { fill: #b3d168; }
.nen-spark .prov.dalat { fill: #cde486; stroke: #3f7d2a; }
.nen-spark .lbl.ctx { fill: #8d8f6e; stroke: #eef2dc; }
.nen-spark .sw.dalat { background: #cde486; border-color: #3f7d2a; }
.nen-spark .sw.ward { background: #b3d168; }
/* Tầng tỉnh: mỗi xã/phường một màu pastel (trường `mau`), hai nơi sát nhau khác màu; Đà Lạt nổi bằng viền xanh đậm */
.nen-spark .prov.m0 { fill: #c3de7c; }
.nen-spark .prov.m1 { fill: #f2db8b; }
.nen-spark .prov.m2 { fill: #f5c4a0; }
.nen-spark .prov.m3 { fill: #a8dccb; }
.nen-spark .prov.m4 { fill: #d6c6ea; }
.nen-spark .prov.m5 { fill: #e7e2a2; }
.nen-spark .prov[class*=" m"] { stroke: #8a7a5c; stroke-width: 0.9; }
.nen-spark .prov.open[class*=" m"] { stroke: #1f5a2c; stroke-width: 3; }
.nen-spark .prov.dalat[class*=" m"] { stroke: #3f7d2a; stroke-width: 2; }
.nen-spark .prov.picked { fill: var(--pick); }
.tang-tinh .sw.open { background: #fff8e0; border: 3px solid #1f5a2c; }
.tang-tinh .sw.dalat { background: #fff8e0; border: 2px solid #3f7d2a; }

/* Thẻ tỉnh, phường gọn: hình mốc đầu thẻ, ô biểu tượng, các nơi đã có trang thành hình nhỏ bấm được */
.the-dau { display: flex; align-items: center; gap: 12px; margin-right: 36px; }
.the-dau img { width: 72px; height: auto; flex: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.the-dau h2 { margin: 0; }
.the-dau .dac-trung { margin: 2px 0 0; }
.nhan-nho { margin: 10px 0 2px; font-size: .82rem; color: var(--muted); }
.o-bt.gop { margin-top: 2px; align-items: center; }
.o-bt.gop .cong { background: none; border: 0; padding: 0 2px; color: var(--muted); }
.go.lon { display: block; width: 100%; margin-top: 12px; background: #2f6b4f; color: #fff; border-color: #2f6b4f; font-size: 1rem; }
.pho-nho { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.pho-nho a { display: block; text-decoration: none; color: var(--ink); background: #fbf1dc; border-radius: 10px; overflow: hidden; }
.pho-nho img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.pho-nho b { display: block; padding: 5px 8px; font-size: .82rem; }
.xem-them > summary { cursor: pointer; list-style: none; margin: 6px 0; padding: 6px 12px; display: inline-block; border-radius: 999px; background: #f1e3c2; color: #6b4a1e; font-size: .85rem; font-weight: 600; }
.xem-them > summary::-webkit-details-marker { display: none; }
.xem-them[open] > summary { display: none; }
/* Hình món Spark đợt 45 trong ô "Nay có gì" */
.o-bt.mon span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; }
.bt-hinh { width: 34px; height: 34px; flex: none; }

/* mốc lâu đời: hình Spark bên trái, tên bên phải */
.bd-list .moc-hinh { width: 56px; height: 50px; object-fit: contain; }
.bd-list .moc-hinh.bt { display: grid; place-items: center; font-size: 1.6rem; }
.bd-list .so + .moc-hinh { margin-left: 4px; }
/* dòng thời gian: chỉ năm, chạm mới mở */
.dong-tg .nam { display: inline; }
.dong-tg summary::after { content: ' ›'; color: #b08a4a; }
.dong-tg details[open] summary::after { content: ' ⌄'; }
.bd-list .quan-card { margin: 2px 0 8px; }
.bd-list .moc-hinh.bt .bt-hinh { width: 44px; height: 44px; }
.chip-ten.dang-mo { background: #f3dfae; border-color: #c9a45a; }
.ten-ct { display: grid; gap: 2px; margin: -4px 0 10px; padding: 8px 10px; border-radius: 10px; background: #fff6e3; border: 1px solid #e6d3a8; font-size: .9rem; }

/* Đà Lạt 1963: tầng riêng vẽ lại từ bản đồ AMS L909 (nét giấy bản đồ cũ) */
.sang-btn { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 118px); z-index: 4; white-space: nowrap;
  font: inherit; font-weight: 700; font-size: .85rem; color: #fffaf0; background: #8a5a2b; border: 2px solid #5a3410; border-radius: 999px; padding: 7px 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
#svg.y63 ~ .zoom { top: calc(env(safe-area-inset-top, 0px) + 166px); }
.tim63 { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); top: calc(env(safe-area-inset-top, 0px) + 70px); z-index: 6;
  right: max(12px, env(safe-area-inset-right, 0px)); max-width: 480px; display: grid; gap: 4px; }
.tim63 input { font: inherit; font-size: 16px; padding: 8px 12px; border: 2px solid #9a7a58; border-radius: 999px; background: #fffaf0; color: #2b241b; width: 100%; box-sizing: border-box; }
.tim-kq { background: #fffaf0; border: 1.5px solid #9a7a58; border-radius: 10px; overflow: hidden; display: grid; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.tim-kq button { font: inherit; text-align: left; background: none; border: 0; border-bottom: 1px solid #e6dcc6; padding: 8px 12px; display: grid; cursor: pointer; color: #2b241b; }
.tim-kq button span { font-size: .78rem; color: #6d6252; }
.tim-kq p { margin: 0; padding: 8px 12px; font-size: .85rem; color: #6d6252; }
#svg.y63 { background: #e9e2cf; }
.giay63 { fill: #f4efe2; }
.rung63 path { fill: #cfe3b5; }
.nuoc63 path { fill: #a9d3e3; stroke: #6fa9c0; }
.nha63g path { fill: #9b7a58; }
.nhago63 path { fill: #c4ae8e; }
.sw.nhago63 { background: #c4ae8e; border-color: #a88a66; }
/* nét đường theo mức phóng: xa (0) chỉ đường lớn mảnh, vừa (1) thêm đường nhỏ, gần (2) đủ, có nhà */
.vuon63 path { fill: url(#vuon63p); }
.vuon63-nen { fill: #ece6c8; }
.vuon63-cham { fill: #9c8a5a; }
.dam63 path { fill: url(#dam63p); }
.dam63-bui { fill: none; stroke: #4f7fb0; stroke-width: .9; vector-effect: non-scaling-stroke; }
.dm63 path { fill: none; stroke: #b98a52; stroke-width: .7; stroke-opacity: .55; vector-effect: non-scaling-stroke; }
.lbl.cao63 { fill: #6b4f2e; font-size: .72em; font-weight: 500; }
.sw.vuon63 { background: radial-gradient(circle, #9c8a5a 1.2px, #ece6c8 1.6px) 0 0 / 6px 6px; }
.sw.dam63 { background: repeating-linear-gradient(90deg, #4f7fb0 0 1px, transparent 1px 4px) bottom / 100% 5px no-repeat, #f4efe2; }
.sw.dm63 { background: none; border: 0; border-top: 1.5px solid #b98a52; border-bottom: 1.5px solid #b98a52; height: 4px; opacity: .8; }
.khu63 path { fill: #e7d9bf; }
/* Đường 1963 theo góp ý Antigravity 27/11: bề rộng nở mượt theo mức phóng (biến --c1..--f4 do apply() đặt, nội suy theo log2 z),
   lòng đường sáng hơn nền, viền mảnh màu be-nâu dịu; 4 mức data-zm 0/1/2/3 ở z 2,2 / 4,8 / 9 */
.duong63.road-casing .r1 { stroke: #b89b74; stroke-width: var(--c1, 4); }
.duong63.road-casing .r2 { stroke: #b89b74; stroke-width: var(--c2, 3); }
.duong63.road-casing .r3 { stroke: #c8b79b; stroke-width: var(--c3, 1); }
.duong63.road-casing .r4 { stroke: #c8b79b; stroke-width: var(--c4, 0); }
.duong63.road-fill .r1 { stroke: #f0c975; stroke-width: var(--f1, 2.6); }
.duong63.road-fill .r2 { stroke: #f8e4b4; stroke-width: var(--f2, 1.8); }
.duong63.road-fill .r3 { stroke: #fffdf7; stroke-width: var(--f3, 0); }
.duong63.road-fill .r4 { stroke: #f3ead6; stroke-width: var(--f4, 0); }
#svg.y63[data-zm="0"] .duong63 .r4, #svg.y63[data-zm="0"] .duong63.road-fill .r3, #svg.y63[data-zm="1"] .duong63.road-fill .r4 { display: none; }
.dat63 path { fill: none; stroke: #9c7046; stroke-width: 1.3; stroke-dasharray: 4 3; stroke-opacity: .6; vector-effect: non-scaling-stroke; }
#svg.y63[data-zm="0"] .dat63, #svg.y63[data-zm="1"] .dat63 { display: none; }
#svg.y63[data-zm="3"] .dat63 path { stroke-width: 1.6; stroke-dasharray: 5 3; stroke-opacity: .85; }
/* nền theo mức: xa tắt vòng cao độ, khuôn viên; vườn, đầm tô phẳng tới mức 2 (ô hoa văn 25 m còn nhỏ quá) */
#svg.y63[data-zm="0"] .dm63, #svg.y63[data-zm="0"] .kv63 { display: none; }
#svg.y63[data-zm="1"] .dm63 path { stroke-opacity: .22; }
#svg.y63[data-zm="2"] .dm63 path { stroke-opacity: .42; }
#svg.y63[data-zm="3"] .dm63 path { stroke-opacity: .52; }
#svg.y63[data-zm="1"] .kv63 path { stroke-opacity: .35; }
#svg.y63[data-zm="0"] .vuon63 path, #svg.y63[data-zm="1"] .vuon63 path { fill: #ece6c8; }
#svg.y63[data-zm="0"] .dam63 path, #svg.y63[data-zm="1"] .dam63 path { fill: #dceae8; }
/* nhà: từ z 6,5 (nhà 10 m ≥ 3 điểm ảnh) */
#svg.y63:not([data-nha]) .nha63g { display: none; }
#svg.y63[data-nha] .nha63g { display: inline; }
#svg.y63[data-nha] .khu63 path { fill: #ece2cc; }
#svg.y63[data-zm="3"] .khu63 path { fill-opacity: .35; }
.hl63 path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.hl63 .hl-quang { stroke: #e0662f; stroke-opacity: .3; stroke-width: 26; animation: hl63nhay 1.4s ease-in-out 4; }
.hl63 .hl-vien { stroke: #fff; stroke-width: 13; }
.hl63 .hl-net { stroke: #d9531e; stroke-width: 8; }
@keyframes hl63nhay { 0%, 100% { stroke-opacity: .1; stroke-width: 18; } 50% { stroke-opacity: .45; stroke-width: 34; } }
@media (prefers-reduced-motion: reduce) { .hl63 .hl-quang { animation: none; } }
.lbl.road-name.ten-1963 { fill: #5a3410; font-weight: 700; }
.lbl.diem-1963 { fill: #5a3410; font-weight: 700; text-anchor: start; }
.lbl.ap63 { fill: #6b5a43; font-weight: 600; letter-spacing: .12em; text-anchor: middle; font-style: italic; }
.sw.road63 { background: #f2d59a; border-color: #7a5230; border-width: 2px; }
.sw.nha63 { background: #d9c39b; border-color: #a88a66; }
.sw.dat63 { background: repeating-linear-gradient(90deg, #7a5230 0 4px, transparent 4px 7px); height: 3px; border: 0; }
.ram63 path { fill: #a9cd8c; }
.sw.ram63 { background: #a9cd8c; border-color: #7fae66; }
.sw.rung63 { background: #cfe3b5; border-color: #9bbf86; }
.lbl.rung63-ten { fill: #4f7a3a; font-style: italic; font-weight: 600; }
.lbl.ct63-ten { text-anchor: start; font-weight: 600; fill: #4a3626; }
.lbl.ct63-ten.n-tho { fill: #7a2e5a; }
.lbl.ct63-ten.n-chua { fill: #a2481f; }
.lbl.ct63-ten.n-truong { fill: #2d5a86; }
.lbl.ct63-ten.n-dinh, .lbl.ct63-ten.n-cho, .lbl.ct63-ten.n-ga { fill: #8a1f1f; font-weight: 700; }
.lbl.ct63-ten.n-benh { fill: #b3261e; }
.lbl.ct63-ten.n-choi { fill: #2f6b4f; }
.hl63-diem { fill: #e0662f; fill-opacity: .35; stroke: #e0662f; stroke-width: 2; vector-effect: non-scaling-stroke; }

/* Đà Lạt 1963 gọn: chú thích gập, nút "Hôm nay" nhỏ góc dưới, ô tìm mảnh */
.legend.gap { pointer-events: auto; padding: 0; background: none; border: 0; }
.legend.gap > span { display: none; }
.legend.gap.mo { z-index: 5; max-height: 72vh; overflow: auto; padding: 8px 10px; background: color-mix(in srgb, var(--card) 94%, transparent); border: 1.5px solid var(--edge); }
.legend.gap.mo > span { display: flex; }
.lg-nut { font: inherit; font-size: .78rem; font-weight: 600; color: var(--ink); background: var(--card); border: 1.5px solid var(--edge); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.legend.gap.mo .lg-nut { margin-bottom: 4px; }
#svg.y63 ~ .sang-btn { top: auto; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); font-size: .8rem; padding: 6px 14px; }
#svg.y63 ~ .zoom { top: calc(env(safe-area-inset-top, 0px) + 120px); }
.tim63 input { padding: 7px 14px; font-size: 16px; border-width: 1.5px; }
/* địa điểm trên bản đồ 1963: hình Spark trong vòng tròn giấy, hoặc dấu tròn theo loại */
.dd63 { cursor: pointer; }
.dd63 { transition: opacity .2s ease-out; }
.dd63.an { opacity: 0; pointer-events: none; transition: opacity .12s ease-in; }
@media (prefers-reduced-motion: reduce) { .dd63, .dd63.an { transition: none; } }
.dd63-tron { stroke: #fffaf0; stroke-width: 1.5; fill: #8a5a2b; }
.dd63-tron.n-tho { fill: #7a2e5a; } .dd63-tron.n-chua { fill: #a2481f; } .dd63-tron.n-truong { fill: #2d5a86; }
.dd63-tron.n-dinh, .dd63-tron.n-cho, .dd63-tron.n-ga { fill: #8a1f1f; } .dd63-tron.n-benh { fill: #b3261e; } .dd63-tron.n-choi { fill: #2f6b4f; }
.dd63-dau { fill: #fff; font-size: 11px; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.nay63 { margin: 4px 0; line-height: 1.5; }
.tg-ngan { color: var(--muted); font-size: .9rem; }
.dong-tg .tg-nay { padding: 6px 0; }
.dong-tg .tg-nay::before { background: #2f6b4f; }
.mon63 path { fill: none; stroke: #8f6d4a; stroke-width: .9; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
#svg.y63[data-zm="0"] .mon63, #svg.y63[data-zm="1"] .mon63 { display: none; }
.mon63 path { stroke-dasharray: 2 3; stroke-opacity: .65; }
#svg.y63[data-zm="3"] .mon63 path { stroke-width: 1.1; stroke-dasharray: 3 3; stroke-opacity: .8; }
.sw.mon63 { background: repeating-linear-gradient(90deg, #8f6d4a 0 3px, transparent 3px 6px); height: 2px; border: 0; }
.cao63-ico { color: #6b4f2e; }

.tim63 input { padding-right: 44px; }
.tim63 input::-webkit-search-cancel-button { display: none; }
.tim-xoa { position: absolute; right: 6px; top: 4px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #e9dcc4; color: #5a4632;
  font-size: 22px; line-height: 1; cursor: pointer; }

.kv63 path { fill: #c0392b; fill-opacity: .06; stroke: #c0392b; stroke-width: 1.3; stroke-opacity: .75; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.sw.kv63 { background: rgba(192,57,43,.08); border: 1.5px dashed #c0392b; }

.dd63-ten { font-size: 11.5px; fill: #5a3a22; stroke-width: 3px; }
.dd63-dau { font-size: 8.5px; }
.dong-tg details p { margin: 4px 0 6px; line-height: 1.5; }
.lbl.ct63-ten.chung63 { font-size: .86em; fill-opacity: .75; }
/* Không dùng opacity cho cả lớp lớn: Safari iPhone phải vẽ cả lớp ra một tấm ảnh trung gian to bằng cả bản đồ khi phóng gần → hết bộ nhớ, trang tự thoát (anh Kha 27/11). Dùng stroke-opacity / fill-opacity. */
#svg.y63 { will-change: transform; }
.dong-tg .ke-them > summary { display: inline-block; padding: 0 0 4px; font-size: .85rem; color: #2f6b4f; font-weight: 600; }
.dong-tg .ke-them > summary::after { content: ' ›'; }
.dong-tg .ke-them[open] > summary::after { content: ' ⌄'; }
.dong-tg .ke-them p { color: #4a3f33; }
/* Sài Gòn 1961: khối phố viền mảnh, nhà gạch xám hiện ở mọi mức, đường là khoảng giấy giữa khối (như bản gốc) */
#svg.sg61 { background: #fbf6ea; }
#svg.sg61 .giay63 { fill: #fbf6ea; }
#svg.sg61 .khu63 path { fill-rule: evenodd; fill: #f3ecdc; stroke: #8f7a5c; stroke-width: .8; vector-effect: non-scaling-stroke; }
#svg.y63.sg61:not([data-nha]) .nha63g, #svg.sg61 .nha63g { display: inline; }
#svg.sg61 .nha63g path { fill: #cdb68f; stroke: #9a8260; stroke-width: .5; vector-effect: non-scaling-stroke; }
.dac63 path { fill: #6e5a44; }
#svg.sg61 .duong63.road-casing path { display: none; }
#svg.sg61 .mon63, #svg.sg61 .dat63, #svg.sg61 .duong63.road-casing { display: none; }
#svg.sg61 .duong63.road-fill path { stroke: #fbf6ea; stroke-linecap: round; }
#svg.sg61 .duong63.road-fill .r1 { stroke-width: calc(var(--f1, 3px) + 3px); }
#svg.sg61 .duong63.road-fill .r2 { stroke-width: calc(var(--f2, 2px) + 2px); }
#svg.sg61 .duong63.road-fill .r3 { display: inline; stroke-width: calc(var(--f3, 1px) + 1.5px); }
#svg.sg61 .nha63g, #svg.sg61 .dac63 { }
#svg.sg61 .rung63 path { fill: #cfe0b5; }
.vien61 path { fill: none; stroke: #4a3b2c; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.net61 path { fill: #4e3f2e; fill-rule: evenodd; stroke: none; }
/* màu Sài Gòn 1961: nền giấy kem, nhà tô cam đất nhạt + nét gạch nâu đỏ, công trình lớn đỏ gạch, viền khối nâu sẫm, cỏ xanh, sông xanh */
.n61-nen_nha path { fill: url(#gach61); fill-rule: nonzero; stroke: #a8643f; stroke-width: .8; vector-effect: non-scaling-stroke; }
.gach61-nen { fill: #f0d9b8; } .gach61-vach { fill: #c08156; }
.n61-dac path { stroke: #7e2c1f; stroke-width: .6; vector-effect: non-scaling-stroke; }
.n61-gach path { fill: #a8643f; }
.n61-dac path { fill: #9c3b2a; }
.n61-vien path { fill: #4a3b2c; }
#svg.sg61 .water path, #svg.sg61 .nuoc63 path { fill: #a9cfe0; stroke: #6c9fb8; }
#svg.sg61 .rung63 path { fill: #d5e6c0; }

/* Sài Gòn 1961: ghi chú chỗ bản đồ gốc không vẽ */
.trong61 { fill: #7a6446; font-style: italic; font-weight: 500; paint-order: stroke; stroke: #f6efdf; }

/* Ký ức (thẻ bản đồ 1963) */
.ky-uc .ku-anh { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 4px -4px 10px; padding: 0 4px 4px; }
.ky-uc figure { margin: 0; flex: 0 0 82%; scroll-snap-align: start; }
.ky-uc figure img { width: 100%; height: 190px; object-fit: cover; border-radius: 10px; display: block; background: #e9e1cf; filter: sepia(.15); }
.ky-uc figcaption { font-size: 13px; line-height: 1.35; margin-top: 4px; }
.ky-uc figcaption span { color: #7a6a55; font-size: 11.5px; }
.ku-dong { list-style: none; margin: 0; padding: 0; }
.ku-dong li { padding: 6px 0; border-bottom: 1px dashed #e2d6bd; }
.ku-dong summary { list-style: none; cursor: pointer; font-size: 15px; line-height: 1.4; }
.ku-dong summary::-webkit-details-marker { display: none; }
.ku-dong summary::before { content: '“'; color: #b08a55; font-weight: 700; margin-right: 3px; }
.ku-them { margin-top: 8px; } .ku-them summary { cursor: pointer; font-weight: 600; }
.ku-them li { margin: 4px 0; font-size: 14px; }
.lbl.co-ky-uc { pointer-events: auto; cursor: pointer; }
.ky-uc figure img { cursor: zoom-in; }
.ku-to { position: fixed; inset: 0; z-index: 50; background: rgba(20,14,8,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.ku-to img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 6px; }
.ku-to p { color: #f3ead6; font-size: 14px; line-height: 1.4; text-align: center; margin: 12px 8px 0; }
.ku-to p span { color: #cdbb9a; } .ku-to a { color: #f6d79a; }
.ku-to .close { position: absolute; top: 14px; right: 14px; }

/* chuyện kể trong thẻ Ký ức (gập lại) */
.ku-ke { margin: 10px 0; padding: 8px 12px; background: #f6efe0; border-radius: 10px; }
.ku-ke summary { font-weight: 600; cursor: pointer; }
.ku-ke p { margin: 8px 0; line-height: 1.55; }
.ku-ke .ku-mo { font-style: italic; color: #6b5a45; }
/* chấm "nay có gì" trên bản đồ Đà Lạt hôm nay (03/12) */
.diem-nay.an { display: none; }
.dn-nen { fill: #fffaf0; stroke: #6b8f71; stroke-width: 1.6; }
.dn-nen.dn-an { stroke: #c8893a; }
.dn-nen.dn-ke { stroke: #7a5c9e; }
.dn-hinh { font-size: 13px; text-anchor: middle; pointer-events: none; }
.sw.diemnay { background: #fffaf0; border-color: #6b8f71; border-radius: 50%; }
.pin.an { display: none; }
.dn-nen.dn-mua { stroke: #b0466e; }
