/* Shared visit language: numbered choices, material previews and quiet revisits. */
/* A location title and its address form one heading, across every case and view. */
.modal h2:has(+ .addr-line), .club-header h2:has(+ .club-address), .park-header h2:has(+ .meta) { margin-bottom:4px; }
.modal h2 + .addr-line, .club-header h2 + .club-address, .park-header h2 + .meta { margin-top:0; }
.popup-loc-body .popup-loc-name:has(+ .popup-loc-addr) { margin-bottom:4px; }
.popup-loc-body .popup-loc-name + .popup-loc-addr { margin-top:0; }
.addr-row .addr-row-name + .addr-row-meta { margin-top:4px; }
/* Every visit renderer uses the same compact title/address/back component. */
#location-modal .location-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:12px; row-gap:3px; align-items:center; margin:0 0 12px; }
#location-modal .location-heading h2 { grid-column:1; grid-row:1; margin:0; color:var(--paper); font:600 28px/1.2 var(--font-sans); letter-spacing:-.025em; overflow-wrap:anywhere; }
#location-modal .location-heading .addr-line { grid-column:1; grid-row:2; margin:0; color:var(--paper-dim); font-size:13px; line-height:1.4; }
#location-modal .location-heading .location-heading-back { grid-column:2; grid-row:1 / span 2; align-self:center; width:auto; min-height:32px; margin:0; padding:6px 0 6px 8px; white-space:nowrap; background:none; border:0; font:14px/1.4 var(--font-sans); }
#location-modal .location-heading[hidden], #location-modal .location-heading-back[hidden] { display:none !important; }
#location-modal .location-heading + .summary-text, #location-modal .location-heading + .code-prompt-text { margin-top:0; }
#location-modal .location-heading + .scene-action-result { margin-top:0; padding-top:0; border-top:0; }
#location-modal .club-content > .club-testimony > .summary-text:first-child { margin-top:0; }
#location-modal .club-content:empty { display:none; }
@media (max-width:760px) {
  #location-modal .location-heading { column-gap:8px; margin-bottom:10px; }
  #location-modal .location-heading h2 { font-size:24px; }
  #location-modal .location-heading .addr-line { align-self:start; }
  #location-modal .location-heading:has(.location-heading-back:not([hidden])) h2 { grid-column:1 / -1; padding-right:32px; }
  #location-modal .location-heading .location-heading-back { grid-row:2; min-height:32px; padding:4px 0 4px 4px; font-size:13px; }
}
.summary-text .compact-paragraph-break { white-space: normal; }
.summary-text .compact-paragraph-break::after { content: '\a'; white-space: pre; }
.investigation-choices { display: flex; flex-direction: column; gap: 0; margin: 24px 0; padding: 6px 0; background: #171412; border-left: 2px solid #80633a; }
.investigation-choice { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px; padding: 14px 18px; border: 0; margin: 0; background: transparent; color: var(--paper); text-align: left; font: 1rem/1.45 var(--font-serif); cursor: pointer; }
.investigation-choice:hover:not(:disabled), .investigation-choice:focus-visible { color: var(--amber-bright); background: linear-gradient(90deg, #47362180, transparent); }
.investigation-choice:focus-visible, .investigation-back:focus-visible, .location-photo-open:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.choice-number { flex: 0 0 20px; color: var(--amber); font: .8rem var(--font-mono); }
.choice-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice-state { color: var(--paper-dim); font: .65rem/1.4 var(--font-mono); white-space: nowrap; }
.choice-arrow { flex: 0 0 20px; color: var(--amber); text-align: right; }
.is-viewed .choice-label { color: var(--paper-dim); }
.investigation-choice:disabled { opacity: .6; cursor: wait; }
.investigation-back { display: inline-block; padding: 0; margin: 0 0 24px; background: none; border: 0; color: var(--amber); font: .85rem var(--font-serif); cursor: pointer; }
.location-visit h2:focus { outline: none; }
.felix-safe { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-dim); }
.felix-safe .code-form { flex-wrap: wrap; align-items: end; }
.felix-safe .code-form label { flex: 1 1 180px; display: grid; gap: 8px; }
.felix-safe .code-form input { width: 100%; box-sizing: border-box; letter-spacing: .35em; }
.felix-safe .code-form [role="alert"] { flex-basis: 100%; margin: 0; }
.location-photo-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.scene-material-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); align-items: stretch; }
.scene-material-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; height: auto; overflow-wrap: anywhere; box-sizing: border-box; }
.scene-material-preview { --material-preview-height: 200px; position: relative; overflow: hidden; height: var(--material-preview-height); }
.scene-material-crop { position: relative; overflow: hidden; width: min(100%, calc(var(--material-preview-height) * var(--crop-ratio, 1))); aspect-ratio: var(--crop-ratio, 1); }
.scene-material-preview.is-crop img { position: absolute; max-width: none; object-fit: fill; }
.scene-material-preview img { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0; }
.scene-material-description { font-size: .9rem; line-height: 1.5; margin: 10px 0 0; }
.scene-material-notes { margin: 0 0 20px; }
.scene-material-notes .scene-material-description { margin: 0; }
.material-preview-fallback { display: block; max-width: 72%; padding: 24px; background: #e8dfcd; color: #403a30; text-align: center; font: .8rem/1.45 var(--font-serif); }
.club-actions.investigation-choices { display: flex; flex-direction: column; gap: 0; padding: 6px 0; }
.club-visit .club-actions .investigation-choice { flex: auto; background: transparent; color: var(--paper); font-weight: normal; border: 0; }
.club-visit .club-actions .investigation-choice:hover { color: var(--amber-bright); background: linear-gradient(90deg, #47362180, transparent); }
.scene-material-card h4 { min-height: 2.6em; margin: 0; line-height: 1.3; align-items: flex-start; }
.scene-material-open { display: flex; flex-direction: column; flex: 1; gap: 12px; color: inherit; font: inherit; text-align: left; }
.scene-material-open .scene-material-preview { margin-bottom: 0; flex-shrink: 0; }
.scene-material-open .scene-material-description { margin: 0; }
.scene-material-open .btn { margin-top: auto; }
.scene-material-open .btn { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 44px; line-height: 1.35; padding: 10px 12px; background: var(--amber); border: 1px solid var(--amber); border-radius: 0; color: var(--bg-black); font-size: 1rem; font-weight: bold; text-align: center; }
.club-content .scene-material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scene-material-open:hover .btn { background: var(--amber-bright); border-color: var(--amber-bright); color: var(--bg-black); }
.park-detail .scene-materials { flex: 1; min-width: 0; max-width: 440px; border: 0; padding: 0; margin: 0; }
.park-detail-text:empty { display: none; }
.park-detail .scene-material-grid { grid-template-columns: 1fr; }
.park-detail .scene-material-preview { --material-preview-height: 250px; }
.park-visit > .investigation-choices { margin-bottom: 0; }
.club-content .scene-materials { margin-bottom: 24px; }

.police-visit .police-entrance-photo, .modal-photo, .club-arrival-image { display: block; width: 100%; height: clamp(200px, 30vh, 360px); object-fit: contain; margin: 0 0 22px; }
/* Keep the original card width. The notebook opens beside the card. */
#location-modal { padding: 24px 58px 24px 16px; overflow-x: auto; justify-content: safe center; }
#location-modal .location-workspace { --location-card-width: min(700px, calc(100vw - 74px)); position: relative; width: var(--location-card-width); max-width: none; flex-shrink: 0; max-height: calc(100dvh - 48px); display: flex; gap: 16px; }
#location-modal .location-workspace.with-materials { width: calc(var(--location-card-width) + 396px); }
#location-modal .location-workspace > .modal { flex: 0 0 var(--location-card-width); align-self:flex-start; width: var(--location-card-width); max-width: none; max-height: calc(100dvh - 48px); min-height:0; scrollbar-gutter:stable; padding:0; }
#location-modal .location-workspace > .modal, #location-modal #modal-body { transition:none !important; }
/* Reserve a compact row for navigation so it never sits on the scene photograph. */
#location-modal .location-top-controls { position:sticky; top:0; z-index:2; display:flex; justify-content:flex-end; align-items:center; min-height:52px; padding:8px 12px; box-sizing:border-box; background:var(--bg-panel); }
#location-modal .location-top-controls .modal-close { position:static; flex:0 0 36px; margin:0; }
#location-modal #modal-body { padding:0 42px 36px; }
#location-modal #modal-body > :last-child { margin-bottom:0; }
#location-modal #modal-body .summary-text:last-child { margin-bottom:0; }
#location-modal .is-inspecting .location-top-controls, #location-modal .park-inspecting-workspace .location-top-controls, #location-modal .club-inspecting .location-top-controls { display:none; }
#location-modal .is-inspecting #modal-body, #location-modal .park-inspecting-workspace #modal-body, #location-modal .club-inspecting #modal-body { padding:0; }
#location-modal .is-inspecting > .modal, #location-modal .park-inspecting-workspace > .modal, #location-modal .modal.club-inspecting { min-height:0; scrollbar-gutter:auto; }
#location-modal .modal-close, #pdf-modal .pdf-toolbar #pdf-close.is-back { z-index:2; background:#191613d9; color:var(--paper-dim); border:1px solid var(--border-dim); border-radius:50%; width:36px; height:36px; min-height:36px; display:flex; align-items:center; justify-content:center; padding:0; font:25px/1 var(--font-sans); }
#location-modal .modal-photo, #location-modal .club-arrival-image, #location-modal .police-entrance-photo { height: auto; max-height: none; width: 100%; }
.location-materials-tab { position: absolute; z-index: 3; right: -42px; top: 100px; width: 42px; min-height: 170px; padding: 14px 10px; writing-mode: vertical-rl; background: var(--bg-panel); color: var(--amber-bright); border: 1px solid var(--border-dim); border-left: 0; font: .9rem var(--font-serif); cursor: pointer; }
.location-materials-tab:hover, .location-materials-tab[aria-expanded="true"] { background: #392e20; }
.location-materials-tab:focus-visible { outline: 2px solid var(--amber-bright); outline-offset: 3px; }
#location-modal .is-inspecting .location-materials-tab { display: none; }
#location-case-panel { position: relative; flex: 0 0 380px; width: 380px; max-height: calc(100dvh - 48px); box-sizing: border-box; box-shadow: 4px 0 24px #0004; animation: location-notebook-in .22s ease-out; }
@keyframes location-notebook-in { from { transform: translateX(-24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@media (max-width: 760px) {
  #location-modal { padding: 12px 48px 12px 8px; }
  #location-modal .location-workspace { --location-card-width: min(700px, calc(100vw - 56px)); }
  #location-modal .location-workspace, #location-modal .location-workspace > .modal, #location-case-panel { max-height: calc(100dvh - 24px); height: auto; }
  #location-modal .location-workspace > .modal { min-height:0; }
  #location-modal .is-inspecting > .modal, #location-modal .park-inspecting-workspace > .modal, #location-modal .modal.club-inspecting { min-height:0; }
  #location-modal #modal-body { padding:0 16px 28px; }
  .location-materials-tab { right: -38px; width: 38px; top: 70px; }
}
@media (prefers-reduced-motion: reduce) { #location-case-panel { animation: none; } }
.police-topics-section { border: 0; padding: 0; }
.investigation-choices:has(> .archive-date-query) { border: 0; padding: 0; background: none; gap: 24px; }
.archive-date-query { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; padding: 24px; border: 1px solid var(--border-dim); background: #171412; }
.archive-date-query .summary-text { grid-column: 1 / -1; margin: 0; font-size: 1.05rem; line-height: 1.45; }
.archive-date-query .hint-text { grid-column: 1 / -1; margin: -4px 0 8px; color: var(--paper-dim); font-size: .78rem; line-height: 1.5; }
.archive-date-query label { display: block; min-width: 0; margin: 0; }
.archive-date-query input { display: block; width: 100%; min-width: 0; box-sizing: border-box; height: 46px; margin: 0; padding: 10px 12px; color: var(--paper); background: #111; border: 1px solid var(--border-dim); font: .9rem var(--font-serif); }
.archive-date-query .btn { width: auto; min-height: 46px; margin: 0; padding: 10px 18px; font-size: .9rem; white-space: nowrap; }
@media(max-width:560px) { .archive-date-query { grid-template-columns: minmax(0,1fr); padding: 18px; } .archive-date-query .btn { width: 100%; } }
.case-pdf { height: calc(100dvh - 32px); }
#pdf-pages { flex: 1; }
#pdf-modal[data-format="html"] #pdf-pages { padding: 0; overflow: hidden; background: #191613; }
.case-document-frame { display: block; width: 100%; height: 100%; border: 0; background: #191613; }
/* Match the location submenu return control in the document toolbar. */
#pdf-modal .pdf-toolbar #pdf-close.is-back:hover { color:var(--amber); }
#pdf-modal[data-format="photo"] #pdf-pages { background: #191613; }
.case-object-photo { display: block; max-width: none; height: auto; margin: 0 auto; object-fit: contain; }
.case-object-crop { position: relative; overflow: hidden; margin: 0 auto; }
.case-object-crop .case-object-photo { position: absolute; max-width: none; }
#pdf-status:empty { display: none; }
[hidden] { display: none !important; }
.document-workspace { display: flex; gap: 16px; width: min(1100px, 100%); height: calc(100dvh - 32px); min-height: 0; }
.document-workspace.with-materials { width: min(1500px, 100%); }
.document-workspace > .case-pdf { flex: 1 1 0; min-width: 0; }
.pdf-toolbar #document-materials-toggle { padding: 6px 10px; color: var(--amber-bright); font: .85rem var(--font-serif); }
.document-case-panel { flex: 0 0 380px; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg-panel); border: 1px solid var(--border-dim); padding: 16px; }
.document-case-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.document-case-panel h3 { margin: 0; color: var(--amber-bright); }
#document-materials-close { border: 0; background: none; color: var(--paper-dim); font-size: 1.6rem; cursor: pointer; }
#document-materials-search { margin-bottom: 12px; }
.document-case-scroll { overflow-y: auto; min-height: 0; }
#document-materials-container { display: grid; gap: 12px; }
#document-materials-container .info-card { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .document-workspace.with-materials { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .document-workspace.with-materials > .case-pdf { height: auto; min-height: 0; }
  .document-case-panel { padding: 12px; }
}
@media (max-width: 600px) {
  .investigation-choice { flex-wrap: wrap; gap: 8px; padding: 13px 12px; }
  .choice-label { flex-basis: calc(100% - 58px); }
  .choice-state { order: 4; margin-left: 28px; }
  .scene-material-preview { --material-preview-height: 180px; }
  .scene-material-grid { grid-template-columns: 1fr; }
  .club-content .scene-material-grid { grid-template-columns: 1fr; }
  .scene-material-open .btn { min-height: 44px; }
  .case-pdf { height: 100dvh; }
  .document-workspace { height: 100dvh; }
}

#location-case-panel .scene-material-grid, .document-case-panel .scene-material-grid { grid-template-columns: 1fr; }

#flynn-milestone { z-index:1200; align-items:center; padding:24px; background:#080706dc; }
.flynn-milestone-card { box-sizing:border-box; width:min(580px,100%); padding:48px 44px 40px; border:1px solid #76603d; background:#1b1814; text-align:center; box-shadow:0 24px 100px #0008; }
.flynn-milestone-rule { display:block; width:42px; height:1px; margin:0 auto 28px; background:#cfab6a; }
.flynn-milestone-card .flynn-milestone-eyebrow { margin:0 0 18px; color:#af946b; font:11px/1.5 var(--font-sans,Arial,sans-serif); text-transform:uppercase; letter-spacing:.2em; }
.flynn-milestone-card h2 { margin:0 0 22px; color:var(--paper); font:normal 36px/1.2 var(--font-serif); }
.flynn-milestone-card #flynn-milestone-question { max-width:390px; margin:0 auto; color:var(--paper-dim); font:20px/1.6 var(--font-serif); }
.flynn-milestone-actions { display:flex; justify-content:center; gap:14px; margin-top:34px; }
.flynn-milestone-actions .btn { min-height:46px; min-width:160px; padding:12px 22px; font:17px/1.2 var(--font-serif); }
@media(max-width:520px) {
 #flynn-milestone { padding:16px; }
 .flynn-milestone-card { padding:36px 24px 28px; }
 .flynn-milestone-card h2 { font-size:30px; }
 .flynn-milestone-card #flynn-milestone-question { font-size:18px; }
 .flynn-milestone-actions { flex-direction:column; gap:10px; }
}
