/* Spierfinder refinements. Keep the practice palette and the source diagrams intact. */
#atlas-root {
  --atlas-ease: cubic-bezier(.2,.7,.2,1);
  --atlas-duration: 200ms;
  --line: rgba(131,171,205,.18);
  --muted: #b2c3d3;
}
#atlas-root :is(.atlas-mobile-nav,.sidebar-backdrop,.sidebar-drawer-header,.sidebar-close,.finder-mobile-selection) { display: none; }
#atlas-root :is(.workspace,.finder-results,.pain-result-copy,.guide-article) { min-width: 0; }
#atlas-root .workspace { border: 0; background: transparent; }
#atlas-root .map-panel { border: 0; background: transparent; }
#atlas-root :is(.intro,.mode-description,.location-context,.note,.article-section p,.article-section li,.finder-instruction p,.muscle-row p,.result-pain-copy > p) { font-size: 14px; line-height: 1.8; }
#atlas-root :is(.small,.result-meta,.result-latin,.source-link,.figure-preview figcaption,.result-pain-figure figcaption) { font-size: 12px; line-height: 1.7; }
#atlas-root :is(.article-section,.guide-muscle,.az-group,#illustraties) { scroll-margin-top: 104px; }
#atlas-root :is(.muscle-row,.result-pain-copy,.location-context,.guide-pagination a,.breadcrumb) { overflow-wrap: anywhere; }
#atlas-root :is(.side-link,.chip,.text-btn,.save-button,.finder-zone-button,.finder-location-button,.finder-back-button,.az-letters a,.mobile-toc a,.book-headings a,.chapter-list a) { min-height: 44px; }
#atlas-root :is(.side-link,.chip,.text-btn,.save-button,.finder-zone-button,.finder-location-button,.finder-back-button) { font-size: 13px; }
#atlas-root :is(.side-link,.chip,.save-button,.finder-zone-button,.finder-location-button,.finder-back-button,.symptom-item,.az-letters a) {
  transition: background-color 180ms var(--atlas-ease), border-color 180ms var(--atlas-ease), color 180ms var(--atlas-ease), transform 180ms var(--atlas-ease);
}
#atlas-root :is(.text-btn,.muscle-row) > svg { transition: transform 180ms var(--atlas-ease); }
#atlas-root :is(.chip,.text-btn,.save-button) { justify-content: center; }
#atlas-root .side-link { padding-block: 10px; }
#atlas-root .side-regions .side-link { font-size: 12px; }
#atlas-root .side-label { font-size: 11px; }
#atlas-root .side-link .count { font-size: 11px; }
#atlas-root .sidebar-book p { font-size: 12px; }
#atlas-root .searchbox { border-color: rgba(127,172,205,.32); background: #0d1520; border-radius: 14px; min-height: 54px; }
#atlas-root .searchbox input { font-size: 16px; line-height: 1.5; padding-block: 13px; }
#atlas-root .searchbox input::placeholder { color: #a2b5c8; }
#atlas-root .searchbox kbd { font-size: 12px; }

