:root {
  --ink: #171714;
  --ink-soft: #282824;
  --paper: #f4f1ea;
  --paper-2: #ebe7de;
  --card: #faf8f3;
  --white: #fffdf8;
  --muted: #706e67;
  --line: rgba(23, 23, 20, 0.14);
  --orange: #ff6846;
  --orange-soft: #ffe0d7;
  --lime: #d8ed59;
  --blue: #95bdff;
  --lavender: #c6b7ff;
  --green: #8fc7a2;
  --yellow: #f5d66b;
  --red: #e5674f;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--orange); text-underline-offset: 2px; }
a:hover { color: var(--orange); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--paper-2); padding: 0 4px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
.muted { color: var(--muted); }

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--ink); color: var(--white);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--orange); color: var(--ink); font-family: var(--mono); font-weight: 500; font-size: 0.8rem;
}
.header-date { display: flex; align-items: center; gap: 0.35rem; font-family: var(--mono); font-size: 1.1rem; }
.header-date i { width: 18px; height: 2px; background: var(--orange); }
.header-date small { font-size: 0.7rem; color: #bbb; margin-left: 0.3rem; }
.site-header nav { margin-left: auto; display: flex; gap: 1rem; flex-wrap: wrap; }
.site-header nav a { color: #ddd; text-decoration: none; font-size: 0.9rem; }
.site-header nav a:hover { color: var(--orange); }

main { max-width: 1240px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
section { margin-bottom: 3.5rem; }
.section-head { max-width: 900px; margin-bottom: 1.25rem; }
.section-head p { color: var(--ink-soft); margin: 0; }

.hero .eyebrow { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--orange); margin: 0 0 0.6rem; }
.hero .lede { font-size: 1.15rem; max-width: 800px; color: var(--ink-soft); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; }
.kpi strong { display: block; font-family: var(--mono); font-size: 1.7rem; font-weight: 500; }
.kpi span { color: var(--muted); font-size: 0.85rem; }

.verdict { background: var(--ink); color: var(--paper); border-radius: 18px; padding: 2rem; }
.verdict h2 { color: var(--lime); }
.verdict p { font-size: 1.05rem; }
.verdict strong { color: var(--white); }
.options { padding-left: 1.2rem; margin: 1rem 0 0; }
.options li { margin-bottom: 0.5rem; }
.options strong { color: var(--orange); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.mini-map { height: 180px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin: -0.25rem 0 0.4rem; background: var(--paper-2); }
.overview-map { height: 560px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; background: var(--paper-2); }
.leaflet-container { font-family: var(--sans); }
.leaflet-popup-content { font-size: 0.85rem; line-height: 1.45; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--ink); }
.pin-label { background: var(--ink); color: var(--white); border: 0; border-radius: 6px; font-weight: 600; font-size: 0.75rem; padding: 2px 8px; box-shadow: none; }
.pin-label::before { border-top-color: var(--ink); }
.card-head { display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: start; margin-bottom: 0.4rem; }
.card-head h3 { margin: 0; }
.card-head .muted { margin: 0.15rem 0 0; font-size: 0.85rem; }
.rank-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--orange); color: var(--ink); font-family: var(--mono); font-weight: 500; }
.price { text-align: right; font-family: var(--mono); line-height: 1.2; }
.price strong { display: block; font-size: 1.3rem; font-weight: 500; }
.price b { display: block; font-size: 1rem; font-weight: 500; margin-top: 0.3rem; color: var(--red); }
.price span { display: block; font-size: 0.7rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 0.6rem; margin: 0; font-size: 0.92rem; }
.kv > span:first-child { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-top: 0.2rem; }
.contact { margin-top: 0.4rem; padding: 0.7rem 0.9rem; background: var(--orange-soft); border-radius: 10px; font-size: 0.9rem; }
.contact em { color: var(--muted); }

.scorebar { display: flex; align-items: center; height: 14px; width: 100%; min-width: 120px; background: var(--paper-2); border-radius: 7px; overflow: hidden; position: relative; }
.scorebar .seg { display: block; height: 100%; }
.scorebar span { position: absolute; right: 6px; top: -1px; font-family: var(--mono); font-size: 0.7rem; color: var(--ink); }
.seg-budget { background: var(--green); }
.seg-location { background: var(--blue); }
.seg-private { background: var(--lavender); }
.seg-workspace { background: var(--orange); }
.seg-quality { background: var(--yellow); }
.seg-capacity { background: #c9c4b8; }
.seg-safety { background: #9be1d6; }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; font-family: var(--mono); font-size: 0.72rem; }
.legend .lg { padding: 2px 8px; border-radius: 6px; color: var(--ink); }
.lg-budget { background: var(--green); } .lg-location { background: var(--blue); } .lg-private { background: var(--lavender); }
.lg-workspace { background: var(--orange); } .lg-quality { background: var(--yellow); } .lg-capacity { background: #c9c4b8; } .lg-safety { background: #9be1d6; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.65rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--paper-2); }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 0.85rem; white-space: nowrap; }
#rank-table tbody tr:not(.detail) { cursor: pointer; }
#rank-table tbody tr:not(.detail):hover { background: var(--white); }
tr.fits td:first-child { box-shadow: inset 4px 0 0 var(--green); }
td.ok { color: #2e7d4f; font-weight: 500; }
td.near { color: #a06a00; }
td.over { color: var(--red); }
.flag { color: var(--red); font-family: var(--mono); font-size: 0.7rem; }
.links { font-size: 0.8rem; white-space: nowrap; }
.links a { color: var(--muted); text-decoration-color: var(--line); }
.links a:hover { color: var(--orange); }
.card h3 a, td strong a { text-decoration: none; }
.card h3 a:hover, td strong a:hover { text-decoration: underline; }
tr.detail { display: none; background: var(--white); }
tr.detail.open { display: table-row; }
tr.detail td { padding: 0.8rem 1.2rem 1rem 3.2rem; }
tr.detail .kv { margin-bottom: 0.35rem; }

.tier-grid, .airbnb-grid, .method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.tier, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; }
.tier-price { font-family: var(--mono); color: var(--orange); margin: 0 0 0.5rem; }
.tier p:last-child, .panel p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.listing-list { margin: 0.8rem 0 0; padding-left: 1.1rem; font-size: 0.92rem; }
.listing-list li { margin-bottom: 0.5rem; }
.listing-list small { display: block; color: var(--muted); }
.method-grid ul { padding-left: 1.1rem; margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.method-grid li { margin-bottom: 0.4rem; }

.site-footer { border-top: 1px solid var(--line); padding: 1.2rem 1.5rem; font-size: 0.8rem; color: var(--muted); text-align: center; }

@media (max-width: 720px) {
  .site-header { gap: 0.8rem; padding: 0.6rem 1rem; }
  .header-date { display: none; }
  main { padding: 1.5rem 1rem 3rem; }
  .verdict { padding: 1.4rem; }
  .card-head { grid-template-columns: auto 1fr; }
  .price { grid-column: 1 / -1; text-align: left; }
  .kv { grid-template-columns: 1fr; gap: 0.1rem; }
  .overview-map { height: 420px; }
}
