:root {
  color-scheme: light;
  --paper: #f6f6ef;
  --surface: #fffefa;
  --ink: #181c17;
  --muted: #54594f;
  --line: #dbddd0;
  --accent: #ddff79;
  --dark: #1e271c;
  --on-accent: #181c17;
  --on-dark: #fffefa;
  --focus: #5e7433;
  --accent-text: #576e24;
  --link: #40542b;
  --control-border: #c7cbbb;
  --hover: #ebeee1;
  --row-hover: #eef1e5;
  --image-placeholder: #e8e7db;
  --status: #e9eedc;
  --notice: #ecefdf;
  --map-ground: #e5e8dc;
  --map-water: #a4c3c5;
  --map-road: #f5f6e9;
  --map-park: #dce3ce;
  --pin: #506942;
  --field: #fff;
  --selected: #e8efda;
  --surface-muted: #f1f3e9;
  --feed-sidebar: #f5f6ee;
  --rating-star: #eeb321;
  --rating-star-edge: #865b08;
  --rating-star-idle: #6c745f;
  --segmented: #e9ece1;
  --canvas: #e8ebdf;
  --error: #98263f;
  --field-icon: #515c44;
  --radius: 16px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141813;
  --surface: #20271e;
  --ink: #eef2e9;
  --muted: #b7c1b1;
  --line: #3e4b39;
  --focus: #c4e975;
  --accent-text: #c4e975;
  --link: #c1db9c;
  --control-border: #727d6a;
  --hover: #303a2c;
  --row-hover: var(--hover);
  --image-placeholder: #2b3328;
  --status: #303f2b;
  --notice: #2d3928;
  --map-ground: #252e26;
  --map-water: #29434a;
  --map-road: #3b4538;
  --map-park: #2c382a;
  --pin: #a9c491;
  --field: #1a2018;
  --selected: #36452c;
  --surface-muted: #1b231a;
  --feed-sidebar: var(--surface-muted);
  --rating-star: #ffd451;
  --rating-star-edge: #ffd451;
  --rating-star-idle: #a4ae9a;
  --segmented: #293227;
  --canvas: #293227;
  --error: #ff9bad;
  --field-icon: #b7c4ae;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { line-height: 1.06; letter-spacing: -.04em; overflow-wrap: anywhere; }
.container { width: min(1250px, calc(100% - 80px)); margin-inline: auto; }
.main { flex: 1 0 auto; padding-block: 28px 68px; }

.site-header { position: sticky; top: 0; z-index: 1001; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 74px; display: grid; grid-template-columns: auto auto minmax(120px, 1fr) auto; align-items: center; gap: clamp(12px, 2vw, 28px); }
.header-inner nav { display: flex; align-items: center; gap: clamp(15px, 4vw, 40px); margin-inline: auto; }
.header-inner nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.header-inner nav a:hover, .header-inner nav a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: .35em; }
.header-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.header-search { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-search input { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.header-account { display: block; border-radius: 50%; text-decoration: none; }
.header-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.header-avatar.avatar-placeholder { font-size: 1rem; }
.account-logout { margin-top: 12px; }
#projects, #comments, #rating { scroll-margin-top: 90px; }
.theme-picker { position: relative; }
.theme-picker[open] { z-index: 2; }
.theme-toggle.button { display: flex; width: 38px; height: 38px; padding: 0; cursor: pointer; list-style: none; }
.theme-toggle::-webkit-details-marker { display: none; }
.theme-icon { display: block; width: 18px; height: 18px; background: currentColor; mask: var(--theme-icon) center / contain no-repeat; }
.theme-toggle .theme-icon { width: 26px; height: 26px; flex: none; }
.theme-icon-light { --theme-icon: url("../icons/sun.svg"); }
.theme-icon-dark { --theme-icon: url("../icons/moon.svg"); }
.theme-icon-system { --theme-icon: url("../icons/eclipse.svg"); }
.theme-options {
  position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0;
  min-inline-size: max-content; margin: 0; padding: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  box-shadow: 0 6px 20px rgb(0 0 0 / 15%);
}
.theme-option {
  display: grid; grid-template-columns: 18px 1fr 16px; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 5px; cursor: pointer; font-size: .875rem;
}
.theme-option:hover, .theme-option:has(:checked) { background: var(--hover); }
.theme-option:has(:focus-visible), .theme-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-check { visibility: hidden; color: var(--accent-text); font-weight: 800; }
.theme-option :checked ~ .theme-check { visibility: visible; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 800; letter-spacing: -.065em; text-decoration: none; line-height: 1; white-space: nowrap; }
.brand-mark { flex: none; height: auto; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { min-height: 80px; padding-block: 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: .875rem; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 19px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-weight: 680; color: var(--ink); text-align: center; line-height: 1.25; }
.button.compact { min-height: 38px; padding: 7px 13px; font-size: .875rem; }
.button.lime { color: var(--on-accent); background: var(--accent); border-color: #bed859; }
.button.lime:hover:not(:disabled) { background: #c9ef5b; }
.button.outline { border-color: var(--control-border); background: transparent; }
.button.outline:hover:not(:disabled) { background: var(--hover); }

.hero { display: grid; grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr); min-height: 490px; background: var(--dark); border-radius: 18px; overflow: hidden; color: var(--on-dark); }
.hero-copy { padding: clamp(28px, 5vw, 70px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.location { display: flex; align-items: center; gap: 9px; color: #e1e8d8; font-weight: 650; font-size: .875rem; margin-bottom: 22px; }
.location span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: clamp(3rem, 6.5vw, 6.65rem); line-height: .94; font-weight: 760; letter-spacing: -.085em; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-description { color: #e1e8d8; font-size: clamp(1rem, 1.4vw, 1.15rem); max-width: 31ch; margin: 26px 0; }
.hero-image { min-height: 100%; position: relative; overflow: hidden; }
.hero-image img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: 52% 49%; }

.section { margin-top: 48px; scroll-margin: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.section-heading h2 { font-size: clamp(1.8rem, 3.5vw, 3rem); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project-card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.project-card a { height: 100%; display: flex; flex-direction: column; text-decoration: none; }
.project-card a:focus-visible { outline-offset: -4px; }
.project-card a:hover h3 { text-decoration: underline; text-underline-offset: .17em; }
.project-card img { width: 100%; aspect-ratio: 1.65; object-fit: cover; background: var(--image-placeholder); }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 9px; padding: 18px; }
.card-body h3 { font-size: 1.52rem; }
.card-body p { color: var(--muted); }
.card-body .card-location { font-size: .875rem; font-weight: 650; }
.card-body .card-meta { font-size: .8125rem; margin-top: auto; padding-top: 8px; }
.empty { grid-column: 1 / -1; padding: 24px; border: 1px dashed var(--control-border); border-radius: var(--radius); color: var(--muted); }

.page-heading { display: grid; gap: 13px; justify-items: start; margin: 22px 0 24px; }
.page-heading h1, .auth-panel h1 { font-size: clamp(2rem, 5.4vw, 4.25rem); }
.page-heading > p:not(.status), .auth-panel > p { color: var(--muted); }
.back-link { font-size: .9rem; text-underline-offset: .23em; color: var(--link); font-weight: 650; overflow-wrap: anywhere; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.5vw, 26px); }
.status { font-weight: 700; background: var(--status); padding: 4px 10px; border-radius: 6px; font-size: .875rem; }
.mural-state {
  display: inline-block; width: fit-content; padding: 2px 8px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 6px;
  color: var(--state-ink); background: color-mix(in srgb, currentColor 8%, var(--surface));
  font-size: .8rem; font-weight: 650; line-height: 1.4;
}
.mural-state--idea { --state-ink: #405a9a; }
.mural-state--in_progress { --state-ink: #835015; }
.mural-state--done { --state-ink: #35623d; }
:root[data-theme="dark"] .mural-state--idea { --state-ink: #b0c5ff; }
:root[data-theme="dark"] .mural-state--in_progress { --state-ink: #f5c77d; }
:root[data-theme="dark"] .mural-state--done { --state-ink: #a7d7a7; }
.notice { margin: 0 0 20px; padding: 12px 15px; border-radius: 8px; background: var(--notice); }
.building-cover { display: block; width: min(100%, 960px); max-height: 670px; object-fit: contain; object-position: left center; border-radius: 12px; }
.project-description { margin-top: 22px; display: grid; gap: 12px; justify-items: start; max-width: 65ch; overflow-wrap: anywhere; }

body:has(.map-main) { min-height: 100dvh; height: 100dvh; }
.main.map-main {
  --map-inset: 24px;
  width: 100%;
  min-height: 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.map-main + .site-footer { display: none; }
.map-main > .notice { margin: 8px var(--map-inset); }
.map-layout { position: relative; flex: 1; min-height: 0; isolation: isolate; }
.map-panel { position: absolute; inset: 0; isolation: isolate; background: var(--map-ground); }
.city-map { height: 100%; }
.city-map.is-live { touch-action: none; }
.city-map:not(.is-live) {
  background:
    linear-gradient(36deg, transparent 60%, var(--map-water) 60% 71%, transparent 71%),
    repeating-linear-gradient(122deg, transparent 0 77px, var(--map-road) 77px 84px, transparent 84px 123px),
    repeating-linear-gradient(26deg, var(--map-park) 0 46px, var(--map-road) 46px 51px, var(--map-ground) 51px 90px);
}
.map-footer {
  position: absolute;
  z-index: 1000;
  inset-inline-start: var(--map-inset);
  inset-block-end: var(--map-inset);
  max-width: calc(100% - 2 * var(--map-inset));
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--surface);
}
.map-hint { color: var(--muted); font-size: .9rem; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .875rem; color: var(--muted); }
.map-legend label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.map-legend input { margin: 0; accent-color: var(--focus); }
.map-legend i, .map-marker { border-radius: 50%; background: #22558a; }
.map-legend i { width: 12px; height: 12px; }
.map-legend .map-legend-project, .map-marker.map-marker-project { background: #6e3692; }
.map-legend .map-legend-selected { background: #3e691d; }
.map-marker { border: 2px solid white; box-shadow: 0 1px 5px #16221a88; }
.map-marker-project::after { position: absolute; inset: 5px; border: 1px solid white; border-radius: 50%; content: ""; }
.city-map .map-project-preview {
  width: 160px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}
.city-map .map-project-preview::before { display: none; }
.map-project-preview img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 5px; background: var(--surface-muted); }
.map-project-preview span { display: block; padding: 5px 3px 1px; font-weight: 650; }
:root[data-theme="dark"] .city-map.leaflet-container { background: var(--map-ground); }
:root[data-theme="dark"] .city-map .leaflet-tile-pane { filter: invert(.94) hue-rotate(180deg) saturate(.7); }
:root[data-theme="dark"] .city-map :is(.leaflet-bar a, .leaflet-control-attribution, .leaflet-popup-content-wrapper, .leaflet-popup-tip) {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
:root[data-theme="dark"] .city-map .leaflet-bar a:hover { background: var(--hover); }
:root[data-theme="dark"] .city-map .leaflet-bar a.leaflet-disabled { color: var(--muted); background: var(--surface-muted); }
:root[data-theme="dark"] .city-map :is(.leaflet-control-attribution a, .map-popup a:where(:not(.button.lime))) { color: var(--link); }
:root[data-theme="dark"] .city-map a.leaflet-popup-close-button { color: var(--muted); }
:root[data-theme="dark"] .map-legend i { background: #7fb2e6; }
:root[data-theme="dark"] .map-legend .map-legend-project { background: #cb9be8; }
:root[data-theme="dark"] .map-legend .map-legend-selected { background: #a9ce7c; }
.map-popup { overflow-wrap: anywhere; }
.map-popup-image {
  display: block;
  width: 260px;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  margin-bottom: 8px;
  border-radius: 5px;
  background: var(--surface-muted);
}
.map-popup-title { display: block; font-size: 1rem; }
.map-popup-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 8px; }
.map-popup-actions .street-walk-link { margin-top: 0; }
.city-map .map-popup-actions .button.lime { color: var(--on-accent); }
.map-popup ul { margin: 4px 0 8px; padding-inline-start: 16px; }
.map-popup ul:last-child { margin-bottom: 0; }
.building-list {
  position: absolute;
  z-index: 1;
  inset-block-start: var(--map-inset);
  inset-inline-start: var(--map-inset);
  width: min(360px, calc(100% - 2 * var(--map-inset) - 44px));
  max-height: calc(100% - 2 * var(--map-inset));
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.address-form {
  display: flex;
  gap: 6px;
  margin: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.address-form input {
  flex: 1;
  min-width: 0;
  padding-inline: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
}
.address-form input:focus-visible { outline: none; }
.address-form:has(input:focus-visible) { outline: 1px solid var(--focus); outline-offset: 2px; }
.address-form input::placeholder { color: var(--muted); opacity: 1; }
.address-feedback { display: grid; gap: 8px; padding: 12px; }
.address-catalog { align-self: start; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.address-catalog summary { cursor: pointer; font-size: .875rem; color: var(--muted); }
.address-catalog .building-row { margin-block-start: 6px; }
.building-row { position: relative; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.building-row:hover { background: var(--row-hover); }
.pin { flex: 0 0 13px; width: 13px; height: 13px; border: 3px solid var(--pin); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.address-form-pin { align-self: center; margin-inline-start: 8px; border-color: var(--muted); }
.comment-form textarea {
  width: 100%; min-width: 0; border: 1px solid var(--control-border); border-radius: 6px;
  padding: 8px 10px; background: var(--field); color: var(--ink);
}
.address-results { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.address-results li { display: grid; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.address-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.address-actions [aria-pressed="true"] { background: var(--selected); }
.street-walk-link { margin-top: 8px; }
.map-address-result { min-width: 155px; font: inherit; }
.map-address-result p { margin: 4px 0 8px; font-weight: 650; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.profile-rating strong, .profile-rating span { color: var(--link); }
.graffiti-feed { display: grid; gap: 24px; }
.search-results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.feed-post {
  display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr); grid-template-rows: minmax(0, 1fr);
  block-size: 100%;
  background: var(--surface);
  overflow: clip;
}
.feed-main { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; min-width: 0; min-height: 0; }
.graffiti-feed .feed-post { block-size: auto; grid-template-rows: auto; border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 90px; }
#projects .feed-post, #projects .feed-sidebar, #projects .button.outline, #projects .comment-form textarea {
  border-color: color-mix(in srgb, var(--line) 65%, transparent);
}
.search-results .feed-post { block-size: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.graffiti-feed .feed-main { grid-template-rows: auto auto 1fr; }
.graffiti-feed .feed-main-home { grid-template-rows: auto auto auto 1fr; }
.graffiti-feed .feed-cover { aspect-ratio: 16 / 10; max-block-size: 65vh; border-bottom-left-radius: var(--radius); touch-action: auto; }
.graffiti-feed .feed-sidebar { overflow: visible; }
.feed-byline, .feed-caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 16px; }
.feed-main { --feed-text-gap: 8px; }
.feed-main-home .feed-byline { padding-block-end: var(--feed-text-gap); }
.feed-main-home .feed-caption { padding-block-start: var(--feed-text-gap); }
.feed-location { padding-inline: 16px; }
.feed-byline time { color: var(--muted); font-size: .875rem; text-align: right; }
.feed-author { display: inline-flex; align-items: center; justify-self: start; gap: 9px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.feed-author img, .feed-author .avatar-placeholder { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; font-size: .95rem; }
.feed-cover { position: relative; min-height: 0; overflow: clip; touch-action: pan-x pinch-zoom; user-select: none; }
.feed-cover a { display: block; height: 100%; }
.feed-cover a:focus-visible { outline-offset: -5px; }
.feed-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feed-sidebar { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--feed-sidebar); border-left: 1px solid var(--line); }
.discussion .feed-rating { margin-block-start: 24px; }
.feed-rating .rating-widget { margin: 0; }
.feed-rating + .button { margin-block-start: 16px; }
.feed-sidebar .discussion { border-left: 0; background: transparent; }
.search-results .feed-rating { padding: clamp(14px, 2vw, 22px); padding-bottom: 0; }
.search-results .feed-sidebar { overflow: visible; overscroll-behavior: auto; }
.search-results .feed-sidebar .comment-list { max-height: none; overflow: visible; overscroll-behavior: auto; }
.search-results .feed-sidebar textarea { overscroll-behavior: auto; }
.feed-title-group { display: grid; row-gap: var(--feed-text-gap); min-width: 0; }
.feed-title-group .card-location, .feed-location { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graffiti-feed .feed-title-group h3 { line-height: 1.2; overflow-wrap: anywhere; }
.feed-title-group h3 { font-size: clamp(1.15rem, 2.3vw, 1.65rem); }
.feed-title-group h3 a { text-decoration: none; }
.feed-title-group h3 a:hover { text-decoration: underline; }
.feed-title-group .card-location, .feed-location, .building-list .card-meta { color: var(--muted); font-size: .875rem; }
.feed-details { justify-self: end; white-space: nowrap; }
.graffiti-feed .feed-details { align-self: end; }
.rating-widget { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.rating-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: .875rem; }
.rating-summary strong {
  padding: 3px 9px;
  border-radius: 100px;
  color: var(--link);
  background: var(--selected);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.rating-stars { position: relative; display: inline-block; color: var(--muted); white-space: nowrap; }
.rating-stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--link); }
.rating-form {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface-muted);
}
.rating-form button {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--rating-star-idle);
  background: transparent;
  font: 24px / 1 system-ui, sans-serif;
}
.rating-form button span, .rating-form button::after { grid-area: 1 / 1; }
.rating-form .is-rated {
  color: var(--rating-star);
  -webkit-text-stroke: .65px var(--rating-star-edge);
}
@media (hover: hover) {
  .rating-form button:hover { background: var(--hover); }
  .rating-form:has(button:hover) button span { visibility: hidden; }
  .rating-form:has(button:hover) button::after {
    content: "☆" / "";
    color: var(--rating-star-idle);
    -webkit-text-stroke: 0;
  }
  .rating-form button:is(:hover, :has(~ button:hover))::after {
    content: "★" / "";
    color: var(--rating-star);
    -webkit-text-stroke: .65px var(--rating-star-edge);
  }
}
.discussion { padding: clamp(14px, 2vw, 22px); background: var(--surface-muted); border-left: 1px solid var(--line); min-width: 0; }
.discussion h3 { font-size: 1.3rem; margin-bottom: 12px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 12px; }
.feed-post .comment-list { max-height: clamp(110px, 34svh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.comment-list li { border-bottom: 1px solid var(--line); padding-bottom: 8px; overflow-wrap: anywhere; }
.comment-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; margin-bottom: 4px; }
.comment-header a { font-weight: 700; text-underline-offset: .15em; }
.comment-header time, .no-comments { color: var(--muted); font-size: .875rem; }
.comment-like, .comment-like-count { margin-top: 6px; }
.comment-like-count, .comment-like button { color: var(--muted); font-size: .875rem; }
.comment-like button { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 2px 9px; border: 0; border-radius: 100px; background: var(--surface); }
.comment-like button span { font-size: 1.15rem; line-height: 1; }
.comment-like button:hover { background: var(--hover); }
.comment-like button[aria-pressed="true"] { color: var(--error); }
.comment-like-count { display: inline-block; }
.comment-form { display: grid; gap: 7px; justify-items: start; margin-top: 14px; }
.comment-form label { font-size: .9rem; font-weight: 650; }
.comment-form textarea { resize: vertical; }
.header-search input:focus-visible, .comment-form textarea:focus-visible {
  outline-width: 1px;
  outline-offset: 2px;
}
.comment-form > .button { margin-block-start: 6px; }
.interaction-error { color: var(--error); font-size: .875rem; margin-top: 8px; }
.rating-widget[aria-busy="true"], .discussion[aria-busy="true"] { opacity: .85; }
.feed-sidebar textarea { overscroll-behavior: contain; }
.project-detail-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(250px, 1fr); gap: 22px; align-items: start; }
.project-feed-return { margin-top: 16px; }
.publication-byline, .publication-author { display: flex; align-items: center; gap: 10px; }
.publication-byline { flex-wrap: wrap; gap: 8px 16px; }
.publication-byline time { color: var(--muted); font-size: .9rem; }
.publication-author { min-width: 0; font-size: 1.25rem; font-weight: 750; text-decoration: none; overflow-wrap: anywhere; }
.publication-author-name { text-decoration: underline; text-underline-offset: .2em; }
.publication-avatar { width: 42px; height: 42px; flex: 0 0 auto; object-fit: cover; border-radius: 50%; }
.publication-avatar.avatar-placeholder { font-size: 1.05rem; }
.project-detail-layout .discussion { border: 1px solid var(--line); border-radius: var(--radius); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: .9rem; }
.profile-header { display: flex; align-items: center; gap: 16px; margin-top: 20px; overflow-wrap: anywhere; }
.profile-header h1 { font-size: clamp(2rem, 5vw, 4rem); }
.profile-header p { margin-top: 6px; color: var(--muted); }
.profile-avatar { width: clamp(62px, 12vw, 96px); aspect-ratio: 1; flex: 0 0 auto; object-fit: cover; border-radius: 50%; }
.avatar-placeholder { display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--on-accent); background: var(--accent); }
.profile-settings { margin-top: 22px; max-width: 540px; }
.profile-check input { width: auto; margin-inline-end: 4px; }
.profile-check label { display: inline; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(290px, 1fr); gap: 22px; align-items: start; }
.editor-opacity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.editor-opacity input { width: clamp(100px, 20vw, 220px); accent-color: var(--link); }
.editor-opacity output { min-width: 4ch; text-align: end; font-variant-numeric: tabular-nums; }
.editor-panel { display: flex; flex-direction: column; gap: 17px; }
.segmented { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.segmented { width: max-content; max-width: 100%; padding: 4px; gap: 3px; background: var(--segmented); border-radius: 8px; }
.segmented button { background: transparent; padding: 5px 13px; border: 0; border-radius: 5px; font-weight: 650; color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px #2e441f25; }
.comparison .segmented { margin-bottom: 12px; }
.placement-modes { margin-bottom: 20px; justify-content: flex-start; }
.placement-modes a { padding: 8px 13px; border-radius: 5px; font-weight: 650; text-decoration: none; }
.placement-modes a:hover { background: var(--hover); }
.placement-modes a[aria-current="page"] { background: var(--surface); box-shadow: 0 1px 2px #2e441f25; }
.placement-building-picker { max-width: 620px; }
.canvas-frame { margin-top: 11px; display: grid; align-items: center; min-height: 200px; text-align: center; background: var(--canvas); color: var(--muted); border-radius: 12px; overflow: hidden; }
.canvas-frame canvas, .canvas-frame img { width: 100%; display: block; }
.canvas-frame canvas { height: auto; }
.facade-stage { position: relative; }
.facade-stage.is-editable { user-select: none; }
.corner-handle { touch-action: none; }
.canvas-frame .editor-sketch-overlay, .editor-sketch-outline {
  position: absolute;
  inset: 0 auto auto 0;
  pointer-events: none;
}
.canvas-frame .editor-sketch-overlay { height: 100%; object-fit: fill; transform-origin: 0 0; }
.editor-sketch-outline { width: 100%; height: 100%; fill: none; stroke-linejoin: round; }
.editor-sketch-outline polygon:first-child { stroke: #141813; stroke-width: 4px; }
.editor-sketch-outline polygon:last-child { stroke: #fffefa; stroke-width: 2px; }
.facade-stage.is-dragging, .facade-stage.is-dragging .corner-handle { cursor: grabbing; }
.corner-handle {
  position: absolute;
  top: clamp(22px, var(--corner-y), calc(100% - 22px));
  left: clamp(22px, var(--corner-x), calc(100% - 22px));
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--on-accent);
  font-size: .875rem;
  font-weight: 750;
  isolation: isolate;
  cursor: grab;
}
.corner-handle::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: -1;
  border: 2px solid var(--on-accent);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px white;
}
.corner-handle:hover, .corner-handle:focus, .corner-handle.is-dragged { z-index: 1; }
.corner-handle:focus-visible { outline: none; }
.corner-handle:focus-visible::before, .corner-handle.is-dragged::before {
  background: white;
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--on-accent);
}
.canvas-frame img { object-fit: contain; }
.editor-message { margin-top: 9px; font-size: .9rem; }
.editor-message { color: var(--link); font-weight: 650; }
.editor-message.is-error, .errorlist { color: var(--error); }
.design-preview { width: 145px; max-height: 95px; object-fit: contain; object-position: left; border-radius: 5px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 1.1rem; padding: 0; font-weight: 730; margin-bottom: 6px; }
.editor-panel label, .field-stack label { display: block; margin: 8px 0 5px; font-weight: 600; font-size: .9rem; }
.editor-panel select, .editor-panel input, .editor-panel textarea, .field-stack input {
  width: 100%; min-width: 0; border: 1px solid var(--control-border); border-radius: 6px; padding: 8px 10px; background: var(--field); color: var(--ink);
}
.editor-panel select { appearance: none; padding-right: 32px; background: linear-gradient(45deg, transparent 50%, var(--field-icon) 50%) right 15px center / 6px 6px no-repeat, linear-gradient(135deg, var(--field-icon) 50%, transparent 50%) right 9px center / 6px 6px no-repeat, var(--field); }
.editor-picker { position: relative; }
.editor-picker[open] { z-index: 2; }
.editor-picker summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--field); color: var(--ink); cursor: pointer; list-style: none;
}
.editor-picker summary::-webkit-details-marker { display: none; }
.editor-picker summary::after {
  content: ""; flex: 0 0 7px; height: 7px; border: solid var(--field-icon); border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.editor-picker summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.editor-picker-options {
  position: absolute; inset: calc(100% + 4px) 0 auto; display: grid; gap: 2px;
  max-height: 230px; overflow-y: auto; padding: 4px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); box-shadow: 0 6px 20px rgb(0 0 0 / 15%);
}
.editor-picker-options button {
  display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px;
  border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: start;
}
.editor-picker-options button:hover { background: var(--hover); }
.editor-picker-options button:focus-visible { outline-offset: -2px; }
.editor-picker-options button[aria-pressed="true"] { background: var(--selected); }
.editor-picker-options button[aria-pressed="true"]::after { content: "✓"; color: var(--accent-text); }
.editor-panel input[type="file"] { font-size: .875rem; }
.editor-panel textarea { resize: vertical; }
.editor-panel img { margin-top: 8px; }
.errorlist { margin: 6px 0; padding-left: 18px; font-size: .875rem; }
.auth-panel { width: min(100%, 500px); margin: 24px auto 0; }
.auth-panel h1 { margin-bottom: 12px; font-size: clamp(2rem, 4vw, 3rem); }
.field-stack { margin: 12px 0 18px; }
.field-stack p { margin-bottom: 11px; }
.field-stack .button { margin-top: 8px; }
.helptext, .field-stack li { color: var(--muted); font-size: .875rem; }

.graffiti-feed .discussion { padding: 12px 14px; }
.graffiti-feed .discussion h3, .graffiti-feed .comment-list { margin-bottom: 8px; }
.graffiti-feed .comment-list { max-height: none; overflow: visible; }
.graffiti-feed .comment-header { gap: 2px 8px; }
.graffiti-feed .comment-header a { overflow-wrap: anywhere; }
.graffiti-feed .comment-list li > p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.graffiti-feed .comment-like button { min-height: 26px; }
.graffiti-feed .rating-widget, .graffiti-feed .comment-form { margin-top: 8px; }
.graffiti-feed .comment-form { gap: 4px; }
.graffiti-feed .comment-form textarea { width: 100%; resize: none; }

@media (max-width: 900px) {
  .container { width: calc(100% - 48px); }
  .header-inner { grid-template-columns: 1fr auto; padding-block: 10px; gap: 10px; }
  .header-inner nav { grid-row: 2; grid-column: 1 / -1; margin-inline: 0; flex-wrap: wrap; }
  .header-search { grid-row: 3; grid-column: 1 / -1; }
  .header-actions { grid-row: 1; grid-column: 2; }
  #projects, #comments, #rating { scroll-margin-top: 155px; }
  .hero { min-height: 405px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout, .feed-post, .project-detail-layout { grid-template-columns: minmax(0, 1fr); }
  .feed-post { grid-template-rows: minmax(0, 2.2fr) minmax(0, 1fr); }
  .graffiti-feed .feed-post { grid-template-rows: auto auto; scroll-margin-top: 155px; }
  .feed-sidebar { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .container { width: calc(100% - 28px); }
  .main.map-main { --map-inset: 14px; }
  .building-list { max-height: 50%; }
  .main { padding-block: 16px 42px; }
  .header-inner nav { gap: 20px; font-size: .875rem; }
  .header-inner .brand { gap: 5px; font-size: clamp(17px, 4.5vw, 24px); }
  .header-inner .brand-mark { width: 34px; }
  .header-actions { gap: 4px; }
  .theme-picker:has(~ a.button) .theme-options { inset-inline: 0 auto; }
  .header-actions .button.compact:not(.theme-toggle) { padding-inline: 6px; font-size: .8rem; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .hero-copy { padding: 29px 24px 32px; }
  .hero-image { min-height: 220px; aspect-ratio: 1.7; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .feed-byline, .feed-caption { padding: 8px 10px; }
  .feed-location { padding-inline: 10px; }
  .feed-byline time { font-size: .75rem; }
  .section { margin-top: 35px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .building-row { transition: background-color 120ms ease; }
}
