/* Native reference surfaces: fixed cards, scrollable overlays, no new animation clock. */
@layer ui-theme {
 body .dex-library {display:grid!important;gap:8px!important;margin-top:14px!important;}
 body .dex-library .pt-entry {margin:0!important;}
 body .dex-library-action {display:flex!important;align-items:center!important;gap:10px!important;min-height:62px!important;width:100%!important;max-width:none!important;padding:10px 12px!important;border:1px solid var(--ui-line,#bdd2e1)!important;border-radius:13px!important;background:var(--ui-card,#f6fafc)!important;color:var(--ui-ink,#193e56)!important;text-align:left!important;font:inherit!important;box-shadow:none!important;cursor:pointer;}
 body .dex-library-action>svg {width:26px!important;height:26px!important;flex:none!important;color:var(--ui-accent,#087bbb)!important;}
 body .dex-library-action>svg:last-child {width:17px!important;height:17px!important;}
 body .dex-library-action>span {display:grid!important;gap:3px!important;min-width:0!important;flex:1!important;}
 body .dex-library-action b {font-size:14px!important;line-height:1.25!important;}
 body .dex-library-action small {display:block!important;overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important;font-size:10px!important;font-weight:400!important;color:var(--ui-muted,#526e82)!important;background:none!important;margin:0!important;padding:0!important;border-radius:0!important;}
 body .dex-library-action em {font-size:12px!important;font-weight:700!important;font-style:normal!important;color:var(--ui-accent,#087bbb)!important;flex:none!important;}
 body .dex-library-action:hover {border-color:var(--ui-accent,#087bbb)!important;background:var(--ui-paper,#edf7fc)!important;}
 body :is(.dex-library-action,.dex-library-dialog button,.dex-search-dialog button,.pt-dialog button):focus-visible {outline:3px solid #178ed1!important;outline-offset:2px!important;}
 body #app #sidePanel :is(.dex-library-dialog,.dex-search-dialog) {box-sizing:border-box!important;position:fixed!important;border:1px solid var(--ui-line,#bdd2e1)!important;border-radius:20px!important;background:var(--ui-card,#fff)!important;color:var(--ui-ink,#193e56)!important;padding:18px!important;box-shadow:0 24px 80px #102c4938!important;overflow:auto!important;}
 body #app #sidePanel .dex-library-dialog {width:860px!important;height:560px!important;}
 body #app #sidePanel :is(.dex-library-dialog,.dex-search-dialog)::backdrop {background:#112d497a!important;backdrop-filter:none!important;}
 body #app #sidePanel :is(.dex-library-dialog,.dex-search-dialog)>header {display:flex!important;align-items:center!important;justify-content:space-between!important;gap:16px!important;padding:0 0 14px!important;margin:0!important;border:0!important;background:transparent!important;}
 body #app #sidePanel :is(.dex-library-dialog,.dex-search-dialog)>header small {font-size:10px!important;letter-spacing:1.4px!important;color:var(--ui-muted,#526e82)!important;}
 body #app #sidePanel :is(.dex-library-dialog,.dex-search-dialog)>header {position:sticky!important;top:0!important;z-index:5!important;background:var(--ui-card,#fff)!important;}
 body #app #sidePanel :is(.dex-library-dialog,.dex-search-dialog)>header h3 {margin:3px 0 0!important;font-size:23px!important;line-height:1.2!important;}
 body #app #sidePanel :is(.dex-library-dialog,.dex-search-dialog) [data-pc-close] {display:grid!important;place-items:center!important;min-width:44px!important;width:44px!important;height:44px!important;min-height:44px!important;padding:10px!important;border:1px solid var(--ui-line,#bdd2e1)!important;border-radius:12px!important;background:var(--ui-paper,#edf5fa)!important;color:var(--ui-ink,#193e56)!important;}
 body #app #sidePanel .dex-library-dialog .pf-tabs {display:flex!important;gap:6px!important;flex-wrap:nowrap!important;overflow-x:auto!important;overscroll-behavior:contain!important;padding:2px 2px 10px!important;margin:0 0 10px!important;}
 body #app #sidePanel .dex-library-dialog .pf-tabs button {display:flex!important;align-items:center!important;gap:7px!important;flex:none!important;min-height:48px!important;max-width:210px!important;padding:6px 10px!important;border:1px solid var(--ui-line,#bdd2e1)!important;border-radius:11px!important;background:var(--ui-card,#fff)!important;color:var(--ui-ink,#193e56)!important;box-shadow:none!important;font:600 12px/1.25 system-ui!important;}
 body #app #sidePanel .dex-library-dialog .pf-tabs button[aria-pressed=true] {border-color:var(--ui-accent,#087bbb)!important;background:var(--ui-paper,#edf7fc)!important;color:var(--ui-accent,#087bbb)!important;}
 body #app #sidePanel .dex-library-dialog .pf-tabs :is(img,svg) {width:32px!important;height:32px!important;flex:none!important;object-fit:contain!important;}
 body #app #sidePanel .dex-library-dialog .pf-body {display:grid!important;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important;gap:22px!important;align-items:start!important;}
 body #app #sidePanel .dex-library-dialog .pf-art {display:block!important;position:relative!important;isolation:isolate!important;height:330px!important;min-width:0!important;overflow:hidden!important;border:1px solid var(--ui-line,#d3e2eb)!important;border-radius:16px!important;background:var(--ui-paper,#edf5fa)!important;padding:0!important;}
 body #app #sidePanel .dex-library-dialog .pf-art>.pk-platform-scene {position:absolute!important;inset:0!important;}
 body #app #sidePanel .dex-library-dialog .pf-art>img {position:absolute!important;inset:12px 5% auto!important;z-index:1!important;display:block!important;width:90%!important;height:calc(100% - 62px)!important;max-height:none!important;object-fit:contain!important;margin:0!important;filter:drop-shadow(0 8px 8px #17364c25)!important;}
 body #app #sidePanel .dex-library-dialog .pf-art>span:not(.pk-platform-scene) {position:absolute!important;bottom:12px!important;left:12px!important;right:12px!important;z-index:2!important;text-align:center!important;font-size:11px!important;padding:6px!important;border-radius:8px!important;background:var(--ui-card,#fff)!important;color:var(--ui-muted,#526e82)!important;}
 body #app #sidePanel .dex-library-dialog .pf-copy {min-width:0!important;}
 body #app #sidePanel .dex-library-dialog .pf-kind {font-size:11px!important;color:var(--ui-accent,#087bbb)!important;}
 body #app #sidePanel .dex-library-dialog h3 {font-size:23px!important;margin:4px 0 10px!important;}
 body #app #sidePanel .dex-library-dialog p {font-size:12px!important;line-height:1.55!important;margin:12px 0!important;}
 body #app #sidePanel .dex-library-dialog .pf-types {margin-bottom:12px!important;}
 body #app #sidePanel .dex-library-dialog .pf-base-stats {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;margin:0!important;}
 body #app #sidePanel .dex-library-dialog .pf-base-stats>div {padding:9px!important;background:var(--ui-paper,#f0f6fa)!important;border-radius:9px!important;}
 body #app #sidePanel .dex-library-dialog .pf-base-stats dt {display:flex!important;align-items:center!important;gap:4px!important;font-size:10px!important;color:var(--ui-muted,#526e82)!important;white-space:nowrap!important;}
 body #app #sidePanel .dex-library-dialog .pf-base-stats dt svg {width:16px!important;height:16px!important;}
 body #app #sidePanel .dex-library-dialog .pf-base-stats dd {margin:5px 0 0!important;font-size:20px!important;font-weight:800!important;}
 body #app #sidePanel .dex-library-dialog .pf-measures {display:flex!important;gap:18px!important;margin-top:12px!important;font-size:12px!important;}
 body #app #sidePanel .dex-library-dialog .pf-measures>span {display:flex!important;align-items:center!important;gap:5px!important;}
 body #app #sidePanel .dex-library-dialog .pf-measures svg {width:18px!important;height:18px!important;}
 body #app #sidePanel .dex-library-dialog .pf-requirements {display:grid!important;gap:7px!important;}
 body #app #sidePanel .dex-library-dialog .pf-note {border-top:1px solid var(--ui-line,#bdd2e1)!important;padding-top:10px!important;color:var(--ui-muted,#526e82)!important;}
 body #app #sidePanel .dex-library-dialog .pf-tera-types {display:flex!important;flex-wrap:wrap!important;gap:5px!important;}
 body #app #sidePanel .dex-library-dialog .pf-tera-types>span {border:1px solid color-mix(in srgb,var(--tera-color,#9675db) 45%,transparent)!important;background:color-mix(in srgb,var(--tera-color,#9675db) 12%,var(--ui-card,#fff))!important;border-radius:7px!important;font-size:11px!important;padding:5px 7px!important;}
 body #app #sidePanel .dex-search-dialog {width:500px!important;height:640px!important;}
 body #app #sidePanel .dex-search-field {display:flex!important;align-items:center!important;gap:9px!important;border:1px solid var(--ui-line,#bdd2e1)!important;border-radius:12px!important;padding:0 10px!important;margin:0 0 12px!important;}
 body #app #sidePanel .dex-search-field svg {width:20px!important;height:20px!important;flex:none!important;color:var(--ui-accent,#087bbb)!important;}
 body #app #sidePanel .dex-search-field input {width:100%!important;min-width:0!important;height:46px!important;margin:0!important;padding:6px 0!important;border:0!important;box-shadow:none!important;border-radius:0!important;background:transparent!important;color:var(--ui-ink,#193e56)!important;font:14px system-ui!important;}
 body #app #sidePanel .dex-search-results {display:grid!important;gap:5px!important;}
 body #app #sidePanel .dex-search-results>button {display:flex!important;align-items:center!important;gap:10px!important;min-height:50px!important;width:100%!important;padding:4px 10px!important;border:1px solid transparent!important;border-radius:10px!important;background:var(--ui-paper,#f2f7fb)!important;color:var(--ui-ink,#193e56)!important;text-align:left!important;box-shadow:none!important;}
 body #app #sidePanel .dex-search-results>button:hover {border-color:var(--ui-accent,#087bbb)!important;}
 body #app #sidePanel .dex-search-results img {width:42px!important;height:42px!important;object-fit:contain!important;}
 body #app #sidePanel .dex-search-results span {display:grid!important;gap:3px!important;flex:1!important;min-width:0!important;}
 body #app #sidePanel .dex-search-results b {font:700 13px system-ui!important;}
 body #app #sidePanel .dex-search-results small {font:11px system-ui!important;color:var(--ui-muted,#526e82)!important;}
 body #app #sidePanel .dex-search-results svg {width:18px!important;height:18px!important;}
 body #app #sidePanel :is(.dex-search-hint,.dex-search-empty) {font:12px/1.5 system-ui!important;color:var(--ui-muted,#526e82)!important;margin:12px 0 0!important;}
 body .pt-dialog {box-sizing:border-box!important;width:min(780px,calc(100dvw - 24px))!important;height:520px!important;max-height:calc(100dvh - 24px)!important;padding:18px!important;border:1px solid var(--ui-line,#bdd2e1)!important;border-radius:20px!important;background:var(--ui-card,#fff)!important;color:var(--ui-ink,#193e56)!important;overflow:auto!important;box-shadow:0 24px 80px #102c4938!important;}
 body .pt-dialog[open] {display:block!important;}
 body .pt-dialog::backdrop {background:#112d497a!important;backdrop-filter:none!important;}
 body .pt-dialog>header {display:flex!important;justify-content:space-between!important;align-items:center!important;gap:12px!important;margin-bottom:16px!important;}
 body .pt-dialog>header {position:sticky!important;top:0!important;z-index:5!important;background:var(--ui-card,#fff)!important;}
 body .pt-dialog header small {font-size:11px!important;color:var(--ui-muted,#526e82)!important;}
 body .pt-dialog h2 {display:flex!important;gap:8px!important;align-items:center!important;font-size:24px!important;line-height:1.2!important;margin:4px 0 0!important;}
 body .pt-dialog h2 svg {width:25px!important;height:25px!important;color:var(--ui-accent,#087bbb)!important;}
 body .pt-dialog button {min-height:44px!important;border:1px solid var(--ui-line,#bdd2e1)!important;border-radius:11px!important;background:var(--ui-paper,#edf5fa)!important;color:var(--ui-ink,#193e56)!important;font:600 13px/1.3 system-ui!important;padding:10px!important;box-shadow:none!important;cursor:pointer;}
 body .pt-dialog button:disabled {opacity:.5!important;cursor:default!important;}
 body .pt-dialog [data-pt-close] {display:grid!important;place-items:center!important;width:44px!important;height:44px!important;padding:11px!important;}
 body .pt-dialog [data-pt-close] svg {width:20px!important;height:20px!important;}
 body .pt-workspace {display:grid!important;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)!important;gap:18px!important;}
 body .pt-dialog .pt-preview {grid-area:auto!important;position:relative!important;isolation:isolate!important;height:380px!important;margin:0!important;overflow:hidden!important;border:1px solid var(--ui-line,#bdd2e1)!important;border-radius:16px!important;background:var(--ui-paper,#edf5fa)!important;}
 body .pt-preview>.pk-platform-scene {position:absolute!important;inset:0!important;}
 body .pt-preview>.pk-platform-scene {background:linear-gradient(145deg,color-mix(in srgb,var(--platform-a) 20%,var(--ui-card,#fff)),color-mix(in srgb,var(--platform-b) 34%,var(--ui-card,#fff)))!important;}
 body .pt-preview :is(.pk-platform-traces,.pk-platform-orbit,.pk-platform-light) {display:none!important;}
 body .pt-preview canvas {position:relative!important;z-index:1!important;display:block!important;width:100%!important;height:calc(100% - 46px)!important;object-fit:contain!important;}
 body .pt-caption {position:absolute!important;z-index:2!important;bottom:14px!important;left:12px!important;right:12px!important;display:flex!important;justify-content:space-between!important;align-items:center!important;gap:8px!important;font-size:12px!important;background:var(--ui-card,#fff)!important;border-radius:9px!important;padding:9px!important;}
 body .pt-caption small {white-space:nowrap!important;color:var(--ui-muted,#526e82)!important;}
 body .pt-controls {min-width:0!important;}
 body .pt-list-label {display:flex!important;justify-content:space-between!important;font-size:11px!important;color:var(--ui-muted,#526e82)!important;margin:0 0 10px!important;}
 body .pt-dialog .pt-options {display:grid!important;grid-template-columns:1fr!important;gap:7px!important;max-height:240px!important;overflow:auto!important;padding:2px!important;}
 body .pt-dialog .pt-options button {display:flex!important;align-items:center!important;gap:10px!important;text-align:left!important;min-height:65px!important;background:var(--ui-card,#fff)!important;}
 body .pt-options i {font-style:normal!important;font-size:11px!important;color:var(--ui-muted,#526e82)!important;}
 body .pt-options span {display:grid!important;gap:5px!important;flex:1!important;min-width:0!important;}
 body .pt-options small {font-size:10px!important;color:var(--ui-muted,#526e82)!important;font-weight:400!important;}
 body .pt-options svg {width:17px!important;height:17px!important;flex:none!important;}
 body .pt-dialog .pt-options button[aria-pressed=true] {border-color:var(--ui-accent,#087bbb)!important;background:var(--ui-paper,#edf7fc)!important;color:var(--ui-accent,#087bbb)!important;}
 body .pt-dialog footer {display:grid!important;gap:7px!important;margin-top:12px!important;}
 body .pt-dialog footer button {display:flex!important;justify-content:center!important;align-items:center!important;gap:8px!important;}
 body .pt-dialog footer svg {width:18px!important;height:18px!important;}
 body .pt-dialog [data-pt-world] {background:var(--ui-accent,#087bbb)!important;color:#fff!important;}
 body .pt-dialog .pt-note {font-size:11px!important;line-height:1.55!important;color:var(--ui-muted,#526e82)!important;margin:12px 0 0!important;}
 body .pt-dialog .pt-status {font-size:12px!important;color:var(--ui-muted,#526e82)!important;margin:8px 0!important;}
 body .pt-dialog .pt-status:empty {display:none!important;}
 @media(max-width:600px) {
  body #app #sidePanel .dd-header nav {gap:4px!important;}
  body #app #sidePanel .dd-header :is(.dd-search-open,[data-pc-open=habitat]) {width:42px!important;min-width:42px!important;padding:9px!important;}
  body #app #sidePanel .dd-header :is(.dd-search-open,[data-pc-open=habitat]) span {display:none!important;}
  body #app #sidePanel .dex-library-dialog .pf-body {grid-template-columns:1fr!important;gap:14px!important;}
  body #app #sidePanel .dex-library-dialog {height:calc(100dvh - 24px)!important;padding:12px!important;}
  body #app #sidePanel .dex-library-dialog .pf-art {height:220px!important;}
  body .pt-dialog {height:calc(100dvh - 24px)!important;padding:12px!important;}
  body .pt-workspace {grid-template-columns:1fr!important;gap:14px!important;}
  body .pt-dialog .pt-preview {height:240px!important;}
  body .pt-dialog .pt-options {max-height:220px!important;}
  body .pt-dialog .pt-options button {min-height:56px!important;}
 }
 @media(max-height:560px) and (min-width:601px) {
  body .pt-dialog {height:calc(100dvh - 24px)!important;padding:12px!important;}
  body .pt-dialog>header {margin-bottom:10px!important;}
  body .pt-dialog .pt-preview {height:250px!important;}
  body .pt-dialog .pt-options {max-height:165px!important;}
  body .pt-dialog .pt-options button {min-height:49px!important;padding:7px!important;}
  body .pt-dialog .pt-note {margin-top:8px!important;}
  body #app #sidePanel .dex-library-dialog .pf-art {height:230px!important;}
 }
}
@layer mobile-window-accessibility {
 @media(max-width:760px),(pointer:coarse) and (max-height:560px) {
  body .pt-dialog[open] .pt-preview canvas {height:calc(100% - 46px)!important;}
  body .pt-dialog[open]>header {top:0!important;}
 }
}

/* The library actions fit into the existing biology column. */
@layer ui-theme {
 body #app #sidePanel .dex-library:has(.pt-entry[hidden]) {grid-template-columns:minmax(0,1fr)!important;}
 body #app #sidePanel .dex-library {grid-template-columns:repeat(2,minmax(0,1fr))!important;min-width:0!important;margin-top:4px!important;gap:6px!important;}
 body #app #sidePanel .dex-library .pt-entry {min-width:0!important;}
 body #app #sidePanel .dex-library-action {box-sizing:border-box!important;min-width:0!important;max-width:100%!important;min-height:54px!important;padding:7px 8px!important;gap:6px!important;overflow:hidden!important;}
 body #app #sidePanel .dex-library-action>svg {width:20px!important;height:20px!important;}
 body #app #sidePanel .dex-library-action>svg:last-child {display:none!important;}
 body #app #sidePanel .dex-library-action b {font-size:12px!important;overflow-wrap:anywhere!important;}
 body #app #sidePanel .dex-library-action small {font-size:9px!important;}
 body #app #sidePanel .dex-library-dialog {height:auto!important;max-width:calc(100dvw - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow-x:hidden!important;overscroll-behavior:contain!important;}
 body #app #sidePanel .dex-library-dialog .pf-tabs {flex-wrap:wrap!important;max-height:132px!important;overflow-x:hidden!important;overflow-y:auto!important;}
 body #app #sidePanel .dex-library-dialog .pf-tabs button {flex:0 1 auto!important;min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important;}
 body #app #sidePanel .dex-library-dialog .pf-art {align-self:start!important;}
 body #app #sidePanel .dex-library-dialog .pf-copy {overflow-wrap:anywhere!important;}
 body #app #sidePanel .dex-library-dialog .pf-base-stats dt {white-space:normal!important;}
 body #app #sidePanel .dex-library-dialog .pf-measures {flex-wrap:wrap!important;}
 body #app #sidePanel .dex-library-dialog .pf-requirements>div {display:flex!important;gap:8px!important;align-items:center!important;min-width:0!important;border:1px solid var(--ui-line)!important;border-radius:9px!important;padding:8px!important;}
 body #app #sidePanel .dex-library-dialog .pf-requirements img {width:32px!important;height:32px!important;flex:none!important;}
 body #app #sidePanel .dex-library-dialog .pf-requirements small {display:block!important;margin-top:3px!important;color:var(--ui-muted)!important;}
 body #app #sidePanel .dex-library-dialog .pf-tera-portraits {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
 body #app #sidePanel .dex-library-dialog .pf-tera-portraits figure {margin:0!important;text-align:center!important;background:var(--ui-paper)!important;border-radius:10px!important;padding:8px!important;min-width:0!important;}
 body #app #sidePanel .dex-library-dialog .pf-tera-portraits img {display:block!important;width:100%!important;height:130px!important;object-fit:contain!important;}
 body #app #sidePanel .dex-library-dialog .pf-tera-portraits figcaption {font:600 11px/1.4 system-ui!important;}
 @media(min-width:961px) and (max-height:800px) {
  body #app #sidePanel .dd-dossier .dd-stage {height:clamp(140px,calc(100dvh - 500px),220px)!important;}
 }
 @media(max-width:600px) {
  body #app #sidePanel .dex-library-dialog {height:auto!important;}
  body #app #sidePanel .dex-library-dialog .pf-art {height:200px!important;}
 }
}
