:root {
    --bg: #f5f3ef;
    --surface: #fffdf8;
    --surface-2: #f8fafc;
    --line: #d8d5cc;
    --text: #171717;
    --muted: #6b685f;
    --green: #1f7a4d;
    --green-soft: #d9eadf;
    --blue: #2266a5;
    --amber: #b7791f;
    --red: #b42318;
    --purple: #6d5bd0;
    --shadow: 0 18px 45px rgba(29, 28, 24, 0.08);
    --radius: 8px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.login-body {
    min-height: 100vh;
    background:
        linear-gradient(120deg, rgba(31, 122, 77, 0.18), transparent 45%),
        linear-gradient(300deg, rgba(34, 102, 165, 0.14), transparent 38%),
        var(--bg);
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(100%, 440px);
}

.login-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

.login-panel h1 {
    margin: 2px 0 10px;
    font-size: 32px;
    letter-spacing: 0;
}

.login-copy {
    color: var(--muted);
    margin: 0 0 24px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.form-error {
    min-height: 20px;
    color: var(--red);
    margin: 0;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.public-shell {
    min-height: 100vh;
}

.public-header {
    min-height: 72px;
    padding: 12px 28px;
    border-bottom: 1px solid var(--line);
    background: #25251f;
    color: #f8f5ed;
    display: grid;
    grid-template-columns: minmax(230px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.public-brand {
    border-bottom: 0;
    padding: 0;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.public-nav a {
    min-height: 36px;
}

.account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: rgba(248, 245, 237, 0.82);
}

.account-actions .button {
    border-color: rgba(255, 255, 255, 0.22);
}

.nav-profile-menu {
    position: relative;
    display: inline-flex;
}

.nav-profile-link {
    position: relative;
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(244, 216, 138, 0.34);
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.18) 28%, transparent 29%),
        linear-gradient(135deg, #d9eadf, #9fc5b0 58%, #8fb4cc);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    padding: 0;
    color: #183b2a;
}

.nav-profile-link:hover,
.nav-profile-menu.is-open .nav-profile-link {
    border-color: rgba(244, 216, 138, 0.72);
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.22) 28%, transparent 29%),
        linear-gradient(135deg, #e7f4e5, #a9cfb3 58%, #9fc3da);
}

.nav-profile-link img,
.nav-profile-fallback {
    width: 100%;
    height: 100%;
}

.nav-profile-link img {
    display: block;
    object-fit: cover;
}

.nav-profile-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.03em;
    color: #163b29;
}

.nav-profile-fallback svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.nav-profile-link-caret {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(37, 37, 31, 0.18);
    background: rgba(255, 253, 248, 0.94);
    color: #25251f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.nav-profile-link-caret svg {
    width: 9px;
    height: 9px;
    fill: currentColor;
    transition: transform 0.18s ease;
}

.nav-profile-menu.is-open .nav-profile-link-caret svg {
    transform: rotate(180deg);
}

.nav-profile-menu-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(320px, calc(100vw - 24px));
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    padding: 14px;
    display: grid;
    gap: 12px;
    z-index: 45;
}

.nav-profile-menu-panel[hidden] {
    display: none;
}

.nav-profile-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-profile-menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: #d9eadf;
}

.nav-profile-menu-avatar img,
.nav-profile-menu-avatar .nav-profile-fallback {
    width: 100%;
    height: 100%;
}

.nav-profile-menu-avatar img {
    display: block;
    object-fit: cover;
}

.nav-profile-menu-head-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.nav-profile-menu-head-copy strong {
    font-size: 14px;
}

.nav-profile-menu-head-copy span {
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-profile-menu-list {
    display: grid;
    gap: 8px;
}

.nav-profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: #f8f5ed;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.nav-profile-menu-item:hover {
    border-color: #c9d8c5;
    background: #eff8f1;
}

.nav-profile-menu-item.is-danger:hover {
    border-color: #fecaca;
    background: #fff1f0;
}

.nav-profile-menu-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--green);
    background: var(--green-soft);
}

.nav-profile-menu-item.is-danger .nav-profile-menu-item-icon {
    color: var(--red);
    background: #fee2e2;
}

