:root {
  --bg: #f5f0e6;
  --bg-elev: #fffdf9;
  --bg-soft: #eae3d2;
  --bg-glass: rgba(245, 240, 230, 0.88);
  --ink: #0f211e;
  --ink-soft: #3d504b;
  --muted: #5c6e69;
  --line: rgba(15, 33, 30, 0.1);
  --line-strong: rgba(15, 33, 30, 0.2);
  --canopy: #0d2622;
  --canopy-mid: #163e37;
  --emerald: #21634f;
  --sage: #d8ebe3;
  --gold: #c48823;
  --gold-soft: #f7ebd2;
  --gold-border: #e2c68d;
  --terracotta: #bf583b;
  --terracotta-soft: #fae5de;
  --ring: #d49b38;
  --shadow-sm: 0 2px 6px rgba(13, 38, 34, 0.025);
  --shadow-md: 0 8px 24px rgba(13, 38, 34, 0.07);
  --shadow-lg: 0 24px 56px rgba(13, 38, 34, 0.18);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --sidebar-w: 272px;
  --topbar-h: 72px;
  --bottomnav-h: calc(68px + env(safe-area-inset-bottom, 0px));
  --nav-space: 0px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0a1412;
  --bg-elev: #11201d;
  --bg-soft: #182c28;
  --bg-glass: rgba(10, 20, 18, 0.88);
  --ink: #f1ede4;
  --ink-soft: #bfd0cb;
  --muted: #8ea39d;
  --line: rgba(241, 237, 228, 0.1);
  --line-strong: rgba(241, 237, 228, 0.2);
  --canopy: #173f38;
  --canopy-mid: #20544b;
  --emerald: #56b899;
  --sage: rgba(86, 184, 153, 0.16);
  --gold: #e6b14e;
  --gold-soft: rgba(230, 177, 78, 0.14);
  --gold-border: rgba(230, 177, 78, 0.34);
  --terracotta: #e68265;
  --terracotta-soft: rgba(230, 130, 101, 0.16);
  --ring: #e6b14e;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.65);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Focus-visible Accessibility (UI/UX Pro Max Priority 1) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.svg-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.mono {
  font-family: var(--font-mono);
}

