:where(html, body).dex-document { margin:0; min-height:100%; background:#141628; color:#fff9e9 }
#ive-dex, .dex-app {
 --ink:#20263c; --paper:#fff8e7; --ui:#e9e0c9; --wine:#4e2331;
 --shell:#b94348; --shell-light:#dc5e56; --screen:#cde2cf; --blue:#91d6ed;
 box-sizing:border-box; max-width:1050px; margin:24px auto; font-family:ui-monospace, "Courier New", monospace; color:var(--ink); text-align:left;
}
#ive-dex *, .dex-app * { box-sizing:border-box }
.dex-app [hidden]{ display:none!important }
.dex-app button,.dex-app input,.dex-app select { font:inherit }
.dex-app button,.dex-app select { cursor:pointer }
.dex-app button:focus-visible,.dex-app input:focus-visible,.dex-app select:focus-visible,.dex-app a:focus-visible { outline:3px solid #2840db; outline-offset:3px }
.dex-case {
 padding:14px; border:4px solid var(--ink); border-radius:17px; background:var(--shell);
 box-shadow:inset 0 5px var(--shell-light), inset 0 -5px #8a313b, 0 7px 0 #171825;
}
.dex-head { display:flex; align-items:center; gap:14px; padding:2px 6px 13px; color:#fff8e7 }
.dex-head h1 { color:inherit; margin:0; font-size:clamp(23px,4vw,35px); line-height:1; letter-spacing:-.055em }
.dex-brand { font-size:12px; line-height:1.4; text-transform:uppercase; letter-spacing:.12em }
.dex-lamp { display:flex; align-items:center; gap:5px; flex:0 0 auto }
.dex-lamp:before { width:35px;height:35px;border-radius:50%; border:4px solid var(--ink); background:#76c9e9;box-shadow:inset 4px 4px #c1f1f9; content:"" }
.dex-lamp i { width:9px;height:9px;border-radius:50%;border:2px solid var(--ink);background:#f2b96a }
.dex-lamp i:last-child {background:#a8d89b}
.dex-counter { margin-left:auto; padding:6px 9px; border:2px solid var(--ink); border-radius:4px; color:var(--ink); background:var(--paper);font-size:13px;font-weight:bold; white-space:nowrap }
.dex-filters { display:grid; grid-template-columns:minmax(140px,1fr) minmax(116px,180px) auto; gap:8px 12px; align-items:end; margin:0 0 13px; padding:10px 12px 12px; border:2px solid var(--ink); border-radius:7px; background:#e1a19b }
.dex-field { display:grid; min-width:0; gap:3px; font-size:12px; font-weight:bold }
.dex-field input,.dex-field select {
 width:100%; color:var(--ink); background:var(--paper); min-height:40px; padding:6px 8px;
 border:2px solid var(--ink); border-radius:4px; box-shadow:inset 0 2px #e4d8be; font-size:14px;
}
.dex-toggle { display:flex; align-items:center; gap:5px; font-size:13px; font-weight:bold; min-height:40px; cursor:pointer }
.dex-toggle input {width:18px;height:18px;accent-color:#6048a3}
.dex-panels { display:grid; grid-template-columns:minmax(168px, .7fr) minmax(0, 2fr); gap:11px; align-items:stretch }
.dex-index, .dex-screen { min-width:0; border:3px solid var(--ink); border-radius:8px; overflow:hidden; background:var(--paper) }
.dex-panel-label { display:flex; align-items:center; justify-content:space-between; gap:4px; padding:7px 10px; background:#37435f; color:#fff9e9; font-size:12px; font-weight:bold; letter-spacing:.07em }
.dex-list {
 list-style:none; padding:6px; margin:0; height:clamp(300px,56vh,520px); overflow:auto; overscroll-behavior:contain;
 scrollbar-color:#8f654e #f3e7cf; background:repeating-linear-gradient(#faf3df 0 31px,#f2e8d0 31px 32px);
}
.dex-list li+li { margin-top:2px }
.dex-app .dex-entry {
 position:relative; width:100%; min-height:38px; display:grid; align-items:center; grid-template-columns:4.4ch minmax(0,1fr);
 border:2px solid transparent; border-radius:4px; background:transparent; color:var(--ink); text-align:left; font-size:13px; padding:4px 6px; font-weight:bold; line-height:1.1;
}
.dex-app .dex-entry:hover { background:#f1ddb6 }
.dex-app .dex-entry[aria-current="true"] { background:#fae6a6; color:#241d2c; border-color:#806044; box-shadow:inset 3px 0 #e46a4c }
.dex-entry-code { font-size:11px; color:#56476c }
.dex-index-help { margin:0; min-height:27px; display:flex; align-items:center; justify-content:center; gap:5px; padding:4px; font-size:11px; color:#3e4359; background:#e9dfc6; border-top:2px solid var(--ink) }
.dex-empty { padding:16px; font-size:14px; line-height:1.45 }
.dex-entry-meta { padding:8px 11px; border-bottom:2px solid var(--ink); display:flex; flex-wrap:wrap; gap:4px 12px; align-items:center; justify-content:space-between; background:#e8ead8 }
.dex-entry-meta h2 { margin:0; font-size:clamp(17px,3vw,25px); color:var(--ink); line-height:1.05; letter-spacing:-.04em }
.dex-details-kind { font-size:11px; text-transform:uppercase; font-weight:bold; color:#51536b }
.dex-types { display:flex; flex-wrap:wrap; gap:4px }
.dex-type { padding:3px 6px; border:2px solid var(--ink); border-radius:4px; color:#20223b; background:#ded7ee; font-size:11px; font-weight:bold; line-height:1.05 }
.dex-type-Fire {background:#ffba98} .dex-type-Water {background:#a8d8f7} .dex-type-Grass {background:#b8dfa7} .dex-type-Electric {background:#f7e285}
.dex-type-Dark {background:#c6b5d8} .dex-type-Ghost {background:#ccbff1} .dex-type-Fighting {background:#e8aea7} .dex-type-Rock {background:#e1c99e}
.dex-type-Ground {background:#ead3a3} .dex-type-Steel {background:#c1d0df} .dex-type-Ice {background:#aee4ea} .dex-type-Flying {background:#b9d7fa}
.dex-type-Poison {background:#d7a7dc} .dex-type-Dragon {background:#b6c6ff} .dex-type-Psychic {background:#f2b5d3} .dex-type-Fairy {background:#f5c9e0}
.dex-type-Bug {background:#d3e49c} .dex-type-Normal {background:#e7dfc8}
.dex-viewport {
 position:relative; display:grid; place-items:center; height:clamp(188px,37vh,310px); padding:14px; overflow:hidden;
 border-bottom:2px solid var(--ink); background:repeating-linear-gradient(0deg,transparent 0 3px,#778e6e19 3px 4px), radial-gradient(ellipse at bottom,#edf7da,#bfd7ba);
}
.dex-viewport[data-mode="art"] { background:#f4e9d7 }
.dex-viewport img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
.dex-viewport[data-mode="sprite"] img { width:min(100%,232px); image-rendering:pixelated }
.dex-viewport-hint { position:absolute; left:7px; top:6px; padding:3px 6px; border:1px solid var(--ink); border-radius:3px; font-size:10px; font-weight:bold; background:#fffaeb; color:var(--ink); text-transform:uppercase; letter-spacing:.07em; pointer-events:none }
.dex-image-controls { display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; padding:6px 8px; background:#eee6d0; border-bottom:2px solid var(--ink) }
.dex-image-note { color:#49445b; font-size:11px }
.dex-app .dex-chip,.dex-app .dex-tab,.dex-app .dex-evo, .dex-home {
 min-height:34px; border:2px solid var(--ink); border-radius:4px; background:var(--paper); color:var(--ink); padding:4px 8px; font-size:12px; font-weight:bold; text-decoration:none;
}
.dex-app .dex-chip:hover,.dex-app .dex-tab:hover,.dex-app .dex-evo:hover { background:#f6e2b8 }
.dex-app .dex-chip[aria-pressed="true"], .dex-app .dex-tab[aria-selected="true"] { background:#b7dbed; box-shadow:inset 0 -2px #6d99bd }
.dex-tabs { display:flex; flex-wrap:wrap; gap:4px; padding:7px 8px 0; background:#e9dfc7 }
.dex-app .dex-tab { border-radius:5px 5px 0 0; border-bottom:0; flex:1 }
.dex-tabpanel { padding:10px 12px; min-height:125px; border-top:2px solid var(--ink); font-size:14px; line-height:1.45; }
.dex-tabpanel p { margin:0 0 8px }
.dex-tabpanel h3 { font-size:12px; margin:9px 0 5px; text-transform:uppercase; color:#4a4c69; letter-spacing:.06em }
.dex-evolution { display:flex; gap:5px; flex-wrap:wrap; margin:3px 0 0; padding:0; list-style:none }
.dex-evolution li { display:flex; flex-direction:column; align-items:flex-start }
.dex-evo-method { font-size:11px; padding-top:2px; color:#535267 }
.dex-stat-list { padding:0; margin:0; list-style:none; display:grid; gap:3px }
.dex-stat { display:grid; grid-template-columns:7ch minmax(0,1fr) 3ch; align-items:center; gap:7px }
.dex-stat span:last-child { text-align:right; font-weight:bold }
.dex-stat-track { height:9px; border:1px solid #4d536d; border-radius:2px; overflow:hidden; background:#eee5ce }
.dex-stat-track i { height:100%; display:block; background:#699c8b }
.dex-total {margin-top:6px!important; font-weight:bold;text-align:right }
.dex-moves { list-style:none; padding:0; margin:0; max-height:210px; overflow:auto }
.dex-moves li {display:flex; gap:8px; border-bottom:1px solid #dfd4bc; padding:3px 0 }
.dex-level { color:#544569; flex:0 0 7ch }
.dex-footer { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:7px; margin-top:10px; padding:1px 2px; color:#fff8e7; font-size:11px; font-weight:bold }
.dex-home {display:inline-flex; align-items:center; margin:0 0 10px}
.dex-sr { position:absolute; width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0 }
@media(max-width:650px){#ive-dex,.dex-app{margin:10px auto}.dex-case{padding:9px;border-width:3px}.dex-head{gap:7px;padding-left:0;padding-right:0}.dex-lamp:before{width:28px;height:28px}.dex-lamp i{display:none}.dex-filters{grid-template-columns:minmax(0,1fr) minmax(90px,1fr);gap:5px 7px;padding:5px}.dex-toggle{grid-column:1/-1;min-height:28px}.dex-panels{grid-template-columns:minmax(0,1fr);gap:7px}.dex-list{height:126px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px}.dex-list li+li{margin:0}.dex-app .dex-entry{font-size:12px;min-height:36px}.dex-viewport{height:220px}.dex-index-help{display:none}.dex-counter{font-size:11px;padding:4px}.dex-panel-label{padding:5px 8px}}
@media(prefers-reduced-motion:reduce){.dex-app *{scroll-behavior:auto!important;transition:none!important}}
/* Fixed row pitch keeps scroll selection to one scrollTop read per animation frame. */
.dex-app { width:min(1050px,calc(100% - 22px)); }
.dex-filters { grid-template-columns:minmax(135px,1fr) minmax(108px,145px) minmax(125px,165px) auto }
.dex-list {
 display:block; height:var(--dex-list-height); --dex-list-height:clamp(300px,56vh,520px);
 padding:calc((var(--dex-list-height) - 48px)/2) 6px;
 scroll-snap-type:y proximity;
}
.dex-list li,.dex-list li+li { height:48px; display:flex; align-items:center; margin:0; scroll-snap-align:center; }
.dex-app .dex-entry { display:grid; grid-template-columns: 4.2ch 26px minmax(0,1fr); gap:4px; min-height:40px; }
.dex-entry-icon { display:block; width:26px; height:26px; object-fit:contain; image-rendering:pixelated; }
.dex-index-help { min-height:40px; }
.dex-app .dex-dpad { color:var(--ink); background:var(--paper); border:2px solid var(--ink); border-radius:4px; min-width:32px; min-height:30px; }
.dex-app .dex-dpad:disabled { opacity:.5; cursor:default; }
.dex-entry-code { letter-spacing:-.04em }
.dex-evo-name { font-size:12px;padding:5px 4px; }
.dex-evolution+.dex-evolution { margin-top:7px; }
.dex-media,.dex-tab-content { animation:dex-enter 160ms cubic-bezier(.19,.72,.29,.99) both; }
.dex-tab-content { animation-duration:130ms; }
@keyframes dex-enter { from { opacity:0; transform:translate3d(0,6px,0); } to { opacity:1; transform:translate3d(0,0,0); } }
@media(max-width:650px){
 .dex-filters { grid-template-columns:minmax(0,1fr) minmax(0,1fr) }
 .dex-filters .dex-field:first-child {grid-column:1/-1;}
 .dex-list { display:block;--dex-list-height:150px; }
 .dex-list li,.dex-list li+li { height:48px;margin:0; }
 .dex-index-help { display:flex; }
 .dex-viewport { height:205px; }
}
@media(prefers-reduced-motion:reduce){.dex-app *{animation:none!important}}

/* Windowed National register: only the nearby rows receive layout or icons. */
.dex-filters { grid-template-columns:minmax(140px,1fr) minmax(123px,175px) minmax(96px,125px) minmax(105px,140px) auto }
.dex-list.dex-windowed { scroll-snap-type:none; overflow-anchor:none; }
.dex-list li.dex-list-gap { display:block; min-height:0; margin:0; scroll-snap-align:none; pointer-events:none; }
.dex-app .dex-entry { grid-template-columns:5.1ch 22px minmax(0,1fr); }
.dex-national-badge { font-size:9px; line-height:1; white-space:nowrap; text-align:center; padding:3px 1px; border:1px solid #a49baf; border-radius:3px; color:#514366; background:#eee2ee; }
.dex-viewport[data-mode="sprite"] canvas { display:block; width:min(100%,232px); height:auto; max-height:100%; object-fit:contain; image-rendering:pixelated; }
@media(max-width:735px){ .dex-filters {grid-template-columns:repeat(2,minmax(0,1fr))} .dex-filters .dex-field:first-child{grid-column:1/-1}.dex-toggle{min-height:40px;} }

.dex-filters {grid-template-columns:minmax(140px,1fr) minmax(123px,175px) minmax(96px,125px) minmax(105px,140px)}
.dex-form-controls {display:flex;flex-wrap:wrap;gap:4px}
.dex-local-shiny[aria-pressed="true"] {background:#ded0f8!important;}
@media(max-width:735px){.dex-filters {grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Optically larger labels retain their rhythm with the bitmap-styled VT323. */
@font-face{font-family:VT323;src:url('./site-art/fonts/VT323-Regular.ttf') format('truetype');font-display:swap}
#ive-dex,.dex-app{font-family:VT323,ui-monospace,monospace;font-size:19px}
.dex-app .dex-entry,.dex-app .dex-field input,.dex-app .dex-field select{font-size:19px}
.dex-app .dex-brand,.dex-app .dex-field,.dex-app .dex-panel-label,.dex-app .dex-counter{font-size:16px}
.dex-app .dex-entry-code,.dex-app .dex-details-kind,.dex-app .dex-type,.dex-app .dex-index-help,.dex-app .dex-viewport-hint{font-size:14px}
.dex-app .dex-tab,.dex-app .dex-chip,.dex-app .dex-evo,.dex-app .dex-tab-content{font-size:18px}
.dex-app .dex-head h1,.dex-app .dex-entry-meta h2{letter-spacing:0}
.dex-app .dex-entry-meta h2{font-size:clamp(21px,3vw,32px)}
.dex-embedded{background:#b9414a;color:#fff8e7;scrollbar-color:#702b3b #d75c5e;scrollbar-width:thin}
.dex-embedded #ive-dex{width:100%;max-width:none;margin:0}
.dex-embedded #ive-dex>nav,.dex-embedded .dex-head> :not(.dex-counter){display:none}
.dex-embedded .dex-case{padding:6px;border:0;border-radius:0;box-shadow:none}
.dex-embedded .dex-head{padding:0 0 5px}
.dex-embedded .dex-counter{font-size:14px;padding:1px 5px}
.dex-embedded .dex-list{--dex-list-height:clamp(220px,45vh,502px)}
.dex-embedded .dex-viewport{height:clamp(195px,38vh,340px)}
@media(max-width:650px){
 .dex-embedded .dex-list{--dex-list-height:138px}
 .dex-embedded .dex-viewport{height:215px}
 .dex-app .dex-entry{font-size:17px;grid-template-columns:3.8ch 20px minmax(0,1fr)}
}
