/* Quy hoạch Pha A — token Banggia navy */

:root {
  --bg: #f6f7fa;
  --sf: #ffffff;
  --sf2: #f0f2f7;
  --soft: #e8ecf6;
  --bd: #d8dee9;
  --bd2: #c5cddc;
  --tx: #101828;
  --tx2: #475467;
  --tx3: #667085;
  --navy: #12308a;
  --warn: #b54708;
  --r: 10px;
  --r-xs: 6px;
  --ring: 0 0 0 3px rgba(18, 48, 138, 0.18);
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
}

html { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1424;
  --sf: #131c2e;
  --sf2: #1a2438;
  --soft: #1e2a42;
  --bd: #2a3650;
  --bd2: #3a4660;
  --tx: #e8edf7;
  --tx2: #b0bacd;
  --tx3: #8490a8;
  --navy: #3e63d4;
  --warn: #f79009;
  --ring: 0 0 0 3px rgba(62, 99, 212, 0.28);
}

html, body { overflow-x: clip; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--tx);
  line-height: 1.5;
  font-size: 15px;
}
a { color: var(--navy); }
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--navy); color: #fff; padding: 8px 12px; border-radius: var(--r-xs);
}
.skip-link:focus { left: 8px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--sf) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bd);
}
.nav {
  max-width: var(--max); margin: 0 auto;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--tx); font-weight: 600; text-decoration: none;
}
.brand:hover { color: var(--navy); text-decoration: none; }
.brand strong { color: var(--navy); }
.brand svg .lg-bg { fill: var(--navy); }
.brand svg .lg-pin { fill: #fff; }
.brand svg .lg-hole { fill: var(--navy); }
.brand svg .lg-cross { stroke: #fff; }
.pill {
  font-size: 12px; font-weight: 600; color: var(--navy);
  background: var(--soft); border: 1px solid var(--bd);
  padding: 4px 10px; border-radius: 999px;
}
.nav-meta { margin-left: auto; color: var(--tx3); font-size: 12px; }

main { max-width: var(--max); margin: 0 auto; padding: 20px 16px 64px; }

.intro h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  overflow-wrap: break-word;
}
.intro p { margin: 0; color: var(--tx2); max-width: 65ch; }
.note {
  margin-top: 12px; padding: 10px 12px;
  background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r);
  color: var(--tx2); font-size: 13px;
}
.note strong { color: var(--warn); font-weight: 600; }

