:root {
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #ccfbf1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #fff;
  --star: #f59e0b;
  --good: #16a34a;
  --mid: #ca8a04;
  --bad: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding-bottom: 3rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 1.2em 0 .5em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.h3 { font-size: 1.1rem; margin-top: 0; }
.h4 { font-size: 1rem; margin: 1em 0 .5em; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; }
.narrow-sm { max-width: 440px; }
.center { text-align: center; }
.pad-xl { padding-top: 4rem; padding-bottom: 4rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.15rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem; z-index: 99; }
.inline { display: inline; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 1.1rem; }
.header-search { flex: 1; max-width: 360px; position: relative; }
.header-search input { width: 100%; }
.site-nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.site-nav a, .site-nav .link { color: var(--ink-2); font-weight: 500; }
.site-nav .btn { color: #fff; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; font-size: 1.5rem; cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .header-search { display: none; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
}

/* Forms */
input, select, textarea, button { font: inherit; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=month], input:not([type]), select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field { display: block; margin: 0 0 1rem; border: 0; padding: 0; }
.field > span, .field > legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field em { color: var(--bad); font-style: normal; }
.hint { font-size: .85rem; color: var(--muted); margin: .25rem 0 .5rem; }
.check { display: flex; gap: .5rem; align-items: flex-start; margin: .35rem 0; font-weight: 400; }
.check input { margin-top: .3rem; }
.form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.grid-2, .grid-3 { display: grid; gap: 0 1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.geo-row { display: flex; gap: .5rem; margin-bottom: .5rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-small { padding: .35rem .75rem; font-size: .875rem; }
.btn-big { padding: .9rem 1.6rem; font-size: 1.05rem; }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #b91c1c; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* Flash */
.flashes { margin-top: 1rem; }
.flash { padding: .75rem 1rem; border-radius: 8px; margin: .5rem 0; border: 1px solid; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--radius); margin-bottom: 1rem; }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 99px; background: #f1f5f9; color: var(--ink-2); font-size: .8rem; font-weight: 600; vertical-align: middle; }
.pill-sm { font-size: .72rem; padding: .05rem .45rem; }
.pill-ok { background: var(--brand-soft); color: var(--brand-dark); }
.pill-warn { background: #fef3c7; color: #92400e; }
.pill-bad { background: #fee2e2; color: #991b1b; }
.badge { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 99px; background: var(--bad); color: #fff; font-size: .75rem; text-align: center; }
.tag { display: inline-block; padding: .2rem .6rem; border-radius: 99px; background: #f1f5f9; color: var(--ink-2); font-size: .82rem; margin: 0 .25rem .3rem 0; }
.tag:hover, .tag.active { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.tag small { color: var(--muted); }
.tag-cloud { margin-bottom: 1.5rem; }

/* Stars */
.stars { --size: 1.1rem; position: relative; display: inline-block; width: max-content; flex: none; align-self: flex-start; font-size: var(--size); line-height: 1; letter-spacing: 2px; vertical-align: middle; }
.stars::before { content: "★★★★★"; color: #e2e8f0; }
.stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; }
.stars-fill::before { content: "★★★★★"; color: var(--star); }
.stars.xs { --size: .8rem; letter-spacing: 1px; }
.stars.sm { --size: .95rem; }
.stars.lg { --size: 1.5rem; }

.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; border: 0; padding: 0; margin: 0; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 1.9rem; color: #cbd5e1; cursor: pointer; padding: 0 .08rem; line-height: 1; transition: color .1s, transform .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }
.star-input label:hover { transform: scale(1.12); }
.facets-input .star-input label { font-size: 1.4rem; }
.facet-input-row { display: flex; align-items: center; justify-content: space-between; max-width: 360px; }

/* Avatar */
.avatar { --h: 180; display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 55% 28%); font-weight: 700; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; }

/* Hero */
.hero { background: linear-gradient(160deg, #134e4a 0%, #0f766e 55%, #14b8a6 100%); color: #fff; padding: 4rem 0 3.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-top: 0; letter-spacing: -.02em; }
.hero .lead { max-width: 640px; opacity: .92; }
.hero .muted { color: #ccfbf1; }
.big-search { display: flex; gap: .5rem; background: #fff; border-radius: 14px; padding: .5rem; max-width: 820px; box-shadow: 0 10px 40px rgba(0,0,0,.2); margin-top: 1.5rem; }
.big-search .field { flex: 1; margin: 0; padding: .25rem .5rem; color: var(--ink); }
.big-search .field span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.big-search input { border: 0; padding: .2rem 0; font-size: 1.05rem; }
.big-search input:focus { outline: none; }
.big-search .field + .field { border-left: 1px solid var(--line); }
.hero-stats { margin-top: 1rem; }
@media (max-width: 640px) {
  .big-search { flex-direction: column; }
  .big-search .field + .field { border-left: 0; border-top: 1px solid var(--line); }
}
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; margin-bottom: 1rem; }
.how-step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.how-step h3 { margin: .5rem 0 .25rem; }
.how-step p { margin: 0; color: var(--ink-2); }
.how-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }

.section-title { font-size: 1.2rem; margin: 2rem 0 1rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.cta-box { margin-top: 1.5rem; background: var(--brand-soft); border-radius: var(--radius); padding: 1.25rem; }
.cta-box h3 { margin-top: 0; }

.mini-review { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.mini-review.card { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.mini-review p { margin: .25rem 0; }
.mr-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mr-title { display: block; font-weight: 600; color: var(--ink); margin-top: .25rem; }

/* Person cards */
.card-list { display: flex; flex-direction: column; gap: .6rem; }
.card-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.person-card { display: flex; gap: .9rem; align-items: center; padding: .9rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.person-card:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow); }
.pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-loc { font-size: .85rem; }
.pc-tags { margin-top: .25rem; }
.pc-tags .tag { font-size: .72rem; padding: .05rem .45rem; }
.pc-score { text-align: right; display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.pc-score strong { font-size: 1.3rem; line-height: 1; }
.pc-score small { color: var(--muted); font-size: .75rem; }
.score-good strong, .score-good .big-num { color: var(--good); }
.score-mid strong, .score-mid .big-num { color: var(--mid); }
.score-bad strong, .score-bad .big-num { color: var(--bad); }
.card-list.compact .person-card { padding: .6rem .75rem; }
.card-list.compact .avatar { width: 38px; height: 38px; font-size: .85rem; }

/* Search */
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.filters .field { flex: 2 1 180px; margin: 0; }
.filters .field-sm { flex: 1 1 110px; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.pager { display: flex; justify-content: center; gap: 1.5rem; margin: 1.5rem 0; align-items: center; }

/* Suggest dropdown */
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 1100; overflow: hidden; margin-top: 4px; }
.suggest a { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .75rem; color: var(--ink); }
.suggest a:hover, .suggest a.active { background: var(--brand-soft); text-decoration: none; }
.suggest small { color: var(--muted); }
.suggest-host { position: relative; }

/* Person page */
.person-hero { background: #fff; border-bottom: 1px solid var(--line); padding: 2rem 0; }
.person-head { display: flex; gap: 1.5rem; align-items: flex-start; }
.ph-main { flex: 1; min-width: 0; }
.ph-main h1 { margin: 0 0 .25rem; }
.ph-main p { margin: .25rem 0; }
.ph-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.ph-score { text-align: center; min-width: 140px; background: var(--bg); border-radius: var(--radius); padding: 1rem; }
.big-num { font-size: 3rem; font-weight: 800; line-height: 1; margin-bottom: .25rem; }
@media (max-width: 700px) {
  .person-head { flex-wrap: wrap; }
  .ph-score { width: 100%; }
  .person-head .avatar.xl { width: 64px; height: 64px; font-size: 1.4rem; }
}
.person-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; margin-top: 2rem; }
@media (max-width: 900px) { .person-layout { grid-template-columns: 1fr; } }
.reviews-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.reviews-head h2 { margin: 0; }
.inline-filters { display: flex; gap: .5rem; }
.inline-filters select { width: auto; padding: .35rem .5rem; font-size: .9rem; }
.review-head { display: flex; flex-direction: column; gap: .25rem; }
.review-head h3 { margin: 0; font-size: 1.1rem; }
.review-meta { margin: .4rem 0 .6rem; }
.review-body { margin: .5rem 0; }
.facet-chips { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .75rem 0; }
.facet-chips div { display: flex; gap: .4rem; align-items: center; }
.facet-chips dt { font-size: .8rem; color: var(--muted); }
.facet-chips dd { margin: 0; }
.review-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .2rem .7rem; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.reply { background: var(--bg); border-left: 3px solid var(--brand); padding: .75rem 1rem; border-radius: 0 8px 8px 0; margin: .75rem 0; }
.reply p { margin: .35rem 0; }
.reply-form summary { cursor: pointer; color: var(--brand); font-size: .9rem; margin: .5rem 0; }
.reply-form textarea { margin-bottom: .5rem; }
.bar-row, .facet-row { display: grid; grid-template-columns: 2.2rem 1fr 2rem; gap: .5rem; align-items: center; font-size: .9rem; margin: .3rem 0; }
.facet-row { grid-template-columns: 1fr auto 2rem; }
.bar { height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--star); }
.mini-map { height: 200px; border-radius: 8px; margin-bottom: .5rem; }
.person-side .card .btn { margin: 0 .25rem .5rem 0; }

/* Forms specific */
.picker-map { height: 280px; border-radius: 8px; border: 1px solid var(--line); }
.guideline-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; }
.guideline-box ul { margin: .4rem 0; padding-left: 1.2rem; }
.warn-card { border-color: #fde68a; background: #fffbeb; }
details.danger summary { cursor: pointer; color: var(--bad); font-weight: 600; }

/* Map page */
.map-page { display: flex; flex-direction: column; }
.map-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem 1.25rem; background: #fff; border-bottom: 1px solid var(--line); }
.map-bar input, .map-bar select { width: auto; flex: 1 1 140px; padding: .4rem .6rem; }
.map-full { height: calc(100vh - 64px - 62px); min-height: 420px; }
.map-popup strong { display: block; font-size: 1rem; }
.map-popup .stars { margin-right: .25rem; }

/* User */
.user-head { display: flex; gap: 1rem; align-items: center; margin: 2rem 0 1rem; }
.user-head h1 { margin: 0; }

/* Prose */
.prose h2 { margin-top: 2rem; }
.prose li { margin: .35rem 0; }

/* Admin */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.tabs a:hover { text-decoration: none; background: #f1f5f9; }
.tabs-sub { display: flex; gap: 1rem; }
.tabs-sub a.active { font-weight: 700; text-decoration: underline; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; color: var(--ink); }
.stat-tile strong { font-size: 2rem; }
.stat-tile span { color: var(--muted); }
.stat-tile.attn { border-color: var(--bad); }
.stat-tile.attn strong { color: var(--bad); }
.admin-item blockquote { margin: .5rem 0; padding: .5rem .75rem; background: var(--bg); border-left: 3px solid #cbd5e1; }
.admin-item .target { border: 1px solid var(--line); border-radius: 8px; padding: .75rem; margin: .5rem 0; }
.admin-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.admin-actions input[name=note] { flex: 1 1 200px; width: auto; padding: .35rem .5rem; }
.admin-actions input[name=into] { width: 120px; padding: .3rem .4rem; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #f8fafc; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr.banned td { opacity: .6; }
@media (max-width: 800px) { .table { display: block; overflow-x: auto; } }

/* Footer */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 2rem 0 1.5rem; }
.site-footer a { color: #e2e8f0; }
.site-footer .muted { color: #94a3b8; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.footer-inner nav { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: flex-start; }
.footer-inner p { margin: .25rem 0 0; }

/* Leaflet custom marker */
.pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); color: #fff; font-weight: 700; font-size: .8rem; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.pin span { transform: rotate(45deg); }
.pin.good { background: var(--good); } .pin.mid { background: var(--mid); } .pin.bad { background: var(--bad); } .pin.none { background: #64748b; }
