:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fbfe;
  --text: #172136;
  --muted: #66748a;
  --line: #dce4ee;
  --blue: #0b4fa8;
  --blue-dark: #073d82;
  --orange: #f28c18;
  --orange-dark: #cc6f08;
  --red: #c02626;
  --green: #177245;
  --shadow: 0 18px 50px rgba(22, 33, 54, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 248, 251, 0.97)),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 82px -18vw 0;
  z-index: -1;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg width='920' height='620' viewBox='0 0 920 620' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='.78' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M74 438C170 360 214 420 292 354C390 272 428 180 538 218C650 256 650 372 814 298' stroke='%230B4FA8' stroke-width='18' opacity='.08'/%3E%3Cpath d='M40 198C154 132 246 166 338 118C430 70 526 86 610 148C694 210 778 160 884 92' stroke='%23177245' stroke-width='14' opacity='.09'/%3E%3Cpath d='M118 540C248 474 328 506 448 430C568 354 622 452 790 404' stroke='%23F28C18' stroke-width='12' opacity='.11'/%3E%3Cpath d='M122 96L232 216L172 330L292 448L260 568' stroke='%230B4FA8' stroke-width='2' opacity='.18'/%3E%3Cpath d='M398 62L354 182L436 292L404 420L514 548' stroke='%230B4FA8' stroke-width='2' opacity='.14'/%3E%3Cpath d='M618 70L574 190L662 300L624 430L736 548' stroke='%230B4FA8' stroke-width='2' opacity='.13'/%3E%3Cpath d='M52 284L204 248L354 292L506 254L668 302L878 248' stroke='%23177245' stroke-width='2' opacity='.15'/%3E%3Cpath d='M72 410L224 374L382 418L540 374L694 418L858 382' stroke='%23177245' stroke-width='2' opacity='.12'/%3E%3Ccircle cx='294' cy='448' r='8' fill='%23F28C18' opacity='.75'/%3E%3Ccircle cx='538' cy='218' r='7' fill='%230B4FA8' opacity='.48'/%3E%3Ccircle cx='790' cy='404' r='8' fill='%23F28C18' opacity='.55'/%3E%3Ccircle cx='204' cy='248' r='5' fill='%23177245' opacity='.42'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: max(1280px, 140vw) auto;
  opacity: 0.9;
  pointer-events: none;
}

body::after {
  position: fixed;
  inset: auto 0 0;
  z-index: -1;
  height: 32vh;
  content: "";
  background: linear-gradient(180deg, rgba(246, 248, 251, 0), rgba(246, 248, 251, 0.96));
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 7px;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 24px;
}

button:hover {
  background: var(--orange-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px clamp(18px, 5vw, 64px);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: min(240px, 42vw);
}

.brand img {
  display: block;
  width: 100%;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
}

.site-header h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(20px, 3.5vw, 34px);
  font-weight: 850;
  letter-spacing: 0;
  text-align: right;
}

.page-shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
}

.lookup-view {
  display: grid;
  min-height: calc(100svh - 82px);
  place-items: center;
  padding: 38px 0 70px;
}

.lookup-card {
  position: relative;
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid rgba(220, 228, 238, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 42px);
}

.orange-rule {
  display: block;
  width: 78px;
  height: 5px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: var(--orange);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2,
p {
  margin-top: 0;
}

.lookup-card h2 {
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.search-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-box input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #cfd9e7;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 16px;
}

.search-box input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(242, 140, 24, 0.25);
}

.message {
  margin: 14px 0 0;
  color: var(--red);
  font-weight: 850;
  line-height: 1.35;
}

.message.ok {
  color: var(--green);
}

.result-view {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: 28px 0 38px;
  min-height: calc(100svh - 82px);
}

.info-panel,
.map-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(22, 33, 54, 0.08);
}

.info-panel {
  align-self: start;
  padding: 22px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.back-link::before {
  content: "<";
  margin-right: 8px;
  color: var(--orange);
}

.info-panel h2,
.map-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.info-grid {
  display: grid;
  gap: 15px;
  margin: 22px 0 0;
}

.info-grid div {
  min-width: 0;
}

.info-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.info-grid dd {
  margin: 5px 0 0;
  color: #24344f;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.origin-link {
  color: inherit;
  text-decoration: none;
  transition: color 140ms ease;
}

.origin-link:hover,
.origin-link:focus-visible {
  color: var(--orange);
}

.info-grid .full dd {
  font-weight: 650;
}

.map-panel {
  overflow: hidden;
}

.map-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.map-head p:last-child {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-align: right;
}

.map {
  height: calc(100svh - 222px);
  min-height: 520px;
  background: #e8eef5;
}

.leaflet-control-attribution {
  font-size: 10px;
}

@media (max-width: 820px) {
  body::before {
    inset: 106px -62vw 0;
    background-position: center center;
    background-size: max(980px, 220vw) auto;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 106px;
    padding: 13px 18px;
  }

  .brand {
    width: min(230px, 72vw);
  }

  .site-header h1 {
    text-align: left;
  }

  .page-shell {
    width: min(100vw - 22px, 680px);
  }

  .lookup-view {
    min-height: calc(100svh - 106px);
    padding: 24px 0 46px;
  }

  .search-box,
  .result-view,
  .map-head {
    grid-template-columns: 1fr;
  }

  .map-head p:last-child {
    max-width: none;
    text-align: left;
  }

  .result-view {
    min-height: auto;
    padding: 16px 0 24px;
  }

  .map {
    height: 55svh;
    min-height: 360px;
  }
}

@media (max-width: 420px) {
  .lookup-card {
    padding: 22px 16px;
  }

  button {
    width: 100%;
  }
}
