/* The same spatial SVG fills the viewport in C. Only the floating controls
   accept input above it; B retains the split view and normal page scrolling. */
html:not([data-layout='c']) #canvas-sidebar { display: none; }

#canvas-heading { display: none; }
html[data-layout='c'][data-entry-phase='study'] #canvas-heading {
  position: absolute;
  z-index: 1;
  inset: var(--canvas-gutter) auto auto var(--canvas-gutter);
  display: grid;
  gap: .35rem;
  max-width: min(24rem, calc(100% - 2 * var(--canvas-gutter)));
  padding: .65rem .85rem .75rem;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--panel);
  font-weight: 400;
  letter-spacing: normal;
}
#canvas-heading h1 { margin: 0; font-size: clamp(1.1rem, 2.3vw, 1.4rem); letter-spacing: -.015em; line-height: 1.15; }
#canvas-guidance .top-result { margin: 0; min-height: 0; padding: 0; border: 0; }
#canvas-guidance #answer { margin: 0; font-size: 1rem; }
#canvas-guidance #help { margin: .15rem 0 0; font-size: .86rem; }
html[data-layout='c'] #workspace:has(#editor:not([hidden])) #canvas-heading { visibility: hidden; }
#entry[inert] :is(.entry-north, #entry-city-credit) { visibility: hidden; }
#entry-zone-art :is(.entry-zone-shape, .entry-point) { vector-effect: non-scaling-stroke; }

html[data-layout='c'] { overflow: hidden; }
html[data-layout='c'] #workspace {
  --canvas-gutter: clamp(12px, 2vw, 28px);
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0;
}
html[data-layout='c'] #workspace > .views,
html[data-layout='c'] #spatial-panel,
html[data-layout='c'] #spatial-panel .stage {
  position: absolute;
  inset: 0;
  height: auto;
}
html[data-layout='c'] #spatial-panel {
  overflow: visible;
  border: 0;
  border-radius: 0;
}
html[data-layout='c'] #scene-caption { display: none; }
/* The same unresolved-height status is surfaced in the floating study panel. */
html[data-layout='c'] #scene-hud { display: none; }
html[data-layout='c'] #scene:focus-visible { outline-offset: -4px; }

/* Paint-only edge feather. The map and its hit targets remain full-screen. */
html[data-layout='c'] #spatial-panel .stage::after {
  --feather: calc(var(--psfc-edge-feather, 12) * 1%);
  --edge-paper: rgba(255, 255, 255, .95);
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 1px 2px, #6b625918 .5px, transparent 1px) 0 0 / 7px 5px,
    radial-gradient(ellipse at 4px 1px, #8b82751a .4px, transparent 1px) 0 0 / 11px 7px,
    var(--edge-paper);
  mask-image:
    linear-gradient(to right, black, transparent var(--feather)),
    linear-gradient(to left, black, transparent var(--feather)),
    linear-gradient(to bottom, black, transparent var(--feather)),
    linear-gradient(to top, black, transparent var(--feather));
}
html[data-white-paper-feather='false'] #spatial-panel .stage::after { display: none; }
html[data-layout='c'] #scene .psfc-face-bma.psfc-side { stroke: none; }
#scene .psfc-moving-footprints { fill: var(--psfc-fill-roof, #b9aaa0); }

html[data-layout='c'] #workspace > .mast {
  position: absolute;
  z-index: 1;
  top: var(--canvas-gutter);
  left: var(--canvas-gutter);
  display: block;
  margin: 0;
  padding: 8px 14px 12px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 9px;
}
html[data-layout='c'] .mast h1 { font-size: clamp(1.25rem, 2.5vw, 2rem); }
html[data-layout='c'] .mast .zone-chip span { font-size: 1.3rem; }
html[data-layout='c'] #editor {
  position: absolute;
  z-index: 2;
  top: var(--canvas-gutter);
  left: var(--canvas-gutter);
  width: min(24rem, calc(100% - 2 * var(--canvas-gutter)));
}

html[data-layout='c'] #plot-tools {
  position: absolute;
  left: var(--canvas-gutter);
  bottom: calc(var(--canvas-gutter) + 22px);
  min-height: 0;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--panel);
}
html[data-layout='c'] #workspace > footer {
  position: absolute;
  bottom: 5px;
  left: var(--canvas-gutter);
  display: block;
  max-width: calc(100% - 2 * var(--canvas-gutter));
  padding: 2px 6px;
  background: var(--panel);
  border: 0;
  border-radius: 4px;
  font-size: .67rem;
}
html[data-layout='c'] #workspace > footer span { display: none; }

