:root {
  --accent: #0e7490;
  --sel: #e11d48;
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--fg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; }
#map { flex: 1; height: 100%; }

#panel {
  width: 320px; height: 100%; overflow-y: auto;
  background: var(--bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
#panel header { padding: 16px 16px 8px; }
h1 { font-size: 18px; margin: 0; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
h2 small { text-transform: none; letter-spacing: 0; font-weight: normal; }
section { padding: 12px 16px; border-top: 1px solid var(--line); }
label { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
label small { color: var(--muted); margin-left: auto; font-size: 11px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.seg label { flex: 1; padding: 0; gap: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { flex: 1; text-align: center; padding: 6px 2px; font-size: 13px; white-space: nowrap; }
.seg label + label span { border-left: 1px solid var(--line); }
.seg input:checked + span { background: var(--fg); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.opacity { margin-top: 6px; color: var(--muted); }
.opacity input { flex: 1; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.muted { color: var(--muted); }

.search { position: relative; display: flex; padding: 0 16px 12px; margin: 0; }
#search { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px 0 0 6px; font: inherit; }
.search button { padding: 0 10px; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; background: #f9fafb; color: var(--muted); cursor: pointer; }
.search button:hover { background: #f3f4f6; color: var(--fg); }
#search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
#results {
  position: absolute; left: 16px; right: 16px; top: 40px; z-index: 5;
  list-style: none; margin: 0; padding: 4px 0; background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgb(0 0 0 / .12);
  max-height: 320px; overflow-y: auto;
}
#results li { padding: 6px 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#results li small { display: block; color: var(--muted); font-size: 11px; }
#results li em { font-style: normal; color: var(--muted); font-size: 11px; white-space: nowrap; }
#results li.msg { cursor: default; display: block; color: var(--muted); font-size: 12px; }
#results li.active, #results li:hover { background: #f3f4f6; }

#panel h1 a { color: inherit; text-decoration: none; }
#info { flex: 1; }
#info h3 { font-size: 15px; margin: 0 0 2px; }
#info .kind { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
#info table { border-collapse: collapse; width: 100%; font-size: 12px; margin-bottom: 12px; }
#info td { padding: 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
#info td:first-child { color: var(--muted); padding-right: 10px; white-space: nowrap; }
#info td:last-child { word-break: break-word; }

/* Property card */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; list-style: none; white-space: nowrap; }
.btn::-webkit-details-marker { display: none; }
.btn:hover { background: #f3f4f6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #155e75; }
.btn[aria-pressed="true"] { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.menu { position: relative; }
.menu > div { position: absolute; z-index: 6; top: calc(100% + 4px); right: 0; min-width: 190px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgb(0 0 0 / .12); padding: 4px 0; }
.menu > div button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 12px; border: 0; background: none; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.menu > div button:hover { background: #f3f4f6; }
.menu > div small { color: var(--muted); font-size: 11px; }
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 12px; }
.figs div { background: #f9fafb; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.figs dt { color: var(--muted); font-size: 11px; }
.figs dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.figs dd small { font-weight: normal; color: var(--muted); font-size: 11px; }
.figs dd.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
button.copy { all: unset; cursor: copy; border-bottom: 1px dotted var(--muted); overflow-wrap: anywhere; }
button.copy:focus-visible { outline: 2px solid var(--accent); }
.note { display: block; font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.note textarea { display: block; width: 100%; margin-top: 2px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; color: var(--fg); resize: vertical; }
#info details:not(.menu) { border-top: 1px solid var(--line); padding: 6px 0; }
#info details:not(.menu) > summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 2px 0; }
.menu > summary { cursor: pointer; }
#info summary small { color: var(--muted); font-weight: normal; }
#info details:not(.menu)[open] > summary { margin-bottom: 6px; }
#info table.sides th { text-align: left; font-weight: normal; color: var(--muted); padding: 3px 0; border-bottom: 1px solid var(--line); }
#info table.sides td:first-child { color: var(--fg); font-weight: 600; }
#info table.sides td:not(:first-child), #info table.sides th:not(:first-child) { text-align: right; }
#info .hint { margin-top: 0; }
.also { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; font-size: 12px; }
.chip { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 4px 8px; font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.chip:hover { background: #f3f4f6; }
.chip small { color: var(--muted); font-size: 10.5px; }

/* Saved properties */
#saved-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
#saved-list li { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
#saved-list .open { flex: 1; min-width: 0; border: 0; background: none; padding: 6px 0; font: inherit; text-align: left; cursor: pointer; }
#saved-list .open:hover { color: var(--accent); }
#saved-list .open small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#saved-list .remove { border: 0; background: none; color: var(--muted); font-size: 18px; padding: 0 4px; cursor: pointer; }
#saved-list .remove:hover { color: var(--sel); }
button.link { border: 0; background: none; padding: 6px 0 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }

/* Map overlays: ruler readout and toast */
#map { position: relative; }
.ruler-box { position: absolute; z-index: 3; left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: var(--bg); border-radius: 8px; box-shadow: 0 4px 16px rgb(0 0 0 / .2); padding: 8px 12px; font-size: 13px; max-width: calc(100% - 24px); }
.ruler-actions { display: flex; gap: 4px; }
.ruler-actions button { border: 1px solid var(--line); border-radius: 5px; background: var(--bg); padding: 3px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.ruler-btn[aria-pressed="true"] { background: #fef3c7 !important; color: #b45309; }
.ruler-btn svg { display: block; margin: auto; }
.toast { position: absolute; z-index: 4; left: 50%; top: 16px; transform: translateX(-50%); background: var(--fg); color: #fff; border-radius: 6px; padding: 7px 14px; font-size: 13px; box-shadow: 0 4px 16px rgb(0 0 0 / .2); }
.toast[hidden], .ruler-box[hidden] { display: none; }

footer { padding: 12px 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
footer p { margin: 0 0 6px; }
footer a, .page a { color: var(--accent); }

/* Ad container (hidden unless ads.js fills it). min-height avoids layout jump. */
.ad-slot { padding: 12px 16px; border-top: 1px solid var(--line); min-height: 274px; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.ad-slot[hidden] { display: none; }

/* Text pages (about, privacy, 404) */
body.page { display: block; overflow: auto; background: #f9fafb; }
.page main { max-width: 720px; margin: 0 auto; padding: 32px 20px 64px; line-height: 1.6; }
.page h1 { font-size: 26px; margin-bottom: 4px; }
.page h2 { font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--fg); margin: 28px 0 8px; }
.page .back { display: inline-block; margin-bottom: 20px; }
.page .todo { background: #fef3c7; padding: 0 4px; border-radius: 3px; }

/* Header on text pages */
.site-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-head > a { font-weight: 700; color: var(--fg); text-decoration: none; }
.site-head nav { display: flex; gap: 16px; }
.site-head nav a { color: var(--muted); text-decoration: none; }
.site-head nav a:hover { color: var(--fg); }

/* Home page */
body.home { display: block; overflow: auto; height: auto; background: #fff; font-size: 15px; line-height: 1.55; }
.home main > section { max-width: 1120px; margin: 0 auto; padding: 56px 24px; }
.home main > section.band { max-width: none; background: #f8fafc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.home main > section.band > * { max-width: 1072px; margin-left: auto; margin-right: auto; }
.home h2 { font-size: 26px; text-transform: none; letter-spacing: -.01em; color: var(--fg); margin: 0 0 24px; }
.home h3 { font-size: 16px; margin: 0 0 6px; }
.home p { margin: 0; }
.home .btn { font-size: 15px; padding: 10px 18px; }
.home-head { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px; background: rgb(255 255 255 / .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.home-head .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--fg); text-decoration: none; }
.home-head .logo svg { color: var(--accent); }
.home-head nav { display: flex; align-items: center; gap: 20px; }
.home-head nav a:not(.btn) { color: var(--muted); text-decoration: none; }
.home-head nav a:not(.btn):hover { color: var(--fg); }
.home-head .btn { font-size: 14px; padding: 8px 14px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding-top: 64px !important; }
.hero h1 { font-size: 40px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 16px; }
.hero .lede { font-size: 18px; color: #374151; margin-bottom: 24px; }
.hero-search { display: flex; gap: 8px; max-width: 560px; }
.hero-search input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: 16px; }
.hero-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.examples { margin-top: 12px !important; font-size: 14px; color: var(--muted); }
.examples a { color: var(--accent); }
.free { margin-top: 6px !important; font-size: 14px; font-weight: 600; color: #047857; }
.hero-pic img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 20px 50px rgb(15 23 42 / .15); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 8px !important; padding-bottom: 48px !important; text-align: center; }
.stats b { display: block; font-size: 28px; letter-spacing: -.02em; }
.stats span { color: var(--muted); }
.stats p { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 0; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 10px; }
.steps p, .cards p, .faq p { color: #4b5563; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards article { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fff; }
.cards.who { grid-template-columns: repeat(5, 1fr); }
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 8px; }
.cta { text-align: center; }
.cta .hero-search { margin: 0 auto; }
.home-foot { max-width: 1120px; margin: 0 auto; padding: 24px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-foot nav { display: flex; gap: 16px; }
.home-foot a { color: var(--muted); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px !important; }
  .hero h1 { font-size: 30px; }
  .cards, .cards.who { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .home-head nav a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  .cards, .cards.who { grid-template-columns: 1fr; }
  .hero-search { flex-direction: column; }
  .home main > section { padding: 40px 18px; }
}

@media (max-width: 700px) {
  body { flex-direction: column-reverse; }
  #panel { width: 100%; height: 45%; border-right: 0; border-top: 1px solid var(--line); }
}
