/* Mobile interaction layouts; all assessment and task data remain unchanged. */
html { scrollbar-gutter: stable; }
dialog.research-dialog { margin:auto; padding:0; width:min(1100px,calc(100% - 24px)); height:calc(100dvh - 24px); max-width:none; max-height:none; border:1px solid #59616d; border-radius:10px; color:#eeeef4; background:#121216; overflow:hidden; }
dialog.research-dialog:not([open]) { display:none; }
dialog.research-dialog[open] { display:flex; flex-direction:column; }
.research-dialog::backdrop { background:#030407c9; }
.research-dialog .dialog-header { flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 16px; border-bottom:1px solid #454751; background:#121216; }
.research-dialog .dialog-header h2 { margin:0; font:500 18px/1.3 Arial,sans-serif; max-width:none; letter-spacing:normal; }
.research-dialog button.dialog-close { flex:none; min-width:64px; min-height:44px; padding:10px 12px; font:inherit; font-size:16px; border:1px solid #727884; border-radius:4px; background:#22252d; color:#f2f3f6; cursor:pointer; }
.research-dialog .dialog-scroll { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.research-dialog .map-shell.expanded { position:static; inset:auto; border:0; border-radius:0; overflow:visible; }
.research-dialog .map-shell.expanded #expand { display:none; }
.research-dialog .map-shell.expanded #inspector { max-height:none; overflow:visible; }
.research-dialog #recordList { max-height:none; overflow:visible; }
.research-dialog .map-shell.expanded .chart svg { max-height:none; }
.map-detail-dialog .map-shell { border:0; border-radius:0; overflow:visible; }
.map-detail-dialog .map-shell #inspector { max-height:none; overflow:visible; border:0; }
.map-detail-dialog .inspector-top { display:none; }
.map-shell .catalogue { margin:0 12px 16px; }
.map-shell .catalogue-body { max-height:none; }
.map-shell .xy-touch-target { fill:transparent; stroke:transparent; stroke-width:44px; vector-effect:non-scaling-stroke; pointer-events:all; }
.map-shell .xy-point,.map-shell .xy-range,.map-shell .xy-area { pointer-events:none; }
.map-shell .xy-area { pointer-events:all; }
.map-shell .xy-hit { stroke-width:44px; vector-effect:non-scaling-stroke; pointer-events:stroke; }
.map-shell .xy-mark:focus-visible { outline:2px solid #fff; outline-offset:3px; }
.map-shell .group-pick { min-height:48px; }
.map-shell .search input,.map-shell .status-filter select { font-size:16px; min-height:44px; }
.map-shell .chart { scrollbar-width:auto; }
#research-workspace [hidden] { display:none!important; }
#research-workspace #timeline-diagram:empty { min-height:calc(clamp(400px,70svh,640px) + 52px); }
#research-workspace .timeline-task-disclosure { margin-top:24px; border-block:1px solid #454b56; }
#research-workspace .timeline-task-disclosure > summary { display:flex; justify-content:space-between; align-items:center; min-height:52px; padding:12px 0; font-size:18px; color:#e2e8ef; cursor:pointer; }
#research-workspace .timeline-task-disclosure > summary::marker,#research-workspace .timeline-task-disclosure > summary::-webkit-details-marker { display:none; }
#research-workspace .timeline-task-disclosure[open] > summary span { transform:rotate(45deg); }
#research-workspace .timeline-task-disclosure .task-list { margin-bottom:20px; }
#research-workspace .task-list { list-style:none; padding:0; margin:0; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#research-workspace .task-list button { display:block; text-align:left; width:100%; min-height:64px; padding:14px 16px; border:1px solid #414753; border-left:4px solid var(--task-color); border-radius:4px; color:#f0f1f4; background:#15191e; cursor:pointer; font:inherit; font-size:17px; line-height:1.4; }
#research-workspace .task-list button small { display:block; color:#c5cad3; font-size:14px; margin-top:6px; }
#research-workspace .task-list [data-state="complete"] { --task-color:#969da7!important; background:#202329; color:#c4c9d0; }
#research-workspace .task-list button:focus-visible { outline:2px solid #a6e3ff; outline-offset:3px; }
#research-workspace .record-header button { width:48px; height:48px; min-width:48px; }
#research-workspace .record-header { padding:12px 18px; align-items:center; }
#research-workspace .record-header h2 { font-size:22px; overflow-wrap:anywhere; }
#research-workspace .flow-scroll { height:clamp(400px,70svh,640px); }
@media(max-width:960px) {
  html { scroll-padding-top:var(--research-nav-space,100px); }
  .page-navigation { z-index:30; isolation:isolate; background:#0b0c0e; backdrop-filter:none; margin-inline:-1.5rem; padding-inline:1.5rem; box-shadow:0 12px #0b0c0e; }
  .page-index > summary { min-height:72px; padding-block:12px; }
  .page-index-current { min-width:0; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
  .page-index nav { max-height:var(--menu-space,60svh); box-sizing:border-box; padding-bottom:0; overflow:hidden; }
  .page-index .index-links { max-height:var(--menu-space,60svh); overflow-y:auto; overscroll-behavior:contain; padding-bottom:12px; box-sizing:border-box; }
  .research-layout [data-research-section].is-current-section::after { top:var(--section-outline-top,-6.5px); bottom:var(--section-outline-bottom,-6.5px); }
  .research-layout [data-research-section] { scroll-margin-top:12px; }
  #research-workspace .task-list { grid-template-columns:1fr; }
  #research-workspace .flow-layout { grid-template-columns:1fr 1fr; }
  #research-workspace .flow-scroll { grid-column:1 / -1; grid-row:1; }
  #research-workspace .flow-edge { grid-row:2; width:52px; height:44px; min-height:44px; margin-top:8px; }
  #research-workspace .flow-edge.previous { grid-column:1; justify-self:start; }
  #research-workspace .flow-edge.following { grid-column:2; justify-self:end; }
}
@media(max-width:900px) {
  .map-shell:not(.expanded) #inspector { max-height:none; overflow:visible; }
  .map-shell #recordList { max-height:none; overflow:visible; }
  .map-detail-dialog { width:min(680px,calc(100% - 12px))!important; }
}
@media(max-width:740px) {
  .map-shell .xy-tools { align-items:stretch; }
  .map-shell .search { min-width:0; width:100%; }
  .map-shell .status-filter { flex:1; min-width:0; }
  .map-shell .status-filter select { display:block; width:100%; max-width:none; }
  .map-shell .record-row { padding-block:14px; }
  .map-shell .record-row span { min-width:0; overflow-wrap:anywhere; }
  .map-shell .coordinate-pair { gap:12px; }
  .map-shell .y-components span { gap:8px; }
  .map-shell .recovery-codes { overflow-wrap:anywhere; gap:4px 12px; }
  .research-dialog .dialog-header { padding:8px 12px; padding-top:max(8px,env(safe-area-inset-top)); }
  dialog.research-dialog { width:calc(100% - 8px); height:calc(100dvh - 8px); border-radius:6px; }
  .research-dialog .dialog-scroll { padding-bottom:env(safe-area-inset-bottom); }
  #research-workspace .flow-scroll { height:clamp(340px,65svh,540px); }
  #research-workspace #timeline-diagram:empty { min-height:calc(clamp(340px,65svh,540px) + 52px); }
}
@media(max-width:600px) {
  .page-navigation { margin-inline:-1.125rem; padding-inline:1.125rem; }
  #research-workspace .record-dialog { height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); }
}
@media(max-height:450px) {
  .research-dialog .dialog-header h2,#research-workspace .record-header h2 { font-size:18px; }
  #research-workspace .record-dialog { height:calc(100dvh - 12px); max-height:calc(100dvh - 12px); }
  #research-workspace .record-header { padding-block:6px; }
}

/* The expanded dialog already has its own Close header. */
#mapShell.expanded .map-top{display:none}

@media(max-width:700px){.map-caption{display:none}}
