/* Site Layout tool — page-specific styles on top of mck-chrome.css */

.workbench { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .workbench { grid-template-columns: 1fr; } }

.controls .row { display: flex; gap: 8px; }
.controls .row .input { flex: 1; }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.wide-btn { width: 100%; }
.split2 { display: flex; gap: 16px; }
.check { font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }

/* Zone auto-detect badge, inline inside the "Planning zone pack" label. Uses
 * the existing .pill.ok/.pill.warn classes from mck-chrome.css; only display
 * is toggled here rather than via [hidden], since .pill sets display and
 * would otherwise win over the UA [hidden] rule. text-transform/letter-spacing
 * are reset because .label (its ancestor) sets both for its own uppercase
 * caption style, which the pill's own sentence-case text must not inherit. */
.zone-auto-badge {
  display: inline-block; margin-left: 4px; vertical-align: middle;
  text-transform: none; letter-spacing: normal;
}

.warnings { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.warnings .warn-item {
  font-size: 0.78rem; background: #fbf0dd; color: #7a5008;
  border-left: 3px solid var(--status-amber); border-radius: 4px; padding: 6px 9px;
}

.stage { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stage-tabs { display: flex; border-bottom: 1px solid var(--border); }
.stage-tab { padding: 9px 16px; font: inherit; font-size: 0.8rem; font-weight: 600; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; }
.stage-tab.active { color: var(--moss); border-bottom-color: var(--moss); }
.view { display: none; }
.view.active { display: block; }
#map { height: 640px; }
.plan-host { min-height: 640px; display: flex; align-items: center; justify-content: center; background: #fbfaf7; }
.plan-host svg { width: 100%; height: auto; max-height: 78vh; display: block; }
.empty { color: var(--muted); font-size: 0.9rem; padding: 60px 0; }

.tabpane { display: none; margin-top: 20px; }
.tabpane.active { display: block; }
.tabpane h2 { font-size: 1.05rem; color: var(--moss-dark); }

table.data td.pass { color: var(--moss-dark); font-weight: 700; }
table.data td.fail { color: var(--status-red); font-weight: 700; }
table.data td.na { color: var(--muted); }

/* Options bar — ranked alternatives from /api/options, best first */
.options-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.options-bar:empty { display: none; }
.option-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--wood);
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 4px 6px 4px 12px; cursor: pointer;
}
.option-chip:hover { border-color: var(--moss); }
.option-chip.active { background: var(--moss); border-color: var(--moss); color: #fff; }
.option-chip .chip-score { background: var(--moss-pale); color: var(--moss-dark); border-radius: 10px; padding: 1px 8px; font-size: 0.7rem; font-weight: 700; }
.option-chip.active .chip-score { background: rgba(255, 255, 255, 0.25); color: #fff; }
.options-note { font-size: 0.75rem; color: var(--muted); }

/* Yield shortfall banner — units were requested but did not fit. Deliberately
 * the loudest thing on the stage: a buried checks-table row is exactly how a
 * "0 units placed, all checks pass" layout slipped through unnoticed. */
.yield-banner {
  background: #f7e0dd; color: #8c2c20; border-bottom: 2px solid var(--status-red);
  padding: 10px 14px; font-size: 0.8rem; line-height: 1.45;
}

/* Options gallery — side-by-side option cards with a thumbnail + risk flags,
 * so options are compared at a glance rather than clicked through one at a
 * time. Horizontally scrollable rather than wrapped/shrunk, so a thumbnail
 * always stays legible. */
.options-gallery { display: flex; gap: 12px; overflow-x: auto; padding: 12px; align-items: stretch; }
.option-card {
  flex: 0 0 220px; display: flex; flex-direction: column; gap: 6px;
  font: inherit; text-align: left; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; cursor: pointer;
}
.option-card:hover { border-color: var(--moss); }
.option-card.active { border-color: var(--moss); box-shadow: 0 0 0 2px var(--moss-pale); }
.option-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--wood); }
.option-card .chip-score { background: var(--moss-pale); color: var(--moss-dark); border-radius: 10px; padding: 1px 8px; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }
.option-thumb { background: #fbfaf7; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.option-thumb svg { width: 100%; height: 110px; display: block; }
.option-risks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.option-risks .risk-warn { font-size: 0.7rem; color: var(--status-amber); }
.option-risks-ok { font-size: 0.7rem; color: var(--moss-dark); }

/* Feedback box — "move entry left 1m" / "move unit 3 to reduce the HIRB
 * encroachment". Sits between the options gallery and the plan/aerial tabs
 * since it acts on whichever layout is currently shown. */
.feedback-bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--sand-pale); }
.feedback-bar .input { flex: 1; }

