/* Reuse the study’s land and ink swatches; the city sits behind the entry form. */
.city-outline { fill: var(--psfc-fill-land, #edf0df); }
:is(.city-street, .city-major, .city-canal, .city-river) { fill: none; stroke: var(--psfc-road-ink, #718c83); stroke-linecap: round; stroke-linejoin: round; }
.city-street { stroke-width: calc(.65px * var(--psfc-road-weight, 1)); opacity: .5; }
.city-major { stroke-width: calc(1.25px * var(--psfc-road-weight, 1)); opacity: .8; }
.city-canal { stroke: var(--psfc-land-ink, #a8b4ad); stroke-width: .65; }
.city-river { stroke-width: 2.75; }
:is(#city-base, #entry-zone-art)[data-suspended] { display: none; }
#scene .psfc-flat-footprints {
  fill: var(--psfc-fill-roof, #a0b3ac);
  stroke: var(--psfc-footprint-ink, #957849);
  stroke-width: .55;
  vector-effect: non-scaling-stroke;
}
#entry-city-credit { position: absolute; left: var(--canvas-gutter); bottom: 8px; pointer-events: auto; padding: 2px 6px; border-radius: 4px; background: var(--panel); font-size: .72rem; }
#entry .entry-card { width: min(54rem, calc(100vw - 2rem)); padding: 1.55rem clamp(1rem, 3vw, 2.1rem) 1.1rem; border-color: #a76441; overflow: visible; }
#entry .entry-card h1 { text-align: center; margin-bottom: .45rem; }
.entry-fields {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr) 4rem;
  gap: .65rem;
  align-items: baseline;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}
.entry-lead { font-weight: 550; }
.entry-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.entry-search, #entry .themed-select-trigger {
  border: 0;
  border-bottom: 1px solid var(--muted);
  border-radius: 0;
  background: transparent;
}
.entry-search:focus-within { outline: 2px solid var(--study-action); outline-offset: 2px; }
#entry-location { min-height: 2.75rem; min-width: 0; padding: 0 .15em; border: 0; outline: 0; background: transparent; font: inherit; }
#entry-location::placeholder { color: var(--muted); opacity: 1; }
#entry-clear { display: grid; place-items: center; min-width: 28px; min-height: 28px; padding: 0; border: 0; background: transparent; }
#entry-clear[hidden] { display: none; }
#entry-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
#entry-places { min-width: 100%; }
#entry .themed-select-trigger { padding: 0 .15em; font-weight: 550; }
#entry .themed-select-trigger[aria-expanded='true'] { border-color: var(--study-action); }
.entry-fields :is(.themed-select-list, #entry-go) { font-size: 1rem; }
.entry-notes { min-height: 1.2em; color: var(--muted); font-size: .84rem; }
.entry-notes p { margin: 0; }
@media (max-width: 690px) {
  .entry-fields { grid-template-columns: max-content minmax(0, 1fr); gap: .3rem .65rem; }
  #entry-go { grid-column: 2; justify-self: end; width: auto; min-width: 4rem; }
  #entry .themed-select-list { min-width: 100%; }
}

/* Desktop: results and input rows keep their footprint as the study changes. */

@media (min-width: 721px) {
  /* Keep the form, toolbar and results legible against the illustrated map. */
  #entry .entry-card { padding-block: 1.65rem 1.1rem; }
  #entry .entry-card h1 { line-height: 1.1; margin-bottom: .65rem; }
  .entry-notes { text-align: center; }
  #entry-location { caret-color: var(--study-action); }
  #entry .entry-search:focus-within,
  #entry .themed-select-trigger[aria-expanded='true'] { border-bottom-color: var(--study-action); }
}
.entry-north { padding: 4px 9px; border-radius: 5px; background: var(--panel); }
#entry-location:focus-visible, #workspace-dialkit :focus-visible { outline: 2px solid var(--study-action); outline-offset: 2px; }
#canvas-heading #help { max-width: 42ch; line-height: 1.4; }
#road-pick-prompt { max-width: 32ch; font-weight: 600; }
#road-pick-prompt:not([hidden]) + #canvas-guidance { display: none; }
@media (scripting: none) { #entry .entry-fields, #entry-status { display: none; } }
.canvas-tool-label { display: none; }

/* One inspector, with a result band and two working sections on the same paper. */
html[data-layout='c'] #workspace { --sidebar-width: clamp(21rem, 33vw, 32rem); }
html[data-layout='c'] #canvas-sidebar {
  gap: 0; padding: 0; color: var(--ink); background: var(--panel);
  border: 1px solid #877369; border-radius: 12px; box-shadow: 0 5px 22px #30231e22;
  font-size: 1rem; line-height: 1.25; font-variant-numeric: tabular-nums;
}
html[data-layout='c'] #canvas-sidebar > :is(section, div, details) { padding: 10px 16px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; }
html[data-layout='c'] #canvas-sidebar .canvas-card-title { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.2; letter-spacing: -.02em; }
html[data-layout='c'] #canvas-sidebar #canvas-results { background: var(--study-action-hover); color: white; }
html[data-layout='c'] #canvas-sidebar .summary { grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(2, minmax(43px,auto)); gap: 3px 16px; }
html[data-layout='c'] #canvas-results .summary > div { border-top: 1px solid #ffffff55; padding: 4px 0 0; }
html[data-layout='c'] #canvas-results .summary > #concept-area-metric { grid-area: auto; }
html[data-layout='c'] #canvas-results .summary strong { margin: 0; color: white; font-size: clamp(1.08rem,1.45vw,1.36rem); line-height: 1.15; }
html[data-layout='c'] #canvas-results .summary small { color: #d2efdf; font-size: .83rem; }
html[data-layout='c'] #compass { top: 5px; right: 10px; min-width: 44px; min-height: 34px; justify-content: center; background: var(--study-action-hover); color: white; border-color: #ffffff75; }
#compass svg { width: 18px; height: 18px; fill: none; stroke: currentColor; }
#canvas-facts { grid-template-areas: 'location use' 'road road' 'windows windows'; gap: 6px 10px; }
#fact-location { grid-area: location; }
#fact-road { grid-area: road; position: relative; }
#fact-use { grid-area: use; }
#fact-windows { grid-area: windows; }
#canvas-facts > div { border: 0; padding: 0; }
#canvas-facts small { font-size: .86rem; font-weight: 600; }
#canvas-inputs #canvas-facts .use-picker { padding: 0; gap: 0; }
#canvas-facts :is(button,select), #canvas-facts .themed-select-list [role='option'] { min-height: 44px; font: inherit; font-weight: 580; }
#canvas-facts #study-location, #canvas-facts .themed-select-trigger, #fact-road #road-controls > button {
  width: 100%; padding: 5px 9px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; color: var(--ink);
}
#canvas-facts #study-location b, #canvas-facts .themed-select-trigger > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#fact-road #road-controls { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
#fact-road #road-controls small { color: var(--study-action-hover); }
#fact-road #panel-width { position: absolute; z-index: 3; inset: 100% 0 auto; width: 100%; }
#canvas-inputs #study-cue { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; min-height: 36px; font-size: .89rem; }
#study-cue[hidden] { display: grid !important; visibility: hidden; }
#study-cue button { min-height: 44px; padding: 2px 9px; }
#check-grid { gap: 6px; }
#canvas-checks .check-tile { --check-ink: var(--tea); align-content: center; gap: 2px; min-height: 54px; padding: 5px 9px; color: var(--ink); background: #faecd7; }
#canvas-checks .check-tile[data-status='Pass on inputs'] { --check-ink: var(--study-action); background: var(--study-tint); }
#canvas-checks .check-tile[data-status='Fail'] { --check-ink: #8d281e; background: #fae4da; }
.check-tile strong { display: flex; align-items: center; gap: 6px; font-size: 1.04rem; line-height: 1.2; }
.check-tile strong b { display: inline-grid; place-items: center; width: 1.12rem; height: 1.12rem; border-radius: 50%; background: var(--check-ink); color: white; font: 700 .84rem/1 system-ui; }
#canvas-checks .check-tile > :is(small,span) { font-size: .93rem; line-height: 1.15; }
#canvas-sidebar #check-evidence, #canvas-sidebar #canvas-sources { font-size: .95rem; }
#canvas-sidebar summary { cursor: pointer; }

/* The tool rail stays anchored as the optional concept comparison opens above it. */
html[data-layout='c'] #workspace #plot-tools, html[data-layout='c'] #workspace:has(#concept-bar:not([hidden])) #plot-tools {
  left: var(--map-center); bottom: calc(var(--canvas-gutter) + 18px); translate: -50% 0;
  display: flex; flex-wrap: nowrap; gap: 4px; padding: 4px; background: var(--panel);
  box-shadow: 0 3px 12px #30231e24;
}
html[data-layout='c'] #plot-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 44px; min-height: 44px; padding: 0 7px; font-size: 1rem; }
html[data-layout='c'] #plot-tools .canvas-tool-label { display: inline-flex; gap: 5px; align-items: center; font-weight: 650; }
.canvas-tool-label kbd { min-width: 17px; padding: 1px 3px; border: 1px solid currentColor; border-radius: 3px; font: 650 .72rem/1.15 system-ui; }
#plot-tools button:not([aria-keyshortcuts]) .canvas-tool-label kbd { visibility: hidden; }
#fact-road #road-controls > button:is([aria-pressed='true'],[aria-expanded='true']) { background: var(--study-tint); border-color: var(--study-action); }
@media (hover: hover) {
  #canvas-facts :is(.themed-select-trigger,#study-location):enabled:hover, #fact-road #road-controls > button:enabled:hover { border-color: var(--study-action); background: var(--study-tint); }
}
html[data-layout='c'] #concept-bar { bottom: calc(var(--canvas-gutter) + 78px); display: grid; width: min(20rem,calc(100% - 16px)); padding: 5px 9px 9px; gap: 2px; border-radius: 9px; justify-content: stretch; }
.concept-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.concept-heading strong { font-size: 1.12rem; }
.envelope-toggle { min-height: 44px; cursor: pointer; font-size: .94rem; }
.concept-previews { display: grid; grid-auto-columns: minmax(0,1fr); grid-auto-flow: column; gap: 6px; }
#concept-bar .concept-previews button { --concept-preview-paper: #f8e6d8; display: flex; justify-content: center; align-items: center; gap: 4px; padding: 3px; color: var(--tea); background: var(--concept-preview-paper); font-size: 1rem; font-weight: 700; }
#concept-bar .concept-previews button[aria-pressed='true'] { --concept-preview-paper: var(--study-tint); color: var(--study-action-hover); background: var(--concept-preview-paper); box-shadow: inset 0 0 0 2px currentColor; }
#concept-bar .concept-previews svg { width: 56px; height: 56px; }
.concept-previews .preview-side { fill: color-mix(in srgb,currentColor 67%,var(--concept-preview-paper)); stroke: currentColor; }
.concept-previews .preview-roof { fill: color-mix(in srgb,currentColor 33%,var(--concept-preview-paper)); stroke: currentColor; }
#show-envelope { appearance: none; position: relative; width: 34px; height: 20px; padding: 0; border-radius: 1rem; background: #e5d8ca; border: 1px solid #866c5c; cursor: pointer; }
#show-envelope::after { content: ''; position: absolute; inset: 2px auto 2px 2px; aspect-ratio: 1; border-radius: 50%; background: white; }
#show-envelope:checked { background: var(--study-action); border-color: var(--study-action); }
#show-envelope:checked::after { transform: translateX(14px); }
#show-envelope:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 720px) {
  html[data-layout='c'] #canvas-sidebar { bottom: 124px; }
  html[data-layout='c'] #workspace:has(#concept-bar:not([hidden])) #canvas-sidebar { bottom: 258px; }
  html[data-layout='c'] #workspace #plot-tools, html[data-layout='c'] #workspace:has(#concept-bar:not([hidden])) #plot-tools { bottom: 58px; }
  html[data-layout='c'] #concept-bar { bottom: 116px; }
  #canvas-facts { grid-template-areas: 'location location' 'road road' 'windows use'; }
}
@media (min-width: 721px) {
  .themed-select-trigger[aria-expanded='true']::after { transform: translateY(.12em) rotate(225deg); }
  @media (prefers-reduced-motion: no-preference) {
    #show-envelope::after,
    .themed-select-trigger:not(:focus-visible)::after { transition: transform 150ms var(--study-ease, ease-out); }
    @media (hover: hover) and (pointer: fine) {
      :is(#entry-go, #plot-tools button, #concept-bar button, #compass):not(:focus-visible) {
        transition: transform 120ms var(--study-ease), background-color 120ms ease;
      }
      :is(#entry-go, #plot-tools button, #concept-bar button, #compass):enabled:active:not(:focus-visible) {
        transform: scale(.97);
      }
    }
  }
}
