/* Street-survey folio: the interface frames the evidence; it never tints it. */
.case-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono, monospace);
  font-size: .85rem;
  text-decoration-thickness: 1px;
}
.case-head { margin: .5rem 0 1.1rem; gap: 1rem; }
.case-head > div { min-width: 0; }
.case-heading-bar .eyebrow { margin-bottom: .6rem; font-family: var(--mono, monospace); }
.case-head h1 {
  max-width: 24ch;
  margin: .3rem 0 .7rem;
  font-family: var(--display, sans-serif);
  font-size: clamp(2.25rem, 4.2vw, 4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.case-head p { max-width: 56rem; font-size: 1.08rem; line-height: 1.55; }
.investigation-progress {
  margin: 0 0 1rem;
  padding: .55rem .85rem;
  border-left: 5px solid var(--forest, #203f34);
  color: var(--ink);
  background: var(--gold, #f4c768);
  font-family: var(--mono, monospace);
  font-size: .85rem;
  line-height: 1.5;
}
.investigation-workspace { position: relative; }
.case-layout { gap: clamp(1rem, 2.4vw, 2.5rem); }
.photo-column, .map-column, .reveal { scroll-margin-top: 6rem; }
.case-layout :is(button, select, textarea, .viewport) { scroll-margin-block: 6rem 2rem; }
.surface-panel {
  min-width: 0;
  border: 1px solid var(--forest, #203f34);
  border-radius: 0;
  background: var(--paper);
}
.surface-panel .panel-head {
  gap: .7rem;
  flex-wrap: wrap;
  padding: .65rem .85rem;
  color: var(--paper);
  background: var(--forest, #203f34);
  border-bottom: 3px solid var(--gold, #f4c768);
}
.surface-panel .panel-head h2 {
  margin: 0;
  font-family: var(--display, sans-serif);
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.surface-panel .panel-head button {
  min-height: 44px;
  padding: .45rem .8rem;
  border: 1px solid var(--paper);
  border-radius: 0;
  color: var(--paper);
  background: transparent;
  font-size: .9rem;
}
.surface-panel .panel-head button:hover { color: var(--ink); background: var(--gold, #f4c768); border-color: var(--gold, #f4c768); }
.surface-panel .panel-head button:focus-visible { outline-color: var(--gold, #f4c768); }
.surface-panel .toolbar {
  gap: .45rem;
  padding: .65rem;
  align-items: center;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.surface-panel .toolbar button {
  min-height: 48px;
  min-width: 48px;
  padding: .6rem .75rem;
  border: 1px solid var(--forest, #203f34);
  border-radius: 0;
  font-size: .9rem;
  line-height: 1.35;
  background: transparent;
}
.surface-panel .toolbar button:hover { background: var(--gold, #f4c768); }
.surface-panel .toolbar [data-action='pin'] { border-width: 2px; font-weight: 700; }
.surface-panel .toolbar [aria-pressed='true'] { color: var(--paper); background: var(--forest, #203f34); }
.surface-panel .toolbar [aria-pressed='true']:hover { color: var(--paper); background: var(--ink); }
.surface-panel .zoom-level { min-width: 3.7rem; font: .9rem var(--mono, monospace); font-variant-numeric: tabular-nums; }
.surface-panel .viewport {
  touch-action: none;
  background: #e3e1d7;
  scrollbar-width: auto;
  scrollbar-color: var(--forest, #203f34) var(--paper);
  scroll-padding: 2rem;
}
.surface-panel .viewport:focus-visible { outline: 4px solid var(--accent, #8f432d); outline-offset: -4px; z-index: 1; }
.surface-panel .viewport.pinning { box-shadow: inset 0 0 0 4px var(--accent, #8f432d); }
.surface-panel .marker {
  width: 36px;
  height: 36px;
  font: 700 18px Arial, sans-serif;
  background: #8f432d;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #6b2d1d;
}
.surface-panel .marker.correct { background: #203f34; box-shadow: 0 0 0 2px #fff; }
.surface-panel .marker.draft { color: #70331e; background: #fff; border: 3px dashed #70331e; box-shadow: 0 0 0 2px #fff; }
.surface-panel .radius { border-color: #203f34; background: #e9fff530; }
.surface-help, .surface-feedback { margin: 0; padding: .65rem .85rem; font-size: .92rem; line-height: 1.55; }
.surface-help { background: var(--paper); }
.surface-feedback { min-height: 3rem; color: var(--ink); background: #e7ebdf; border-block: 1px solid var(--line); }
.surface-panel .panel-note { margin: 0; padding: .85rem; color: var(--muted, #4c5d53); font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.surface-panel .scene { padding: .65rem .85rem; }
.surface-panel .scene summary { display: list-item; min-height: 44px; line-height: 1.5; padding-block: .45rem; }
.surface-panel .scene p { font-size: 1rem; line-height: 1.6; }
.pan-controls { display: flex; flex-wrap: wrap; gap: .45rem; padding: .1rem .65rem .65rem; }
.pan-controls button { min-height: 44px; border-color: var(--forest, #203f34); border-radius: 0; font-size: .95rem; }
.pan-controls[hidden], .discovery-pick[hidden] { display: none; }
.case-layout .tabs { gap: 0; margin-top: 1.3rem; padding: 0; border-bottom: 2px solid var(--forest, #203f34); }
.case-layout .tabs button { min-height: 48px; padding: .65rem 1rem; border-radius: 0; border: 1px solid var(--forest, #203f34); border-bottom: 0; background: var(--paper); line-height: 1.4; }
.case-layout .tabs button + button { margin-left: -1px; }
.case-layout .tabs button[aria-selected='true'] { color: var(--paper); background: var(--forest, #203f34); }
.case-layout .tab-content { padding: 1rem 0; }
.case-layout .clue { padding: .65rem 0; border-color: var(--line); }
.case-layout .clue:first-child { padding-top: 0; }
.case-layout .clue button { min-height: 52px; border: 1px solid var(--forest, #203f34); border-radius: 0; background: transparent; line-height: 1.5; }
.case-layout .clue button[aria-expanded='true'] { background: var(--gold, #f4c768); }
.case-layout .clue p { padding: .4rem .7rem 0; line-height: 1.65; }
.play-instructions { padding-left: 1.5rem; }
.play-instructions li { line-height: 1.65; margin-bottom: .85rem; }
.next-map { margin: .25rem 0 1.5rem; min-height: 52px; }
.map-evidence { margin: 1rem 0; padding: .75rem 1rem; border: 1px solid var(--line); background: var(--paper); }
.map-evidence summary { min-height: 44px; line-height: 1.5; padding-block: .4rem; }
.map-evidence img { display: block; width: min(100%, 30rem); height: auto; margin: .8rem auto; }
.map-evidence li { margin-block: .6rem; }
.guess-box { padding: 1.25rem; border-top: 5px solid var(--forest, #203f34); }
.guess-box h2 { font-family: var(--display, sans-serif); font-size: 1.9rem; font-weight: 750; line-height: 1.1; letter-spacing: -.035em; }
.guess-box label { font-size: 1rem; line-height: 1.5; }
.guess-box select { min-height: 54px; padding: .8rem; font-size: 1rem; line-height: 1.5; border-color: var(--forest, #203f34); border-radius: 0; white-space: normal; }
.guess-box textarea { min-height: 8rem; padding: .8rem; font-size: 1rem; line-height: 1.6; border-color: var(--forest, #203f34); border-radius: 0; }
.guess-box .map-instruction, .guess-box .save-status { font-size: .95rem; line-height: 1.55; }
.guess-box .save-status { padding: .4rem 0; color: var(--muted, #4c5d53); font-family: var(--mono, monospace); font-size: .85rem; }
.guess-box #reveal-button { min-height: 54px; line-height: 1.5; }
.building-comparisons { margin-block: 1rem; }
.building-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .8rem; }
.building-files figure { margin: 0; }
.building-files img { width: 100%; height: auto; display: block; }
.building-files figcaption { font-size: .95rem; padding-top: .4rem; line-height: 1.5; }
.case-sharing { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.investigation-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.investigation-steps li { padding: 1rem; border-top: 3px solid var(--forest, #203f34); background: var(--paper); line-height: 1.5; }
.investigation-steps strong, .investigation-steps span { display: block; }
.investigation-steps span { margin-top: .35rem; font-size: .95rem; }
/* The dialog stays a working image surface, with a clearly separate close control. */
#inspection { width: min(96vw, 1680px); height: 94vh; height: 94dvh; max-height: 96dvh; padding: 1.1rem; border: 2px solid var(--forest, #203f34); border-radius: 0; background: var(--paper); box-shadow: 0 1rem 4rem #14291f66; }
#inspection::backdrop { background: #14291fe6; }
#close-inspection { position: sticky; top: 0; z-index: 5; margin: 0 0 .7rem .7rem; width: 48px; height: 48px; padding: 0; border: 1px solid var(--forest, #203f34); border-radius: 0; color: var(--ink); background: var(--gold, #f4c768); font-size: 1.8rem; }
#inspection .surface-panel .viewport { height: clamp(220px, 54dvh, 800px); }
#inspection .surface-help { padding-right: 1rem; }
.desktop-list-action { display: none; }
@media (min-width: 721px) {
  main:has(> .case-heading-bar) { padding-top: .45rem; }
  .case-heading-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem 1rem; }
  .case-heading-bar .eyebrow { margin: 0; }
  .case-head { margin: .15rem 0 .65rem; }
  .case-head h1 { max-width: 42ch; margin: 0 0 .3rem; font-size: clamp(2.1rem, 3.4vw, 3.4rem); }
  .case-head p { margin: 0; line-height: 1.4; }
  .investigation-progress { margin-bottom: .65rem; padding-block: .3rem; }
  .case-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-layout .panel-head { padding-block: .25rem; }
  .case-layout .viewport { height: clamp(250px, 44dvh, 510px); }
  .case-layout .toolbar { gap: .35rem; padding: .4rem; }
  .case-layout .toolbar :is([data-action='out'], [data-action='in']) { font-size: 1.18rem; padding: .3rem; }
  .case-layout .toolbar :is([data-action='out'], [data-action='in']) span { display: none; }
  .case-layout .zoom-level { text-align: center; }
  .case-layout .zoom-level::before { content: 'Zoom '; }
  .case-layout .map-evidence, .mobile-map-action { display: none; }
  .desktop-list-action { display: inline; }
  .map-column > .guess-box { margin-top: 1rem; }
}
@media (max-width: 1000px) {
  .case-layout { gap: 1rem; }
  .surface-panel .toolbar button { padding: .6rem; }
  .surface-panel .toolbar [data-action='fit'] { flex-grow: 1; }
}
@media (max-width: 720px) {
  /* Keep the first photograph in view before instructions and writing controls. */
  .case-head { margin: .4rem 0 .65rem; gap: 0; }
  .case-heading-bar .eyebrow { margin-bottom: .35rem; font-size: .75rem; line-height: 1.4; }
  .case-head h1 { margin: .25rem 0 .5rem; font-size: 1.9rem; line-height: 1.05; }
  .case-head p { font-size: 1rem; line-height: 1.45; }
  .investigation-progress { margin-bottom: .5rem; padding: .4rem .65rem; font-size: .8rem; }
  .mobile-views { display: flex; position: sticky; top: 0; z-index: 8; gap: .4rem; margin: 0 0 .6rem; padding: .35rem 0; background: var(--paper); border-bottom: 2px solid var(--forest, #203f34); }
  .mobile-views button { min-height: 52px; padding: .5rem; border: 1px solid var(--forest, #203f34); border-radius: 0; color: var(--ink); background: var(--paper); font-size: .95rem; line-height: 1.35; }
  .mobile-views button[aria-pressed='true'] { color: var(--paper); background: var(--forest, #203f34); box-shadow: inset 0 -3px 0 var(--gold, #f4c768); }
  .surface-panel .panel-head { padding: .5rem .65rem; }
  .surface-panel .panel-head h2 { font-size: 1.1rem; }
  .surface-panel .panel-head button { padding: .4rem .6rem; }
  .surface-panel .viewport { height: clamp(260px, 46dvh, 400px); }
  .surface-panel .plane { align-content: start; }
  .surface-panel .toolbar [data-action='pin'] { flex-basis: 100%; }
  .keyboard-help { display: block; margin-top: .35rem; }
  .guess-box { padding: 1rem; }
  .guess-box #reveal-button, .next-map { width: 100%; }
  .case-layout[data-view='photo'] > .map-column { display: none; }
  .case-layout[data-view='map'] > .photo-column { display: none; }
  .investigation-workspace:has(+ #reveal:not([hidden])) .mobile-views { position: static; }
  .investigation-steps { grid-template-columns: 1fr; gap: .6rem; }
  .investigation-steps li { padding: .7rem 1rem; }
  #inspection { width: calc(100% - .7rem); height: 96dvh; padding: .65rem; }
}
.portrait-jump, .touch-places { display: none; }
@media (any-pointer: coarse) and (min-width: 721px) and (min-height: 540px) {
  .place-picker { display: none; }
  .touch-places { display: block; min-width: 0; margin: 0; padding: 0; border: 0; }
  .touch-places legend { padding: 0; margin-bottom: .55rem; font-weight: 700; line-height: 1.5; }
  .place-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .45rem; }
  .guess-box .place-options label {
    display: flex; align-items: center; gap: .6rem; min-height: 48px; margin: 0; padding: .55rem .7rem;
    border: 1px solid var(--line); font-weight: 500; line-height: 1.35; cursor: pointer; overflow-wrap: anywhere;
  }
  .place-options input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--forest); }
  .place-options label:has(:checked) { border-color: var(--forest); background: #e7ebdf; }
  .place-options label:focus-within { outline: 2px solid var(--forest); outline-offset: 1px; }
  .touch-places + .map-instruction { margin-top: .7rem; }
}
@media (any-pointer: coarse) and (min-width: 721px) and (orientation: portrait) {
  .case-layout { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .case-layout .viewport { height: clamp(320px, 48dvh, 660px); }
  .case-layout .toolbar [data-action='fit'] { flex-grow: 0; }
  .case-progress-row {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 0 .7rem; margin-bottom: .65rem; padding-inline: .65rem; border-left: 5px solid var(--forest); background: var(--gold);
  }
  .case-progress-row .investigation-progress { margin: 0; padding-inline: 0; border: 0; }
  .portrait-jump {
    display: inline-flex; align-items: center; min-height: 44px; padding: .35rem .25rem;
    border: 0; background: transparent; color: var(--ink); font-weight: 600;
    text-decoration: underline; text-underline-offset: .2em;
  }
  .map-column > .portrait-jump { margin-bottom: .25rem; }
}
.strong-contrast .surface-feedback { background: var(--paper); border-color: var(--ink); }
.strong-contrast .surface-panel .panel-note, .strong-contrast .guess-box .save-status { color: var(--ink); }
@media (forced-colors: active) {
  .surface-panel .marker, .surface-panel .marker.draft { border: 3px solid CanvasText; background: Canvas; color: CanvasText; }
  .surface-panel .marker.draft { border-style: dashed; }
  .surface-panel .radius { border-color: CanvasText; background: transparent; }
  .surface-panel .viewport.pinning { outline: 4px solid Highlight; }
  .mobile-views button[aria-pressed='true'], .case-layout .tabs button[aria-selected='true'] { border: 3px solid Highlight; }
}

/* Keep viewer guidance available to assistive technology without repeated rows. */
.surface-panel .viewer-assistive {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Direct pinning is a mouse shortcut; touch and keyboard retain explicit mode. */
.mouse-pin-cue { display: none; }
@media (hover: hover) and (pointer: fine) {
  .mouse-pin-cue:not([hidden]) {
    display: inline-block;
    padding: .3rem .15rem;
    color: var(--paper);
    font-size: .85rem;
    line-height: 1.4;
  }
}

/* Tablet taps use the same gesture safeguards as desktop clicks; phones keep explicit mode. */
.tablet-pin-cue { display: none; }
@media (min-width: 721px) and (min-height: 600px) and (pointer: coarse) {
  .tablet-pin-cue:not([hidden]) {
    display: inline-block;
    padding: .3rem .15rem;
    color: var(--paper);
    font-size: .85rem;
    line-height: 1.4;
  }
}
/* A fitted tablet viewer may scroll its dialog, never the page behind it. */
#inspection { overscroll-behavior-y: contain; }
