:root {
  --ink: #17211d;
  --muted: #17211d;
  --line: #dde4df;
  --ground: #f7f8f5;
  --panel: #ffffff;
  --panel-soft: #fbfcfa;
  --green: #21634f;
  --shadow-soft: 0 18px 48px rgba(34, 48, 41, 0.09);
  --shadow-subtle: 0 8px 24px rgba(34, 48, 41, 0.06);
  --level-1: #4f9d69;
  --level-2: #fdb81e;
  --level-3: #f58220;
  --level-4: #d83933;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 248, 245, 0.64), rgba(247, 248, 245, 0.72)),
    url("assets/vintage-map-bg.png") center top / 760px auto repeat,
    var(--ground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(
      180deg,
      rgba(247, 248, 245, 0.82) 0,
      rgba(247, 248, 245, 0.18) 13%,
      rgba(247, 248, 245, 0.22) 87%,
      rgba(247, 248, 245, 0.9) 100%
    ),
    url("assets/vintage-map-bg.png") center top / 780px auto repeat;
  opacity: 0.76;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
}

.header-note {
  color: var(--muted);
  font-size: 14px;
}

.home {
  max-width: 1100px;
  margin: 72px auto 0;
  text-align: center;
}

.home h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 400;
  line-height: 1;
}

.home > p {
  max-width: 570px;
  margin: 18px auto 34px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.trip-search {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 900px;
  margin-inline: auto;
  border: 1px solid #aeb7b1;
  border-radius: var(--radius);
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.trip-field {
  display: grid;
  position: relative;
  gap: 7px;
}

.trip-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #ffffff;
  font-size: 14px;
  outline: none;
}

.trip-field input:focus {
  border-color: #397b61;
  box-shadow: 0 0 0 3px rgba(57, 123, 97, 0.12);
}

.localized-date-field {
  position: relative;
}

.localized-date-field .native-date-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  cursor: pointer;
}

.localized-date-field:focus-within #travelDateDisplay {
  border-color: #397b61;
  box-shadow: 0 0 0 3px rgba(57, 123, 97, 0.12);
}

.localized-date-field #travelDateDisplay[aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.trip-field input[aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.city-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 45, 37, 0.14);
}

.city-suggestions[hidden] {
  display: none;
}

