/* #region zone:map.style.shell — โครงหน้า: แผนที่เต็มจอ แผงกระจก ปุ่มลอย ค้นหา และแผงล่างบนมือถือ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
.link-opening {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: #163c42;
  background: #e6eeeb;
  font-family: Anuphan, sans-serif;
}
.link-opening[hidden] {
  display: none;
}
.link-opening img {
  border-radius: 14px;
  box-shadow: 0 8px 28px rgb(16 46 55 / 18%);
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--map-bg);
  color: var(--text);
  font: 400 var(--fs-md)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input {
  font: inherit;
  color: inherit;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon {
  flex: none;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
}
.app {
  position: fixed;
  inset: 0;
}
.map {
  position: absolute;
  inset: 0;
  background: var(--map-bg);
}
/* Card sits top-left of the free map area: clear of the key box (bottom-right) and the layer/locate buttons (top-right). */
.map-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: start;
  padding: 96px 96px var(--u-space-5) 468px;
  background:
    radial-gradient(circle at 1px 1px, var(--track) 1px, transparent 0) 0 0 / 22px 22px,
    var(--map-bg);
}
.map-state-card {
  max-width: 440px;
  padding: 22px var(--u-space-5);
  border-radius: var(--r-card);
  display: grid;
  gap: 6px;
}
.map-state-card h2 {
  font-size: var(--fs-lg);
  font-weight: 650;
}
.map-state-card p {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  width: min(640px, calc(100% - 100px));
  display: flex;
  gap: var(--u-space-2);
  z-index: 5;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--u-space-2);
  height: 52px;
  padding: 0 14px 0 10px;
  border-radius: 18px;
  text-decoration: none;
  color: var(--text);
  flex: none;
}
.brand img {
  width: 30px;
  height: 30px;
}
.brand-name {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent-strong);
  padding: 2px 7px;
  border-radius: var(--u-radius-pill);
  background: var(--accent-soft);
}
.gate-logo {
  width: 64px;
  height: 64px;
}
.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 6px 0 var(--u-space-4);
  border-radius: 18px;
}
.search input {
  flex: 1;
  min-width: 0;
  height: var(--u-tap);
  border: 0;
  background: transparent;
  font-size: var(--u-body);
}
.search input::placeholder {
  color: var(--faint);
}
.search .icon-button {
  width: var(--u-tap);
  height: var(--u-tap);
}
.search input:focus-visible {
  outline: none;
}
.search:focus-within {
  box-shadow:
    var(--glass-shadow),
    0 0 0 3px var(--accent-soft);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease-out),
    color var(--t-fast);
  flex: none;
}
.icon-button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 14px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text);
}
/* Hazard link (2026-09-28 restyle): a glass pill matching .lang's height/radius/surface/vertical-align exactly,
   so it reads as a sibling of the language pill instead of a detached icon square. The glyph is a calm cloud
   (not the old alarm-triangle) held permanently in the brand accent — it never needs a hover colour to read as
   interactive, so only the label shifts on hover/focus for feedback. */
.hazard {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 14px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text);
  flex: none;
  transition: color var(--t-fast);
}
.hazard .icon {
  color: var(--accent);
  flex: none;
}
.hazard:hover,
.hazard:focus-visible {
  color: var(--accent-strong);
}
.search-results {
  position: absolute;
  top: 76px;
  left: 16px;
  width: 420px;
  max-height: 50vh;
  overflow: auto;
  border-radius: var(--r-card);
  padding: var(--u-space-2);
  z-index: 6;
}

.fab-stack {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  justify-items: end;
  gap: 10px;
  z-index: 5;
}
.fab-group {
  gap: var(--u-space-2, 8px);
  padding: var(--u-space-1, 4px);
  display: grid;
  border-radius: var(--r-card);
  overflow: hidden;
}
.fab {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  cursor: pointer;
  color: var(--text);
  transition: background var(--t-fast) var(--ease-out);
}
.fab-text {
  font-weight: 750;
  font-size: var(--fs-md);
  letter-spacing: 0.02em;
}
.fab[aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
}
.map3d {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000;
}
.map3d > * {
  width: 100%;
  height: 100%;
  display: block;
}
.close3d {
  position: absolute;
  z-index: 6;
  top: 16px;
  left: 452px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
}
.fab:hover,
.fab[aria-expanded='true'] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.layers-menu {
  display: grid;
  gap: var(--u-space-1);
  padding: 6px;
  border-radius: 18px;
  min-width: 190px;
  animation: pop var(--t-med) var(--ease-out);
}
.layer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--u-space-3);
  padding: 10px var(--u-space-3);
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-weight: 550;
  text-align: start;
}
.layer-toggle::after {
  content: '';
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: var(--track);
  box-shadow: inset 0 0 0 2px var(--card-line);
  transition: background var(--t-fast);
  flex: none;
}
.layer-toggle[aria-pressed='true']::after {
  background: var(--accent);
  box-shadow:
    inset -16px 0 0 2px var(--accent),
    inset 14px 0 0 2px #fff;
}
.layer-toggle:hover {
  background: var(--accent-soft);
}

/* #endregion */
