:root {
  --ink: #17212f;
  --muted: #667085;
  --line: #d8e0ea;
  --blue: #1652b8;
  --teal: #0f766e;
  --green: #0b7a48;
  --amber: #9a5b00;
  --red: #b42318;
  --panel: #ffffff;
  --soft: #f5f8fc;
  --soft-blue: #ecf3ff;
  --shadow: 0 12px 30px rgba(15, 23, 42, .10);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: #f3f7fb; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 24px; }
h1 { margin: 0; font-size: 23px; letter-spacing: 0; }
h2, h3 { letter-spacing: 0; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
button, .official { border: 0; border-radius: 7px; height: 38px; padding: 0 13px; background: var(--blue); color: #fff; font-weight: 750; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.ghost { background: #eef3fb; color: #24405f; }
.icon-settings { width: 40px; padding: 0; }
.icon-settings svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
main { max-width: 1560px; margin: 0 auto; padding: 18px 24px 38px; }
.search-panel { position: relative; padding-left: 22px; transition: margin .25s ease; overflow: visible; }
.search-panel.collapsed .filters { display: none; }
.filter-toggle { position: absolute; left: 0; top: 12px; z-index: 10; width: 30px; height: 52px; padding: 0; border-radius: 8px 0 0 8px; background: #dbe8f7; color: #214160; box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.filter-toggle span { font-size: 27px; line-height: 1; }
.search-panel.collapsed { margin-bottom: 4px; }
.search-panel.collapsed .filter-toggle { position: relative; top: auto; left: auto; border-radius: 8px; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; box-shadow: 0 4px 16px rgba(15,23,42,.04); }
.field { min-width: 0; }
.wide { grid-column: span 2; }
.full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
input, select { width: 100%; height: 38px; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: #fff; color: var(--ink); }
.checkrow { display: flex; gap: 8px; flex-wrap: wrap; }
.checkrow label { margin: 0; border: 1px solid var(--line); background: #fff; border-radius: 999px; height: 34px; padding: 0 10px; display: flex; align-items: center; gap: 7px; font-size: 13px; }
.checkrow input { width: 14px; height: 14px; }
.tagbox { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 38px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 4px 7px; }
.tagbox input { flex: 1; border: 0; height: 28px; padding: 0; min-width: 120px; outline: 0; }
.tag-actions { display: inline-flex; align-items: center; gap: 4px; }
.tag-actions button { height: 24px; padding: 0 7px; border-radius: 999px; background: #f0f4f9; color: #365572; font-size: 11px; font-weight: 800; }
.tag { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; background: var(--soft-blue); color: #174ea6; padding: 5px 8px; font-size: 12px; font-weight: 750; }
.tag.muted { background: #eef2f7; color: #475467; }
.tag button { width: 18px; height: 18px; padding: 0; border-radius: 50%; background: #d9e7ff; color: #174ea6; }
.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 50; border: 1px solid var(--line); background: #fff; border-radius: 8px; box-shadow: var(--shadow); max-height: 210px; overflow: auto; padding: 6px; }
.suggestions button { display: flex; width: 100%; gap: 8px; text-align: left; background: #fff; color: var(--ink); height: 32px; justify-content: flex-start; padding: 0 8px; font-weight: 650; }
.suggestions button span { width: 58px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.suggestions button.selected { background: #f4f8ff; color: #174ea6; }
.suggestions button:hover { background: var(--soft); }
.actions { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: #e8eef6; color: #35506e; font-size: 11px; cursor: help; }
.help[data-help]:hover:after, .help[data-help]:focus:after { content: attr(data-help); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); z-index: 80; width: min(320px, 76vw); padding: 10px 11px; border-radius: 8px; background: #17212f; color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; box-shadow: var(--shadow); }
.help[data-help]:hover:before, .help[data-help]:focus:before { content: ""; position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); border: 6px solid transparent; border-bottom-color: #17212f; z-index: 81; }
.summary { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin: 18px 0 12px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: stretch; }
.card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; min-height: 330px; display: flex; flex-direction: column; box-shadow: 0 4px 14px rgba(15,23,42,.06); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.card:hover, .card.active { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(22,82,184,.5); }
.hero { position: relative; height: 160px; overflow: hidden; background: #d9e3ef; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero:after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.72)); }
.heroText { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 13px; color: #fff; }
.closing { font-size: 12px; opacity: .9; margin-bottom: 5px; }
.name { font-size: 18px; font-weight: 800; line-height: 1.12; }
.area { font-size: 12px; opacity: .86; margin-top: 5px; }
.cardbody { padding: 13px 14px 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.statline { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge { border-radius: 999px; background: #eef2f7; color: #344054; padding: 4px 8px; font-size: 12px; font-weight: 750; }
.badge.rental { background: #e8f0fe; color: #174ea6; }
.badge.owner { background: #fef7e0; color: #8a5a00; }
.badge.likely, .badge.better { background: #e6f4ea; color: var(--green); }
.badge.unknown, .badge.medium { background: #fff4d6; color: var(--amber); }
.badge.unlikely, .badge.lower { background: #fee4e2; color: var(--red); }
.route { width: 21px; height: 21px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 850; }
.route.yellow { color: #111827; }
.hovermore { margin-top: auto; color: var(--muted); font-size: 12px; opacity: 0; transition: opacity .16s ease; }
.card:hover .hovermore { opacity: 1; }
.detail { margin-top: 20px; scroll-margin-top: 96px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.detail[hidden] { display: none; }
.detail-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin: 0; font-size: 28px; line-height: 1.1; }
.detail-grid { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(500px, 1.25fr); gap: 20px; padding: 20px 22px 24px; }
.gallery-main { height: 320px; border-radius: 10px; overflow: hidden; background: #dbe5ef; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.thumbs button { height: 70px; padding: 0; border-radius: 8px; overflow: hidden; background: #eef3fb; border: 2px solid transparent; }
.thumbs button.active { border-color: var(--blue); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.metric { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fbfdff; }
.metric b { display: block; font-size: 17px; }
.metric span { color: var(--muted); font-size: 11px; }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.map-tools button { background: #eef3fb; color: #24405f; height: 32px; padding: 0 10px; }
.map-tools button.active { background: var(--blue); color: #fff; }
.google-map { width: 100%; height: 360px; border: 0; border-radius: 10px; background: #e6edf5; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.panel { border-top: 1px solid var(--line); padding: 14px 0; }
.panel h3 { margin: 0 0 9px; font-size: 16px; }
.rowitem { padding: 8px 0; border-top: 1px solid #edf1f6; font-size: 13px; }
.rowitem:first-child { border-top: 0; }
.score-bars { display: grid; gap: 9px; }
.barrow { display: grid; grid-template-columns: 86px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; }
.bar { height: 8px; border-radius: 999px; background: #e7edf5; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); }
.source-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.source-links a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; color: #24405f; text-decoration: none; font-size: 12px; font-weight: 750; background: #fbfdff; }
.requirements-section { padding: 0 22px 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 2px; }
.section-head h3 { margin: 0 0 4px; font-size: 20px; }
.section-head a { color: var(--blue); font-weight: 800; text-decoration: none; }
.requirements-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.requirements-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; }
.requirements-table th, .requirements-table td { border-bottom: 1px solid #dfe6ef; border-right: 1px solid #dfe6ef; padding: 12px 10px; text-align: left; vertical-align: top; }
.requirements-table th { background: #f8fafc; color: #182536; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
.requirements-table td:nth-child(2), .requirements-table td:nth-child(5) { background: #dce9fb; }
.requirements-table tr:nth-child(odd) td { background-color: #f6f9fe; }
.requirements-table tr:nth-child(odd) td:nth-child(2), .requirements-table tr:nth-child(odd) td:nth-child(5) { background: #cfe0f7; }
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.45); display: grid; place-items: center; padding: 20px; }
.settings { width: min(560px, 100%); background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 12px; }
.settings-head { display: flex; justify-content: space-between; align-items: center; }
.settings h2 { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.iconbtn { width: 34px; padding: 0; background: #eef3fb; color: #24405f; }
.empty { color: var(--muted); padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
@media (max-width: 1220px) { .cards { grid-template-columns: repeat(3, minmax(220px, 1fr)); } .detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr; } .wide, .full { grid-column: auto; } .cards { grid-template-columns: repeat(2, minmax(220px, 1fr)); } .columns, .metrics { grid-template-columns: 1fr 1fr; } .topbar { align-items: flex-start; flex-direction: column; } }
@media (max-width: 620px) { main { padding: 12px; } .cards, .columns, .metrics, .settings-grid { grid-template-columns: 1fr; } .actions { align-items: stretch; flex-direction: column; } .gallery-main { height: 230px; } .detail-head { flex-direction: column; } }