.city-suggestion {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0ee;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.city-suggestion:last-child {
  border-bottom: 0;
}

.city-suggestion:hover,
.city-suggestion:focus,
.city-suggestion.is-active {
  background: #e8f2ed;
  outline: none;
}

.city-suggestion-status {
  padding: 10px 12px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
}

.trip-search > button {
  grid-column: 1 / -1;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.trip-search > button:hover {
  background: #184f40;
  box-shadow: 0 8px 18px rgba(24, 79, 64, 0.16);
  transform: translateY(-1px);
}

.trip-search > button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.form-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.form-status[hidden] {
  display: none;
}

.form-status.is-error {
  color: #9f1f1f;
}

.form-status.is-success {
  color: var(--green);
}

.travel-facts {
  display: none;
  max-width: 900px;
  margin: 14px auto 0;
  text-align: left;
}

.travel-facts.is-visible {
  display: block;
}

.information-group-heading {
  max-width: 900px;
  margin: 30px auto 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.information-group-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  text-align: left;
}

.travel-facts details {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  box-shadow: var(--shadow-subtle);
}

.travel-facts summary {
  padding: 16px 18px;
  cursor: pointer;
  list-style-position: inside;
}

.travel-facts summary span,
.travel-facts summary strong,
.travel-facts summary small {
  display: block;
}

.travel-facts summary span {
  margin-bottom: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.travel-facts summary strong {
  color: var(--ink);
  font-size: 15px;
}

.travel-facts summary small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.travel-facts-content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 18px;
}

.travel-fact-panel {
  display: flex;
  flex-direction: column;
  min-height: 205px;
}

.travel-fact-panel + .travel-fact-panel {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

.travel-fact-panel > span {
  display: block;
  min-height: 12px;
  margin-bottom: 10px;
  color: #1f5f4b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.travel-fact-panel > strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.travel-fact-panel > .official-advisory-pill {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 7px;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 16px;
  line-height: 1.25;
}

.official-advisory-pill.level-1 {
  border: 1px solid var(--level-1);
  color: #1f5f3c;
  background: #dff0e5;
}

.official-advisory-pill.level-2 {
  border: 1px solid var(--level-2);
  color: #694d00;
  background: #ffe9a3;
}

.official-advisory-pill.level-3 {
  border: 1px solid var(--level-3);
  color: #7a3c08;
  background: #ffd5b5;
}

.official-advisory-pill.level-4 {
  border: 1px solid var(--level-4);
  color: #84211d;
  background: #f5c7c4;
}

.official-advisory-pill.level-unknown {
  color: #4f5752;
  background: #e8ebe9;
}

.visa-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 13px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--line);
}

.visa-fields div {
  min-width: 0;
  padding: 10px 12px;
  background: #ffffff;
}

.visa-fields dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.visa-fields dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.travel-fact-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.travel-fact-panel a {
  color: #1f5f4b;
}

.regional-advisory-list {
  display: grid;
  gap: 6px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.regional-advisory-details {
  margin-top: 13px;
  margin-bottom: 14px;
}

.regional-advisory-details summary {
  color: #1f5f4b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.regional-advisory-list strong {
  color: var(--ink);
}

.emergency-number-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.emergency-number-list a {
  font-size: 15px;
  font-weight: 800;
}

.emergency-number-list li + li {
  margin-top: 4px;
}

.emergency-number-list strong {
  color: var(--ink);
}

.destination-guidance {
  max-width: 900px;
  margin: 14px auto 0;
  text-align: left;
}

.destination-guidance[hidden] {
  display: none;
}

.destination-guidance details {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  box-shadow: var(--shadow-subtle);
}

.destination-guidance summary {
  padding: 16px 18px;
  cursor: pointer;
  list-style-position: inside;
}

.destination-guidance summary span,
.destination-guidance summary strong,
.destination-guidance summary small {
  display: block;
}

.destination-guidance summary span {
  margin-bottom: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.destination-guidance summary strong {
  color: var(--ink);
  font-size: 15px;
}

.destination-guidance summary small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.destination-guidance-content {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 16px 18px;
}

.destination-guidance-text {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.destination-guidance-text section + section {
  margin-top: 16px;
  border-top: 1px solid #e9eeeb;
  padding-top: 14px;
}

.destination-guidance-text h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 13px;
}

.destination-guidance-text p {
  margin: 0 0 7px;
}

.destination-guidance-text p:last-child {
  margin-bottom: 0;
}

.city-safety-updates-content {
  display: grid;
  gap: 12px;
}

.city-safety-update {
  border-bottom: 1px solid #e9eeeb;
  padding-bottom: 12px;
}

.city-safety-update:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.city-safety-update a {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.city-safety-update p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.neighborhood-safety-content {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.neighborhood-safety-content h3 {
  margin: 16px 0 7px;
  color: var(--ink);
  font-size: 13px;
}

.neighborhood-safety-content h3:first-child {
  margin-top: 0;
}

.neighborhood-safety-content p {
  margin: 0;
}

.neighborhood-safety-content ul {
  margin: 0;
  padding-left: 19px;
}

.neighborhood-safety-content li + li {
  margin-top: 7px;
}

.weather-forecast-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.weather-forecast-day {
  min-width: 0;
  padding: 13px;
}

.weather-forecast-day + .weather-forecast-day {
  border-left: 1px solid var(--line);
}

.weather-forecast-day time,
.weather-forecast-day strong,
.weather-forecast-day span {
  display: block;
}

.weather-forecast-day time {
  color: var(--muted);
  font-size: 11px;
}

.weather-forecast-day .weather-forecast-icon {
  margin: 9px 0 5px;
  font-size: 24px;
}

.weather-forecast-day strong {
  color: var(--ink);
  font-size: 15px;
}

.weather-forecast-day .weather-forecast-condition,
.weather-forecast-day .weather-forecast-metrics {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.interactive-map-content {
  display: grid;
  gap: 18px;
}

.interactive-safety-map {
  position: relative;
  height: 500px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2ef;
}

.interactive-map-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.map-legend-panel,
.route-planner-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.map-legend-panel > strong,
.route-planner-panel > strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.map-status {
  min-height: 16px;
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.map-coverage-warning {
  margin: -3px 0 14px;
  border: 1px solid #d6a545;
  border-radius: 6px;
  padding: 9px 10px;
  color: #6b4b0d;
  background: #fff6df;
  font-size: 11px;
  line-height: 1.45;
}

.map-coverage-warning[hidden] {
  display: none;
}

.map-legend-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(125px, 0.7fr);
  gap: 18px;
  color: var(--muted);
  font-size: 11px;
}

.map-legend-group {
  display: grid;
  gap: 8px;
}

.map-legend-group strong {
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.map-legend-group span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.map-level-swatch {
  width: 28px;
  height: 12px;
  flex: 0 0 28px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.map-level-swatch.one { background: var(--level-1); }
.map-level-swatch.two { background: var(--level-2); }
.map-level-swatch.three { background: var(--level-3); }
.map-level-swatch.four { background: var(--level-4); }

.map-level-swatch.striped {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92) 0,
    rgba(255, 255, 255, 0.92) 2px,
    transparent 2px,
    transparent 6px
  );
}

.map-level-swatch.one.striped { background-color: var(--level-1); }
.map-level-swatch.two.striped { background-color: var(--level-2); }
.map-level-swatch.three.striped { background-color: var(--level-3); }

.map-risk-swatch {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #2563eb;
}

.map-risk-swatch.earthquake { background: #f59e0b; }
.map-risk-swatch.fire { background: #ef4444; }
.map-risk-swatch.flood { background: #0891b2; }
.map-risk-swatch.disaster { background: #2563eb; }

.route-estimator {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.route-field-grid,
.route-map-pickers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.route-estimator label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.route-estimator input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

.route-estimator input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(33, 99, 79, 0.12);
  outline: none;
}

.route-estimator button {
  border: 0;
  border-radius: 7px;
  padding: 10px 12px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.route-estimator button:hover {
  background: #184f40;
}

.route-estimator button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.route-estimator .route-map-picker {
  border: 1px solid var(--green);
  color: var(--green);
  background: #fff;
  font-size: 11px;
}

.route-estimator .route-map-picker.is-active {
  color: #fff;
  background: var(--green);
}

.route-map-pick-status {
  min-height: 16px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.route-estimate-result {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.route-estimate-result p {
  margin: 4px 0;
}

.route-disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.selected-destination-marker {
  position: relative;
  width: 0;
  height: 0;
  pointer-events: auto;
}

.selected-destination-marker-dot {
  position: absolute;
  top: -7px;
  left: -7px;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #17211d;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.selected-destination-marker-label {
  position: absolute;
  top: -13px;
  left: 10px;
  width: max-content;
  max-width: 180px;
  border-radius: 4px;
  padding: 4px 6px;
  color: #fff;
  background: #17211d;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.interactive-safety-map .maplibregl-map {
  font: inherit;
}

.interactive-safety-map .maplibregl-popup-content {
  max-width: 270px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.interactive-safety-map .maplibregl-popup-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.interactive-safety-map .maplibregl-popup-content a {
  color: var(--green);
  font-weight: 700;
}

.maplibregl-ctrl.map-layer-toggle-control {
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
}

.map-layer-toggle {
  min-width: 108px;
  border: 0;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: 700 11px/1.2 Arial, sans-serif;
}

.map-layer-toggle::before {
  content: "✓";
  margin-right: 6px;
  color: #18794e;
}

.map-layer-toggle[aria-pressed="false"]::before {
  content: "○";
  color: var(--muted);
}

.map-layer-toggle:hover {
  background: #f3f6f4;
}

@media (max-width: 680px) {
  .weather-forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-forecast-day:nth-child(odd) {
    border-left: 0;
  }

  .weather-forecast-day:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .interactive-safety-map {
    height: 380px;
  }

  .interactive-map-controls,
  .route-field-grid,
  .route-map-pickers,
  .map-legend-groups {
    grid-template-columns: 1fr;
  }
}

#entryRequirementsSource,
#localLawsSource {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.source-line {
  margin-top: auto !important;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 11px;
}

#visaStatus {
  margin-top: auto !important;
  min-height: 46px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.source-label {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    gap: 16px;
  }

  .trip-search {
    grid-template-columns: 1fr;
  }

  .travel-facts-content {
    grid-template-columns: 1fr;
  }

  .travel-fact-panel + .travel-fact-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 18px;
    padding-left: 0;
  }

  .travel-fact-panel {
    min-height: 0;
  }

  .source-line {
    margin-top: 16px !important;
  }

  #visaStatus {
    min-height: 0;
    margin-top: 16px !important;
  }
}

@media (max-width: 570px) {
  .page {
    width: min(100% - 24px, 1100px);
  }

  .home {
    margin-top: 48px;
  }
}