html[data-layout='c'] #canvas-sidebar {
  position: absolute;
  z-index: 1;
  top: var(--canvas-gutter);
  right: var(--canvas-gutter);
  max-height: calc(100% - 60px - var(--canvas-gutter)); /* Keep the Map style dock clear. */
  width: clamp(18rem, 27vw, 26rem);
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 4px; /* Focus outlines stay inside the scrollport. */
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
html[data-layout='c'] :is(#canvas-results, #canvas-inputs, #map-notes) {
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--panel);
}
html[data-layout='c'] #map-notes { font-size: .84rem; }
html[data-layout='c'] .canvas-card-title {
  margin-bottom: 8px;
  font: 650 1.05rem/1.3 Allo, sans-serif;
}
html[data-layout='c'] .top-result #help:empty { display: none; }
html[data-layout='c'] #plot-tools button[aria-pressed='true'] { color: white; background: var(--study-action); border-color: var(--study-action); }
html[data-layout='c'] #canvas-sidebar .summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 6px 12px;
  padding: 0;
}
html[data-layout='c'] #canvas-sidebar .summary strong { font-size: 1.2rem; }
html[data-layout='c'] #canvas-sidebar .summary small { font-size: .73rem; }
html[data-layout='c'] #concept-tools { display: none; }
html[data-layout='c'] #workspace { --sidebar-width: clamp(18rem, 27vw, 26rem); --map-center: calc((100% - var(--sidebar-width) - var(--canvas-gutter)) / 2); }
html[data-layout='c'] #concept-bar {
  position: absolute;
  z-index: 1;
  left: var(--map-center);
  bottom: calc(var(--canvas-gutter) + 22px);
  translate: -50% 0;
  max-width: calc(2 * var(--map-center) - 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
  font-size: .8rem;
}
html[data-layout='c'] #concept-bar[hidden] { display: none; }
#concept-bar button { padding: .45rem .65rem; color: var(--ink); }
#concept-bar button[aria-pressed='true'] { color: white; background: var(--study-action); border-color: var(--study-action); }
#concept-bar small { display: block; font-variant-numeric: tabular-nums; }
#concept-bar button[aria-pressed='true'] small { color: #ccf2e5; }
#concept-availability { flex-basis: 100%; margin: 0; text-align: center; }
.envelope-toggle { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding-inline: 5px; }
#show-envelope { min-height: auto; margin: 0; }
html[data-layout='c'] #workspace:has(#concept-bar:not([hidden])) #plot-tools { left: var(--map-center); bottom: calc(var(--canvas-gutter) + 108px); translate: -50% 0; }
@media (max-width: 720px) {
  html[data-layout='c'] #workspace { --map-center: 50%; }
}
#compass { display: none; }
html[data-layout='c'] #compass {
  display: flex;
  align-items: center;
  gap: 1px;
  padding-inline: 5px;
  color: var(--tea);
}
#compass svg { stroke-width: 1.5; }
#compass span { font-size: .69rem; font-weight: 750; }
html[data-layout='c'] #canvas-sidebar details:not(#map-notes) { padding: 7px 2px; }
html[data-layout='c'] #canvas-sidebar details > ul { padding-inline-start: 1.4em; font-size: .86rem; }

html[data-layout='c'] #canvas-inputs .road-controls { border: 0; padding: 0 0 6px; }
html[data-layout='c'] #panel-width {
  position: static;
  grid-column: 1 / -1;
  max-width: 100%;
  width: auto;
  box-shadow: none;
}
html[data-layout='c'] #panel-width[inert] { display: none; }
html[data-layout='c'] #canvas-inputs .inputs {
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
html[data-layout='c'] #canvas-inputs .use-picker {
  border: 0;
  padding: 4px 0;
}
html[data-layout='c'] #canvas-inputs .use-picker select {
  min-height: 36px;
  border: 1px solid var(--rule);
  padding: 5px 10px;
}
html[data-layout='c'] #mapped-overlaps { display: none; }
html[data-layout='c'] .clear-trial { padding-inline: 0; }

/* Fade the 3D volumes while placing points on the same ground plane. */
html[data-layout='c'][data-canvas-editing] #scene [data-layer='volumes'] { opacity: .2; }
html[data-layout='c'] #scene:not(.dragging):is([data-tool='pen'], [data-tool='road']) { cursor: crosshair; }
html[data-layout='c'] #scene g[data-edge]:focus-visible {
  outline: 3px solid #703172;
  outline-offset: 2px;
}