.serif {
  font-family: var(--font-serif);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.tiny {
  font-size: 0.75rem;
}

.caps {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Motion & Reduced Motion */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card, .hero-banner, .dossier-hero {
  animation: cardEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* App Shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  background: #0b201c;
  color: #f4f0e6;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-emblem {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0a843, #a87119);
  color: #0b201c;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(212, 155, 56, 0.25);
  flex-shrink: 0;
}

.brand-title {
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: rgba(244, 240, 230, 0.64);
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.nav-item {
  min-height: 44px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(244, 240, 230, 0.74);
  padding: 10px 13px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13.5px;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: rgba(212, 155, 56, 0.16);
  color: #f9d88e;
  font-weight: 700;
  border-color: rgba(212, 155, 56, 0.34);
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: 6px;
}

.sidebar-stats {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 15px;
  flex-shrink: 0;
}

.sidebar-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0;
}

.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ca387, #e0a843);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.sidebar-footer-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-btn {
  flex: 1;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f4f0e6;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Workspace & Topbar */
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(16px, 2.4vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.topbar-title-group > div {
  min-width: 0;
}

.topbar-title-group .tiny {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title-compact {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line-strong);
}

.pill-btn {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 0.8125rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

.pill-btn:hover {
  background: var(--bg-soft);
}

.pill-btn.primary {
  background: var(--canopy);
  color: #fff;
  border-color: var(--canopy);
}

.pill-btn.primary:hover {
  background: var(--canopy-mid);
}

.pill-btn.gold {
  background: var(--gold-soft);
  color: #784f0d;
  border-color: var(--gold-border);
}

[data-theme="dark"] .pill-btn.gold {
  color: #f7d288;
}

.main-container {
  padding: clamp(20px, 2.4vw, 36px) clamp(16px, 2.4vw, 36px) calc(64px + var(--nav-space));
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

/* Bento Hero Banner */
.hero-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  gap: 20px;
}

.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.8vw, 40px);
  background: radial-gradient(circle at 88% 18%, rgba(212, 155, 56, 0.22), transparent 45%),
              linear-gradient(135deg, #0b221e 0%, #153c35 60%, #1d4d44 100%);
  color: #f7f4eb;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-side-card {
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2vw, 28px);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.hero-eyebrow {
  color: #e6c27a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-heading {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  line-height: 1.1;
  margin: 10px 0 12px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-desc {
  max-width: 600px;
  color: rgba(247, 244, 235, 0.84);
  font-size: 14.5px;
  line-height: 1.6;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-metric b {
  display: block;
  font-size: 22px;
  font-family: var(--font-mono);
  color: #fff;
}

.hero-metric span {
  font-size: 0.75rem;
  color: rgba(247, 244, 235, 0.72);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* Ring Gauge */
.ring-gauge-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 12px 0;
}

.ring-gauge-row > svg {
  flex-shrink: 0;
}

/* Sections & Cards */
.section-block {
  margin-top: clamp(28px, 3vw, 44px);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.section-title {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 3px;
}

.grid-cards {
  display: grid;
  gap: 16px;
}

.grid-cards.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
}

.grid-cards.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.grid-cards.cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: clamp(18px, 1.6vw, 24px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  min-width: 0;
  overflow-wrap: anywhere;
}

:where(.card, .hero-bento, .hero-side-card, .section-header, .place-item, .ring-gauge-row, .cmd-item) > div {
  min-width: 0;
}

.card.interactive {
  cursor: pointer;
}

.card.interactive:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.mood-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--sage);
  color: var(--emerald);
  display: grid;
  place-items: center;
}

.card-eyebrow {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  color: var(--emerald);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 5px 0 6px;
  letter-spacing: -0.02em;
}

/* Status Badges & Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-soft);
  color: var(--ink-soft);
  max-width: 100%;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge.explored {
  background: var(--sage);
  color: var(--emerald);
}

.badge.planned {
  background: var(--terracotta-soft);
  color: var(--terracotta);
}

.badge.gold {
  background: var(--gold-soft);
  color: #7d540f;
  border: 1px solid var(--gold-border);
}

[data-theme="dark"] .badge.gold {
  color: #f6ce7b;
}

.golden-callout {
  margin-top: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  border-radius: 13px;
  padding: 11px 13px;
}

.golden-callout-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7d540f;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

[data-theme="dark"] .golden-callout-label {
  color: #f0c36d;
}

.golden-callout-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-top: 3px;
  line-height: 1.35;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: normal;
  max-width: 100%;
  text-align: left;
}

button.tag-chip {
  min-height: 44px;
}

/* Toolbar & Filters */
.filter-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 45;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  padding: 14px 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.filter-controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.input-control, .select-control {
  width: 100%;
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 1rem;
}

.input-control:focus, .select-control:focus {
  border-color: var(--emerald);
}

.region-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 10px;
  scrollbar-width: none;
}

.region-pill {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.region-pill.active {
  background: var(--canopy);
  color: #fff;
  border-color: var(--canopy);
}

/* ATLAS: full-bleed map, floating controls, Google-Maps-style sheet */
.atlas-layout {
  --sheet-w: clamp(320px, 34vw, 400px);
  --peek-h: 190px;
  position: relative;
  height: calc(100dvh - var(--topbar-h) - var(--nav-space));
  min-height: 360px;
  width: 100%;
  overflow: hidden;
  background: #d5dfd9;
}

#atlasMap {
  position: absolute;
  inset: 0;
}

.atlas-overlay-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 1050;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.atlas-overlay-top > * {
  pointer-events: auto;
}

.atlas-layout[data-sheet="open"] .atlas-overlay-top {
  left: calc(var(--sheet-w) + 24px);
}

.atlas-pop {
  position: relative;
}

.map-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(13, 38, 34, 0.14);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.map-chip::-webkit-details-marker {
  display: none;
}

.atlas-pop[open] > .map-chip {
  background: var(--canopy);
  border-color: var(--canopy);
  color: #fff;
}

.atlas-pop-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: min(62dvh, 480px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
}

.atlas-ctrl-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 700;
}

.atlas-ctrl-card select {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 10px;
}

.atlas-ctrl-card select option {
  background: var(--bg-elev);
  color: var(--ink);
}

.legend-items {
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
}

.leaflet-container {
  font-family: var(--font-sans);
}

.leaflet-touch .leaflet-bar a, .leaflet-bar a,
.atlas-tools button {
  width: 44px;
  height: 44px;
  line-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--bg-elev);
  cursor: pointer;
}

