@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/work-sans-latin.woff2?v=28c54eed') format('woff2');
}

/* White, black type, light green accents. */
:root {
  --bg: #fff;
  --text: #000;
  --muted: #000;
  --green: #b9f6ca;
  --green-soft: #ecfdf1;
  --green-strong: #10893e;
  --line: #000;
  --border: #dedede;
  --alert: #ffe1e1;
  font-family: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1.5px solid var(--line); background: var(--bg); border-radius: 6px; padding: 0.4rem 0.8rem; }
button:disabled { cursor: default; opacity: 0.6; }
button.link { border: 0; background: none; text-decoration: underline; padding: 0.4rem; }
a { color: var(--text); text-decoration-color: var(--green-strong); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.muted { color: var(--muted); opacity: 0.75; }
:focus-visible { outline: 3px solid var(--green-strong); outline-offset: 2px; }
.logo { display: inline-block; width: 1em; height: 1em; margin-right: 0.35em; vertical-align: -0.12em; background: currentColor; mask: url('/building.svg?v=28c54eed') center / contain no-repeat; }

.topbar { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1rem; background: var(--bg); border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; white-space: nowrap; }
.topbar h1 .logo { color: var(--green-strong); }
.brand { text-decoration: none; }
.brand:hover { text-decoration: underline; text-decoration-color: var(--green-strong); }
.topbar form { margin: 0; }
.spacer { flex: 1; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1rem; align-items: center; background: var(--green-soft); border-bottom: 1px solid var(--border); }
.filters input, .filters select { padding: 0.4rem 0.5rem; border: 1px solid #bdbdbd; border-radius: 6px; background: var(--bg); }
.filters input[type='number'] { width: 9.5rem; }
.filters input[type='search'] { flex: 1 1 14rem; }
.check { display: inline-flex; gap: 0.3rem; align-items: center; }
.check input, .chip input { accent-color: var(--green-strong); }
.districts { flex-basis: 100%; }
.districts summary { font-size: 0.9rem; font-weight: 700; cursor: pointer; padding: 0.25rem 0; width: fit-content; }
.districts[open] summary { margin-bottom: 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.55rem; margin: 0 0.25rem 0.25rem 0; border: 1px solid #bdbdbd; border-radius: 999px; background: var(--bg); font-size: 0.85rem; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--line); background: var(--green); font-weight: 600; }
.chip input { margin: 0; }

#summary { padding: 0 1rem; margin: 0.75rem 0 0.25rem; font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.6rem; padding: 1rem; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.75rem 0.9rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); text-align: left; }
.kpi strong { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.kpi span { font-size: 0.85rem; font-weight: 600; }
.kpi:hover { background: var(--green-soft); }
.kpi[aria-pressed='true'] { background: var(--green); box-shadow: inset 0 0 0 1.5px var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; padding: 0.5rem 1rem 1rem; }

.card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.card:hover { border-color: var(--line); }
/* Projects: two offset sheets behind the card read as a stack. */
.card.stack { margin: 0 12px 12px 0; box-shadow: 6px 6px 0 -1px var(--bg), 6px 6px 0 0 #9e9e9e, 12px 12px 0 -1px var(--bg), 12px 12px 0 0 #c4c4c4; }
.card.stack:hover { box-shadow: 6px 6px 0 -1px var(--bg), 6px 6px 0 0 var(--line), 12px 12px 0 -1px var(--bg), 12px 12px 0 0 var(--line); }
.card.stack .count { background: var(--green); border: 1px solid var(--line); }
.addresses { margin: 0; padding-left: 1.1rem; }
.detail .units { padding: 0; }
.detail h2 { margin: 0.5rem 0 0; font-size: 1.2rem; font-weight: 800; }
.more-units summary { font-weight: 700; cursor: pointer; margin: 0.5rem 0; }
.cover { text-decoration: none; position: relative; padding: 0; border: 0; border-radius: 0; aspect-ratio: 3 / 2; background: #f2f2f2; display: block; width: 100%; overflow: hidden; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mosaic { position: absolute; inset: 0; display: grid; gap: 2px; background: var(--bg); }
.mosaic.m2 { grid-template-columns: 1fr 1fr; }
.mosaic.m3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.m3 > :first-child { grid-row: span 2; }
.mosaic.m4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.cover .mosaic img { position: static; min-height: 0; }
.mosaic .noimg { gap: 0; }
.mosaic .noimg span { display: none; }
.mosaic .noimg::before { width: 1.5rem; height: 1.5rem; }
.cover .count { position: absolute; right: 0.5rem; bottom: 0.5rem; background: var(--bg); font-size: 0.8rem; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 4px; }
.cover .new { position: absolute; left: 0.5rem; top: 0.5rem; }
/* Missing or broken photos: soft striped panel with the building icon, no extra image file. */
.noimg { display: grid; place-items: center; align-content: center; gap: 0.5rem; height: 100%; background: repeating-linear-gradient(135deg, var(--green-soft) 0 14px, #f7fdf9 14px 28px); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; }
.noimg::before { content: ''; width: 2.6rem; height: 2.6rem; background: var(--green-strong); opacity: 0.45; mask: url('/building.svg?v=28c54eed') center / contain no-repeat; }
.body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.body h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.body h2 a { text-decoration: none; }
.body h2 a:hover { text-decoration: underline; text-decoration-color: var(--green-strong); }
.body p { margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.badge { font-size: 0.75rem; font-weight: 500; padding: 0.1rem 0.45rem; border-radius: 4px; background: #f0f0f0; }
.badge.new { background: var(--green); font-weight: 700; border: 1px solid var(--line); }
.status-available { background: var(--green-soft); border: 1px solid var(--green); }
.status-under-construction, .status-planned { background: #f0f0f0; }
.badge.removed { background: var(--alert); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin: 0.25rem 0; }
.fact { display: flex; flex-direction: column; font-size: 0.85rem; }
.fact strong { font-weight: 700; }
.links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; font-size: 0.9rem; }
.btn { display: inline-block; padding: 0.35rem 0.8rem; border-radius: 6px; background: var(--green); border: 1.5px solid var(--line); color: var(--text); text-decoration: none; font-size: 0.85rem; font-weight: 700; }
.btn:hover { background: var(--green-strong); }
.provider { font-weight: 700; }

.sources { margin: 1rem; }
.sources summary { font-weight: 600; cursor: pointer; }
.sources table { border-collapse: collapse; margin-top: 0.5rem; font-size: 0.9rem; }
.sources th, .sources td { text-align: left; padding: 0.25rem 0.75rem 0.25rem 0; border-bottom: 1px solid var(--border); }
.sources tr.error td { background: var(--alert); }

.detail { max-width: 1000px; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.detail h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.detail p { margin: 0; }
.detail > .facts { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); background: var(--green-soft); border: 1px solid var(--green); border-radius: 10px; padding: 0.75rem; }
.detail > .facts .fact { font-size: 1rem; }
.back { font-weight: 600; }
.banner { background: var(--alert); border-radius: 8px; padding: 0.6rem 0.8rem; font-weight: 500; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; }
.gallery button { position: relative; padding: 0; border: 0; aspect-ratio: 4 / 3; overflow: hidden; background: #f2f2f2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.description { white-space: pre-line; line-height: 1.55; }
.dates { font-size: 0.85rem; padding-left: 1.1rem; margin: 0; }

.lightbox { position: fixed; inset: 0; background: rgb(0 0 0 / 0.92); display: grid; place-items: center; z-index: 50; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lb-close, .lb-nav { position: absolute; background: rgb(255 255 255 / 0.15); color: #fff; border: 0; font-size: 2rem; line-height: 1; padding: 0.3rem 0.8rem; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; }
.lb-next { right: 1rem; top: 50%; }
.lb-count { position: absolute; bottom: 1rem; color: #fff; }

/* Login: full-screen, magazine-cover style. */
.login-page { display: grid; grid-template-columns: 1.7fr 1fr; min-height: 100vh; min-height: 100dvh; }
.login-brand { container-type: inline-size; background: var(--green); padding: clamp(2rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; border-right: 2px solid var(--line); }
/* Sized to the panel width (cqi) so the name always fits on one line. */
.wordmark { margin: 0; font-size: 10.6cqi; font-weight: 900; line-height: 0.9; letter-spacing: -0.055em; white-space: nowrap; }
.wordmark .logo { width: 0.78em; height: 0.78em; margin-right: 0.14em; vertical-align: -0.04em; }
.tagline { margin: 0; max-width: 28rem; font-size: clamp(1.1rem, 1.8vw, 1.5rem); font-weight: 500; line-height: 1.3; }
.login-form { display: flex; flex-direction: column; justify-content: center; gap: 0.75rem; padding: clamp(2rem, 6vw, 5rem); max-width: 34rem; width: 100%; justify-self: center; }
.login-form h2 { margin: 0 0 1rem; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; }
.login-form label { font-weight: 700; }
.login-form input { padding: 0.9rem 1rem; border: 2px solid var(--line); border-radius: 8px; font-size: 1.1rem; }
.login-form button { margin-top: 0.5rem; padding: 0.9rem 1rem; border: 2px solid var(--line); border-radius: 8px; background: var(--text); color: var(--bg); font-size: 1.1rem; font-weight: 700; }
.login-form button:hover:not(:disabled) { background: var(--green-strong); color: var(--text); }
/* While the bot check runs: label hidden, spinner centred in the button. */
.login-form button.busy { position: relative; color: transparent; opacity: 1; }
.login-form button.busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 1.3rem; height: 1.3rem; border: 3px solid rgb(255 255 255 / 0.35); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Same spinner as the sign-in button, for the whole page or single sections (images, lightbox). */
.spinner { display: inline-block; width: 1.6rem; height: 1.6rem; border: 3px solid rgb(0 0 0 / 0.1); border-top-color: var(--green-strong); border-radius: 50%; animation: spin 0.8s linear infinite; }
.spinner.large { width: 3rem; height: 3rem; border-width: 4px; }
.page-loader { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; }
.cover > .spinner, .gallery button > .spinner, .lb-spinner { position: absolute; inset: 0; margin: auto; z-index: 1; }
.lb-spinner { width: 2.5rem; height: 2.5rem; border-color: rgb(255 255 255 / 0.25); border-top-color: var(--green); }
@media (prefers-reduced-motion: reduce) { .spinner, .login-form button.busy::after { animation-duration: 2.4s; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.login-form .error { margin: 0; padding: 0.6rem 0.8rem; background: var(--alert); border-radius: 8px; font-weight: 600; }

@media (max-width: 800px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { border-right: 0; border-bottom: 2px solid var(--line); }
}

@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 0.25rem 1rem; }
  .topbar #updated { order: 1; flex-basis: 100%; font-size: 0.8rem; }
  .topbar #user { display: none; }
  .kpis { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; padding: 0.75rem; }
  .kpi { padding: 0.5rem 0.6rem; }
  .kpi strong { font-size: 1.35rem; }
  .kpi span { font-size: 0.72rem; }
  .filters input[type='number'] { width: calc(50% - 0.25rem); }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