/* The current view reads as a selection instead of another text link. */
#atlas-root .tabs { gap: 6px; padding: 5px; border: 0; border-radius: 14px; margin: 20px 0 24px; background: #0c141f; }
#atlas-root .tabs :is(a,button) { justify-content: center; min-height: 44px; padding: 10px 13px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; line-height: 1.5; transition: background-color 180ms var(--atlas-ease), color 180ms var(--atlas-ease), border-color 180ms var(--atlas-ease); }
#atlas-root .tabs .active { color: #b2efff; border-color: rgba(71,190,228,.28); background: #162b3c; }
#atlas-root .finder-steps { gap: 6px; flex-wrap: nowrap; margin-bottom: 18px; font-size: 12px; }
#atlas-root .finder-steps :is(a,span):has(b) { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 5px 7px; border-radius: 10px; line-height: 1.45; }
#atlas-root .finder-steps b { flex-shrink: 0; width: 27px; height: 27px; margin: 0; font-size: 12px; background: #1c2a3a; color: #acc5d9; }
#atlas-root .finder-steps [aria-current] { background: rgba(0,184,238,.07); }
#atlas-root .finder-steps [aria-current] b { background: #84dff7; color: #0b2434; }
#atlas-root .map-heading { padding: 17px 18px 5px; font-size: 14px; }
#atlas-root .map-heading .text-btn { font-size: 12px; }
#atlas-root .map-number { font-size: 11px; }
#atlas-root .finder-person figcaption { font-size: 11px; }
/* One large body at a time gives every anatomical region more room to tap. */
#atlas-root .finder-body-viewer { display: grid; gap: 12px; width: min(100%,348px); min-width: 0; justify-self: center; padding: 18px 12px 12px; }
#atlas-root .finder-body-viewer .finder-figures { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; min-width: 0; padding: 0; }
#atlas-root .finder-body-viewer .finder-person { width: 100%; padding: 10px 4px 4px; }
#atlas-root .finder-body-viewer .finder-person[hidden] { display: none; }
#atlas-root .finder-body-viewer .finder-person-svg { width: 100%; height: auto; aspect-ratio: 293 / 650; max-height: none; }
#atlas-root .finder-flip-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid rgba(97,204,235,.4); border-radius: 12px; background: #17354a; color: #b8efff; font-size: 14px; font-weight: 650; line-height: 1.5; cursor: pointer; touch-action: manipulation; transition: background-color 180ms var(--atlas-ease), border-color 180ms var(--atlas-ease), transform 180ms var(--atlas-ease); }
#atlas-root .finder-flip-button svg { width: 22px; height: 22px; flex-shrink: 0; }
#atlas-root .finder-flip-button [data-flip-label] { min-width: 0; }
#atlas-root .finder-flip-button:hover { border-color: #7adcf6; background: #20465e; }
#atlas-root .finder-flip-button:active { transform: scale(.985); }
#atlas-root .finder-flip-button:focus-visible { outline: 3px solid #8be3fa; outline-offset: 4px; }
#atlas-root .finder-view-overview .finder-zone-button { font-size: 14px; }
#atlas-root .finder-location-button { min-height: 48px; font-size: 13px; }
#atlas-root .finder-image-credit { font-size: 11px; }
#atlas-root .results-title { align-items: flex-start; }
#atlas-root .results-title h2 { font-size: 24px; line-height: 1.4; }
#atlas-root .results-title > .small { flex-shrink: 0; padding: 5px 8px; border-radius: 8px; background: rgba(0,184,238,.07); }
#atlas-root .result-context { margin: 0 0 16px; padding: 0 13px; border: 0; border-radius: 12px; background: rgba(14,27,41,.45); }
#atlas-root .result-context summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 0; color: #b6cfdf; cursor: pointer; font-size: 13px; line-height: 1.6; list-style: none; }
#atlas-root .result-context summary::-webkit-details-marker { display: none; }
#atlas-root .result-context summary svg { width: 16px; height: 16px; flex-shrink: 0; margin-left: auto; color: #7bd3ef; }
#atlas-root .result-context summary::after { content: ''; width: 6px; height: 6px; flex-shrink: 0; margin: -3px 2px 0 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 180ms var(--atlas-ease); }
#atlas-root .result-context[open] summary::after { transform: rotate(225deg); }
#atlas-root .result-context summary:hover { color: #d5edf8; }
#atlas-root .result-context[open] summary { border-bottom: 1px solid var(--line); color: #d5edf8; }
#atlas-root .result-context[open] > :not(summary) { margin-top: 14px; margin-bottom: 14px; }
#atlas-root .result-context :is(.mode-description,.location-context) { font-size: 14px; line-height: 1.75; }