.atlas-tools > :last-child {
  border-bottom: 0;
}

.leaflet-bar a:hover, .atlas-tools button:hover {
  background: var(--bg-soft);
}

.leaflet-touch .leaflet-bar, .leaflet-bar {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(13, 38, 34, 0.14);
}

.atlas-layout .leaflet-bottom.leaflet-right {
  left: 0;
}

.atlas-layout[data-sheet="open"] .leaflet-bottom.leaflet-right {
  left: calc(var(--sheet-w) + 24px);
}

.atlas-layout .leaflet-control-attribution {
  max-width: calc(100% - 16px);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sheet: floating card on wide screens, bottom sheet on phones */
.atlas-sheet {
  position: absolute;
  z-index: 1100;
  top: 12px;
  left: 12px;
  width: var(--sheet-w);
  height: calc(100% - 24px);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(13, 38, 34, 0.18);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  transition: height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.atlas-layout[data-sheet="peek"] .atlas-sheet {
  height: var(--peek-h);
  overflow: hidden;
}

.sheet-peek {
  padding: 18px 18px 0;
}

.sheet-grip {
  display: none;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.sheet-title {
  min-width: 0;
}

.sheet-name {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 4px 0 8px;
}

.sheet-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.sheet-meta .badge, .card-head .badge {
  white-space: nowrap;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--sage);
  color: var(--emerald);
}

.sheet-toggle .svg-icon {
  transition: transform 0.25s ease;
}

/* Wide card grows downward: chevron down to expand, up to collapse */
.atlas-layout[data-sheet="peek"] .sheet-toggle .svg-icon {
  transform: rotate(180deg);
}

.action-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.action-tile {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.action-tile:hover {
  border-color: var(--emerald);
  background: var(--sage);
}

.action-tile.primary {
  background: var(--canopy);
  border-color: var(--canopy);
  color: #fff;
}

.action-tile.primary:hover {
  background: var(--canopy-mid);
}

[data-theme="dark"] .action-tile.primary {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #0b201c;
}

.action-tile.is-on {
  background: var(--gold-soft);
  border-color: var(--gold-border);
  color: #7d540f;
}

[data-theme="dark"] .action-tile.is-on {
  color: #f6ce7b;
}

.action-bar.on-dark {
  max-width: 560px;
  margin-top: 22px;
}

.on-dark .action-tile {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.on-dark .action-tile:hover {
  background: rgba(255, 255, 255, 0.16);
}

.on-dark .action-tile.primary {
  background: #e0a843;
  border-color: #e0a843;
  color: #0b201c;
}

.sheet-body {
  padding: 22px 18px 24px;
  display: grid;
  gap: 22px;
}

.sheet-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.sheet-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.nearby-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -18px;
  padding: 2px 18px;
}

.nearby-row::-webkit-scrollbar {
  display: none;
}

.nearby-chip {
  flex-shrink: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nearby-chip:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

.nearby-row.on-dark {
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  overflow: visible;
}

.on-dark .nearby-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.on-dark .nearby-chip:hover {
  background: rgba(255, 255, 255, 0.16);
}

.row-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-elev);
}

.place-row, .nearby-mukim {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px 8px 8px 14px;
  border-bottom: 1px solid var(--line);
}

.row-list > :last-child {
  border-bottom: 0;
}

.place-row-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.place-row-name {
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.3;
}

.place-row .icon-btn {
  border-color: var(--line);
}

.nearby-mukim {
  width: 100%;
  border-width: 0 0 1px;
  border-style: solid;
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 0.875rem;
  cursor: pointer;
  padding-right: 14px;
}

.nearby-mukim:hover {
  background: var(--bg);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--emerald);
  font-size: 0.8125rem;
  font-weight: 800;
  cursor: pointer;
  justify-self: start;
}

.setup-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed var(--gold-border);
  background: var(--gold-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.sheet-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 18px;
  color: var(--muted);
  font-size: 0.875rem;
}

.atlas-sheet .golden-callout {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  display: grid;
  gap: 4px;
}

.atlas-sheet .passport-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-panel .pill-btn {
  min-height: 44px !important;
}

/* Passport 6-Stamp Grid */
.passport-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.passport-stamp {
  border: 1px dashed var(--line-strong);
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  transition: all 0.15s ease;
}

.passport-stamp.stamped {
  border-style: solid;
  border-color: var(--emerald);
  background: var(--sage);
  color: var(--emerald);
}

.passport-stamp-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  display: block;
}