.nav-profile-menu-item-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #25251f;
    color: #f8f5ed;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #e4c36b;
    color: #1d1d17;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: rgba(248, 245, 237, 0.7);
    margin-top: 2px;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav a {
    padding: 10px 12px;
    border-radius: 6px;
    color: rgba(248, 245, 237, 0.78);
}

.nav a:hover,
.nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(248, 245, 237, 0.74);
}

.sidebar-footer a {
    color: #f4d88a;
}

.main {
    min-width: 0;
}

.topbar {
    min-height: 96px;
    padding: 22px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.9);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.content {
    padding: 24px 28px 40px;
}

.explore-shell {
    display: grid;
    gap: 16px;
}

.explore-filters {
    padding-bottom: 4px;
}

.explore-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 16px;
    align-items: stretch;
}

.explore-main .map-canvas {
    min-height: 560px;
}

.explore-detail {
    align-content: start;
}

.explore-list {
    display: grid;
    gap: 8px;
}

.property-strip {
    border: 1px solid #e0dbd0;
    border-radius: 7px;
    background: #fffdf8;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(360px, auto);
    gap: 10px;
    align-items: center;
    padding: 10px;
}

.property-strip.active {
    border-color: var(--green);
    box-shadow: inset 4px 0 0 var(--green);
}

.property-strip-main {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    display: grid;
    justify-items: start;
    gap: 3px;
    text-align: left;
}

.property-strip-main:hover {
    background: transparent;
    border: 0;
}

.property-strip-main strong {
    color: var(--blue);
    font-size: 15px;
}

.property-strip-main span {
    color: var(--muted);
    font-weight: 600;
}

.property-strip-metrics {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
}

.property-strip-metrics span,
.climate-pill {
    min-height: 26px;
    border: 1px solid #e0dbd0;
    border-radius: 999px;
    padding: 4px 9px;
    background: #f8f5ed;
    font-size: 12px;
    font-weight: 800;
}

.climate-pill.climate-high {
    border-color: #fecaca;
    background: #fff1f0;
    color: var(--red);
}

.climate-pill.climate-medium {
    border-color: #fde68a;
    background: #fff8e6;
    color: #92400e;
}

.climate-pill.climate-low {
    border-color: #bbf7d0;
    background: #eff8f1;
    color: #166534;
}

.public-table-shell {
    display: grid;
    gap: 16px;
}

.public-table-wrap {
    max-height: calc(100vh - 270px);
}

.public-compare-table {
    min-width: 1540px;
}

.public-compare-table th {
    top: 0;
}

.public-compare-table td {
    vertical-align: top;
}

.table-photo-button {
    width: 86px;
    height: 58px;
    min-height: 58px;
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #20231f;
    color: #f8f5ed;
    font-size: 11px;
}

.table-photo-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.table-name-button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    display: grid;
    justify-items: start;
    gap: 3px;
    text-align: left;
}

.table-name-button:hover {
    border: 0;
    background: transparent;
}

.table-name-button strong {
    color: var(--blue);
    font-size: 14px;
}

.table-name-button span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.mini-tags {
    margin-top: 6px;
}

.mini-tags .tag {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 11px;
}

.table-notes {
    min-width: 260px;
    max-width: 360px;
}

.table-notes strong,
.table-notes span {
    display: block;
}

.table-notes strong {
    margin-bottom: 4px;
}

.table-notes span {
    color: var(--muted);
}

.source-links {
    min-width: 150px;
}

.source-links a {
    display: block;
    color: var(--blue);
    font-weight: 800;
}

.source-links a + a {
    margin-top: 4px;
}

.loading-panel,
.empty-state,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.loading-panel,
.empty-state {
    padding: 28px;
    color: var(--muted);
}

.panel {
    padding: 18px;
    box-shadow: 0 8px 30px rgba(29, 28, 24, 0.04);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.panel-header h2,
.section-title {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0;
}

.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 5px solid var(--green);
    border-radius: var(--radius);
    padding: 14px;
}

.stat:nth-child(2) {
    border-left-color: var(--amber);
}

.stat:nth-child(3) {
    border-left-color: var(--blue);
}

.stat:nth-child(4) {
    border-left-color: var(--purple);
}