.filters {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 640px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
}
.field {
  background: var(--sf); border: 1.5px solid var(--bd); border-radius: var(--r);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.field:focus-within { border-color: var(--navy); box-shadow: var(--ring); }
.field label {
  font-size: 12px; font-weight: 600; color: var(--tx3);
}
.field select, .field input, .select-btn {
  appearance: none; -webkit-appearance: none;
  border: 0; outline: 0;
  background: var(--sf); color: var(--tx);
  font: inherit; width: 100%; min-width: 0;
}
.field:focus-within { background: var(--sf); }
.field-select { position: relative; }
.select-btn { text-align: left; padding: 0; cursor: pointer; }
.select-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  z-index: 50; max-height: min(320px, 50vh); overflow: auto;
  margin: 0; padding: 6px; list-style: none;
  background: var(--sf); color: var(--tx);
  border: 1px solid var(--bd); border-radius: var(--r);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.select-list[hidden] { display: none; }
.select-list li {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  background: var(--sf); color: var(--tx);
}
.select-list li:hover,
.select-list li[aria-selected="true"] {
  background: var(--soft); color: var(--tx);
}
html[data-theme="dark"] .field,
html[data-theme="dark"] .select-btn,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .select-list {
  background: #131c2e;
  color: #f2f5fb;
}
html[data-theme="dark"] .select-list li {
  background: #131c2e;
  color: #f2f5fb;
}
html[data-theme="dark"] .select-list li:hover,
html[data-theme="dark"] .select-list li[aria-selected="true"] {
  background: #243056;
  color: #fff;
}

.status { margin-top: 12px; font-size: 13px; color: var(--tx2); min-height: 1.25em; }
.status.error { color: #b42318; }

.boot { padding: 40px; text-align: center; color: var(--tx3); }
.spin {
  display: inline-block; width: 18px; height: 18px; margin-right: 8px;
  border: 2px solid var(--bd); border-top-color: var(--navy);
  border-radius: 50%; vertical-align: -3px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  margin-top: 16px; padding: 28px; text-align: center; color: var(--tx3);
  background: var(--sf); border: 1px dashed var(--bd); border-radius: var(--r);
}

.grid {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  appearance: none; border: 1px solid var(--bd); background: var(--sf);
  border-radius: var(--r); padding: 0; overflow: hidden; cursor: pointer;
  text-align: left; color: inherit; font: inherit; width: 100%;
  display: flex; flex-direction: column; min-width: 0;
}
.card:hover { border-color: var(--navy); }
.card:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.card-thumb {
  aspect-ratio: 16 / 10; background: var(--sf2);
  display: grid; place-items: center; overflow: hidden;
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-body { padding: 10px 12px 12px; min-width: 0; }
.card-body .prov {
  font-size: 12px; font-weight: 700; color: var(--navy);
}
.card-body h2 {
  margin: 4px 0 0; font-size: 14px; font-weight: 700;
  overflow-wrap: break-word; line-height: 1.35;
}
.card-body .meta { margin-top: 4px; font-size: 12px; color: var(--tx3); }

.links { margin-top: 18px; }
.links h2 {
  margin: 0 0 6px; font-size: 15px; font-weight: 700;
}
.links-lead, .links-meta, .links-fallback {
  margin: 0 0 10px; font-size: 13px; color: var(--tx2);
}
.links-fallback { padding: 8px 10px; background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r-xs); }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.link-list li {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px;
  align-items: start; background: var(--sf); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 10px 12px;
}
.link-list a { font-weight: 600; text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.host, .link-note { display: block; font-size: 12px; color: var(--tx3); }
.link-note { margin-top: 2px; }
.empty-li { grid-template-columns: 1fr; color: var(--tx3); }
.kind {
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  padding: 3px 7px; border-radius: 999px; text-align: center;
  background: var(--soft); color: var(--navy); border: 1px solid var(--bd);
}
.k-GIS { background: #e8f1ff; color: #12308a; }
.k-SoXD { background: #eef6ea; color: #2f6b2f; }
.k-QHSDD { background: #fff4e5; color: #9a5b00; }
.k-App { background: #f3e8ff; color: #6b21a8; }
.trust {
  display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700;
  color: var(--warn);
}
html[data-theme="dark"] .k-GIS { background: #1a2a4a; color: #8eb0ff; }
html[data-theme="dark"] .k-SoXD { background: #1a3320; color: #8dcf8d; }
html[data-theme="dark"] .k-QHSDD { background: #3a2a12; color: #f0b45a; }
html[data-theme="dark"] .k-App { background: #2a1a3a; color: #d8b4fe; }

.viewer {
  border: 0; padding: 0; width: min(96vw, 1100px); max-height: 92vh;
  border-radius: var(--r); background: var(--sf); color: var(--tx);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.viewer::backdrop { background: rgba(10, 16, 32, 0.72); }
.viewer-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--bd);
  margin: 0;
}
.viewer-title {
  margin: 0; font-size: 14px; font-weight: 600;
  overflow-wrap: break-word; min-width: 0;
}
.viewer-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.viewer-actions a { font-size: 13px; font-weight: 600; }
.btn-close {
  appearance: none; border: 1px solid var(--bd); background: var(--sf2);
  color: var(--tx); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: var(--r-xs); cursor: pointer;
}
.btn-close:hover { border-color: var(--navy); color: var(--navy); }
.viewer-body {
  overflow: auto; max-height: calc(92vh - 52px);
  background: #0a0f1a; padding: 8px;
}
.viewer-body img {
  display: block; max-width: 100%; height: auto; margin: 0 auto;
}