/* Dossier View */
.dossier-hero {
  background: linear-gradient(135deg, #0b221e, #19453c);
  color: #f7f4eb;
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.5vw, 36px);
  box-shadow: var(--shadow-md);
}

.dossier-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 46px);
  margin: 8px 0;
  font-weight: 400;
}

.dossier-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.pill-btn.on-dark {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.pill-btn.on-dark:hover {
  background: rgba(255, 255, 255, 0.18);
}

.pill-btn.on-dark.is-on {
  background: #e0a843;
  border-color: #e0a843;
  color: #0b201c;
}

.dossier-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8125rem;
}

.dossier-towns {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.dossier-towns .svg-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.dossier-nearby {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.dossier-nearby .caps {
  color: rgba(255, 255, 255, 0.6);
}

.pill-btn.sm {
  min-height: 44px;
  padding: 6px 12px;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.place-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Place groups: Pelancong / Lokal / Masjid & Surau tabs */
.seg-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px;
  border-radius: 99px;
  background: var(--bg-soft);
  width: max-content;
  max-width: 100%;
}

.seg-tabs::-webkit-scrollbar {
  display: none;
}

.seg-tabs [role="tab"] {
  flex-shrink: 0;
  min-height: 44px;
  padding: 6px 14px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.seg-tabs [role="tab"] span {
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  opacity: 0.7;
}

.seg-tabs [aria-selected="true"] {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(13, 38, 34, 0.12);
}

.section-block > .seg-tabs {
  margin-bottom: 14px;
}

.place-board {
  display: grid;
  gap: 16px;
}

.place-board[data-filter="pelancong"] .place-group:not([data-group="pelancong"]),
.place-board[data-filter="lokal"] .place-group:not([data-group="lokal"]),
.place-board[data-filter="masjid"] .place-group:not([data-group="masjid"]) {
  display: none;
}

.atlas-sheet .place-board[data-filter] .place-group-head {
  display: none;
}

.place-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--emerald);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.place-group-head .tiny {
  margin-left: auto;
  font-family: var(--font-mono);
}

.place-item-name {
  font-size: 1.0625rem;
  font-weight: 800;
  margin-top: 3px;
  line-height: 1.3;
}

.place-meta {
  margin-top: 4px;
}

.place-notes {
  margin-top: 6px;
  line-height: 1.55;
  max-width: 70ch;
}

.place-row-sub {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.source-link:hover {
  color: var(--emerald);
  text-decoration: underline;
}

.golden-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 10px;
}

/* Facts: "Tahukah kau?" */
.fact-card {
  display: grid;
  gap: 4px;
  align-content: start;
}

.fact-item {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.fact-card .fact-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.atlas-sheet .fact-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}

.fact-item p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.fact-item .source-link {
  min-height: 44px;
  padding: 0;
}

.fact-kind {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--sage);
  color: var(--emerald);
}

.fact-kind[data-kind="sejarah"] {
  background: var(--gold-soft);
  color: #7d540f;
}

.fact-kind[data-kind="asal nama"] {
  background: var(--terracotta-soft);
  color: var(--terracotta);
}

[data-theme="dark"] .fact-kind[data-kind="sejarah"] {
  color: #f6ce7b;
}

/* Atlas pins, layer toggle, legend dots, quick search groups */
.atlas-ctrl-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.atlas-ctrl-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--emerald);
}