/* Calm card surfaces group each muscle name with its uncropped pain diagrams. */
#atlas-root .result-list:has(.pain-result-card) { display: grid; gap: 16px; border-top: 0; }
#atlas-root .pain-result-card { padding: 18px; border: 0; border-radius: 16px; background: #101c2a; }
#atlas-root .pain-result-card > .muscle-row { min-height: 50px; padding-bottom: 16px; gap: 12px; }
#atlas-root .pain-result-card .muscle-row h3 { font-size: 17px; line-height: 1.45; margin-bottom: 4px; }
#atlas-root .pain-result-card > .muscle-row > svg { width: 28px; height: 28px; padding: 5px; margin: 0; border-radius: 50%; background: rgba(0,184,238,.08); }
#atlas-root .pain-result-card > .muscle-row:hover { background: transparent; }
#atlas-root :is(.pain-result-body,.az-items .pain-result-body,.az-items .pain-result-body:has(.has-multiple)) { grid-template-columns: minmax(0,1fr); gap: 16px; }
#atlas-root :is(.result-pain-images,.az-items .result-pain-images).has-multiple { grid-template-columns: repeat(2,minmax(0,1fr)); }
#atlas-root .result-pain-figure { border: 0; border-radius: 12px; }
#atlas-root .result-pain-figure button { padding: 10px; }
#atlas-root .result-pain-figure img { height: 260px; }
#atlas-root .result-pain-figure figcaption { padding: 9px 10px; font-size: 11px; }
#atlas-root .result-pain-zoom { right: 8px; bottom: 8px; padding: 7px; border-radius: 8px; transition: transform 180ms var(--atlas-ease); }
#atlas-root .result-pain-zoom svg { width: 16px; height: 16px; }
#atlas-root .result-pain-copy .result-meta { padding-top: 12px; margin-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
#atlas-root .result-pain-unavailable { min-height: 160px; padding: 16px; }
#atlas-root .result-pain-unavailable span { font-size: 14px; }
#atlas-root .result-pain-unavailable p { font-size: 13px; }
#atlas-root .az-items { grid-template-columns: 1fr; gap: 16px; }
#atlas-root .az-toolbar { font-size: 14px; }
#atlas-root :is(.az-toolbar select,.chapter-select,.guide-mobile-select select) { min-height: 48px; font: inherit; font-size: 16px; border: 1px solid rgba(127,172,205,.32); border-radius: 12px; background: #0d1520; color: var(--ink); padding: 10px 12px; max-width: 100%; }
#atlas-root .az-letters { gap: 6px; }
#atlas-root .az-letters a { min-width: 44px; font-size: 14px; background: #0d1622; border: 1px solid var(--line); }
#atlas-root .symptom-item { min-height: 64px; }
#atlas-root .symptom-item span { font-size: 14px; }
#atlas-root .symptom-item small { font-size: 12px; }
#atlas-root .research-details summary { min-height: 44px; align-content: center; font-size: 13px; }
#atlas-root :is(.research-link,.article-section .research-item p) { font-size: 14px; }
#atlas-root .article-section .research-item .research-type { font-size: 12px; }
#atlas-root .figure-placeholder { font-size: 14px; }
#atlas-root .book-headings :is(summary,a) { font-size: 14px; }
#atlas-root .book-headings summary { min-height: 44px; align-content: center; }
#atlas-root .guide-pagination a { min-height: 48px; font-size: 14px; }
#atlas-root .guide-mobile-select { margin-top: 16px; }

@media (min-width: 701px) {
  #atlas-root .az-items { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (min-width: 901px) {
  #atlas-root .atlas-page-header { padding-bottom: 24px; }
  #atlas-root .atlas-page-header h1 { font-size: 40px; margin: 12px 0; }
  #atlas-root .atlas-page-header > p { font-size: 14px; line-height: 1.7; }
  #atlas-root .workspace > .page-heading { margin-bottom: 18px; }
  #atlas-root .workspace > .page-heading .intro { margin-bottom: 0; }
  #atlas-root .finder-title { margin-bottom: 8px; }
  #atlas-root[data-view="kaart"] .workspace > .page-heading .eyebrow { display: none; }
}