.stat:nth-child(5) {
    border-left-color: var(--red);
}

.stat span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    letter-spacing: 0;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) repeat(5, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.toolbar.compact {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.climate-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) repeat(5, minmax(130px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid #d8d5cc;
    border-radius: var(--radius);
    background: #f6f9fb;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid #cac6ba;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
}

textarea {
    min-height: 92px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(31, 122, 77, 0.22);
    border-color: var(--green);
}

.button-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

button,
.button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #bbb6a8;
    border-radius: 6px;
    padding: 8px 12px;
    background: #fff;
    color: var(--text);
    font-weight: 750;
}

button:hover,
.button:hover {
    border-color: #8d887d;
    background: #faf8f2;
}

button.primary,
.button.primary {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

button.danger {
    border-color: var(--red);
    background: #fff5f3;
    color: var(--red);
}

button.ghost {
    background: transparent;
}

button.small,
.button.small {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
}

.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #e7e2d8;
    text-align: left;
    vertical-align: middle;
}

th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f0ede5;
    color: #4c493f;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

td {
    background: #fffdf8;
}

tr:hover td {
    background: #fbf7ed;
}

td input,
td select {
    min-width: 104px;
}

.name-cell {
    min-width: 220px;
}

.name-cell a {
    color: var(--blue);
    font-weight: 800;
}

.muted {
    color: var(--muted);
}

.money,
.number {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.badge,
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge {
    background: #ede9dd;
    color: #494538;
}

.badge.green {
    background: var(--green-soft);
    color: #14532d;
}

.badge.blue {
    background: #dbeafe;
    color: #1e3a8a;
}

.badge.red {
    background: #fee2e2;
    color: #991b1b;
}

.tag {
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #fff;
}

.tag-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-toggle {
    opacity: 0.55;
}

.tag-toggle.active {
    opacity: 1;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 360px;
    gap: 16px;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.form-grid .wide {
    grid-column: span 2;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.section-stack {
    display: grid;
    gap: 16px;
}

.section-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.score-input {
    display: grid;
    grid-template-columns: 1fr 64px;
    gap: 8px;
    align-items: center;
}

.section-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.section-field-grid label.textarea {
    grid-column: 1 / -1;
}

.mini-list {
    display: grid;
    gap: 8px;
}

.mini-row {
    border: 1px solid #e0dbd0;
    border-radius: 7px;
    padding: 10px;
    background: #fffdf8;
}

.mini-row-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.mini-row-grid .wide {
    grid-column: span 2;
}

.mini-row-grid .full {
    grid-column: 1 / -1;
}

.row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
}

.map-canvas {
    position: relative;
    min-height: 620px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background:
        linear-gradient(rgba(34, 102, 165, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 102, 165, 0.08) 1px, transparent 1px),
        linear-gradient(145deg, #e5efe4, #f8f1df 46%, #dbeaf1);
    background-size: 48px 48px, 48px 48px, cover;
}

.map-canvas.real-map {
    background: #20231f;
    isolation: isolate;
}

.map-canvas.real-map .leaflet-container,
.leaflet-container {
    font: inherit;
}

.map-canvas.real-map .leaflet-control-attribution {
    font-size: 10px;
}

.map-loading,
.map-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: #20231f;
    z-index: 0;
}

.map-legend {
    max-width: 250px;
    border: 1px solid rgba(255, 253, 248, 0.32);
    border-radius: 7px;
    padding: 10px 12px;
    background: rgba(37, 37, 31, 0.86);
    color: #f8f5ed;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    display: grid;
    gap: 6px;
    font-size: 12px;
    line-height: 1.25;
}

.map-legend strong,
.map-legend span,
.map-legend small {
    display: flex;
    align-items: center;
    gap: 7px;
}

.map-legend small {
    color: rgba(248, 245, 237, 0.72);
}

.map-legend hr {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(248, 245, 237, 0.18);
    margin: 2px 0;
}

.map-legend .dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    border: 2px solid #fff;
    flex: 0 0 auto;
}

.map-legend .dot.high {
    background: var(--red);
}

.map-legend .dot.medium {
    background: var(--amber);
}

.map-legend .dot.low {
    background: var(--green);
}

.map-legend .dot.unknown {
    background: #64748b;
}

.map-legend .halo {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(244, 216, 138, 0.8);
    background: rgba(244, 216, 138, 0.16);
    flex: 0 0 auto;
}

.map-canvas.basemap-terrain {
    background:
        linear-gradient(rgba(87, 83, 70, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(87, 83, 70, 0.08) 1px, transparent 1px),
        linear-gradient(145deg, #dfead4, #f3e5bb 46%, #bad1c5);
}

.map-canvas.basemap-satellite {
    background:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(145deg, #1f3b2f, #536b3f 48%, #213d57);
}

.map-canvas.basemap-muted {
    background:
        linear-gradient(rgba(100, 116, 139, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 116, 139, 0.08) 1px, transparent 1px),
        linear-gradient(145deg, #eef2f4, #f6f3ec 46%, #e1e8eb);
}

.water-band {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background:
        repeating-linear-gradient(135deg, rgba(36, 116, 185, 0.28) 0 12px, rgba(36, 116, 185, 0.18) 12px 24px),
        rgba(36, 116, 185, 0.22);
    border-top: 2px solid rgba(30, 98, 150, 0.36);
    pointer-events: none;
}

.map-canvas:not(.real-map)::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 24% 32%, rgba(31, 122, 77, 0.16), transparent 23%),
        radial-gradient(circle at 74% 58%, rgba(34, 102, 165, 0.14), transparent 26%);
    pointer-events: none;
}

.pin {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--green);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
    transform: translate(-50%, -50%);
    z-index: 2;
}

.pin.climate-high {
    background: var(--red);
}

.pin.climate-high::before,
.pin.climate-medium::before {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.38;
}

.pin.climate-high::before {
    color: var(--red);
}

.pin.climate-medium {
    background: var(--amber);
}

.pin.climate-medium::before {
    color: var(--amber);
}

.pin.climate-low {
    background: var(--green);
}

.pin.climate-unknown {
    background: #64748b;
}

.pin.approximate,
.pin.city_only,
.pin.region_only {
    background: var(--amber);
}

.pin.region_only {
    opacity: 0.62;
}

.pin.hidden {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: #33332d;
}

.pin.hidden::after {
    content: "";
    width: 8px;
    height: 5px;
    border: 2px solid #fff;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    position: absolute;
    left: 5px;
    top: 3px;
}

.pin.unknown {
    background: #64748b;
    opacity: 0.5;
}

.pin.climate-high {
    background: var(--red);
}

.pin.climate-medium {
    background: var(--amber);
}

.pin.climate-low {
    background: var(--green);
}

.pin.climate-unknown {
    background: #64748b;
}

.pin.hidden {
    background: #33332d;
}

.map-card {
    display: grid;
    gap: 10px;
}

.climate-summary {
    border: 1px solid var(--line);
    border-left: 5px solid #64748b;
    border-radius: 7px;
    padding: 10px;
    background: #f8fafc;
    display: grid;
    gap: 3px;
}

.climate-summary strong {
    font-size: 14px;
}

.climate-summary span {
    color: var(--muted);
}

.climate-summary.climate-high {
    border-left-color: var(--red);
    background: #fff5f3;
}

.climate-summary.climate-medium {
    border-left-color: var(--amber);
    background: #fff8e6;
}

.climate-summary.climate-low {
    border-left-color: var(--green);
    background: #eff8f1;
}

.compare-table {
    min-width: 760px;
}

.compare-table th:first-child,
.compare-table td:first-child {
    min-width: 180px;
    color: var(--muted);
    font-weight: 800;
}

.print-view {
    background: #fff;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #25251f;
    color: #fff;
    border-radius: 7px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 22px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 16, 0.62);
    backdrop-filter: blur(4px);
}

.modal-card,
.property-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    max-height: calc(100vh - 44px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

.login-modal-card {
    padding: 28px;
    display: grid;
    gap: 12px;
    text-align: center;
}

.login-modal-card h2 {
    margin: 0;
    font-size: 24px;
}

.login-modal-card p {
    margin: 0;
    color: var(--muted);
}

.modal-close.icon-only {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 999px;
    z-index: 2;
}

.modal-icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    color: var(--green);
    background: var(--green-soft);
}

.modal-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.modal-loader {
    width: 34px;
    height: 34px;
    margin: 4px auto;
    border-radius: 999px;
    border: 3px solid #d9eadf;
    border-top-color: var(--green);
    animation: spin 1s linear infinite;
}

.modal-error {
    margin: 0;
    color: var(--red);
    font-weight: 800;
}

.property-modal-card {
    width: min(100%, 1040px);
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.15fr);
}

.property-modal-hero {
    position: sticky;
    top: 0;
    min-height: 100%;
    background: #20231f;
}

.property-modal-hero img,
.property-modal-placeholder {
    width: 100%;
    height: 100%;
    min-height: 520px;
    display: block;
    object-fit: cover;
}

.property-modal-placeholder {
    display: grid;
    place-items: center;
    color: #f8f5ed;
    background:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(145deg, #1f3b2f, #536b3f 48%, #213d57);
    background-size: 42px 42px, 42px 42px, cover;
    font-weight: 800;
}

.property-modal-hero-caption {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 7px;
    padding: 8px 10px;
    background: rgba(20, 20, 16, 0.72);
    color: #f8f5ed;
    font-size: 12px;
    font-weight: 700;
}

.property-modal-body {
    padding: 26px;
    display: grid;
    gap: 16px;
}

.property-modal-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.property-modal-title-row h2 {
    margin: 0 0 4px;
    font-size: 26px;
    line-height: 1.15;
}

.property-modal-title-row p {
    margin: 0;
}

.property-modal-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.property-modal-metrics strong {
    min-height: 68px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px;
    background: #f8f5ed;
    display: grid;
    align-content: center;
    gap: 2px;
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

.property-modal-metrics span {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.property-modal-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.property-modal-body h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.property-modal-body ul {
    margin: 0;
    padding-left: 18px;
}

.property-modal-body li + li {
    margin-top: 5px;
}

.risk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.risk-chip {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    background: #f8f5ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.risk-chip strong {
    font-size: 12px;
}

.risk-chip em {
    font-size: 12px;
    font-style: normal;
    font-weight: 850;
}

.risk-high {
    border-color: #fecaca;
    background: #fff1f0;
    color: var(--red);
}

.risk-medium {
    border-color: #fde68a;
    background: #fff8e6;
    color: #92400e;
}

.risk-low {
    border-color: #bbf7d0;
    background: #eff8f1;
    color: #166534;
}

.source-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    color: var(--text);
}

.inline-check input {
    width: 16px;
    min-height: 16px;
}

@media (max-width: 1120px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-grid,
    .grid.four,
    .grid.three,
    .toolbar,
    .toolbar.compact,
    .climate-controls,
    .detail-grid,
    .map-layout,
    .explore-main,
    .property-strip,
    .public-header {
        grid-template-columns: 1fr;
    }

    .public-nav,
    .account-actions,
    .property-strip-metrics {
        justify-content: flex-start;
    }

    .property-modal-card {
        grid-template-columns: 1fr;
    }

    .property-modal-hero {
        position: relative;
    }

    .property-modal-hero img,
    .property-modal-placeholder {
        min-height: 300px;
        max-height: 360px;
    }

    .topbar {
        position: relative;
    }
}

@media (max-width: 760px) {
    .content,
    .topbar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid.two,
    .form-grid,
    .section-field-grid,
    .score-grid,
    .mini-row-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .wide,
    .form-grid .full,
    .mini-row-grid .wide,
    .mini-row-grid .full {
        grid-column: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal {
        padding: 10px;
    }

    .property-modal-body {
        padding: 18px;
    }

    .property-modal-title-row,
    .property-modal-columns,
    .property-modal-metrics,
    .risk-grid {
        grid-template-columns: 1fr;
    }

    .property-modal-title-row {
        display: grid;
    }
}

@media print {
    .sidebar,
    .topbar,
    .button-row,
    .row-actions,
    .toolbar {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .content {
        padding: 0;
    }

    .panel,
    .table-wrap {
        box-shadow: none;
        border-color: #ccc;
        break-inside: avoid;
    }
}
