/* Wellerman theme: built from the logo's navy (#03234a). */
:root {
  --navy: #03234a;
  --navy-hover: #0b3a70;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #0d1b2e;
  --muted: #56677c;
  --line: #dbe2ea;
  --soft: #e8eef5;      /* tinted navy, for placeholders and hovers */
  --logo: var(--navy);
  --link: #0b4f8a;
  --btn-bg: var(--navy);
  --btn-ink: #ffffff;
  --danger: #b42318;
  --ok: #127a45;
  --brand-font: "Rockwell", "Roboto Slab", "Museo Slab", Georgia, serif; /* echoes the slab wordmark */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #06162b;
    --card: #0c2240;
    --ink: #e8eef7;
    --muted: #9fb0c6;
    --line: #1c3557;
    --soft: #12305a;
    --logo: #e8eef7;
    --link: #8fbef0;
    --btn-bg: #e8eef7;
    --btn-ink: var(--navy);
    --navy-hover: #ffffff;
    --danger: #ff8a80;
    --ok: #6fdc9f;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; min-height: 70vh; }
h1, h2, .price { font-family: var(--brand-font); }
h1 { font-size: 1.9rem; line-height: 1.15; margin: 0.5em 0; color: var(--ink); }
h2 { font-size: 1.25rem; margin: 0 0 0.5em; }

/* Logos (inline SVG with fill=currentColor) */
.mark { display: inline-block; color: var(--logo); line-height: 0; }
.mark svg, .brand svg { width: 100%; height: auto; display: block; }

/* Splash: visible until Dioxus renders into #main */
#splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
#splash img { animation: bob 1.6s ease-in-out infinite; }
#main:not(:empty) ~ #splash { display: none; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { #splash img { animation: none; } }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: block; width: 96px; color: var(--logo); }
.top nav { display: flex; gap: 18px; align-items: center; font-weight: 600; }
.top nav a { text-decoration: none; color: var(--ink); }
.top nav a:hover { color: var(--link); }

/* Footer */
footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 40px 16px; border-top: 1px solid var(--line); margin-top: 40px; }
.footer-mark { width: 56px; opacity: 0.85; }
footer p { max-width: 520px; margin: 8px auto 0; }

.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

/* About, Terms, Privacy */
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: 0.5em; }
.prose p, .prose li { line-height: 1.6; }

/* Forms */
.search { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; margin: 16px 0 24px; }
@media (max-width: 760px) { .search { grid-template-columns: 1fr 1fr; } .search input:first-child { grid-column: 1 / -1; } }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
button {
  padding: 10px 18px; border: 0; border-radius: 8px; background: var(--btn-bg); color: var(--btn-ink); font-weight: 700; cursor: pointer;
}
button:hover { background: var(--navy-hover); }
button:disabled { opacity: 0.6; cursor: progress; }
button.link { background: none; color: var(--link); padding: 0; font-weight: normal; }
button.danger { background: none; color: var(--danger); border: 1px solid var(--danger); margin-top: 12px; }
.form-mark { width: 88px; margin: 16px auto 0; display: block; }

/* Listing cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgb(3 35 74 / 0.12); }
.card img, .nophoto { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.nophoto { display: grid; place-items: center; align-content: center; gap: 8px; background: var(--soft); color: var(--muted); font-size: 0.85rem; }
.nophoto .mark { width: 45%; opacity: 0.35; }
.card-body { padding: 12px 14px 16px; }
.price { color: var(--logo); font-weight: 800; font-size: 1.35rem; }
.price.big { font-size: 2.2rem; }
.title { font-weight: 600; }
.muted { color: var(--muted); }
.facts { font-size: 0.9rem; }
.error { color: var(--danger); }
.ok { color: var(--ok); }

/* Listing page */
.listing { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .listing { grid-template-columns: 1fr; } }
.gallery .main { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; }
.thumb { padding: 0; background: none; border: 2px solid transparent; border-radius: 6px; flex: 0 0 88px; }
.thumb:hover { background: none; }
.thumb.on { border-color: var(--logo); }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }
.desc { white-space: pre-wrap; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; display: grid; gap: 10px; }
.panel form { display: grid; gap: 8px; }
.narrow { max-width: 620px; margin: 0 auto; }
.center { text-align: center; }
.stack { display: grid; gap: 14px; }
.stack label { display: grid; gap: 4px; font-weight: 600; }
.stack small { font-weight: normal; color: var(--muted); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stack label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; }
.check input { width: auto; margin-top: 4px; }
.report-link { font-size: 0.85rem; color: var(--muted); margin-top: 12px; text-decoration: underline; }
.actions { display: flex; gap: 16px; align-items: center; }