/* Quick-fix buttons inside the checks table (HIRB breaches). */
.quickfix-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
.quickfix-btn { font-size: 0.72rem; padding: 3px 10px; }

/* Layer panel — grouped by the consultant who owns each layer, so the plan
 * reads the way a real drawing set does. */
.layer-panel { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.layer-panel-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 8px; }
.layer-group { margin-bottom: 10px; }
.layer-group-head {
  font-size: 0.72rem; font-weight: 700; color: var(--wood);
  border-left: 3px solid var(--moss); padding-left: 7px; margin-bottom: 4px;
}
.layer-row { display: flex; align-items: center; gap: 7px; font-size: 0.76rem; padding: 2px 0 2px 10px; cursor: pointer; }
.layer-row:hover { color: var(--moss-dark); }
.layer-swatch { width: 13px; height: 9px; border: 1.5px solid #999; border-radius: 2px; flex-shrink: 0; }
.layer-name { line-height: 1.25; }

/* Consultant findings with no geometry - stated, not toggled. */
.layer-finding { display: flex; gap: 6px; align-items: flex-start; padding: 3px 0 3px 10px; font-size: 0.72rem; line-height: 1.3; }
.layer-finding-text { color: var(--text); }
.layer-hint { font-size: 0.7rem; color: var(--muted); padding: 6px 0 0 10px; font-style: italic; }

/* Scenario card sub-line: what the scheme delivers, under its title. */
.option-sub { font-size: 0.7rem; color: var(--muted); margin: -2px 0 2px; }

.stage-spacer { flex: 1; }
.stage-action {
  align-self: center; margin: 4px 10px 4px 0;
  font: inherit; font-size: 0.75rem; font-weight: 600; color: var(--moss);
  background: #fff; border: 1px solid var(--moss); border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.stage-action:hover { background: var(--sand-pale); }
.stage-action.active { background: var(--moss); color: #fff; }
.stage-action.active:hover { background: var(--moss); opacity: 0.9; }

/* Frontage picker — wide invisible hit strokes over each boundary edge.
 * pointer-events:stroke so the transparent paint still catches clicks. */
.edge-pick { stroke: transparent; pointer-events: stroke; cursor: pointer; }
.edge-pick:hover { stroke: rgba(44, 107, 138, 0.3); }
.edge-pick.current { cursor: default; }
.edge-pick.current:hover { stroke: rgba(44, 107, 138, 0.12); }

/* Existing-crossing pin mode — a hit line over just the frontage edge,
 * drawn after the edge-pick lines so it wins the hit test there instead of
 * reassigning the frontage. crosshair cursor signals "click to mark", not
 * "click to pick this boundary". */
.plan-host.pin-mode { cursor: crosshair; }
.crossing-pin { stroke: transparent; pointer-events: stroke; cursor: crosshair; }
.crossing-pin:hover { stroke: rgba(61, 89, 43, 0.35); }

/* Consultants tab */
.consultant-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; align-items: end; margin-bottom: 12px; }
.consultant-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.report-head h3 { margin: 0; font-size: 0.95rem; color: var(--moss-dark); }
.report-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.report-meta { font-size: 0.72rem; color: var(--muted); margin: 6px 0 10px; }
.consultant-card h4 { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 14px 0 6px; }
table.report-kv th { background: none; color: var(--wood); font-size: 0.78rem; font-weight: 600; text-align: left; width: 28%; padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.report-kv td, table.report-arr td { vertical-align: top; }
td.src { color: var(--muted); font-size: 0.72rem; }
.src { color: var(--muted); font-size: 0.72rem; }
.pill.basis { font-size: 0.62rem; padding: 1px 7px; white-space: nowrap; }

/* Service-area column in the unit schedule: the shed/clothesline/yard the
   Kainga Ora tables require per dwelling. Kept narrow and quiet so it does not
   compete with the typology columns it sits beside. */
table.data td.furniture-cell { font-size: 12px; color: var(--muted); max-width: 260px; line-height: 1.45; }