.atlas-ctrl-check small {
  display: block;
  font-weight: 500;
}

.legend-sep {
  height: 1px;
  background: var(--line);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line-strong);
  flex-shrink: 0;
}

.pin-popup {
  display: grid;
  gap: 4px;
  font-family: var(--font-sans);
}

.pin-popup b {
  font-size: 0.9375rem;
}

.pin-popup p {
  margin: 2px 0 4px;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.pin-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.cmd-group {
  padding: 10px 4px 4px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Routes: corridor cards with a stop timeline */
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.corridor-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.corridor-card .card-title {
  margin-bottom: 0;
}

.corridor-theme {
  margin: 0;
  line-height: 1.55;
}

.stop-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.stop-list::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: var(--gold-border);
}

.stop-row {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 4px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.stop-row:hover {
  background: var(--bg);
}

.stop-num {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
}

.stop-name {
  font-size: 0.875rem;
  font-weight: 700;
}

.stop-row .tiny {
  margin-left: auto;
  text-align: right;
}

.corridor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.nav-legs {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
}

.nav-legs + .corridor-actions {
  margin-top: 0;
}

.nav-legs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-legs-row .pill-btn {
  white-space: normal;
  text-align: left;
}

.place-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.place-item:last-child {
  border-bottom: 0;
}

.worth-box {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--sage);
  color: var(--emerald);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

/* Modal & Command Palette */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 18, 0.68);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

body:has(.modal-backdrop) {
  overflow: hidden;
}

.modal-panel {
  width: 100%;
  max-width: 640px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.cmd-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  max-height: 360px;
  overflow-y: auto;
}

.cmd-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.cmd-item:hover {
  background: var(--bg-soft);
  border-color: var(--emerald);
}

.form-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.form-row {
  display: grid;
  gap: 12px;
}

.form-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
  min-width: 0;
}

.form-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.stamp-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stamp-check-label {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

/* Toast */
#toastContainer {
  position: fixed;
  bottom: calc(20px + var(--nav-space));
  right: 24px;
  z-index: 3000;
  display: grid;
  gap: 8px;
  max-width: calc(100% - 32px);
}

.toast-msg {
  background: #0b201c;
  color: #f6f2e8;
  border: 1px solid rgba(212, 155, 56, 0.45);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

.toast-msg.toast-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-msg.toast-action .pill-btn {
  background: #d49b38;
  color: #14231f;
  border-color: #d49b38;
}

.visit-status-preview {
  margin: 2px 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 13px;
  font-weight: 600;
}

.visit-status-preview[data-status='Qualified'] {
  background: var(--sage);
  border-color: var(--emerald);
  color: var(--emerald);
}

.sync-key-row {
  margin-top: 10px;
}

.sync-status {
  margin-top: 10px;
  line-height: 1.45;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.sync-status[data-state='on'] {
  border-color: var(--emerald);
}

.sync-status[data-state='error'] {
  border-color: var(--sage);
  color: #8f3520;
}

[data-theme='dark'] .sync-status[data-state='error'] {
  color: #f0a48f;
}

/* Mobile Bottom Nav */
.mobile-nav {
  display: none;
}

@media (max-width: 1399px) and (min-width: 1180px), (max-width: 999px) {
  .hero-bento {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 520px) and (max-width: 999px) {
  .grid-cards.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1179px) {
  :root {
    --nav-space: var(--bottomnav-h);
    --topbar-h: 68px;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    padding: 0 16px;
  }
  .hide-sm {
    display: none;
  }
  .filter-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-controls-grid > :first-child {
    grid-column: 1 / -1;
  }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottomnav-h);
    padding: 4px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom, 0) max(8px, env(safe-area-inset-left));
    background: var(--bg-glass);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--line-strong);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 900;
  }
  .mobile-nav-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
  }
  .mobile-nav-btn.active {
    color: var(--emerald);
    background: var(--sage);
    border-radius: 14px;
  }
}