/* Admin */
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #b42318; color: #fff; margin-bottom: 6px; }
.admin-item.hidden { opacity: 0.8; }
.admin-head { display: flex; gap: 14px; align-items: flex-start; }
.admin-thumb { width: 88px; height: 88px; border-radius: 8px; object-fit: cover; flex: none; background: var(--soft); }
.reports { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
button.danger-solid { background: #b42318; color: #fff; }
button.danger-solid:hover { background: #912018; }

/* House details */
.factgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px 16px; margin: 12px 0; }
.factgrid dt { font-size: 0.8rem; color: var(--muted); }
.factgrid dd { margin: 0; font-weight: 700; }
.chips { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--soft); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; }

/* Sell form: address picker and features */
.suggest { list-style: none; margin: -8px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.suggest button { width: 100%; text-align: left; background: none; color: var(--ink); font-weight: normal; padding: 8px 10px; }
.suggest button:hover { background: var(--soft); }
.picked { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-weight: normal; }
fieldset.features { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
fieldset.features legend { font-weight: 600; padding: 0 4px; }

/* Public records (api/records) */
.records { max-width: 760px; margin: 32px auto 0; }
.records-head { font-size: 1.5rem; margin-bottom: 4px; }
.small { font-size: 0.85rem; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.kv.total { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.big-num { font-family: var(--brand-font); font-size: 1.3rem; font-weight: 800; color: var(--logo); }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 8px 0 0; }
.pill { font-size: 0.8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pill.good { background: #dcf3e6; color: #0e5a33; }
.pill.med { background: #fdf0d2; color: #7a4b00; }
.pill.bad { background: #fde0dc; color: #8f1d12; }
.pill.tsunami-red { background: #d92d20; color: #fff; }
.pill.tsunami-orange { background: #f79009; color: #1a1a1a; }
.pill.tsunami-yellow { background: #fdd835; color: #1a1a1a; }
.pill.tsunami-blue { background: #2e90fa; color: #fff; }
.hazard { border-top: 1px solid var(--line); padding-top: 10px; }
.hazard p { margin: 4px 0 0; }
.aerial { margin: 16px 0; }
.aerial img { width: 100%; border-radius: 12px; display: block; }
.aerial figcaption { margin-top: 4px; }
.sun iframe { width: 100%; height: 420px; border: 0; border-radius: 10px; background: var(--soft); }
.place .times { display: grid; text-align: right; font-size: 0.85rem; white-space: nowrap; }
.school { text-decoration: none; color: inherit; padding: 6px 0; }
.school:hover strong { color: var(--link); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.num { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.num input { color: var(--ink); }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }

/* Listing photos: no drag-to-save, no long-press save menu on phones */
img[src^="/photos/"] { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

/* Home toolbar: list or map, sort, save search */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: -8px 0 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--card); color: var(--ink); border-radius: 0; padding: 8px 16px; font-weight: 600; }
.seg button.on { background: var(--btn-bg); color: var(--btn-ink); }
.sort { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.sort select { width: auto; padding: 8px 10px; }
.save-search { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.save-search .check { display: inline-flex; gap: 6px; align-items: center; font-size: 0.9rem; }
.save-search .check input { width: auto; }
.more { text-align: center; margin: 24px 0; }
.saved { list-style: none; padding: 0; display: grid; gap: 10px; }
.saved li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }

/* Map */
.map { position: relative; height: 560px; max-height: 75vh; overflow: hidden; border-radius: 12px; border: 1px solid var(--line);
  background: var(--soft); touch-action: none; cursor: grab; user-select: none; }
.map:active { cursor: grabbing; }
.map .tile { position: absolute; width: 256px; height: 256px; background-size: cover; pointer-events: none; }
.pin { position: absolute; transform: translate(-50%, -100%); padding: 3px 8px; border-radius: 999px; font-size: 0.8rem;
  background: var(--btn-bg); color: var(--btn-ink); box-shadow: 0 2px 6px rgb(0 0 0 / 0.35); white-space: nowrap; }
.pin.on { background: var(--danger); z-index: 2; }
.pin-card { position: absolute; left: 10px; bottom: 24px; z-index: 3; width: 240px;
  background: var(--card); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.3); overflow: hidden; cursor: default; }
.pin-card a { display: block; color: inherit; text-decoration: none; }
.pin-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.pin-card a > div { padding: 8px 10px 10px; }
.pin-card .price { font-size: 1.1rem; }
.zoom { position: absolute; top: 10px; right: 10px; display: grid; gap: 4px; z-index: 4; }
.zoom button { width: 38px; height: 38px; padding: 0; font-size: 1.3rem; }
.attrib { position: absolute; right: 6px; bottom: 4px; font-size: 0.7rem; background: rgb(255 255 255 / 0.8); color: #333; padding: 1px 6px; border-radius: 4px; }

/* Profiles: public username and photo; the real name stays private */
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none;
  display: inline-grid; place-items: center; background: var(--soft); color: var(--ink); font-weight: 700; font-size: 0.9rem; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.top nav .who .avatar { width: 28px; height: 28px; }
.profile-photo { display: flex; gap: 20px; align-items: center; }
.profile-photo .avatar { width: 112px; height: 112px; font-size: 2.6rem; }
.profile-photo .stack { gap: 6px; }
.file-button { display: inline-block; padding: 10px 18px; border-radius: 8px; background: var(--btn-bg); color: var(--btn-ink); font-weight: 700; cursor: pointer; width: fit-content; }
.file-button:hover { background: var(--navy-hover); }
.profile-photo input:focus-visible + .file-button, .file-button:focus-within { outline: 2px solid var(--link); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.banner { margin: 0; padding: 10px 16px; text-align: center; background: var(--soft); border-bottom: 1px solid var(--line); }
.profile-photo .stack > * { justify-self: start; }