.image-modal { max-height: 92dvh; overscroll-behavior: contain; }
.image-modal .modal-bar { position: sticky; top: 0; z-index: 1; padding: 10px 16px; background: #101722; font-size: 14px; }
.image-modal .modal-bar button { min-width: 44px; min-height: 44px; justify-content: center; gap: 8px; padding: 10px 14px; font-size: 14px; }
.image-modal .modal-image { max-height: 68dvh; }
.image-modal .modal-caption { font-size: 14px; line-height: 1.75; }
.image-modal[open] { animation: atlas-modal-in 200ms cubic-bezier(.2,.7,.2,1); }
.image-modal[open]::backdrop { animation: atlas-backdrop-in 180ms ease-out; }
@keyframes atlas-modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes atlas-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

@media (hover: hover) and (pointer: fine) {
  #atlas-root :is(.finder-zone-button,.finder-location-button,.symptom-item):hover { transform: translateY(-1px); }
  #atlas-root :is(.text-btn,.muscle-row):hover > svg { transform: translateX(3px); }
  #atlas-root .result-pain-figure button:hover .result-pain-zoom { transform: scale(1.08); }
  #atlas-root .tabs :is(a,button):hover { background: rgba(0,184,238,.08); }
}
#atlas-root :is(.chip,.save-button,.finder-zone-button,.finder-location-button,.finder-back-button):active { transform: scale(.985); }

@media (min-width: 901px) and (max-width: 1180px) {
  #atlas-root .az-items { grid-template-columns: 1fr; }
  #atlas-root .finder-grid.has-results { grid-template-columns: minmax(230px,.9fr) minmax(0,1.1fr); }
  #atlas-root .finder-results .pain-result-body { grid-template-columns: 1fr; }
  #atlas-root .finder-results .result-pain-images.has-multiple { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #atlas-root .finder-location-list { grid-template-columns: 1fr; }
  #atlas-root .tabs { gap: 2px; }
  #atlas-root .tabs :is(a,button) { padding-inline: 9px; font-size: 11px; }
}

/* Phone and tablet: stable bottom navigation, one task per screen, scrollable drawer. */
@media (max-width: 900px) {
  body:is(.atlas-menu-open,.atlas-image-open) { overflow: hidden; }
  body:has(#atlas-root) > .ff-footer { padding-bottom: calc(90px + env(safe-area-inset-bottom,0px)); }
  #atlas-root { padding: 125px 20px calc(100px + env(safe-area-inset-bottom,0px)); }
  #atlas-root .atlas-page-header { padding: 0 2px 18px; }
  #atlas-root .atlas-page-header h1 { margin: 9px 0; font-size: 30px; letter-spacing: -.85px; line-height: 1.2; }
  #atlas-root .atlas-page-header .breadcrumb { display: none; }
  #atlas-root .atlas-page-header > p { font-size: 14px; line-height: 1.6; }
  #atlas-root .app-shell { display: block; }
  #atlas-root .workspace { padding: 20px; border-radius: 18px; }
  #atlas-root .atlas-mobile-toolbar { display: none; }
  #atlas-root .atlas-mobile-nav {
    position: fixed; z-index: 90; left: 50%; bottom: 0; transform: translateX(-50%);
    display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px;
    width: min(100%,620px); padding: 8px 10px calc(8px + env(safe-area-inset-bottom,0px));
    border: 1px solid rgba(130,167,203,.24); border-bottom: 0; border-radius: 19px 19px 0 0;
    background: #111c2a; box-shadow: 0 -8px 30px rgba(4,10,18,.22);
  }
  #atlas-root .atlas-mobile-nav :is(a,button) {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    min-width: 0; min-height: 52px; padding: 7px 2px; margin: 0; border: 1px solid transparent;
    border-radius: 12px; color: #b4c7d8; background: transparent; font-size: 11px; line-height: 1.3;
    white-space: nowrap; transition: background-color 180ms var(--atlas-ease), color 180ms var(--atlas-ease), transform 180ms var(--atlas-ease);
  }
  #atlas-root .atlas-mobile-nav :is(a,button) svg { width: 21px; height: 21px; }
  #atlas-root .atlas-mobile-nav :is(.active,[aria-current="page"],[aria-expanded="true"]) { color: #a4eaff; background: #1b3447; border-color: rgba(96,200,231,.18); }
  #atlas-root .atlas-mobile-nav :is(a,button):active { transform: scale(.96); }
  #atlas-root .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 110; display: block; background: rgba(3,9,16,.72);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 180ms var(--atlas-ease), visibility 0s linear 220ms;
  }
  body.atlas-menu-open #atlas-root .sidebar-backdrop { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  #atlas-root .sidebar-backdrop[hidden] { display: none; }
  #atlas-root .sidebar {
    position: fixed; z-index: 111; inset: 0 auto 0 0; display: flex; gap: 24px;
    width: min(340px,calc(100vw - 28px)); height: 100dvh; max-height: none; margin: 0;
    padding: calc(20px + env(safe-area-inset-top,0px)) 18px calc(28px + env(safe-area-inset-bottom,0px));
    border: 0; border-right: 1px solid var(--line); border-radius: 0 20px 20px 0;
    background: #101a28; box-shadow: 16px 0 40px rgba(0,0,0,.22); overscroll-behavior: contain;
    transform: translateX(-102%); visibility: hidden; pointer-events: none;
    transition: transform 220ms var(--atlas-ease), visibility 0s linear 220ms;
  }
  #atlas-root .sidebar.open { display: flex; transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
  #atlas-root .sidebar-drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  #atlas-root .sidebar-drawer-header h2 { font-size: 20px; margin: 0; }
  #atlas-root .sidebar-close { display: inline-flex; align-items: center; justify-content: center; align-self: flex-end; gap: 8px; min-width: 44px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; color: #d4e7f4; font-size: 14px; }
  #atlas-root .sidebar :is(.side-link,.side-regions .side-link) { min-height: 48px; padding: 12px; font-size: 14px; }
  #atlas-root .sidebar-book { display: block; padding-top: 18px; }
  #atlas-root .sidebar-book .book-icon { display: none; }
  #atlas-root .sidebar-book h3 { font-size: 17px; }
  #atlas-root .sidebar-book p { font-size: 13px; }
  #atlas-root .workspace > .page-heading { margin-bottom: 16px; }
  #atlas-root[data-view="kaart"] .workspace > .page-heading { display: none; }
  #atlas-root :is([aria-label="Weergave"]) { display: none; }
  #atlas-root .edition-pill { font-size: 11px; }
  #atlas-root .eyebrow { font-size: 11px; }
  #atlas-root .intro { font-size: 14px; }
  #atlas-root .searchbox { margin-bottom: 16px; padding-inline: 13px; min-height: 50px; }
  #atlas-root .searchbox input { font-size: 16px; }
  #atlas-root .searchbox kbd { display: none; }
  #atlas-root .finder-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  #atlas-root .finder-grid.has-results:not(.map-expanded) > .map-panel { display: none; }
  #atlas-root .finder-mobile-selection { display: flex; grid-column: 1/-1; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 12px 14px; border: 0; border-radius: 13px; background: #152b3a; color: #d1ecf8; font-size: 14px; line-height: 1.5; }
  #atlas-root .finder-mobile-selection > :first-child { min-width: 0; overflow-wrap: anywhere; }
  #atlas-root .finder-mobile-selection button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 6px; min-height: 44px; padding: 9px 11px; border: 1px solid rgba(96,201,237,.3); border-radius: 10px; color: #a0e8ff; background: #102333; font-size: 13px; }
  #atlas-root .finder-mobile-selection small { display: block; color: #a9c7d9; font-size: 12px; margin-bottom: 2px; }
  #atlas-root .finder-mobile-selection .eyebrow { font-size: 10px; letter-spacing: .04em; margin: 0 0 4px; }
  #atlas-root .finder-mobile-selection .eyebrow::before { display: none; }
  #atlas-root .map-panel { border-radius: 15px; }
  #atlas-root .map-heading { gap: 8px; padding: 12px 14px 2px; }
  #atlas-root .map-heading .text-btn { flex-shrink: 0; }
  #atlas-root .finder-view-overview .finder-overview,
  #atlas-root .finder-view-detail:has(.finder-instruction) .finder-detail { display: grid; grid-template-columns: minmax(0,1fr) minmax(230px,.85fr); align-items: start; }
  #atlas-root .finder-figures { gap: 10px; padding: 14px 12px 4px; }
  #atlas-root .finder-person { padding: 8px 3px 2px; border-radius: 11px; }
  #atlas-root .finder-body-viewer { padding-top: 14px; }
  #atlas-root .finder-zone-list { padding: 14px 12px; gap: 8px; }
  #atlas-root .finder-view-overview .finder-zone-list { gap: 8px; padding-top: 14px; }
  #atlas-root .finder-view-overview .finder-zone-button { min-height: 48px; font-size: 14px; }
  #atlas-root .finder-detail-art { padding: 10px; margin: 14px 12px 0; border-radius: 11px; }
  #atlas-root .finder-detail-svg { max-height: 490px; }
  #atlas-root .finder-location-list,
  #atlas-root .finder-view-detail:has(.finder-instruction) .finder-location-list { grid-template-columns: 1fr; padding: 14px 12px; gap: 8px; }
  #atlas-root .finder-location-button { min-height: 48px; font-size: 14px; }
  #atlas-root .finder-image-credit { padding: 3px 14px 14px; font-size: 11px; }
  #atlas-root .finder-results { scroll-margin-top: 92px; }
  #atlas-root .finder-results .mode-description { margin: 8px 0 14px; line-height: 1.7; }
  #atlas-root .finder-results .location-context { margin-bottom: 16px; line-height: 1.7; }
  #atlas-root .results-title h2 { font-size: 24px; }
  #atlas-root .result-list:has(.pain-result-card) { gap: 16px; }
  #atlas-root .pain-result-card { padding: 18px; }
  #atlas-root .pain-result-card .muscle-row h3 { font-size: 18px; }
  #atlas-root .result-latin { font-size: 12px; }
  #atlas-root :is(.pain-result-body,.az-items .pain-result-body,.az-items .pain-result-body:has(.has-multiple)) { grid-template-columns: minmax(0,1fr); gap: 18px; }
  #atlas-root .result-pain-figure img { height: 220px; }
  #atlas-root .result-pain-figure button { padding: 12px; }
  #atlas-root .result-pain-copy > p { font-size: 14px; }
  #atlas-root .az-group { grid-template-columns: 24px minmax(0,1fr); gap: 12px; }
  #atlas-root .az-toolbar { gap: 12px; align-items: flex-start; flex-wrap: wrap; }
  #atlas-root .az-toolbar select { max-width: 100%; font-size: 16px; }
  #atlas-root .detail-aside { display: block; }
  #atlas-root .detail-aside .figure-preview { margin-bottom: 16px; }
  #atlas-root .detail-aside .figure-preview img { max-height: 400px; }
  #atlas-root .toc { display: none; }
  #atlas-root .mobile-toc { display: block; margin: 0 0 22px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,184,238,.035); }
  #atlas-root .mobile-toc summary { min-height: 44px; align-content: center; cursor: pointer; color: #d3eaf7; font-size: 14px; font-weight: 650; }
  #atlas-root .mobile-toc a { display: flex; align-items: center; color: #91dff5; font-size: 14px; }
  #atlas-root .detail-heading .page-heading { gap: 14px; }
  #atlas-root .save-button { min-height: 46px; font-size: 14px; }
  #atlas-root .article-section :is(p,li) { font-size: 15px; }
  #atlas-root .note { font-size: 13px; }
  #atlas-root .footer { font-size: 11px; }
  .image-modal { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 16px; }
  .image-modal .modal-bar { padding: 8px 12px; }
  .image-modal .modal-image { padding: 12px; max-height: 62dvh; }
  .image-modal .modal-caption { padding: 16px; }
}