@media (max-width: 739px) {
  .atlas-sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: min(78%, calc(100% - 64px));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -8px 30px rgba(13, 38, 34, 0.16);
  }
  .sheet-peek {
    padding-top: 10px;
  }
  .sheet-grip {
    display: block;
    width: 40px;
    height: 5px;
    margin: 0 auto 12px;
    border-radius: 99px;
    background: var(--line-strong);
  }
  .sheet-grip, .sheet-head {
    touch-action: none;
  }
  /* Bottom sheet grows upward: chevron up to expand, down to collapse */
  .atlas-layout[data-sheet="peek"] .sheet-toggle .svg-icon {
    transform: none;
  }
  .atlas-layout[data-sheet="open"] .sheet-toggle .svg-icon {
    transform: rotate(180deg);
  }
  .atlas-layout[data-sheet] .atlas-overlay-top {
    left: 12px;
    justify-content: flex-start;
  }
  .atlas-pop {
    position: static;
  }
  .atlas-pop-panel {
    left: 0;
    right: 0;
    width: auto;
  }
  .atlas-layout .leaflet-bottom {
    bottom: var(--peek-h);
  }
  .atlas-layout[data-sheet] .leaflet-bottom.leaflet-right {
    left: 0;
  }
  .filter-bar {
    position: static;
  }
  .topbar {
    gap: 10px;
  }
  .topbar-title {
    font-size: 0.9375rem;
  }
  .topbar-title-wide {
    display: none;
  }
  .topbar-title-compact {
    display: inline;
  }
  .topbar-actions {
    gap: 5px;
  }
  .topbar-actions .pill-btn {
    width: 44px;
    padding: 0;
  }
  .topbar-actions .pill-btn span {
    display: none;
  }
  .hero-metrics {
    /* 5 metrics: balanced 3 + 2 rows */
    grid-template-columns: repeat(6, minmax(0, 1fr));
    row-gap: 16px;
    margin-top: 22px;
    padding-top: 18px;
  }
  .hero-eyebrow {
    font-size: 0.625rem;
    letter-spacing: 0.08em;
  }
  .hero-cta-row {
    gap: 8px;
    margin-top: 18px;
  }
  .hero-cta-row > :first-child {
    width: 100%;
  }
  .hero-cta-row > :not(:first-child) {
    flex: 1;
    padding-inline: 10px;
  }
  .hero-cta-row > :not(:first-child) .svg-icon {
    display: none;
  }
  .hero-metric {
    grid-column: span 2;
  }
  .hero-metric:nth-child(n + 4) {
    grid-column: span 3;
  }
  .hero-side-card {
    gap: 20px;
  }
  .section-header > .pill-btn {
    flex-shrink: 0;
  }
  .modal-panel {
    padding: 20px;
    border-radius: 20px;
  }
}

@media (max-width: 519px) {
  .form-row.cols-3, .form-row.cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .stamp-checkbox-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .passport-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .atlas-sheet .passport-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-height: 540px) {
  :root {
    --topbar-h: 52px;
  }
  .atlas-layout {
    min-height: 0;
  }
  .topbar .pill-btn {
    min-height: 44px;
  }
  #viewHost:has(.atlas-layout) {
    padding-bottom: var(--nav-space);
  }
  .modal-panel {
    max-height: calc(100dvh - 24px);
  }
}

@media (max-height: 540px) and (max-width: 1179px) {
  :root {
    --bottomnav-h: calc(52px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-nav-btn {
    flex-direction: row;
    gap: 6px;
  }
}
