:root {
  color-scheme: light;
  --ink: #15271f;
  --muted: #66736d;
  --paper: #f4f2eb;
  --white: #fffefa;
  --line: #d8ded8;
  --green: #145a3a;
  --green-bright: #1c7c50;
  --amber: #e7a93b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 3%, rgba(231, 169, 59, 0.22), transparent 27rem),
    linear-gradient(145deg, #eef2e9 0%, var(--paper) 48%, #ece8dc 100%);
}

.shell { width: min(1080px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 72px; }
.hero { max-width: 820px; }
.eyebrow { margin: 0 0 12px; color: var(--green-bright); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { margin: 0; max-width: 800px; font-family: Georgia, serif; font-size: clamp(2.6rem, 5vw, 4.5rem); font-weight: 500; letter-spacing: -0.055em; line-height: 0.98; }
h1 span { color: var(--green); }
.intro { max-width: 650px; margin: 14px 0 24px; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.search { padding: 24px; border: 1px solid rgba(20, 90, 58, 0.16); border-radius: 22px; background: rgba(255, 254, 250, 0.78); box-shadow: 0 18px 70px rgba(28, 50, 39, 0.09); backdrop-filter: blur(12px); }
.search label { display: flex; flex-direction: column; gap: 9px; font-size: 0.82rem; font-weight: 750; }
.form-grid { display: grid; gap: 14px; margin-bottom: 17px; }
.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.address-row { grid-template-columns: minmax(130px, 0.7fr) minmax(240px, 2fr) minmax(100px, 0.55fr); }
.four-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 17px; margin-bottom: 0; }
input, select, button { min-height: 54px; border-radius: 12px; font: inherit; }
input, select { width: 100%; min-width: 0; border: 1px solid var(--line); padding: 0 17px; color: var(--ink); background: var(--white); font-size: 1rem; outline: none; }
input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 0.02em; }
input:focus, select:focus { border-color: var(--green-bright); box-shadow: 0 0 0 4px rgba(28, 124, 80, 0.11); }
button { border: 0; padding: 0 23px; color: white; background: var(--green); font-weight: 750; cursor: pointer; }
button:hover { background: var(--green-bright); }
button:disabled { cursor: wait; opacity: 0.65; }
.hint { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.address-details { margin: 5px 0 0; padding: 15px 0 0; border-top: 1px solid var(--line); }
.address-details summary, .advanced-search summary { width: fit-content; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; }
.form-actions .hint { max-width: 430px; }
.form-actions button { flex: 0 0 auto; }
.advanced-search { margin: 18px 0 0; padding: 0; border: 0; }
.reference-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 254, 250, 0.7); }
.status { margin-top: 24px; padding: 18px 20px; border-left: 4px solid var(--amber); border-radius: 8px; background: var(--white); }
.status.error { border-color: #bf3b30; color: #84281f; }
.result, .candidates-panel { margin-top: 28px; padding: clamp(24px, 5vw, 48px); border: 1px solid rgba(20, 90, 58, 0.13); border-radius: 26px; background: var(--white); box-shadow: 0 22px 80px rgba(28, 50, 39, 0.1); }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.candidate-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.count-pill { padding: 8px 12px; border-radius: 999px; color: var(--green); background: #e8f2e9; font-size: 0.8rem; font-weight: 800; }
.candidate-list { display: grid; gap: 10px; max-height: 580px; margin-top: 24px; overflow: auto; padding-right: 4px; }
.candidate-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcf8; }
.candidate-card strong { display: block; margin-bottom: 5px; }
.candidate-meta { color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.candidate-card button { min-height: 42px; }
h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 500; line-height: 1.05; }
.muted { color: var(--muted); }
.source-actions { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 9px; }
.source-badge { flex: 0 0 auto; padding: 9px 12px; border-radius: 999px; color: var(--green); background: #e8f2e9; font-size: 0.76rem; font-weight: 800; }
.official-link { color: var(--green); font-size: 0.78rem; font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.map-section { margin-top: 30px; }
.map-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.map-heading h3, .map-heading p { margin: 0; }
.map-heading p { margin-top: 5px; font-size: 0.84rem; }
.map-controls { display: flex; gap: 7px; }
.map-controls button { width: 42px; min-height: 42px; padding: 0; border: 1px solid var(--line); color: var(--green); background: var(--white); font-size: 1.35rem; }
.map-controls button:hover { color: white; background: var(--green); }
.map-frame { position: relative; min-height: 300px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #edf0e9; }
.map-frame img { display: block; width: 100%; min-height: 300px; object-fit: cover; cursor: crosshair; }
.map-target { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; border: 3px solid #d74332; border-radius: 50%; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.72), 0 3px 12px rgba(65, 31, 20, 0.32); transform: translate(-50%, -50%); pointer-events: none; }
.map-target::before, .map-target::after { content: ""; position: absolute; top: 50%; left: 50%; background: #d74332; transform: translate(-50%, -50%); }
.map-target::before { width: 44px; height: 2px; }
.map-target::after { width: 2px; height: 44px; }
.map-error { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 30px; color: #84281f; background: #fff7f4; text-align: center; }
.map-tooltip { position: absolute; z-index: 3; width: min(290px, calc(100% - 24px)); padding: 16px 38px 15px 17px; border: 1px solid rgba(20, 90, 58, 0.25); border-radius: 13px; background: rgba(255, 254, 250, 0.97); box-shadow: 0 15px 40px rgba(28, 50, 39, 0.24); transform: translate(-50%, calc(-100% - 18px)); pointer-events: auto; }
.map-tooltip::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; border-right: 1px solid rgba(20, 90, 58, 0.25); border-bottom: 1px solid rgba(20, 90, 58, 0.25); background: var(--white); transform: translateX(-50%) rotate(45deg); }
.tooltip-label { display: block; margin-bottom: 6px; color: var(--green-bright); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.map-tooltip strong { display: block; color: var(--green); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.94rem; }
.map-tooltip p { margin: 8px 0 4px; font-size: 0.84rem; font-weight: 650; line-height: 1.4; }
.map-tooltip small { color: var(--muted); font-size: 0.7rem; }
.tooltip-close { position: absolute; top: 7px; right: 7px; width: 28px; min-height: 28px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 1.15rem; }
.tooltip-close:hover { color: var(--ink); background: #edf3ed; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 38px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.facts div { min-height: 118px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts .reference-fact { background: #edf6ee; }
.availability-note { margin: -18px 0 34px; padding: 14px 16px; border-left: 3px solid var(--amber); border-radius: 8px; color: #4e4b3e; background: #fff8e7; font-size: 0.88rem; line-height: 1.5; }
.reference-fact dd { color: var(--green); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.98rem; overflow-wrap: anywhere; }
dt { margin-bottom: 12px; color: var(--muted); font-size: 0.75rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
dd { margin: 0; font-size: 1.08rem; font-weight: 720; line-height: 1.35; }
h3 { margin: 0 0 14px; }
.units { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.unit { display: flex; flex-direction: column; gap: 7px; padding: 16px; border-radius: 12px; background: #edf3ed; }
.unit span { color: var(--muted); font-size: 0.87rem; }
details { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
summary { color: var(--green); font-weight: 720; cursor: pointer; }
pre { max-height: 420px; overflow: auto; padding: 18px; border-radius: 12px; background: #13231c; color: #e6f1e9; font-size: 0.75rem; line-height: 1.55; }
.notice { margin-top: 24px; padding: 22px 24px; border-radius: 18px; color: #4e4b3e; background: rgba(255, 248, 224, 0.8); }
.notice p { margin: 7px 0 0; line-height: 1.5; }

@media (max-width: 720px) {
  .shell { padding: 42px 0; }
  .two-cols, .address-row, .four-cols, .reference-search, .facts { grid-template-columns: 1fr; }
  .form-actions, .candidate-card { display: grid; }
  .form-actions button, .candidate-card button { width: 100%; }
  .result-heading { display: block; }
  .source-actions { align-items: flex-start; margin-top: 16px; }
  .source-badge { display: inline-block; margin-top: 0; }
  .map-frame, .map-frame img { min-height: 240px; }
}