@media (max-width: 600px) {
  #atlas-root { padding-inline: 12px; }
  #atlas-root .atlas-page-header { padding: 0 5px 16px; }
  #atlas-root .atlas-page-header > p { display: none; }
  #atlas-root .atlas-page-header h1 { font-size: 28px; }
  #atlas-root .workspace { padding: 16px; }
  #atlas-root .finder-steps { display: grid; grid-template-columns: 1fr auto 1fr auto .83fr; gap: 2px; margin: 0 0 12px; font-size: 10px; }
  #atlas-root .finder-steps :is(a,span):has(b) { flex-direction: column; justify-content: center; gap: 5px; padding: 5px 2px; text-align: center; min-width: 0; min-height: 58px; }
  #atlas-root .finder-steps b { width: 25px; height: 25px; font-size: 12px; }
  #atlas-root .finder-steps > span:not(:has(b)) { color: #748fa5; }
  #atlas-root .finder-view-overview .finder-overview,
  #atlas-root .finder-view-detail:has(.finder-instruction) .finder-detail { grid-template-columns: minmax(0,1fr); }
  #atlas-root .finder-body-viewer { width: 100%; }
  #atlas-root .finder-view-overview .finder-zone-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #atlas-root .finder-view-overview .finder-zone-button { font-size: 13px; padding: 9px 10px; gap: 5px; }
  #atlas-root .finder-location-list,
  #atlas-root .finder-view-detail:has(.finder-instruction) .finder-location-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #atlas-root .finder-location-button { padding: 10px; font-size: 13px; gap: 5px; }
  #atlas-root .finder-mobile-selection { padding: 10px 12px; }
  #atlas-root .finder-mobile-selection button { padding-inline: 9px; }
  #atlas-root .pain-result-card { padding: 15px; }
  #atlas-root .pain-result-card > .muscle-row { padding-bottom: 14px; }
  #atlas-root .pain-result-card .muscle-row h3 { font-size: 17px; }
  #atlas-root :is(.pain-result-body,.az-items .pain-result-body,.az-items .pain-result-body:has(.has-multiple)) { grid-template-columns: minmax(0,1fr); gap: 16px; }
  #atlas-root .result-pain-images.has-multiple,
  #atlas-root .az-items .result-pain-images.has-multiple { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  #atlas-root .result-pain-figure img { height: 240px; }
  #atlas-root .has-multiple .result-pain-figure img { height: 190px; }
  #atlas-root [data-muscle="trapezius"] .result-pain-images.has-multiple { grid-template-columns: minmax(0,1fr); }
  #atlas-root [data-muscle="trapezius"] .result-pain-figure img { height: 260px; }
  #atlas-root .result-pain-figure figcaption { font-size: 11px; }
  #atlas-root .result-pain-unavailable { min-height: 0; }
  #atlas-root .result-pain-copy > p { font-size: 14px; line-height: 1.85; }
  #atlas-root .az-group { display: block; margin-top: 25px; }
  #atlas-root .az-letter { padding: 0 0 12px 3px; font-size: 24px; }
  #atlas-root .az-toolbar > label { width: 100%; }
  #atlas-root .az-toolbar select { width: 100%; }
  #atlas-root .tabs:not([aria-label="Weergave"]) { flex-wrap: wrap; }
  #atlas-root .tabs :is(a,button) { padding-inline: 11px; font-size: 12px; }
  #atlas-root .tabs svg { display: block; }
  #atlas-root .guide-pagination { flex-direction: column; gap: 12px; }
  #atlas-root .guide-pagination a { max-width: 100%; justify-content: flex-start; }
  #atlas-root .guide-title { font-size: 26px; }
  #atlas-root .symptom-grid { grid-template-columns: minmax(0,1fr); }
  #atlas-root .symptom-item { padding: 15px; }
}

