:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #172b4d;
  background: #eef3f8;
  line-height: 1.5;
  --navy: #173c7b;
  --navy-dark: #0e2d62;
  --navy-soft: #eaf0f8;
  --orange: #e83b14;
  --orange-dark: #c92f0d;
  --gold: #f6aa00;
  --aqua: #24aebb;
  --ink: #172b4d;
  --muted: #5c6f86;
  --line: #d8e2ed;
  --surface: #ffffff;
  --success: #16734a;
  --success-soft: #eaf7f0;
  --warning: #8a5b00;
  --warning-soft: #fff7dc;
  --shadow: 0 22px 60px rgba(13, 45, 98, .16);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
svg { display: block; }

.page-shell {
  min-height: 100vh;
  padding: clamp(18px, 3vw, 38px);
  background:
    radial-gradient(circle at 8% 8%, rgba(246, 170, 0, .11), transparent 24%),
    radial-gradient(circle at 92% 88%, rgba(36, 174, 187, .11), transparent 27%),
    #eef3f8;
}

.brand-header {
  width: min(1460px, 100%);
  margin: 0 auto;
  min-height: 156px;
  padding: 14px clamp(20px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--navy);
  border-radius: 18px 18px 0 0;
  border-bottom: 6px solid var(--navy);
  background: #fff;
  position: relative;
  overflow: hidden;
}

.brand-header::after {
  content: "";
  position: absolute;
  right: -68px;
  bottom: -72px;
  width: 250px;
  height: 142px;
  border-radius: 50%;
  background: var(--orange);
  transform: rotate(-7deg);
  opacity: .96;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: clamp(170px, 16vw, 205px);
  position: relative;
  z-index: 1;
}

.brand-logo-sunburst,
.brand-logo-words {
  display: block;
  height: auto;
  object-fit: contain;
}

.brand-logo-sunburst {
  width: clamp(122px, 11vw, 144px);
  max-height: 74px;
}

.brand-logo-words {
  width: clamp(156px, 14vw, 184px);
  max-height: 36px;
  margin-top: 0;
}

.header-label {
  position: relative;
  z-index: 2;
  padding: 9px 15px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,.45);
  font-weight: 800;
  font-size: .88rem;
  letter-spacing: .02em;
  box-shadow: 0 8px 20px rgba(13,45,98,.14);
}

