/* ParcelBlend concept. One accent (teal), neutral surfaces, radius scale 8 (controls) / 12 (panels). */
:root {
  --bg: #f5f6f5; --surface: #fff; --surface-2: #eef0ee; --line: #d9dddb; --line-2: #bcc3c0;
  --ink: #15191a; --ink-2: #434b4d; --ink-3: #586163;
  --accent: #0b6b63; --accent-ink: #fff; --accent-soft: #d9eeeb; --accent-line: #6fb3ab;
  --warn-ink: #7a4f00; --warn-bg: #fbf0d9;
  --map-land: #eceee9; --map-block: #e3e6e0; --map-bldg: #d2d6cf; --map-park: #d3e5d1; --map-water: #cbdbe5;
  --map-road: #fff; --map-edge: #cdd2cc; --map-label: #556059;
  --mass-top: #7fc0b8; --mass-s1: #4f9a91; --mass-s2: #3f8179; --mass-edge: #1f4f49;
  --b-top: #b4bbbe; --b-s1: #8d9699; --b-s2: #7a8487;
  --r: 8px; --r-lg: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514; --surface: #1a1e1d; --surface-2: #222726; --line: #333a38; --line-2: #4a5451;
    --ink: #eceeed; --ink-2: #bcc3c1; --ink-3: #9aa3a0;
    --accent: #5fc4b8; --accent-ink: #0b1f1d; --accent-soft: #1c3a37; --accent-line: #2f6d66;
    --warn-ink: #f0c36a; --warn-bg: #33290f;
    --map-land: #1d2220; --map-block: #242a28; --map-bldg: #313835; --map-park: #243629; --map-water: #22343f;
    --map-road: #38403d; --map-edge: #151918; --map-label: #a4aca9;
    --mass-top: #4aa89d; --mass-s1: #347e75; --mass-s2: #2a665e; --mass-edge: #bfe7e2;
    --b-top: #6c7679; --b-s1: #55605f; --b-s2: #49524f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--surface); padding: 10px 14px; border-radius: var(--r); z-index: 10; }
.skip:focus { top: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num, .rv, td, output { font-variant-numeric: tabular-nums; }

.btn { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r); font-weight: 500; cursor: pointer; touch-action: manipulation; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.12); }
.btn[aria-disabled="true"], .btn:disabled { background: var(--surface-2); color: var(--ink-3); border-style: dashed; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover, .btn:disabled:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.quiet:hover { background: var(--surface-2); }

/* ---------- Landing ---------- */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.site-head { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 650; letter-spacing: -0.02em; font-size: 17px; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.signin { color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; }
.signin:hover { color: var(--ink); }
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: center; min-height: min(640px, calc(100dvh - 64px)); padding-bottom: 32px; }
.hero-copy { display: grid; gap: 20px; max-width: 520px; }
.status-line { font-size: 13px; color: var(--accent); font-weight: 600; }
.hero h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 650; }
.hero .sub { font-size: 17px; color: var(--ink-2); max-width: 46ch; }
.hero-actions { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.hero-art { margin: 0; }
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-art figcaption { font-size: 13px; color: var(--ink-3); padding-top: 4px; }
.sec { padding: 72px 0; border-top: 1px solid var(--line); }
.sec h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 650; max-width: 22ch; }
.flow { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 0; max-width: 820px; }
.flow li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; padding: 22px 0; }
.flow li + li { border-top: 1px solid var(--line); }
.flow h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; }
.flow p { color: var(--ink-2); max-width: 48ch; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 32px; }
.pane { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; background: var(--surface); }
.pane.is-proposed { background: transparent; border-style: dashed; border-color: var(--line-2); }
.pane h3 { font-size: 17px; font-weight: 600; }
.pane ul { margin: 12px 0 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 6px; }
.pane p { color: var(--ink-3); font-size: 14px; margin-top: 6px; }
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-3); font-size: 14px; }

.hero-art .layer { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art .layer { animation: settle .9s cubic-bezier(.16, 1, .3, 1) both; }
  .hero-art .l2 { animation-delay: .12s; } .hero-art .l3 { animation-delay: .24s; }
}
@keyframes settle { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

@media (max-width: 800px) {
  .wrap { padding: 0 16px; }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 20px; padding-top: 8px; }
  .hero h1 { font-size: 34px; }
  .hero .sub { font-size: 16px; }
  .sec { padding: 48px 0; }
  .flow li { grid-template-columns: 1fr; gap: 6px; }
  .split { grid-template-columns: 1fr; }
}

/* ---------- Workspace ---------- */
body.ws { height: 100dvh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top" "map panel" "drawer panel"; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar .brand { font-size: 16px; }
.tag { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.stepnav { margin: 0 auto; }
.steps { margin: 0; padding: 3px; list-style: none; display: flex; gap: 2px; background: var(--surface-2); border-radius: var(--r); border: 1px solid var(--line); }
.steps button { min-height: 44px; padding: 0 16px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--ink-2); touch-action: manipulation; transition: background-color .15s, color .15s; }
.steps button:hover { color: var(--ink); }
.steps button[aria-current="step"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--accent-line); }
.top-actions { display: flex; gap: 4px; }