@media (max-width: 360px) {
  #atlas-root { padding-inline: 10px; }
  #atlas-root .workspace { padding: 13px; }
  #atlas-root .atlas-page-header h1 { font-size: 26px; }
  #atlas-root .atlas-mobile-nav { gap: 1px; padding-inline: 5px; }
  #atlas-root .atlas-mobile-nav :is(a,button) { font-size: 10px; }
  #atlas-root .finder-view-overview .finder-zone-list,
  #atlas-root .finder-location-list,
  #atlas-root .finder-view-detail:has(.finder-instruction) .finder-location-list { grid-template-columns: 1fr; }
  #atlas-root .finder-mobile-selection { align-items: flex-start; }
  #atlas-root .finder-mobile-selection button { font-size: 12px; }
  #atlas-root .has-multiple .result-pain-figure img { height: 165px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #atlas-root *, #atlas-root *::before, #atlas-root *::after,
  .image-modal, .image-modal::backdrop { animation: none !important; transition: none !important; }
}
@media print {
  #atlas-root :is(.atlas-mobile-nav,.sidebar-backdrop,.sidebar-close,.finder-mobile-selection) { display: none !important; }
  #atlas-root .pain-result-card { background: #fff; border-color: #ccd5dd; }
  #atlas-root .finder-grid.has-results:not(.map-expanded) > .map-panel { display: block; }
}