/* Width and height are attached to modeled geometry, not to the sidebar. */
#scene .map-callout { cursor: default; }
#scene .map-callout:focus-visible .callout-label { stroke: #703172; stroke-width: 2; }
#scene .map-callout text { font: 650 12px Allo, sans-serif; fill: #30231e; }
#scene .callout-label { fill: #fff9ef; stroke: #815942; }
#scene .callout-dot { fill: #813918; stroke: #fff9ef; stroke-width: 1.5; }
#scene :is(.callout-leader, .callout-dimension) { fill: none; stroke: #813918; }
#scene .callout-dimension { stroke-width: 2; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; pointer-events: none; }
#scene .callout-value { visibility: hidden; }
#scene .map-callout:focus .callout-value { visibility: visible; }
@media (hover: hover) {
  #scene .map-callout:hover .callout-value { visibility: visible; }
}
@media (max-width: 720px) {
  html[data-layout='c'] #canvas-sidebar {
    inset: auto 8px 76px;
    width: auto;
    max-height: 35dvh;
  }
  html[data-layout='c'] #workspace > .mast { padding: 3px 9px 8px; }
  html[data-layout='c'] #plot-tools { left: 8px; bottom: 24px; }
  html[data-layout='c'] #plot-tools button { padding-inline: 8px; }
}
@media (pointer: coarse) {
  html[data-layout='c'] :is(#canvas-inputs select, #canvas-inputs input) { font-size: 1rem; }
}

html[data-layout='c'] {
  --study-action: #006653;
  --study-action-hover: #004c3d;
  --study-tint: #e0f2e9;
  --study-river: #198d89;
  --study-zone: #ac482d;
  --study-ease: cubic-bezier(.23, 1, .32, 1);
  accent-color: var(--study-action);
}
html[data-layout='c'] #workspace ::selection { color: #062c25; background: #b5e8d4; }
#entry { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
#entry[hidden] { display: none; }
.entry-north { position: absolute; right: 1.25rem; top: 1.25rem; font-weight: 700; }
.entry-card {
  pointer-events: auto;
  display: grid;
  gap: .65rem;
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 4rem);
  overflow: auto;
  padding: 1.3rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--panel, #fffcf4);
  box-shadow: 0 8px 30px #0002;
}
.entry-card :is(h1, p) { margin: 0; }
.entry-card h1 { font-size: clamp(1.85rem, 6vw, 2.55rem); font-weight: 600; text-wrap: balance; }
.entry-card label { margin-top: .15rem; font-weight: 650; }
.entry-card :is(button, select) { min-height: 2.75rem; width: 100%; font: inherit; }
.entry-card button { font-weight: 650; }
.entry-card #entry-go:not(:disabled) { color: white; background: var(--study-action); border-color: var(--study-action); }
@media (hover: hover) and (pointer: fine) {
  .entry-card #entry-go:hover:not(:disabled), #concept-bar button[aria-pressed='true']:hover { background: var(--study-action-hover); }
}
#entry-overview-caption, #entry-zone, #entry-status { color: var(--muted); font-size: .85rem; }
#entry-overview-caption { padding-top: .2rem; text-align: center; }
#entry-status:empty { display: none; }
html[data-layout='c'][data-entry-phase]:not([data-entry-phase='study']) :is(#workspace > .mast, #canvas-sidebar, #plot-tools, #scene-caption) { visibility: hidden; }
.entry-grid { stroke: var(--psfc-road-ink, #718c83); stroke-width: 1; opacity: .26; }
.entry-water { stroke: var(--study-river); fill: none; opacity: .46; }
.entry-zone-shape { fill: var(--study-zone); fill-opacity: .30; stroke: var(--study-zone); stroke-width: 2; }
.entry-point { fill: var(--study-action-hover); stroke: white; stroke-width: 2; }

.canvas-tool-icon { display: none; }
html[data-layout='c'] .canvas-tool-icon { display: inline-block; }
html[data-layout='c'] .legacy-tool-label, html[data-layout='c'] #workspace > .mast,
html[data-layout='c'] #workspace > #inputs, html[data-layout='c'] #plot-summary > :has(#far) { display: none; }
html[data-layout='c'] #canvas-sidebar {
  width: var(--sidebar-width);
  border-radius: 16px;
  overflow: hidden auto;
  scrollbar-color: #508476 var(--study-tint);
  scrollbar-gutter: stable;
  scroll-padding: 8px;
  font-size: .83rem;
  line-height: 1.24;
}
html[data-layout='c'] #compass { position: absolute; top: 11px; right: 13px; }
html[data-layout='c'] #canvas-results-title { padding-right: 54px; }
html[data-layout='c'] :is(#canvas-checks, #canvas-sources) {
  border: 1px solid var(--rule);
  border-radius: 9px;
  padding: 9px 12px;
  background: var(--panel);
  font-size: .8rem;
}
#canvas-sources #concept-checks { display: none; }
#selected-result { color: var(--study-action-hover); font-weight: 700; line-height: 1.25; margin: 0 0 7px; }
#selected-result:empty { display: none; }
#canvas-results .summary strong { font-size: 1rem; line-height: 1.2; }
#canvas-facts, #check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 8px; }
#canvas-facts > div { min-width: 0; border-top: 1px solid var(--rule); padding: 4px 0; }
#canvas-facts :is(select, button) { max-width: 100%; min-height: 28px; font-size: .78rem; }
#canvas-facts small { display: block; font-size: .73rem; }
#canvas-facts .use-picker { display: grid; gap: 4px; }
#study-location { padding: 3px 0; text-align: left; border: none; }
html[data-layout='c'] #study-location span { font-size: .88rem; }
.canvas-location-label { display: none; }
html[data-layout='c'] .canvas-location-label { display: inline; }
html[data-layout='c'] .split-location-label { display: none; }
#fact-road #road-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 0; }
#fact-road #road-controls button { min-width: 0; text-align: left; padding: 3px 5px; line-height: 1.13; }
#fact-road #road-controls #width { display: block; width: 100%; }
#fact-road:has(#panel-width:not([inert])) { grid-column: 1 / -1; }
#fact-road #panel-width { width: 100%; }
#canvas-inputs[data-cue='road'] #fact-road,
#canvas-inputs[data-cue='windows'] #fact-windows { background: #fbefcf; border-radius: 4px; box-shadow: 0 0 0 2px #fbefcf; }
#study-cue { margin-top: 6px; font-size: .76rem; }
#study-cue button { padding: 2px 6px; font-size: inherit; }
.check-tile { display: grid; gap: 2px; padding: 4px 6px; border-radius: 5px; background: #f6f4ee; line-height: 1.2; }
.check-tile > span, .check-tile > small { font-size: .72rem; }
.check-tile b { display: inline-block; }
.check-tile[data-status='Pass on inputs'] { background: var(--study-tint); }
.check-tile[data-status='Pass on inputs'] > span { color: var(--study-action-hover); }
.check-tile[data-status='Fail'] { background: #fae4da; }
.check-tile[data-status='Fail'] > span { color: #8d281e; }
#canvas-checks #check-evidence { padding-bottom: 0; }
#scene [data-layer='bma-ground-footprints'] { display: none; }
#scene[data-tool='pen'] [data-layer='bma-ground-footprints'] { display: block; }
#scene .map-callout .callout-value { visibility: visible; }
#scene :is([data-layer='counted-floors'], [data-layer='modeled-open-ground'], [data-layer='checked-height-guide']) { visibility: hidden; pointer-events: none; }
html[data-layout='c'] #workspace:has([data-highlight='floors']:is(:hover,:focus)) #scene [data-layer='counted-floors'] { visibility: visible; stroke: #ffc968; fill: none; stroke-width: 2; }
html[data-layout='c'] #workspace:has([data-highlight='open']:is(:hover,:focus)) #scene [data-layer='modeled-open-ground'] { visibility: visible; fill: #ffdb71; fill-opacity: .45; }
html[data-layout='c'] #workspace:has([data-highlight='setbacks']:is(:hover,:focus)) #scene [data-layer='clearance-limit'] { stroke: #b82918; stroke-width: 4; }
html[data-layout='c'] #workspace:has([data-highlight='height']:is(:hover,:focus)) #scene [data-layer='checked-height-guide'] { visibility: visible; stroke: #7c3115; stroke-width: 3; }
html[data-layout='c'] #workspace:has(#fact-road:is(:hover,:focus-within), #scene [data-callout='road']:is(:hover,:focus)) #scene :is([data-layer='frontage'], [data-layer='matched-osm-road'], [data-layer='assumed-row-width']) { filter: drop-shadow(0 0 3px #ffe298); }
html[data-layout='c'][data-entry-phase]:not([data-entry-phase='study']) #workspace > footer { display: none; }
@media (min-width: 721px) {
  html[data-layout='c'] :is(#canvas-results, #canvas-inputs, #canvas-checks) { padding: 8px 10px; }
  html[data-layout='c'] #canvas-sidebar { gap: 5px; }
  html[data-layout='c'] #canvas-sidebar .canvas-card-title { margin-bottom: 4px; font-size: .95rem; line-height: 1.2; }
  html[data-layout='c'] #canvas-results .summary { grid-template-columns: .8fr 1fr 1.15fr; gap: 6px; }
  #canvas-results .summary > #concept-area-metric { grid-column: 2; grid-row: 1; }
  #canvas-results .summary strong { font-size: .91rem; }
  #canvas-facts > div { padding: 3px 0; }
  html[data-layout='c'] #canvas-inputs .use-picker select { min-height: 30px; padding: 3px 5px; }
  #study-cue:not([hidden]) { display: grid; grid-template-columns: 1fr auto auto; gap: 4px; align-items: center; }
  #study-cue button { min-height: 28px; }
  #canvas-checks .check-tile { padding-block: 4px; }
}
@media (max-width: 720px) {
  html[data-layout='c'] #canvas-sidebar { width: auto; bottom: 142px; }
}