.map-wrap { grid-area: map; position: relative; min-height: 0; background: var(--map-land); overflow: hidden; }
.map-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.status { position: absolute; left: 12px; top: 12px; right: 12px; max-width: 460px; display: none; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px 6px 6px 12px; font-size: 14px; }
.status.on { display: flex; }
.legend { position: absolute; left: 12px; bottom: 12px; max-width: 360px; font-size: 12px; line-height: 1.4; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; }
.legend .keys { display: flex; gap: 12px; padding-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

.m-road { fill: var(--map-road); } .m-edge { fill: var(--map-edge); }
.m-block { fill: var(--map-block); } .m-bldg { fill: var(--map-bldg); } .m-park { fill: var(--map-park); } .m-water { fill: var(--map-water); }
.m-dash { stroke: var(--map-edge); stroke-width: 1; stroke-dasharray: 8 8; fill: none; vector-effect: non-scaling-stroke; }
.mlabel { font-size: calc(12px * var(--u, 1.6)); fill: var(--map-label); font-weight: 500; pointer-events: none; }
.site { cursor: pointer; outline: none; touch-action: manipulation; }
.site .parcel { fill: var(--surface); fill-opacity: .55; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; transition: fill .18s, stroke .18s, fill-opacity .18s; }
.site:hover .parcel { fill-opacity: .85; stroke: var(--ink); }
.site .ring { fill: none; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .15s; }
.site:focus-visible .ring { opacity: 1; stroke-dasharray: 2 4; stroke-linecap: round; }
.site[aria-pressed="true"] .parcel { fill: var(--accent-soft); fill-opacity: 1; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: none; }
.site[aria-pressed="true"] .ring { opacity: 1; stroke-dasharray: none; stroke-width: 0; }
.sel-dim .site[aria-pressed="false"] { opacity: .7; }
.site { transition: opacity .18s; }
#mass { pointer-events: none; }
.m-top { fill: var(--mass-top); stroke: var(--mass-edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.m-s1 { fill: var(--mass-s1); } .m-s2 { fill: var(--mass-s2); }
.m-s1, .m-s2 { stroke: var(--mass-edge); stroke-width: .75; vector-effect: non-scaling-stroke; }
.m-B .m-top { fill: var(--b-top); } .m-B .m-s1 { fill: var(--b-s1); } .m-B .m-s2 { fill: var(--b-s2); }
.wire { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.mtag { font-size: calc(12px * var(--u, 1.6)); font-weight: 650; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: calc(3px * var(--u, 1.6)); }

.panel { grid-area: panel; background: var(--surface); border-left: 1px solid var(--line); overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; min-height: 0; }
.panel-in { padding: 16px; display: grid; gap: 14px; align-content: start; flex: 1; }
.panel h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.panel h3 { font-size: 14px; font-weight: 650; }
.lede, .note { color: var(--ink-2); font-size: 14px; }
.note { font-size: 13px; color: var(--ink-3); }
.sample { display: flex; align-items: center; gap: 10px; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--r); padding: 4px 4px 4px 12px; }
.sample strong { font-size: 14px; font-weight: 600; }
.switch { min-height: 44px; min-width: 76px; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: var(--r); cursor: pointer; font-weight: 600; font-size: 13px; touch-action: manipulation; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.banner { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r); padding: 8px 12px; font-size: 13px; }
.sitelist, .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.sitelist button, .seg button { min-height: 44px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r); cursor: pointer; font-weight: 500; touch-action: manipulation; transition: background-color .15s, border-color .15s; }
.sitelist button:hover, .seg button:hover { background: var(--surface-2); }
.sitelist button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 650; }
.field { display: grid; gap: 3px; }
.field label { font-size: 13px; font-weight: 600; }
.field .unit { font-weight: 400; color: var(--ink-3); }
.field input[type="text"], .field input[type="number"] { min-height: 40px; width: 100%; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); }
.field input::placeholder { color: var(--ink-3); opacity: 1; }
.field input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--accent); }
.meta { font-size: 12px; color: var(--ink-3); }
.meta.is-sample { color: var(--warn-ink); }
.empty { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px; color: var(--ink-3); font-size: 14px; }
.flag { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r); padding: 8px 12px; font-size: 13px; }
.defs { margin: 0; display: grid; gap: 8px; font-size: 14px; }
.defs div { border-left: 3px solid var(--line-2); padding-left: 10px; }
.defs .a { border-color: var(--mass-s1); } .defs .b { border-color: var(--b-s1); }
.defs dt { font-weight: 650; } .defs dd { margin: 0; color: var(--ink-2); }
.panel-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.panel-foot .btn { width: 100%; }

