/* Mobile / coarse pointer */
  @media (hover: none) and (pointer: coarse) {
    html, body {
      height: auto;
      overflow: visible;
    }
    .app {
      height: 100dvh;
      overflow: hidden;
    }
    .settings-panel {
      --settings-scale: 0.85;
      touch-action: pan-y;
    }
    .settings-panel .system-selection {
      margin: 0;
      padding-left: 0;
      padding-right: 0;
      width: 100%;
      max-width: 100%;
    }
    .settings-panel .system-grid,
    .settings-panel .system-bulk-actions {
      width: 100%;
      max-width: 100%;
    }
    .mode-toggle button {
      white-space: nowrap;
    }
    .instructions-popup {
      width: min(680px, calc(100vw - 24px));
      min-width: 0;
      max-height: calc(100dvh - 80px);
      overflow: auto;
    }
    .browser-panel-stack {
      max-width: min(280px, 70vw);
    }
    .z-anatomy-credit {
      font-size: 8px;
    }
    .z-anatomy-credit-backdrop {
      display: none;
      position: absolute;
      inset: 0;
      z-index: 125;
      margin: 0;
      padding: 0;
      border: 0;
      background: rgba(3, 8, 18, 0.62);
      pointer-events: auto;
      cursor: pointer;
    }
    .simulation-panel.has-z-anatomy-credit-open .z-anatomy-credit-backdrop {
      display: block;
    }
    .simulation-panel.has-z-anatomy-credit-open .z-anatomy-credit {
      left: 8px;
      right: 8px;
      bottom: 8px;
      top: 8px;
      z-index: 130;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: stretch;
      pointer-events: none;
    }
    .simulation-panel.has-z-anatomy-credit-open .z-anatomy-credit-trigger {
      pointer-events: auto;
      align-self: flex-end;
      flex-shrink: 0;
    }
    .simulation-panel.has-z-anatomy-credit-open .z-anatomy-credit-panel {
      position: relative;
      right: auto;
      bottom: auto;
      width: 100%;
      max-width: none;
      max-height: calc(100% - 44px);
      margin: 0 0 8px;
      box-sizing: border-box;
      pointer-events: auto;
      flex: 1 1 auto;
      min-height: 0;
    }
    .simulation-panel.has-z-anatomy-credit-open .z-anatomy-credit-close {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      font-size: 24px;
      background: rgba(15, 28, 53, 0.95);
      border: 1px solid rgba(79, 209, 255, 0.35);
      border-radius: 6px;
      color: var(--accent-soft);
    }
    .browser-panel-stack:has(.is-mobile-expanded) {
      top: 0;
      left: 0;
      right: 0;
      width: 100%;
      max-width: none;
      height: 100%;
      z-index: 120;
      gap: 0;
    }
    #skeletonBrowserPanel:not(.is-mobile-expanded),
    #anatomySearchPanel:not(.is-mobile-expanded) {
      max-height: none;
      overflow: hidden;
      padding: 3px 8px;
      line-height: 1.15;
    }
    #skeletonBrowserPanel:not(.is-mobile-expanded) .skeleton-browser-panel-header,
    #anatomySearchPanel:not(.is-mobile-expanded) .anatomy-search-header {
      margin-bottom: 0;
      gap: 0;
      align-items: center;
    }
    #skeletonBrowserPanel:not(.is-mobile-expanded) .skeleton-browser-panel-title,
    #anatomySearchPanel:not(.is-mobile-expanded) .skeleton-browser-panel-title {
      font-size: calc(var(--skel-browser-title-size, 12px) * 0.8);
      line-height: 1.15;
    }
    #skeletonBrowserPanel:not(.is-mobile-expanded) .skeleton-browser-panel-bulk,
    #skeletonBrowserPanel:not(.is-mobile-expanded) .browser-panel-body,
    #skeletonBrowserPanel:not(.is-mobile-expanded) .browser-mobile-ok-bar,
    #anatomySearchPanel:not(.is-mobile-expanded) .anatomy-search-header-actions,
    #anatomySearchPanel:not(.is-mobile-expanded) .browser-panel-body,
    #anatomySearchPanel:not(.is-mobile-expanded) .browser-mobile-ok-bar {
      display: none !important;
    }
    #skeletonBrowserPanel.is-mobile-expanded,
    #anatomySearchPanel.is-mobile-expanded {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      max-width: none;
      height: 100dvh;
      max-height: none;
      z-index: 121;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border-radius: 0;
      padding: 0;
      box-sizing: border-box;
    }
    #skeletonBrowserPanel.is-mobile-expanded .browser-mobile-ok-bar,
    #anatomySearchPanel.is-mobile-expanded .browser-mobile-ok-bar {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      flex-shrink: 0;
      position: sticky;
      top: 0;
      z-index: 2;
      padding: calc(10px * var(--sim-scale, 1)) calc(12px * var(--sim-scale, 1));
      background: rgba(7, 16, 32, 0.98);
      border-bottom: 1px solid rgba(79, 209, 255, 0.28);
    }
    #skeletonBrowserPanel.is-mobile-expanded .skeleton-browser-panel-header,
    #anatomySearchPanel.is-mobile-expanded .anatomy-search-header {
      flex-shrink: 0;
      padding: calc(8px * var(--sim-scale, 1)) calc(12px * var(--sim-scale, 1)) 0;
      margin-bottom: calc(6px * var(--sim-scale, 1));
    }
    #skeletonBrowserPanel.is-mobile-expanded .browser-panel-body,
    #anatomySearchPanel.is-mobile-expanded .browser-panel-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow-x: hidden;
      overflow-y: auto;
      padding: 0 calc(12px * var(--sim-scale, 1)) calc(16px * var(--sim-scale, 1));
      -webkit-overflow-scrolling: touch;
    }
    .skeleton-browser-inline-nest {
      position: relative !important;
      top: auto !important;
      left: auto !important;
      z-index: auto !important;
      max-width: none !important;
      max-height: none !important;
      margin: calc(4px * var(--sim-scale, 1)) 0 calc(6px * var(--sim-scale, 1)) calc(14px * var(--sim-scale, 1));
      padding: calc(6px * var(--sim-scale, 1));
      box-shadow: none;
      border-radius: calc(6px * var(--sim-scale, 1));
      background: rgba(10, 20, 40, 0.88);
    }
    .skeleton-browser-expand.is-open {
      color: var(--accent-soft);
      border-color: rgba(79, 209, 255, 0.55);
    }
    #browserPanelStack:has(#skeletonBrowserPanel.is-mobile-expanded) #anatomySearchPanel:not(.is-mobile-expanded),
    #browserPanelStack:has(#anatomySearchPanel.is-mobile-expanded) #skeletonBrowserPanel:not(.is-mobile-expanded) {
      display: none;
    }
    .skeleton-browser-panel,
    .skeleton-browser-layer,
    .skeleton-browser-inline-nest {
      --sim-scale: 1;
      font-size: var(--skel-browser-font-size, 11px);
    }
  }
  @media (max-aspect-ratio: 1 / 1) and (hover: none) and (pointer: coarse) {
    html, body {
      height: auto;
      overflow-x: hidden;
      overflow-y: auto;
    }
    .app {
      flex-direction: column;
      height: auto;
      min-height: 100dvh;
      overflow: visible;
      padding: 0;
      gap: 0;
      width: 100%;
      max-width: 100%;
      /* Reserve space for the fixed sim chrome so settings scroll underneath it. */
      --mobile-portrait-sim-offset: calc((100vw * 34 / 57) + 16px);
      padding-top: var(--mobile-portrait-sim-offset);
    }
    .simulation-area {
      /* Fixed (not sticky): must stay put while the settings panel scrolls. */
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 60;
      flex: 0 0 auto;
      width: 100%;
      max-width: 100%;
      order: 1;
      align-items: center;
      justify-content: center;
      padding: 8px 0;
      height: var(--mobile-portrait-sim-offset);
      min-height: var(--mobile-portrait-sim-offset);
      box-sizing: border-box;
      background: var(--bg, #071020);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
    }
    .simulation-panel {
      width: 100%;
      max-width: 100%;
    }
    .settings-panel {
      flex: 0 0 auto;
      align-self: stretch;
      width: 100%;
      min-width: 0;
      max-width: none;
      order: 2;
      --settings-scale: clamp(0.7, calc(100vw / 535), 0.95);
      overflow-x: hidden;
      overflow-y: visible;
      padding-left: 12px;
      padding-right: 12px;
      border-radius: 0;
      border-left: none;
      border-right: none;
      /* Keep settings panel behind the fixed sim area (z-index 60). */
      position: relative;
      z-index: 50;
    }
    .settings-panel .seg {
      width: max-content;
      max-width: 100%;
    }
    .settings-panel .seg button {
      flex: 0 0 auto;
    }
    .settings-panel .app-mode-control .seg {
      flex: 0 0 auto;
      width: max-content;
      min-width: 0;
      max-width: 100%;
      margin-left: auto;
    }
    .settings-panel .app-mode-control .seg button {
      /* Match On/Off toggle height; extra width so Explore/Quiz fit comfortably */
      padding: 6px 20px;
      font-size: calc(13px * var(--settings-scale, 1));
      line-height: 1.2;
      white-space: nowrap;
    }
    .settings-panel .app-mode-row {
      justify-content: space-between;
      flex-wrap: nowrap;
      align-items: center;
    }
    .settings-panel .app-mode-label {
      flex: 1 1 auto;
      min-width: 0;
    }
    .settings-panel .quiz-type-btn {
      padding-top: 15px;
      padding-bottom: 15px;
    }
    .settings-panel .control-row {
      flex-wrap: wrap;
    }
    .top-buttons {
      gap: clamp(6px, 1.5vw, 10px);
      left: 12px;
      right: 12px;
    }
    .top-buttons .se-button,
    .top-buttons .instructions-button {
      font-size: clamp(10px, 2.6vw, 13px);
      padding: clamp(6px, 1.8vw, 8px) clamp(8px, 2.4vw, 12px);
      white-space: nowrap;
    }
    .settings-panel .se-button .se-icon {
      width: clamp(14px, 3vw, 18px);
      height: clamp(14px, 3vw, 18px);
    }
  }
  @media (min-aspect-ratio: 1 / 1) and (hover: none) and (pointer: coarse) {
    .app {
      padding: 0;
      gap: 0;
    }
    .app {
      flex-direction: row;
    }
    .simulation-area {
      flex: 0 0 66.666%;
      width: 66.666vw;
    }
    .settings-panel {
      flex: 0 0 33.333%;
      width: 33.333vw;
      min-width: 0;
      max-width: 33.333vw;
      --settings-scale: 0.7;
      overflow-x: hidden;
    }
    .top-buttons .se-button,
    .top-buttons .instructions-button {
      font-size: clamp(10px, 1.05vw, 12px);
    }
    .settings-panel .seg {
      width: max-content;
      max-width: 100%;
    }
    .settings-panel .seg button {
      flex: 0 0 auto;
    }
    .settings-panel .app-mode-control .seg {
      flex: 0 0 auto;
      width: max-content;
      min-width: 0;
      max-width: 100%;
    }
    .settings-panel .control-row,
    .settings-panel .app-mode-row,
    .settings-panel .model-level-row,
    .settings-panel .click-to-hide-main-row,
    .settings-panel .deselection-effect-row,
    .settings-panel .quiz-fade-other-row,
    .settings-panel .show-functions-row,
    .settings-panel .modesty-filter-row {
      flex-wrap: wrap;
      justify-content: flex-end;
      align-items: center;
      column-gap: 10px;
      row-gap: 8px;
    }
    /* Keep headings on the left when they share a row; toggles stay right even when wrapped alone. */
    .settings-panel .app-mode-label,
    .settings-panel .model-level-label,
    .settings-panel .click-to-hide-main-row .settings-subheading,
    .settings-panel .deselection-effect-row .settings-subheading,
    .settings-panel .quiz-fade-other-row .settings-subheading,
    .settings-panel .show-functions-row .settings-subheading,
    .settings-panel .modesty-filter-row .settings-subheading,
    .settings-panel .quiz-subsystem-row .settings-subheading {
      margin-right: auto !important;
      flex: 0 1 auto;
      min-width: 0;
    }
    .settings-panel .app-mode-control .seg,
    .settings-panel .model-level-select,
    .settings-panel .click-to-hide-main-controls,
    .settings-panel .deselection-effect-row .seg,
    .settings-panel .quiz-fade-other-row .seg,
    .settings-panel .show-functions-row .seg,
    .settings-panel .modesty-filter-row .seg {
      margin-left: 0 !important;
      margin-right: 0 !important;
      flex: 0 0 auto;
      width: max-content;
      max-width: 100%;
    }
    .browser-panel-stack:has(.is-mobile-expanded) {
      width: 50%;
      max-width: 50%;
      right: auto;
    }
    #skeletonBrowserPanel.is-mobile-expanded,
    #anatomySearchPanel.is-mobile-expanded {
      width: 100%;
      max-width: none;
    }
  }
  .challenge-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 18, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5200;
    padding: 20px;
  }
  .challenge-overlay.hidden {
    display: none !important;
  }
  .challenge-window {
    width: min(520px, 100%);
    max-height: min(90dvh, 720px);
    overflow: auto;
    background: linear-gradient(160deg, rgba(12, 20, 38, 0.98), rgba(9, 14, 30, 0.98));
    border: 1px solid rgba(79, 209, 255, 0.55);
    border-radius: 14px;
    box-shadow: 0 0 24px rgba(79, 209, 255, 0.22);
    padding: 18px 18px 16px;
    color: var(--text);
  }
  .challenge-window.is-confirm,
  .challenge-window.is-complete {
    width: min(420px, 100%);
  }
  .challenge-window.is-complete {
    width: min(640px, 100%);
  }
  .challenge-window-title {
    margin: 0 0 14px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-soft);
  }
  .challenge-window-subtitle {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-soft);
  }
  .challenge-window-section {
    margin-bottom: 14px;
  }
  .challenge-number-input {
    width: 100%;
    max-width: 140px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #22306a;
    background: #0f1839;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
  }
  .challenge-window-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
  }
  .challenge-window-actions button,
  .challenge-complete-close {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #22306a;
    background: #101a42;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
  }
  .challenge-window-actions button.challenge-primary,
  .challenge-complete-close {
    background: #2563eb;
    border-color: #4fd1ff;
    color: #fff;
  }
  .challenge-confirm-message {
    margin: 0 0 16px;
    font-size: 1rem;
    line-height: 1.45;
  }
  .challenge-final-score {
    margin: 0 0 16px;
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    color: #9be7ff;
  }
  .challenge-results-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
  .challenge-results-column h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-soft);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .challenge-results-column ul {
    margin: 0;
    padding-left: 1.1em;
  }
  .challenge-results-column li {
    margin: 0.35em 0;
    font-size: 0.92rem;
  }
  .challenge-results-empty {
    color: var(--muted);
    font-style: italic;
  }

  .se-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 18, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 20px;
  }
  .se-window {
    max-width: 920px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(12, 20, 38, 0.98), rgba(9, 14, 30, 0.98));
    border: 1px solid rgba(79, 209, 255, 0.5);
    border-radius: 14px;
    box-shadow: 0 0 24px rgba(79, 209, 255, 0.25);
    padding: 0;
  }
  .se-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 16px 20px 10px;
  }
  .se-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-soft);
    margin: 0;
  }
  .se-close {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #22306a;
    background: #101a42;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
  }
  .se-tabs {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    padding: 0 16px;
    border-bottom: 1px solid rgba(79, 209, 255, 0.35);
    background: linear-gradient(180deg, rgba(12, 20, 38, 0.98), rgba(8, 14, 28, 0.98));
  }
  .se-tab {
    position: relative;
    margin: 0;
    padding: 10px 18px 9px;
    border: 1px solid rgba(79, 209, 255, 0.28);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: rgba(16, 26, 66, 0.72);
    color: var(--muted);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(1px);
  }
  .se-tab:hover {
    color: var(--text);
    border-color: rgba(79, 209, 255, 0.5);
  }
  .se-tab.is-active {
    color: #041018;
    background: linear-gradient(180deg, #9be7ff, #4fd1ff);
    border-color: rgba(79, 209, 255, 0.85);
    box-shadow: 0 0 14px rgba(79, 209, 255, 0.35);
    z-index: 1;
  }
  .se-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
  }
  .se-body a {
    color: var(--accent-soft);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .se-body a:hover,
  .se-body a:focus-visible {
    color: #4fd1ff;
  }
  .se-panel[hidden] {
    display: none !important;
  }
  .se-panel p {
    margin: 0 0 12px;
  }
  .se-panel ul {
    margin: 0 0 14px;
    padding-left: 1.25em;
  }
  .se-panel li {
    margin: 0 0 4px;
  }
  .se-system-block {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid rgba(79, 209, 255, 0.22);
    border-radius: 10px;
    background: rgba(10, 18, 36, 0.55);
  }
  .se-system-block h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 800;
    color: var(--accent-soft);
  }
  .se-system-block p {
    margin: 0 0 10px;
  }
  .se-system-block p:last-child {
    margin-bottom: 0;
  }
  .se-system-block ul {
    margin: 0 0 12px;
    padding-left: 1.2em;
  }
  .se-system-block li {
    margin: 0 0 6px;
  }
  .se-system-subheading {
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: #c9f3ff;
  }
  .se-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-left: 3px solid #4fd1ff;
    background: rgba(79, 209, 255, 0.08);
    border-radius: 0 8px 8px 0;
    color: #d7ecff;
  }
  .se-note strong {
    color: var(--accent-soft);
  }
  .se-empty {
    color: var(--muted);
    font-style: italic;
  }
  .se-glossary-type {
    margin: 22px 0 10px;
    font-size: 16px;
    font-weight: 800;
    color: #4fd1ff;
    text-shadow:
      0 0 6px rgba(79, 209, 255, 0.85),
      0 0 14px rgba(79, 209, 255, 0.55),
      0 0 28px rgba(79, 209, 255, 0.35);
  }
  .se-glossary-search {
    margin: 18px 0 4px;
  }
  .se-glossary-search .se-glossary-type {
    margin-top: 0;
  }
  .se-glossary-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 8px;
  }
  .se-glossary-search-input {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 280px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    font-family: var(--sans);
    font-size: 14px;
  }
  .se-glossary-search-input:focus {
    outline: none;
    border-color: rgba(79, 209, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(79, 209, 255, 0.25);
  }
  .se-glossary-search-go {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #22306a;
    background: #2563eb;
    color: #ffffff;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }
  .se-glossary-search-go:disabled {
    background: #1e293b;
    border-color: #334155;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.85;
  }
  .se-glossary-table tr.se-glossary-match-flash td {
    background: rgba(79, 209, 255, 0.18);
  }
  .se-glossary-table-wrap {
    overflow-x: auto;
    margin: 0 0 8px;
    border: 1px solid rgba(79, 209, 255, 0.28);
    border-radius: 10px;
  }
  .se-glossary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.45;
  }
  .se-glossary-table th,
  .se-glossary-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(79, 209, 255, 0.14);
    text-align: left;
    vertical-align: top;
  }
  .se-glossary-table th {
    background: rgba(16, 36, 72, 0.9);
    color: var(--accent-soft);
    font-weight: 700;
    white-space: nowrap;
  }
  .se-glossary-table tr:last-child td {
    border-bottom: none;
  }
  .se-glossary-table td:first-child {
    font-weight: 700;
    color: #c9f3ff;
    white-space: nowrap;
  }
  .share-settings-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .share-settings-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .share-settings-row .settings-subheading {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
  }
  .share-create-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #22306a;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--sans);
    font-size: calc(13px * var(--settings-scale, 1));
  }
  .share-create-btn:hover {
    background: #3b82f6;
  }
  .share-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5500;
    background: rgba(3, 8, 18, 0.82);
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .share-modal.is-open {
    display: flex;
  }
  .share-modal-box {
    width: 100%;
    max-width: 600px;
    background: linear-gradient(160deg, rgba(12, 20, 38, 0.98), rgba(9, 14, 30, 0.98));
    border: 1px solid rgba(79, 209, 255, 0.5);
    border-radius: 14px;
    box-shadow: 0 0 24px rgba(79, 209, 255, 0.25);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .share-modal-box h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-soft);
  }
  .share-modal-box label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
  }
  .share-link-output {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    font: 500 12px ui-monospace, monospace;
    padding: 10px;
    word-break: break-all;
    box-sizing: border-box;
  }
  .share-modal-status {
    font-size: 12px;
    min-height: 1.4em;
    color: var(--muted);
  }
  .share-modal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .share-modal-actions button {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #22306a;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 13px;
  }
  .share-modal-actions button:hover {
    background: #3b82f6;
  }

  .scarecrow-corner-link {
    position: fixed;
    right: 8px;
    bottom: 8px;
    transform: translateY(-10%);
    z-index: 10000;
    opacity: 0.5;
    display: block;
    width: 48px;
    line-height: 0;
  }
  .scarecrow-corner-link svg {
    display: block;
    width: 100%;
    height: auto;
  }
  .simulation-panel {
    background: radial-gradient(ellipse at 50% 35%, #0f1c35 0%, #071020 70%, #020617 100%);
    touch-action: none;
  }
  .sim-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
  }
  .sim-viewport.is-dragging {
    cursor: grabbing;
  }
  .sim-viewport.can-pick {
    cursor: pointer;
  }
  .sim-viewport canvas {
    display: block;
    width: 100%;
    height: 100%;
  }
  .sim-render-canvas {
    position: absolute;
    inset: 0;
  }
  .quiz-silhouette-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 12;
  }
  .anatomy-tooltip {
    position: absolute;
    z-index: 200;
    pointer-events: none;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(7, 16, 32, 0.92);
    border: 1px solid rgba(79, 209, 255, 0.55);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: pre-line;
    text-align: center;
    max-width: min(320px, 90vw);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transform: translate(12px, -50%);
    opacity: 0;
    transition: opacity 0.12s ease;
    visibility: hidden;
  }
  .anatomy-tooltip.is-measuring {
    visibility: hidden;
    opacity: 0;
  }
  .anatomy-tooltip.placement-left {
    transform: translate(calc(-100% - 12px), -50%);
  }
  .anatomy-tooltip.placement-right {
    transform: translate(12px, -50%);
  }
  .anatomy-tooltip.visible {
    opacity: 1;
    visibility: visible;
  }
  .anatomy-tooltip .anatomy-tooltip-alt {
    font-weight: 500;
  }
  .anatomy-tooltip .anatomy-tooltip-function {
    display: block;
    margin-top: 4px;
    font-style: italic;
    font-weight: 400;
    color: var(--muted);
  }
  .sim-status-overlay {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    pointer-events: none;
  }
  .sim-status-overlay.hidden {
    display: none;
  }
  .sim-status-overlay.error {
    color: #fca5a5;
  }
  #simLoadingPercent {
    font-variant-numeric: tabular-nums;
  }
  .sim-status-overlay .sim-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(79, 209, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: sim-spin 0.9s linear infinite;
    margin: 0 auto 12px;
  }
  @keyframes sim-spin {
    to { transform: rotate(360deg); }
  }
  .camera-rotate-cluster {
    position: absolute;
    top: var(--pan-stick-top, 16px);
    right: var(--pan-stick-right, 16px);
    width: var(--pan-stick-size, 96px);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--pan-stick-size, 96px) * 0.08);
  }
  .camera-pan-stick {
    position: relative;
    width: 100%;
    height: var(--pan-stick-size, 96px);
    touch-action: none;
    user-select: none;
    cursor: grab;
  }
  .camera-pan-stick.is-dragging {
    cursor: grabbing;
  }
  .camera-pan-stick-base {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
      radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 28%),
      radial-gradient(circle at 50% 55%, #2a3444 0%, #141c28 52%, #0a1018 100%);
    border: calc(var(--pan-stick-size, 96px) * 0.042) solid rgba(255, 255, 255, 0.1);
    box-shadow:
      inset 0 calc(var(--pan-stick-size, 96px) * 0.04) calc(var(--pan-stick-size, 96px) * 0.08) rgba(0, 0, 0, 0.55),
      0 calc(var(--pan-stick-size, 96px) * 0.03) calc(var(--pan-stick-size, 96px) * 0.08) rgba(0, 0, 0, 0.35);
  }
  .camera-pan-stick-base::before {
    content: "";
    position: absolute;
    inset: 20%;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.45);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.55);
    pointer-events: none;
  }
  .camera-pan-stick-base::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72%;
    height: 72%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
      linear-gradient(90deg, transparent 48%, rgba(0, 0, 0, 0.22) 49%, rgba(0, 0, 0, 0.22) 51%, transparent 52%),
      linear-gradient(0deg, transparent 48%, rgba(0, 0, 0, 0.22) 49%, rgba(0, 0, 0, 0.22) 51%, transparent 52%);
    pointer-events: none;
    opacity: 0.65;
  }
  .camera-pan-stick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 38%;
    height: 38%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
      radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 35%),
      radial-gradient(circle at 50% 60%, #5a6678 0%, #323c4c 55%, #1c2430 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
      0 calc(var(--pan-stick-size, 96px) * 0.02) calc(var(--pan-stick-size, 96px) * 0.05) rgba(0, 0, 0, 0.45),
      inset 0 1px 2px rgba(255, 255, 255, 0.12);
    pointer-events: none;
  }
  .camera-view-reset {
    width: 100%;
    padding: calc(var(--pan-stick-size, 96px) * 0.07) 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: calc(var(--pan-stick-size, 96px) * 0.08);
    background: rgba(10, 16, 24, 0.82);
    color: var(--muted);
    font-size: calc(var(--pan-stick-size, 96px) * 0.118);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  }
  .camera-view-reset:hover {
    color: var(--text);
    border-color: rgba(79, 209, 255, 0.45);
    background: rgba(15, 28, 53, 0.92);
  }
  .camera-view-reset:active {
    transform: translateY(1px);
  }
  .browser-panel-stack {
    position: absolute;
    top: var(--skel-browser-top, 12px);
    left: var(--skel-browser-left, 12px);
    z-index: 45;
    max-width: min(280px, 46vw);
    display: flex;
    flex-direction: column;
    gap: calc(6px * var(--sim-scale, 1));
    pointer-events: none;
  }
  .browser-panel-stack .skeleton-browser-panel {
    position: relative;
    top: auto;
    left: auto;
    pointer-events: auto;
    max-height: var(--skel-browser-selection-max-height, min(280px, 38vh));
  }
  .browser-panel-stack .anatomy-search-panel {
    max-height: none;
    overflow: visible;
  }
  .skeleton-browser-panel,
  .skeleton-browser-layer {
    position: absolute;
    top: var(--skel-browser-top, 12px);
    left: var(--skel-browser-left, 12px);
    z-index: 45;
    max-width: min(280px, 46vw);
    max-height: var(--skel-browser-max-height, 55%);
    overflow-x: hidden;
    overflow-y: auto;
    padding: var(--skel-browser-pad, 8px) calc(var(--skel-browser-pad, 8px) + 2px);
    border-radius: var(--skel-browser-radius, 8px);
    background: rgba(7, 16, 32, 0.92);
    border: 1px solid rgba(79, 209, 255, 0.42);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    font-size: var(--skel-browser-font-size, 11px);
    line-height: 1.35;
    color: var(--text);
    pointer-events: auto;
    user-select: none;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
  }
  #skeletonBrowserLayers {
    position: absolute;
    inset: 0;
    z-index: 46;
    pointer-events: none;
  }
  .skeleton-browser-layer {
    pointer-events: auto;
    max-width: min(320px, 52vw);
  }
  .skeleton-browser-layer[data-layer="sub"] {
    position: absolute;
  }
  .skeleton-browser-layer[data-layer="subsub"] {
    z-index: 47;
    max-width: min(420px, 62vw);
  }

  .skeleton-browser-panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: calc(8px * var(--sim-scale, 1));
    margin-bottom: calc(8px * var(--sim-scale, 1));
    flex-wrap: wrap;
  }
  .skeleton-browser-panel-title {
    font-size: var(--skel-browser-title-size, 12px);
    font-weight: 700;
    color: var(--accent-soft);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .browser-panel-stub-hit {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: default;
    pointer-events: none;
  }
  .browser-mobile-ok-bar {
    display: none;
  }
  .browser-mobile-ok-btn {
    border: 1px solid rgba(79, 209, 255, 0.45);
    border-radius: calc(4px * var(--sim-scale, 1));
    background: rgba(15, 28, 53, 0.95);
    color: var(--accent-soft);
    font-size: var(--skel-browser-font-size, 11px);
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: calc(6px * var(--sim-scale, 1)) calc(14px * var(--sim-scale, 1));
    cursor: pointer;
    touch-action: manipulation;
  }
  @media (hover: none) and (pointer: coarse) {
    .browser-panel-stub-hit {
      pointer-events: auto;
      cursor: pointer;
      touch-action: manipulation;
      width: 100%;
      min-height: 0;
      padding: 0;
      line-height: 1.15;
    }
  }
  .skeleton-browser-panel-bulk {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .anatomy-search-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: calc(8px * var(--sim-scale, 1));
    margin-bottom: calc(8px * var(--sim-scale, 1));
  }
  .anatomy-search-header-actions {
    display: flex;
    align-items: center;
    gap: calc(6px * var(--sim-scale, 1));
    flex-shrink: 0;
  }
  .anatomy-search-clear,
  .anatomy-search-confirm {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: calc(4px * var(--sim-scale, 1));
    background: rgba(10, 16, 24, 0.72);
    color: var(--muted);
    font-size: var(--skel-browser-font-size, 11px);
    font-weight: 600;
    padding: calc(2px * var(--sim-scale, 1)) calc(8px * var(--sim-scale, 1));
    cursor: pointer;
    touch-action: manipulation;
  }
  .anatomy-search-confirm {
    color: var(--accent-soft);
    border-color: rgba(79, 209, 255, 0.4);
  }
  .anatomy-search-clear:hover,
  .anatomy-search-confirm:hover {
    color: var(--text);
    border-color: rgba(79, 209, 255, 0.45);
  }
  .anatomy-search-input-wrap {
    position: relative;
    margin-bottom: calc(6px * var(--sim-scale, 1));
  }
  .anatomy-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: calc(6px * var(--sim-scale, 1)) calc(8px * var(--sim-scale, 1));
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: calc(4px * var(--sim-scale, 1));
    background: rgba(10, 16, 24, 0.82);
    color: var(--text);
    font-size: var(--skel-browser-font-size, 11px);
    line-height: 1.35;
  }
  .anatomy-search-input::placeholder {
    color: var(--muted);
    opacity: 0.72;
  }
  .anatomy-search-input:focus {
    outline: none;
    border-color: rgba(79, 209, 255, 0.5);
  }
  .anatomy-search-suggestions {
    margin: calc(2px * var(--sim-scale, 1)) 0 0;
    padding: calc(4px * var(--sim-scale, 1)) 0;
    list-style: none;
    overflow-y: visible;
    border: 1px solid rgba(79, 209, 255, 0.35);
    border-radius: calc(4px * var(--sim-scale, 1));
    background: rgba(7, 16, 32, 0.97);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  .anatomy-search-suggestions.is-scrollable {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 209, 255, 0.45) rgba(7, 16, 32, 0.6);
  }
  .anatomy-search-suggestions.is-scrollable::-webkit-scrollbar {
    width: calc(8px * var(--sim-scale, 1));
  }
  .anatomy-search-suggestions.is-scrollable::-webkit-scrollbar-track {
    background: rgba(7, 16, 32, 0.6);
    border-radius: calc(4px * var(--sim-scale, 1));
  }
  .anatomy-search-suggestions.is-scrollable::-webkit-scrollbar-thumb {
    background: rgba(79, 209, 255, 0.45);
    border-radius: calc(4px * var(--sim-scale, 1));
  }
  .anatomy-search-suggestions.is-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 209, 255, 0.65);
  }
  .anatomy-search-suggestions li {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--sim-scale, 1));
    padding: calc(5px * var(--sim-scale, 1)) calc(8px * var(--sim-scale, 1));
    cursor: pointer;
    color: var(--text);
  }
  .anatomy-search-suggestion-label {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
  }
  .anatomy-search-suggestion-check {
    flex-shrink: 0;
    width: calc(14px * var(--sim-scale, 1));
    height: calc(14px * var(--sim-scale, 1));
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
  }
  .anatomy-search-suggestions li:hover,
  .anatomy-search-suggestions li[aria-selected="true"] {
    background: rgba(79, 209, 255, 0.14);
    color: var(--accent-soft);
  }
  .anatomy-search-selected-name {
    font-weight: 700;
    color: var(--accent-soft);
    margin-bottom: calc(6px * var(--sim-scale, 1));
    word-break: break-word;
  }
  .anatomy-search-context {
    display: flex;
    flex-direction: column;
    gap: calc(4px * var(--sim-scale, 1));
    font-size: var(--skel-browser-font-size, 11px);
    color: var(--muted);
  }
  .anatomy-search-context label {
    display: flex;
    align-items: center;
    gap: calc(6px * var(--sim-scale, 1));
    cursor: pointer;
    color: var(--text);
  }
  .anatomy-search-context input[type="radio"] {
    flex-shrink: 0;
    margin: 0;
    accent-color: var(--accent);
  }
  .skeleton-browser-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: calc(8px * var(--sim-scale, 1));
    margin-bottom: calc(8px * var(--sim-scale, 1));
    flex-wrap: wrap;
  }
  .skeleton-browser-heading {
    font-size: var(--skel-browser-title-size, 12px);
    font-weight: 700;
    color: var(--accent-soft);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .skeleton-browser-section {
    margin-bottom: calc(6px * var(--sim-scale, 1));
  }
  .skeleton-browser-section-row {
    display: flex;
    align-items: center;
    gap: calc(4px * var(--sim-scale, 1));
    margin-bottom: calc(4px * var(--sim-scale, 1));
  }
  .skeleton-browser-section-row .skeleton-browser-heading {
    flex: 1;
    min-width: 0;
  }
  .skeleton-browser-section-bulk {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .skeleton-browser-section-groups {
    padding-left: calc(22px * var(--sim-scale, 1));
  }
  .skeleton-browser-collapse {
    flex-shrink: 0;
    width: calc(18px * var(--sim-scale, 1));
    height: calc(18px * var(--sim-scale, 1));
    border: none;
    border-radius: 3px;
    background: rgba(19, 32, 84, 0.65);
    color: var(--accent-soft);
    font-size: calc(13px * var(--sim-scale, 1));
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }
  .skeleton-browser-collapse:hover {
    background: rgba(26, 42, 99, 0.9);
    color: var(--accent);
  }
  .skeleton-browser-section-groups[hidden] {
    display: none !important;
  }
  .skeleton-browser-bulk {
    display: inline-flex;
    gap: calc(10px * var(--sim-scale, 1));
    font-size: calc(10px * var(--sim-scale, 1));
    font-weight: 600;
  }
  .skeleton-browser-bulk button {
    border: none;
    background: transparent;
    padding: 0;
    color: var(--accent-soft);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .skeleton-browser-bulk button:hover {
    color: var(--accent);
  }
  .skeleton-browser-group-row,
  .skeleton-browser-subgroup-row {
    display: flex;
    align-items: center;
    gap: calc(4px * var(--sim-scale, 1));
    min-height: calc(26px * var(--sim-scale, 1));
    margin-bottom: calc(2px * var(--sim-scale, 1));
  }
  .skeleton-browser-toggle {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: calc(3px * var(--sim-scale, 1)) 0;
    text-align: left;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    color: #4fd1ff;
    text-shadow: 0 0 8px rgba(79, 209, 255, 0.55);
    transition: color 0.12s ease, text-shadow 0.12s ease;
  }
  .skeleton-browser-toggle.is-off {
    color: rgba(79, 209, 255, 0.38);
    text-shadow: none;
    font-weight: 600;
  }
  .skeleton-browser-expand {
    flex-shrink: 0;
    width: calc(22px * var(--sim-scale, 1));
    height: calc(22px * var(--sim-scale, 1));
    border: none;
    border-radius: 4px;
    background: rgba(19, 32, 84, 0.65);
    color: var(--accent-soft);
    font-size: calc(14px * var(--sim-scale, 1));
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }
  .skeleton-browser-expand:hover {
    background: rgba(26, 42, 99, 0.9);
    color: var(--accent);
  }
  .skeleton-browser-parts-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: calc(4px * var(--sim-scale, 1)) calc(6px * var(--sim-scale, 1));
    width: 100%;
  }
  .skeleton-browser-part-btn {
    border: none;
    background: transparent;
    padding: calc(2px * var(--sim-scale, 1)) 0;
    text-align: center;
    font: inherit;
    font-size: calc(9px * var(--sim-scale, 1));
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    color: #4fd1ff;
    text-shadow: 0 0 6px rgba(79, 209, 255, 0.45);
    word-break: break-word;
    hyphens: auto;
  }
  .skeleton-browser-part-btn.is-off {
    color: rgba(79, 209, 255, 0.38);
    text-shadow: none;
  }
  .skeleton-browser-part-btn:hover {
    color: var(--accent-soft);
  }
  @media (max-width: 520px) {
    .skeleton-browser-panel,
    .skeleton-browser-layer {
      max-width: min(240px, 50vw);
      font-size: calc(10px * var(--sim-scale, 1));
    }
    .skeleton-browser-layer[data-layer="subsub"] {
      max-width: min(300px, 58vw);
    }
  }
  @media (max-width: 520px) and (hover: none) and (pointer: coarse) {
    .skeleton-browser-panel,
    .skeleton-browser-layer,
    .skeleton-browser-inline-nest {
      --sim-scale: 1;
      font-size: var(--skel-browser-font-size, 11px);
    }
  }
  .sim-panel-corner-stack {
    position: absolute;
    left: 10px;
    bottom: 8px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: calc(6px * var(--sim-scale, 1));
    pointer-events: none;
  }
  .sim-feedback-copy-btn {
    pointer-events: auto;
    font-size: calc(10px * var(--sim-scale, 1));
    line-height: 1.3;
    color: rgba(154, 168, 204, 0.95);
    padding: calc(4px * var(--sim-scale, 1)) calc(8px * var(--sim-scale, 1));
    border-radius: 6px;
    background: rgba(7, 16, 32, 0.82);
    border: 1px solid rgba(79, 209, 255, 0.35);
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    max-width: min(220px, 48vw);
    text-align: left;
  }
  .sim-feedback-copy-btn:hover {
    color: var(--text);
    border-color: rgba(79, 209, 255, 0.55);
    background: rgba(15, 28, 53, 0.92);
  }
  .sim-feedback-copy-btn.is-on,
  .sim-feedback-copy-btn.is-copied {
    border-color: rgba(102, 187, 106, 0.65);
    color: #a5d6a7;
  }
  .sim-zoom-readout {
    font-size: 10px;
    line-height: 1.35;
    color: rgba(154, 168, 204, 0.88);
    pointer-events: none;
    user-select: none;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(7, 16, 32, 0.72);
    border: 1px solid rgba(79, 209, 255, 0.22);
    font-variant-numeric: tabular-nums;
  }
  .z-anatomy-credit-backdrop {
    display: none;
  }
  .z-anatomy-credit {
    position: absolute;
    right: 10px;
    bottom: 8px;
    z-index: 40;
    font-size: 10px;
    line-height: 1.35;
    color: rgba(154, 168, 204, 0.88);
    pointer-events: auto;
    user-select: none;
  }
  .z-anatomy-credit-trigger {
    display: inline-block;
    margin: 0;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(7, 16, 32, 0.72);
    border: 1px solid rgba(79, 209, 255, 0.22);
    color: inherit;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
    text-align: left;
  }
  .z-anatomy-credit-trigger:hover,
  .z-anatomy-credit-trigger:focus-visible {
    border-color: rgba(79, 209, 255, 0.45);
    outline: none;
  }
  .z-anatomy-credit-trigger-name {
    color: var(--accent-soft);
    font-weight: 600;
  }
  .z-anatomy-credit a {
    color: var(--accent-soft);
    text-decoration: none;
    font-weight: 600;
  }
  .z-anatomy-credit a:hover,
  .z-anatomy-credit a:focus-visible {
    text-decoration: underline;
    outline: none;
  }
  .z-anatomy-credit-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 41;
    width: min(520px, calc(100vw - 32px));
    max-height: min(85vh, 620px);
    overflow: auto;
    padding: 14px 36px 14px 14px;
    border-radius: 8px;
    background: rgba(7, 16, 32, 0.98);
    border: 1px solid rgba(79, 209, 255, 0.45);
    color: var(--text);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    user-select: text;
  }
  .z-anatomy-credit.is-open .z-anatomy-credit-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .z-anatomy-credit-panel-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-soft);
  }
  .z-anatomy-credit-panel-heading {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-soft);
  }
  .z-anatomy-credit-panel-subtitle {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
  }
  .z-anatomy-credit-panel-authors {
    margin: 0;
    line-height: 1.45;
  }
  .z-anatomy-credit-panel-section + .z-anatomy-credit-panel-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(79, 209, 255, 0.22);
  }
  .z-anatomy-credit-panel p {
    margin: 0 0 8px;
  }
  .z-anatomy-credit-panel ul {
    margin: 0 0 8px;
    padding-left: 1.15em;
  }
  .z-anatomy-credit-panel li {
    margin-bottom: 4px;
  }
  .z-anatomy-credit-panel li em {
    font-style: italic;
    font-weight: 400;
  }
  .z-anatomy-credit-download-wrap {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(79, 209, 255, 0.22);
  }
  .z-anatomy-credit-download-wrap strong {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-soft);
  }
  .z-anatomy-credit-download-intro {
    margin: 0 0 6px;
    font-size: 10px;
    color: var(--muted);
  }
  .z-anatomy-credit-download-list {
    margin: 0;
    padding-left: 1.15em;
  }
  .z-anatomy-credit-download-list .z-anatomy-credit-download-pending {
    color: var(--muted);
    font-style: italic;
  }
  .z-anatomy-credit-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }
  .z-anatomy-credit-close:hover,
  .z-anatomy-credit-close:focus-visible {
    color: var(--text);
    background: rgba(79, 209, 255, 0.12);
    outline: none;
  }
  .slice-control {
    position: absolute;
    top: var(--slice-control-top, 24%);
    right: var(--pan-stick-right, 16px);
    bottom: var(--slice-control-bottom, 10%);
    width: var(--pan-stick-size, 96px);
    z-index: 26;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: calc(8px * var(--sim-scale, 1));
    touch-action: none;
    user-select: none;
    pointer-events: auto;
    font-size: calc(13px * var(--sim-scale, 1));
    overflow: visible;
  }
  .slice-control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    font-size: inherit;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-soft);
    cursor: default;
  }
  .slice-control-label .slice-control-value {
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-transform: none;
    letter-spacing: 0;
  }
  .slice-control-lock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    font-size: inherit;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-soft);
    cursor: pointer;
    user-select: none;
  }
  .slice-control-lock input[type="checkbox"] {
    width: calc(16px * var(--sim-scale, 1));
    height: calc(16px * var(--sim-scale, 1));
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
    flex: 0 0 auto;
  }
  .slice-control-steppers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(8px * var(--sim-scale, 1));
    width: 100%;
  }
  .slice-step-btn {
    flex: 1;
    min-width: 0;
    padding: calc(6px * var(--sim-scale, 1)) calc(8px * var(--sim-scale, 1));
    border-radius: 10px;
    border: 1px solid #22306a;
    background: #132054;
    color: #e6edff;
    font-size: calc(15px * var(--sim-scale, 1));
    font-weight: 700;
    font-family: var(--sans);
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
  }
  .slice-step-btn:hover {
    background: #1a2a63;
    color: #ffffff;
  }
  .slice-step-btn:active {
    transform: translateY(1px);
  }
  .slice-control-track-wrap {
    flex: 1 1 auto;
    min-height: calc(48px * var(--sim-scale, 1));
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: visible;
  }
  .slice-control-track {
    flex: 0 0 auto;
    height: var(--slice-track-height, calc(120px * var(--sim-scale, 1)));
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }
  .slice-control-track input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: calc(18px * var(--sim-scale, 1));
    height: 100%;
    min-height: calc(64px * var(--sim-scale, 1));
    margin: 0;
    padding: 0;
    cursor: ns-resize;
    accent-color: var(--accent);
    background: transparent;
    writing-mode: vertical-lr;
    direction: rtl;
  }
  .slice-control-track input[type="range"]::-webkit-slider-runnable-track {
    width: calc(18px * var(--sim-scale, 1));
    height: 100%;
    border: none;
    border-radius: 999px;
    background: #132054;
    box-shadow: inset 0 0 0 1px #22306a;
  }
  .slice-control-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: calc(18px * var(--sim-scale, 1));
    height: calc(18px * var(--sim-scale, 1));
    margin-left: 0;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(79, 209, 255, 0.45);
  }
  .slice-control-track input[type="range"]::-moz-range-track {
    width: calc(18px * var(--sim-scale, 1));
    border: none;
    border-radius: 999px;
    background: #132054;
    box-shadow: inset 0 0 0 1px #22306a;
  }
  .slice-control-track input[type="range"]::-moz-range-thumb {
    width: calc(18px * var(--sim-scale, 1));
    height: calc(18px * var(--sim-scale, 1));
    border: none;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(79, 209, 255, 0.45);
    cursor: ns-resize;
  }

  .settings-panel .thymus-calibration-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
    overflow: visible;
    background: rgba(9, 18, 40, 0.94);
    border: 1px solid #2f4f8f;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
    padding: calc(12px * var(--settings-scale, 1));
    margin-top: 4px;
    font-size: calc(14px * var(--settings-scale, 1));
  }
  .thymus-calibration-panel[hidden] { display: none; }
  .settings-panel .thymus-calibration-title {
    margin: 0 0 calc(10px * var(--settings-scale, 1));
    font-size: calc(13px * var(--settings-scale, 1));
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--accent-soft);
  }
  .settings-panel .thymus-calibration-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(10px * var(--settings-scale, 1));
  }
  .settings-panel .thymus-mode-seg {
    width: 100%;
  }
  .settings-panel .thymus-mode-seg button {
    min-height: calc(36px * var(--settings-scale, 1));
    font-size: calc(12px * var(--settings-scale, 1));
    padding: calc(8px * var(--settings-scale, 1)) calc(6px * var(--settings-scale, 1));
  }
  .settings-panel .thymus-axis-block {
    border: 1px solid #22306a;
    border-radius: 8px;
    padding: calc(10px * var(--settings-scale, 1));
    display: grid;
    gap: calc(8px * var(--settings-scale, 1));
  }
  .settings-panel .thymus-axis-block h4 {
    margin: 0;
    font-size: calc(12px * var(--settings-scale, 1));
    color: #bcd4ff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .settings-panel .thymus-axis-row {
    display: grid;
    grid-template-columns: 18px 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: calc(6px * var(--settings-scale, 1));
  }
  .settings-panel .thymus-axis-row label {
    color: #d7e5ff;
    font-weight: 700;
    font-size: calc(13px * var(--settings-scale, 1));
  }
  .settings-panel .thymus-axis-row button {
    padding: calc(6px * var(--settings-scale, 1)) 0;
    min-height: calc(36px * var(--settings-scale, 1));
    min-width: calc(36px * var(--settings-scale, 1));
    border-radius: 6px;
    background: #101a42;
    border: 1px solid #22306a;
    color: #e6edff;
    font-size: calc(18px * var(--settings-scale, 1));
    line-height: 1;
    cursor: pointer;
  }
  .settings-panel .thymus-axis-row input[type="number"] {
    width: 100%;
    min-width: 0;
    border-radius: 6px;
    border: 1px solid #22306a;
    background: #0f1839;
    color: #e6edff;
    padding: calc(6px * var(--settings-scale, 1)) calc(8px * var(--settings-scale, 1));
    min-height: calc(36px * var(--settings-scale, 1));
    font-size: calc(14px * var(--settings-scale, 1));
  }
  .settings-panel .thymus-readout {
    border: 1px solid #22306a;
    border-radius: 8px;
    background: rgba(8, 14, 32, 0.8);
    padding: calc(10px * var(--settings-scale, 1));
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: calc(11px * var(--settings-scale, 1));
    line-height: 1.4;
    max-height: calc(160px * var(--settings-scale, 1));
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
  }
  .settings-panel .thymus-readout-row {
    display: flex;
    gap: calc(8px * var(--settings-scale, 1));
    align-items: center;
    justify-content: space-between;
    font-size: calc(13px * var(--settings-scale, 1));
  }
  .settings-panel .thymus-copy-btn {
    border-radius: 6px;
    padding: calc(8px * var(--settings-scale, 1)) calc(12px * var(--settings-scale, 1));
    min-height: calc(36px * var(--settings-scale, 1));
    background: #132054;
    border: 1px solid #2d4a8d;
    color: #e6edff;
    font-size: calc(13px * var(--settings-scale, 1));
    font-weight: 700;
    cursor: pointer;
  }

  /* After base .camera-view-reset / .slice-control so mobile font rules actually win. */
  @media (hover: none) and (pointer: coarse) {
    .camera-rotate-cluster,
    .slice-control {
      /* Nudge inward so controls sit inside the sim panel border on mobile. */
      right: calc(var(--pan-stick-right, 16px) + 10px);
    }
    .camera-view-reset {
      /* 20% smaller than Structure filter / Search stub titles (stub = title * 0.8) */
      font-size: calc(var(--skel-browser-title-size, 12px) * 0.64);
    }
    .slice-control {
      font-size: calc(var(--skel-browser-title-size, 12px) * 0.64);
    }
    .slice-step-btn {
      font-size: calc(var(--skel-browser-title-size, 12px) * 0.64);
    }
    .slice-control-lock input[type="checkbox"] {
      width: calc(var(--skel-browser-title-size, 12px) * 0.64 * 1.35);
      height: calc(var(--skel-browser-title-size, 12px) * 0.64 * 1.35);
    }
  }
  @media (max-aspect-ratio: 1 / 1) and (hover: none) and (pointer: coarse) {
    body {
      display: block;
    }
    html, body {
      height: auto;
      min-height: 100%;
      overflow-x: hidden;
      overflow-y: auto;
    }
    .app {
      display: flex;
      flex-direction: column;
      height: auto;
      min-height: 100dvh;
      overflow: visible;
    }
    .simulation-area {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 60;
      background: var(--bg, #071020);
    }
    .settings-panel {
      overflow-x: hidden;
      overflow-y: visible;
    }
    /*
      System selection cells: 50% taller than the unscaled base (~48px content → 72px),
      then another 50% because prior attempts were eaten by --settings-scale (72px * 0.7 ≈ 50px).
      Use fixed px + height (not min-height alone) so padding/font-scale rules cannot shrink them.
    */
    .settings-panel .system-grid {
      grid-template-rows: repeat(4, 35px) !important;
      grid-auto-rows: 35px !important;
    }
    .settings-panel .system-grid-btn,
    .settings-panel .system-grid-slot,
    .settings-panel button.system-grid-btn {
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      box-sizing: border-box !important;
      height: 35px !important;
      min-height: 35px !important;
      max-height: none !important;
      padding: 0 4px !important;
      font-size: 14px !important;
      line-height: 1.15 !important;
    }
  }
