/* Build a downtown: page layout. Colors and type come from ../styles.css. */
:root { --good: #2f6f62; --good-bg: #dcefe6; --ask: #a86a00; --ask-bg: #fbecc8; --big: #b3261e; --big-bg: #f8dcd9; --homes-c: #c2541b; --park-c: #7a7f88; --open-c: #8cbf7f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --good: #8cc4a8; --good-bg: #24382f; --ask: #e3a857; --ask-bg: #3d3121; --big: #ef8f86; --big-bg: #422523; --park-c: #9aa0a8; --open-c: #6c9a62; } }
:root[data-theme=dark] { --good: #8cc4a8; --good-bg: #24382f; --ask: #e3a857; --ask-bg: #3d3121; --big: #ef8f86; --big-bg: #422523; --park-c: #9aa0a8; --open-c: #6c9a62; }

html, body.build-page { height: auto; }
body.build-page { background: var(--bg); }
.bp { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; display: grid; gap: 18px; }
.bp-nav a { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-block; padding: 8px 0; min-height: 44px; }
.bp-nav a:hover { text-decoration: underline; }
.bp-head h1 { font-family: var(--display); font-weight: 600; font-size: 32px; margin: 0 0 6px; }
.bp-lede { margin: 0 0 12px; max-width: 70ch; font-size: 17px; }
.bp-start { display: grid; gap: 6px; }
.bp-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bp-view { position: sticky; top: 12px; display: grid; gap: 12px; }
.bp-controls { display: grid; gap: 12px; }
.bp-sub { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-family: var(--label); color: var(--muted); margin: 6px 0 0; }
@media (max-width: 900px) {
  .bp-grid { grid-template-columns: minmax(0, 1fr); }
  .bp-view { position: static; }
}

/* controls: big touch targets */
.bp-set { margin: 0; display: grid; gap: 10px; }
.bp-set legend { font-family: var(--display); font-weight: 600; font-size: 19px; padding: 0 4px; }
.stepper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stepper .st-lab { flex: 1 1 10em; font-weight: 600; }
.stepper .st-box { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.stepper button { font: inherit; font-size: 22px; line-height: 1; width: 48px; height: 48px; border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper button:active:not(:disabled) { background: var(--in-bg); }
.stepper input { width: 5.2em; height: 48px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .st-unit { color: var(--muted); font-size: 13px; }
.sizes { display: grid; gap: 4px; }
.bp .chips button, .bp .seg button { min-height: 44px; font-size: 14px; }
.bp-set label.chk { min-height: 44px; font-size: 15px; }
.bp-set label.chk input { width: 22px; height: 22px; }

/* score */
.score { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.score .sc-num { font-family: var(--display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.score .sc-txt { flex: 1 1 14em; font-weight: 600; }
.score .sc-pills { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.pill { font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor; }
.z-good { color: var(--good); } .z-ask { color: var(--ask); } .z-big, .z-bad { color: var(--big); } .z-none { color: var(--muted); }
.score.all-good { border-color: var(--good); background: var(--good-bg); }

/* side view */
.skyline-card { margin: 0; display: grid; gap: 6px; }
#skyline { width: 100%; height: auto; display: block; }
#skyline text { font: 12px var(--label); fill: var(--muted); }
#skyline .lbl-b { fill: var(--fg); font-weight: 600; }
#skyline .rule { stroke-dasharray: 5 4; stroke-width: 1.2; }
#skyline .ground { stroke: var(--fg); stroke-width: 1.5; }

/* meters */
.meters { display: grid; gap: 10px; }
.meter { display: grid; gap: 6px; }
.meter h3 { margin: 0; font-size: 16px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.meter h3 .m-val { font-variant-numeric: tabular-nums; font-size: 15px; }
.bar { position: relative; height: 26px; border-radius: 6px; overflow: hidden; background: var(--line); }
.bar .zone { position: absolute; top: 0; bottom: 0; }
.zone.good { background: var(--good-bg); } .zone.ask { background: var(--ask-bg); } .zone.big, .zone.bad { background: var(--big-bg); }
.bar .mark { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: var(--fg); border-radius: 2px; transition: left .25s ease; }
.bar .seg-fill { position: absolute; top: 0; bottom: 0; transition: left .25s, width .25s; }
.bar .tick { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--fg); opacity: .55; }
.bar-scale { position: relative; height: 16px; font-size: 11.5px; color: var(--muted); }
.bar-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bar-scale span.l { transform: none; } .bar-scale span.r { transform: translateX(-100%); }
.m-msg { margin: 0; font-size: 14.5px; }
.m-msg.z-ask, .m-msg.z-big, .m-msg.z-bad { font-weight: 600; }
.m-why { margin: 0; font-size: 12.5px; color: var(--muted); }
.m-why a { color: inherit; }
.keyrow { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.keyrow i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
@media (prefers-reduced-motion: reduce) { .bar .mark, .bar .seg-fill { transition: none; } }

.bp-how h2 { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 0 0 8px; }
.bp-how dl { margin: 0 0 10px; display: grid; gap: 8px; }
.bp-how dt { font-weight: 600; }
.bp-how dd { margin: 0; font-size: 14.5px; }
.bp-how a { color: var(--accent); }
.bp-foot { text-align: center; }
@media print { .bp-controls, .bp-nav, .bp-start { display: none; } .bp-grid { grid-template-columns: 1fr; } .bp-view { position: static; } }
.bp-howto { font-size: 15px; }
.bp .seg.stack { flex-direction: column; }
.bp .seg.stack button + button { border-left: 0; border-top: 1px solid var(--line); }
.bp .seg button { padding: 10px 12px; font-size: 15px; }
.bp-set legend { font-size: 20px; }
.bp .btn { min-height: 44px; font-size: 15px; padding: 8px 14px; }
.dock { display: none; }
@media (max-width: 900px) {
  .dock { display: flex; gap: 10px; align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 2px solid var(--ask); color: var(--fg); text-decoration: none; font-size: 15px; box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
  .dock b { font-family: var(--display); font-size: 22px; flex: none; }
  .dock span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .dock.all-good { border-top-color: var(--good); }
  .bp { padding-bottom: 96px; }
}
.bp-set legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; line-height: 1.25; }
#skyline text.halo { paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; fill: var(--fg); }
.bp-steps { margin: 0 0 12px; padding-left: 1.4em; font-size: 17px; display: grid; gap: 2px; }