.drawer { grid-area: drawer; background: var(--surface); border-top: 1px solid var(--line); min-height: 0; display: flex; flex-direction: column; max-height: min(46dvh, 400px); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 4px 12px; min-height: 52px; }
.drawer-head h2 { font-size: 15px; font-weight: 650; }
.drawer-head .sum { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { overflow: auto; overscroll-behavior: contain; padding: 4px 16px 16px; }
.drawer.closed .drawer-body { display: none; }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; }
.cols h3 { font-size: 14px; font-weight: 650; padding-bottom: 6px; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; }
.rgroup h4 { font-size: 12px; font-weight: 650; color: var(--ink-3); padding: 12px 0 4px; letter-spacing: .02em; }
.rgroup:first-child h4 { padding-top: 0; }
.rgroup ul { list-style: none; margin: 0; padding: 0; }
.rgroup li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.rgroup li > div { min-width: 0; }
.rl { display: block; font-weight: 600; font-size: 14px; }
.rf, .rn { display: block; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.rv { font-weight: 650; text-align: right; white-space: nowrap; }
.rv.unk { font-weight: 500; font-style: italic; color: var(--ink-3); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
table.cmp th, table.cmp td { text-align: right; padding: 7px 8px; border-top: 1px solid var(--line); }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; padding-left: 0; }
table.cmp thead th { font-size: 12px; color: var(--ink-2); border-top: 0; vertical-align: bottom; font-weight: 650; }
table.cmp td.unk { color: var(--ink-3); font-style: italic; }
table.cmp small { display: block; font-weight: 400; color: var(--ink-3); }

dialog { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); max-width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(10 14 13 / .5); }
dialog h2 { font-size: 20px; } dialog h3 { font-size: 14px; margin-top: 14px; }
dialog ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 4px; }
dialog .btn { margin-top: 18px; }

.sheet, .sheet-content { display: contents; }
.sheet-handle { display: none; }

@media (max-width: 960px) { body.ws { grid-template-columns: minmax(0, 1fr) 300px; } .cols { grid-template-columns: 1fr; gap: 12px; } .steps button { padding: 0 10px; } }

@media (max-width: 759px) {
  body.ws { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top" "map" "sheet"; }
  .topbar { gap: 4px 8px; padding: 4px 8px; }
  .top-actions { margin-left: auto; }
  .stepnav { order: 3; width: 100%; margin: 0; }
  .steps { width: 100%; }
  .steps li { flex: 1; } .steps button { width: 100%; padding: 0 4px; font-size: 14px; }
  .sheet { display: flex; flex-direction: column; grid-area: sheet; background: var(--surface); border-top: 1px solid var(--line-2); border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: env(safe-area-inset-bottom); min-height: 0; }
  .sheet[data-state="half"] { height: 44dvh; } .sheet[data-state="full"] { height: 72dvh; }
  .sheet-handle { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 16px; border: 0; background: transparent; cursor: pointer; font-weight: 600; text-align: left; touch-action: manipulation; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .sheet-handle .hint { font-weight: 400; color: var(--ink-3); font-size: 13px; }
  .sheet-content { display: block; overflow: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
  .sheet[data-state="peek"] .sheet-content { display: none; }
  .panel, .drawer { border: 0; overflow: visible; max-height: none; display: block; }
  .drawer { border-top: 1px solid var(--line); }
  #drawer-toggle { display: none; }
  .drawer.closed .drawer-body { display: block; }
  .drawer-head .sum { white-space: normal; }
  .legend { max-width: calc(100% - 24px); font-size: 11px; } .legend .keys { display: none; }
  .field input[type="text"], .field input[type="number"] { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Landing illustration: expressive, decorative, not a real site */
.h-land { fill: var(--map-block); stroke: var(--line-2); stroke-width: 1; }
.h-edge { fill: var(--map-edge); } .h-edge2 { fill: var(--line-2); }
.h-park { fill: var(--map-park); } .h-water { fill: var(--map-water); } .h-road { fill: var(--map-road); }
.h-ctx-l { fill: var(--map-bldg); } .h-ctx-r { fill: var(--line-2); } .h-ctx-t { fill: var(--surface-2); }
.h-parcel { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.h-a-l { fill: var(--mass-s1); } .h-a-r { fill: var(--mass-s2); } .h-a-t { fill: var(--mass-top); }
.h-a-l, .h-a-r, .h-a-t { stroke: var(--mass-edge); stroke-width: .75; stroke-linejoin: round; }
.h-wire { fill: none; stroke: var(--ink-2); stroke-width: 1.25; stroke-dasharray: 5 4; }
.h-fin { fill: var(--surface); fill-opacity: .72; stroke: var(--line-2); stroke-width: 1.25; }
.h-rule { stroke: var(--line-2); stroke-width: 1.25; } .h-bar { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