.app {
  width: min(1460px, 100%);
  min-height: min(780px, calc(100vh - 116px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(380px, 510px) 1fr;
  background: var(--surface);
  border-radius: 0 0 18px 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(28px, 4vw, 56px) clamp(24px, 4vw, 48px) 28px;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

.panel-copy { max-width: 460px; margin: 0 auto; }

.eyebrow {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--orange);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow span { width: 28px; height: 4px; border-radius: 10px; background: var(--gold); }

h1 {
  max-width: 430px;
  margin: 0;
  color: var(--navy-dark);
  font-size: clamp(2.2rem, 4vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.intro {
  margin: 18px 0 16px;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.04rem;
}

.data-note {
  width: fit-content;
  margin-bottom: 28px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--navy-soft);
  font-size: .8rem;
  font-weight: 700;
}
.data-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 4px rgba(36,174,187,.14); }

label { display: block; margin-bottom: 8px; color: var(--navy-dark); font-weight: 800; }
.search-row { display: grid; gap: 12px; }
.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  fill: var(--orange);
  pointer-events: none;
}

input {
  width: 100%;
  min-height: 56px;
  padding: 13px 16px;
  border: 1px solid #a9bacd;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input-wrap input { padding-left: 49px; }
input::placeholder { color: #7f8fa2; }
input:hover { border-color: #6f87a3; }
input:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(23,60,123,.12); outline: none; }

button {
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
button:hover { background: var(--orange-dark); box-shadow: 0 9px 22px rgba(232,59,20,.22); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .54; transform: none; box-shadow: none; }

#search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 9px 24px rgba(232,59,20,.22);
}
#search-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid #8aa0bb;
  box-shadow: none;
}
.secondary:hover { background: var(--navy-soft); color: var(--navy-dark); box-shadow: none; }
.location-button { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; }
.location-button svg { width: 19px; height: 19px; fill: currentColor; }

.configuration-note, .status, .result { margin-top: 18px; }
.configuration-note {
  margin-bottom: 0;
  padding: 11px 13px;
  border-left: 3px solid var(--aqua);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  background: #f4f8fb;
  font-size: .84rem;
  line-height: 1.45;
}
.configuration-note code { color: var(--navy-dark); font-weight: 700; }
.status { min-height: 25px; padding: 0; font-size: .92rem; }
.status.success { color: var(--success); }
.status.error { color: #a61b1b; font-weight: 800; }
.status.warning-text { color: var(--warning); }
.status.loading { color: var(--navy); }

.result {
  position: relative;
  padding: 19px 20px 19px 86px;
  min-height: 92px;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--success-soft), #f7fcf9);
  border: 1px solid #b7dfca;
  box-shadow: 0 12px 28px rgba(22,115,74,.10);
}
.result::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(36,174,187,.10);
}
.result-badge {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 7px 17px rgba(232,59,20,.22);
}
.result-kicker { margin: 0 0 3px; color: var(--success); font-size: .74rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.result h2 { position: relative; z-index: 1; margin: 0 0 5px; color: var(--navy-dark); font-size: 1.35rem; line-height: 1.18; }
.result p { position: relative; z-index: 1; margin: 4px 0; }
.result-code { color: var(--muted); font-size: .83rem; }

.map-wrap {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: #dce8f0;
}
.map { width: 100%; height: 100%; min-height: 620px; }
.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 36px;
  text-align: center;
  color: var(--navy-dark);
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(23,60,123,.06) 0 1px, transparent 1px 100%),
    linear-gradient(25deg, rgba(23,60,123,.05) 0 1px, transparent 1px 100%),
    #e3edf3;
  background-size: 74px 74px, 92px 92px, auto;
}
.placeholder-grid {
  position: absolute;
  inset: -10%;
  opacity: .55;
  background:
    radial-gradient(circle at 28% 33%, rgba(246,170,0,.34) 0 8%, transparent 8.5%),
    radial-gradient(circle at 64% 24%, rgba(36,174,187,.32) 0 12%, transparent 12.5%),
    radial-gradient(circle at 72% 73%, rgba(232,59,20,.18) 0 16%, transparent 16.5%),
    radial-gradient(circle at 34% 78%, rgba(23,60,123,.22) 0 13%, transparent 13.5%);
  filter: blur(1px);
}
.placeholder-content {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 32px;
  display: grid;
  justify-items: center;
  gap: 9px;
  border-radius: 18px;
  background: rgba(255,255,255,.91);
  border: 1px solid rgba(23,60,123,.12);
  box-shadow: 0 20px 46px rgba(13,45,98,.16);
  backdrop-filter: blur(10px);
}
.placeholder-content strong { font-size: 1.35rem; color: var(--navy-dark); }
.placeholder-content span { color: var(--muted); }
.placeholder-pin { width: 58px; height: 58px; margin-bottom: 5px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); box-shadow: 0 11px 26px rgba(232,59,20,.25); }
.placeholder-pin svg { width: 31px; height: 31px; fill: #fff; }

.map-footnote {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  max-width: 410px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  color: var(--navy-dark);
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(23,60,123,.12);
  box-shadow: 0 8px 22px rgba(13,45,98,.13);
  font-size: .76rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.map-footnote-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--navy); color: #fff; font-family: Georgia, serif; font-weight: 700; }

.tester {
  max-width: 460px;
  margin: 30px auto 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8fafc;
}
.tester summary {
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  color: var(--navy-dark);
  font-weight: 800;
  list-style-position: inside;
}
.tester summary small { color: var(--muted); font-weight: 600; }
.tester-content { padding: 0 15px 15px; }
.tester-content > p { margin-top: 4px; color: var(--muted); font-size: .88rem; }
.test-actions { margin: 12px 0; }
.coordinate-grid { display: grid; grid-template-columns: 92px 1fr; gap: 9px 12px; align-items: center; }
.coordinate-grid label { margin: 0; }
.coordinate-grid input { min-height: 45px; }
.coordinate-grid button { grid-column: 2; justify-self: start; }
.debug {
  max-height: 260px;
  overflow: auto;
  padding: 13px;
  border-radius: 8px;
  background: #0d294a;
  color: #f0f6fb;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .78rem;
}
code { font-family: Consolas, "Courier New", monospace; }

@media (min-width: 1180px) {
  .search-row { grid-template-columns: 1fr auto; }
  #search-button { min-width: 158px; }
}

@media (max-width: 980px) {
  .page-shell { padding: 0; }
  .brand-header { border-radius: 0; }
  .app { grid-template-columns: 1fr; border-radius: 0; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .map-wrap, .map { min-height: 500px; }
}

@media (max-width: 560px) {
  .brand-header { min-height: 128px; padding: 10px 14px; }
  .brand-lockup { width: min(48vw, 170px); gap: 7px; }
  .brand-logo-sunburst { width: 104px; max-height: 62px; }
  .brand-logo-words { width: min(40vw, 138px); max-height: 28px; margin-top: 0; }
  .header-label { display: none; }
  .panel { padding: 28px 18px 24px; }
  h1 { font-size: 2.28rem; }
  .data-note { align-items: flex-start; border-radius: 10px; }
  .result { padding-left: 20px; padding-top: 82px; }
  .result-badge { top: 18px; }
  .coordinate-grid { grid-template-columns: 1fr; }
  .coordinate-grid button { grid-column: 1; width: 100%; }
  .tester summary { align-items: flex-start; flex-direction: column; gap: 2px; }
  .map-footnote { left: 14px; right: 14px; bottom: 14px; }
}