/* Muscle profiles: one page scroll, large illustrations and a compact contents menu. */
#atlas-root .detail-grid { display:block; }
#atlas-root .mobile-toc { display:block; position:static; margin:20px 0 28px; border:1px solid var(--line); border-radius:12px; padding:14px 18px; }
#atlas-root .mobile-toc summary { min-height:30px; cursor:pointer; font-size:14px; color:#bdeaf2; }
#atlas-root .mobile-toc[open] { display:block; }
#atlas-root .mobile-toc a { display:inline-flex; align-items:center; min-height:44px; padding:8px 12px; margin:4px 4px 0 0; font-size:13px; border-radius:8px; background:#172a36; color:#c8e6f1; }
#atlas-root .profile-illustrations { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin:0 0 35px; scroll-margin-top:125px; }
#atlas-root .profile-illustrations > h2 { grid-column:1/-1; margin:0; font-size:22px; }
#atlas-root .profile-illustrations > .figure-preview:first-of-type,
#atlas-root .profile-illustrations > .figure-preview:last-child:nth-of-type(even) { grid-column:1/-1; }
#atlas-root .profile-illustrations .figure-preview { margin:0; align-self:start; }
#atlas-root .profile-illustrations .figure-preview button { padding:8px; }
#atlas-root .profile-illustrations .figure-preview img { width:100%; max-height:680px; object-fit:contain; }
#atlas-root .profile-illustrations .figure-preview figcaption { font-size:13px; padding:17px 20px; }
#atlas-root .profile-illustrations .figure-placeholder { grid-column:1/-1; }
@media (min-width:901px) {
 #atlas-root .sidebar { position:static; max-height:none; overflow:visible; }
}
@media (max-width:600px) {
 #atlas-root .profile-illustrations { grid-template-columns:1fr; gap:16px; }
 #atlas-root .profile-illustrations .figure-preview img { max-height:none; }
 #atlas-root .profile-illustrations .figure-preview figcaption { font-size:12px; padding:14px; }
 #atlas-root .mobile-toc { padding:12px; }
}
