/* DoraDex — compact pocket screens. One shared frame and spacing system. */
:root{--ink:#292064;--muted:#675882;--blue:#2927d9;--paper:#fffaf2;--pink:#f6bddd;--lavender:#d8c9fa;--line:#c5b0de;--font:Arial,Helvetica,sans-serif}
*{box-sizing:border-box}
html{min-width:320px}
body{margin:0;min-height:100svh;font:14px/1.5 var(--font);color:var(--ink);background:radial-gradient(ellipse at 8% 0,#ffe6f3,transparent 60%),linear-gradient(125deg,#e6dffa,#dcecf7)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation}
button:disabled{cursor:default;opacity:.6}
a{color:inherit;text-underline-offset:3px}
img{max-width:100%;object-fit:contain}
[hidden]{display:none!important}
:focus-visible{outline:3px solid #6942b5;outline-offset:3px}
p{margin:0 0 12px}
.skip{position:absolute;top:-100px;left:12px;z-index:10;background:white;padding:12px}
.skip:focus{top:12px}
.app{width:min(414px,calc(100% - 20px));margin:16px auto;padding:10px 12px 6px;border:2px solid #6263b4;border-radius:24px;background:radial-gradient(ellipse at 20% 0,#ffe4f8,transparent 48%),linear-gradient(145deg,#fff7ed,#f8ecfa 70%,#e5e7ff);box-shadow:inset 0 0 0 3px #fff9,0 0 0 3px #b4b7e6,0 7px 0 #aaa9d5,0 18px 45px #5243aa24}
.top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:0 5px;margin-bottom:6px}
.brand-logo{width:120px;max-height:42px}
.edit{min-height:44px;padding:7px 10px;font-size:12px;border:1px solid #a68ad0;border-radius:10px;background:linear-gradient(#fff9ff,#ebddfb);box-shadow:inset 0 1px white}
.screen,.dex-device{position:relative;padding:0;border:0;background:transparent}
.screen:focus,.dex-device:focus{outline:none}
.welcome-screen{text-align:center;padding:18px 14px 14px}
.welcome-heading{display:flex;gap:5px;justify-content:center;align-items:center}
.welcome-heading>img{width:24px;height:28px;image-rendering:pixelated}
.welcome-heading h1{margin:0;min-width:0}
.welcome-logo{display:block;width:248px;max-height:74px;image-rendering:pixelated}
.welcome-screen>p{max-width:285px;margin:10px auto 16px;line-height:1.45}
.welcome-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.welcome-actions button{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:14px 6px;min-height:158px;border:1px solid #d17cb8;border-radius:11px;background:linear-gradient(145deg,#ffe5f2,#f2b6dc);box-shadow:inset 0 2px #fff,0 2px #d9a5d4;font-weight:700;font-size:16px;line-height:1.3}
.welcome-actions button:last-child{border-color:#9991d9;background:linear-gradient(145deg,#e8f0ff,#c9c6fa);box-shadow:inset 0 2px #fff,0 2px #b6a8dd}
.welcome-actions img{width:68px;height:68px;image-rendering:pixelated}
.welcome-actions small{display:block;font-size:12px;font-weight:400;margin-top:5px}
.welcome-screen .welcome-footnote{font-size:12px;margin:16px auto 2px;color:var(--muted)}
.device-top{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;min-height:68px;margin:0 4px 18px;padding:8px 10px 12px;border:2px solid var(--blue);border-radius:16px;background:linear-gradient(#fff,#e9e6ff 50%,#fff4fc);box-shadow:inset 0 0 0 3px #c3ccff,inset 0 0 0 5px white,0 3px 0 #a9a6ea}
.device-lens{color:#f5a836;font-size:23px;text-shadow:1px 1px #ca63c2}
.shell-wordmark{margin:0;line-height:1}
.shell-wordmark img{display:block;width:230px;max-height:48px;image-rendering:pixelated}
.device-model{position:absolute;bottom:-12px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:10px;font-weight:700;line-height:1.4;color:var(--blue);border:1px solid #9284de;border-radius:20px;padding:4px 12px;background:linear-gradient(#fff6bd,#ffe9a2);box-shadow:0 2px 0 #c9c3ec;text-transform:uppercase}
.tag{font-size:12px;line-height:1.4;text-align:center;margin:0 6px 10px;color:var(--blue)}
.identity-row{display:flex;align-items:center;gap:9px;padding:8px;border:1px solid #baa0df;border-radius:8px;background:linear-gradient(110deg,#fff5df,#f9f0fb)}
#dexPortrait{flex:none;width:52px;height:58px;image-rendering:pixelated;border-radius:5px;background:#fff2d9}
.identity-copy{min-width:0;flex:1}
#dexBadge{display:inline-block;font-size:10px;color:#ad3696;line-height:1.4;margin-top:4px;padding:2px 7px;border:1px solid #e8a4db;border-radius:9px;background:#ffe6f5}
#dexName{font-size:16px;line-height:1.4;margin:1px 0;text-transform:uppercase;overflow-wrap:anywhere}
#dexLocation{font-size:12px;line-height:1.4;margin:0;overflow-wrap:anywhere}
.info-button{flex:none;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;font-size:24px;color:#6a4a9a}
.info-button:hover{background:#ede1f9}
.toolbar{margin:9px 0 10px}
.tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:2px;border:1px solid #ad96db;border-radius:8px;background:linear-gradient(#f0e9ff,#dfd9fa)}
.tabs button{min-height:44px;padding:7px 8px;border:1px solid transparent;border-radius:6px;background:transparent;font-size:14px}
.tabs button.on{border-color:#e99bca;background:linear-gradient(#ffdfef,#f5badd);box-shadow:inset 0 1px white;font-weight:700}
.context{font-size:11px;line-height:1.4;margin-top:8px;overflow-wrap:anywhere}
.payoff{position:relative;padding:12px;margin-bottom:10px;border:1px solid #e2a5ce;border-radius:8px;background:linear-gradient(120deg,#fff3e7,#fce7f3);box-shadow:inset 0 1px white}
.payoffIcon{display:none}
.payoffKicker{font-size:10px;color:var(--muted);margin:0 0 5px 30px}
.payoffHeadline{font-size:16px;line-height:1.4;font-weight:700;color:var(--blue);padding-left:30px}
.payoffMeta{font-size:11px;color:var(--muted)}
summary{cursor:pointer;min-height:44px;align-content:center;line-height:1.4}
.daily-note summary{font-size:12px;color:#644a79}
.payoffTry{font-size:14px;line-height:1.5;padding-bottom:4px}
.dex-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.dex-tabs button{min-width:0;min-height:108px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;padding:9px 5px;border:1px solid #a395de;border-radius:8px;background:linear-gradient(135deg,#dcefff,#c8d1fb);box-shadow:inset 0 2px #fff9,0 2px #baaadd;font-size:14px;font-weight:700}
.dex-tabs button:nth-child(2){background:linear-gradient(135deg,#e6d7ff,#c9c7fc)}
.dex-tabs button:nth-child(3){background:linear-gradient(135deg,#f7d7ee,#d8cdfa)}
.dex-tabs img{width:44px;height:44px;image-rendering:pixelated}
.dex-tabs span{text-align:center;min-width:0}
.dex-tabs small{display:block;font-size:11px;font-weight:400;line-height:1.4;margin-top:3px;overflow-wrap:anywhere}
.text-button{min-height:44px;padding:8px 4px;display:block;border:0;background:none;text-decoration:underline;text-underline-offset:3px;font-size:13px}
.back-link{display:inline-flex;align-items:center;gap:7px;min-height:44px;margin-top:8px;font-size:12px}
.back-link img{width:23px;height:23px;image-rendering:pixelated}
#menuBtn{display:inline-flex;margin-right:14px}
/* Weekly forecast: shared columns keep all seven days scannable. */
.timeline{padding:8px;border:1px solid #c9b9f4;border-radius:12px;background:linear-gradient(#fffaf6,#fdf3fb)}
.timeline-heading{display:flex;align-items:baseline;justify-content:space-between;gap:6px;margin:2px 0 8px}
.timeline-heading h2{font-size:13px;margin:0;color:var(--blue)}
.timeline-heading small{font-size:10px;color:var(--muted)}
.timelineTable{width:100%;table-layout:fixed;border-collapse:collapse;font-size:12px}
.timelineTable th{font-weight:600;text-align:left}
.timelineTable thead th{font-size:10px;color:var(--muted);padding:6px 3px;border-bottom:1px solid #d8caee}
.timelineTable th:first-child{width:42px}
.timelineTable td,.timelineTable tbody th{padding:8px 3px;border-bottom:1px solid #e9dcf2;vertical-align:middle}
.timelineTable tbody tr:last-child>*{border-bottom:0}
.timelineDate strong,.timelineDate small{display:block;font-size:11px;line-height:1.5}
.timelineDate small{font-weight:400;color:var(--muted)}
.timelineCell{display:flex;align-items:center;gap:4px;min-width:0;line-height:1.3}
.timelineCell img{width:23px;height:23px;flex:none;image-rendering:pixelated}
.timelineText{min-width:0;overflow-wrap:anywhere}
.timelineText strong{display:block;font-size:11px;font-weight:600;color:var(--blue)}
.timelineText small{display:block;font-size:9px;color:var(--muted);margin-top:2px}
.timelineFootnote{font-size:10px;line-height:1.4;color:var(--muted);margin:8px 0 0}
.status-screen{text-align:center;display:flex;flex-direction:column;align-items:center;gap:15px;padding:26px 18px}
.status-screen h1{font-size:20px;margin:0}
.status-screen p{font-size:14px;margin:0}
.status-screen>img{width:120px;height:120px;image-rendering:pixelated}
.loading-track{width:70%;height:14px;overflow:hidden;border:1px solid #9d83d3;border-radius:8px;background:#f3e9ff}
.loading-track span{display:block;width:45%;height:100%;background:linear-gradient(90deg,#b9b3ff,#eda8df);animation:load-slide 1.6s ease-in-out infinite alternate}
@keyframes load-slide{to{transform:translateX(120%)}}
.screen-primary,.save{width:100%;min-height:48px;padding:11px;border:1px solid #ce87bb;border-radius:8px;background:linear-gradient(#ffe5f4,#f3b8dd);box-shadow:inset 0 2px white,0 2px #d2a6d5;font-weight:700;font-size:14px;color:#702467}
dialog{width:min(392px,calc(100vw - 20px));max-width:calc(100vw - 20px);max-height:calc(100svh - 20px);padding:0;border:1px solid #a18ad5;border-radius:12px;background:linear-gradient(125deg,#fff9eb,#fcebf4 65%,#efe8fc);box-shadow:0 0 0 3px #d7c6ec,0 15px 45px #58427130;overflow:auto}
dialog::backdrop{background:linear-gradient(125deg,#eadef4f5,#e4eaf9f5)}
.modal{padding:0 14px 16px;min-width:0}
.modalTop{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:8px;min-height:54px;margin:0 -14px 12px;padding:0 12px 0 5px;border-bottom:1px solid #dac7f3;background:linear-gradient(110deg,#ffe7f7,#f8f0ff);border-radius:11px 11px 0 0}
.modalTop h2,.modalTop .eyebrow,#entryLabel{font-size:16px;color:var(--blue);line-height:1.4;font-weight:700;margin:0;display:flex;align-items:center;gap:8px}
.title-icon{width:27px;height:27px;image-rendering:pixelated}
.close{order:-1;flex:none;color:var(--blue);width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:7px;background:transparent;font-size:25px;line-height:1}
.close:hover{background:#fff7}
.modal h2{line-height:1.3}
.modal p{font-size:14px;line-height:1.5}
.cards,.card{min-width:0}
.card{display:flex;flex-direction:column;gap:10px}
.cardLabel{display:none}
.artRow{position:relative;display:flex;justify-content:center;align-items:center;}
.mainArt{width:96px;height:96px;image-rendering:pixelated}
.moonBadge{position:absolute;width:30px;height:30px;left:calc(50% + 30px);bottom:0;image-rendering:pixelated}
.cardHead{text-align:center;font-size:24px;line-height:1.25;font-weight:700;overflow-wrap:anywhere}
.cardSub{display:none}
.dex-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.dex-stats>div{text-align:center;min-width:0;padding:10px 5px;border:1px solid #d3c5f5;border-radius:10px;background:linear-gradient(#fffc,#fff5fb);box-shadow:inset 0 1px white}

.dex-stats span{display:block;font-size:10px;line-height:1.5;color:var(--muted)}
.dex-stats strong{display:block;color:var(--blue);font-size:14px;line-height:1.4;margin-top:4px;overflow-wrap:anywhere}
.takeaway{font-size:14px;line-height:1.55;overflow-wrap:anywhere}
.takeaway>b{display:none}
.actions{display:flex;flex-direction:column;gap:7px;margin-top:4px}
.actionBtn,.detailBtn,.utilityBtn{min-height:44px;padding:9px 11px;border:1px solid #b69bd3;border-radius:7px;background:linear-gradient(#fff4ff,#e9dcf8);box-shadow:inset 0 1px white;font-size:13px;text-align:left}
.meta{text-align:center;font-size:11px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.card.loading .cardHead,.card.loading .takeaway{opacity:.6}
.setup-intro{margin-bottom:2px}
.sample-shortcut{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:44px;padding:5px 0;border:0;background:transparent;text-align:left;font-size:13px;text-decoration:underline;text-underline-offset:3px;color:#6d4389;margin-bottom:8px}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.field{min-width:0}
.field.full{grid-column:1/-1}
.field label{display:block;font-size:12px;line-height:1.4;margin-bottom:5px}
.field small{display:block;font-size:10px;line-height:1.4;color:var(--muted);margin-top:2px}
.field input{display:block;width:100%;min-width:0;min-height:44px;border:1px solid #c0a2d2;border-radius:6px;background:#fffc;padding:8px;font-size:16px}
.field input:focus{outline:2px solid #9474cc;outline-offset:2px}
.error{display:none;padding:10px;margin-top:12px;font-size:13px;background:#ffebef;border:1px solid #c58eae;border-radius:7px}
.save{margin-top:14px}
.micro,.note{font-size:11px!important;line-height:1.5!important;color:var(--muted);margin:12px 0 0!important}
#setupForm>.utilityBtn{margin-top:10px;border:0;box-shadow:none;background:none;text-decoration:underline;font-size:11px;padding:8px 0}
.detailHero{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:12px;margin-bottom:12px}
.detailHero img{width:64px;height:64px;image-rendering:pixelated}
.detailHero h2{font-size:21px;line-height:1.3;margin:0 0 6px}
.detailHero p{margin:0}
.chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:12px 0}
.chip{padding:10px 8px;border:1px solid #cdb6df;border-radius:8px;background:linear-gradient(#fffaf3,#f3e9f9);font-size:12px}
.infoBox{border:1px solid #d3c2f2;border-radius:10px;padding:12px;margin:10px 0;background:linear-gradient(#fffaf3,#f5eefe)}
.infoTitle{font-size:12px;color:var(--muted);margin-bottom:5px}
.infoBig{font-size:16px;font-weight:700;line-height:1.5}
.actionPanel{text-align:center}
.actionPanel .modalTop{text-align:left}
.actionPanel>img{display:block;width:96px;height:96px;margin:0 auto 12px;image-rendering:pixelated}
.actionBig{font-size:23px;font-weight:700;line-height:1.35;margin-bottom:12px;overflow-wrap:anywhere}
.actionCopy{font-size:14px;line-height:1.55;overflow-wrap:anywhere}
.sample-info-intro{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.sample-info-intro img{flex:none;width:60px;height:64px;image-rendering:pixelated;background:#fff2d5;border-radius:7px}
.sample-info-intro p{margin:0;font-size:13px}
.sample-data{margin:0}
.sample-data>div{display:grid;grid-template-columns:100px minmax(0,1fr);gap:10px;border-top:1px solid #e0cce8;padding:8px 0;font-size:12px;line-height:1.5}
.sample-data dt{color:var(--muted)}
.sample-data dd{margin:0;overflow-wrap:anywhere}
.source-link{display:inline-flex;align-items:center;min-height:44px;margin-top:5px;font-size:11px}
@media(max-width:360px){
  .app{width:calc(100% - 16px)}
  .screen,.dex-device{padding:10px}
  .welcome-screen{padding:16px 10px 12px}
  .welcome-actions{gap:8px}
  .welcome-actions button{font-size:14px;min-height:148px}
  .welcome-actions small{font-size:11px}
  .welcome-logo{width:220px}
  .welcome-heading>img{width:19px}
  .shell-wordmark img{width:205px}
  .dex-tabs{gap:6px}
  .dex-tabs button{font-size:12px}
  .dex-tabs small{font-size:10px}
  .fields{grid-template-columns:1fr}
  .field.full{grid-column:auto}
  .sample-data>div{grid-template-columns:90px minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* Reference-inspired finish, with safe fallbacks for forthcoming illustrations. */
.edit,.tabs button,.dex-tabs button{color:var(--blue)}
.edit{border-color:#a89aef;border-radius:20px;background:linear-gradient(#fff9ff,#e6e2ff)}
#dexName,.cardHead{color:var(--blue)}
.briefing-bow{position:absolute;left:12px;top:19px;width:23px;height:23px;image-rendering:pixelated}
.welcome-heading{border:2px solid var(--blue);border-radius:14px;padding:7px 4px;background:linear-gradient(#fff,#e8e7ff,#fff7fc);box-shadow:inset 0 0 0 3px #cfcdff}
.welcome-actions button{border-color:#e355bb;box-shadow:inset 0 2px white,0 2px #c989ca}
.welcome-actions button:last-child{border-color:#7168ed}
.app-footer{display:flex;align-items:center;justify-content:space-between;gap:4px;flex-wrap:wrap;margin-top:5px}
.app-footer .back-link{margin-top:0;margin-left:auto}
#menuBtn{margin-right:0}
.scene-slot{isolation:isolate;overflow:hidden;aspect-ratio:2.3/1;border:1px solid #c9bbf1;border-radius:15px;background:radial-gradient(ellipse at 18% 20%,#fff 0,transparent 45%),linear-gradient(135deg,#9fcdff,#e5ddff);min-height:126px;max-height:170px}
.scene-slot::before,.scene-slot::after{position:absolute;z-index:-1;color:#fff8;font-size:34px;line-height:1;content:'✦';top:14%;left:15%;pointer-events:none}
.scene-slot::after{top:auto;left:auto;bottom:20%;right:16%;font-size:21px;color:#ffdc85}
.scene-cosmos{background:radial-gradient(circle at 55% 70%,#ba96ed,transparent 55%),linear-gradient(145deg,#514b9b,#9f8cdb 60%,#e7c6f0)}
.scene-body{background:radial-gradient(ellipse at 20% 10%,#fff,transparent 55%),linear-gradient(140deg,#f5d6ff,#e3dafa,#ffd7ec)}
.scene-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1}
.scene-slot.has-artwork::before,.scene-slot.has-artwork::after{display:none}
.scene-slot.has-artwork .mainArt{position:absolute;width:35px;height:35px;bottom:8px;left:9px;padding:4px;background:#fff9;border-radius:50%}
.scene-slot.has-artwork .moonBadge{left:auto;right:9px;bottom:8px}
.artwork-footer{height:64px;margin:10px -10px -2px;overflow:hidden}
.artwork-footer img{width:100%;height:100%;object-fit:contain;object-position:center bottom}
.takeaway{padding:11px;border:1px solid #d4c2f3;border-radius:10px;background:linear-gradient(130deg,#fff9f1,#f0e9ff)}
.actionBtn,.save,.screen-primary{border-color:#df61bf;color:#762280;background:linear-gradient(#ffe5f7,#f8b9e6);box-shadow:inset 0 2px white,0 2px #d5abdf}
.actionBtn,.detailBtn{position:relative;padding-right:28px;font-weight:600;color:var(--blue)}
.actionBtn::after,.detailBtn::after{content:'›';position:absolute;right:10px;font-size:22px;line-height:1}
.actionCopy{padding:12px;text-align:left;border:1px solid #d6c5ee;border-radius:10px;background:#fff7fc}
@media(max-width:360px){
.app{padding:8px 9px 5px;margin:10px auto}.screen,.dex-device{padding:0}.welcome-screen{padding:6px 0}.shell-wordmark img{width:192px}.device-top{gap:5px;margin-left:0;margin-right:0}.device-lens{font-size:19px}.timeline{padding:6px}.timelineTable th:first-child{width:34px}.timelineCell{flex-direction:column;align-items:flex-start;gap:2px}.timelineCell img{width:20px;height:20px}.timelineTable td,.timelineTable tbody th{padding:7px 2px}.scene-slot{min-height:118px}
}
/* Delivered expansion: scenes retain their full composition; decorative art stays out of controls. */
.scene-slot{aspect-ratio:12/7;min-height:0;max-height:224px}
.scene-art{object-fit:contain;image-rendering:pixelated}
.scene-cosmos.has-artwork .moonBadge{width:100px;height:100px;left:50%;top:44%;right:auto;bottom:auto;transform:translate(-50%,-50%);background:none;filter:drop-shadow(0 0 10px #e6c8ff99)}
.scene-body.has-artwork .scene-art{padding:3px 12px}
.actionPanel>img.outfit-art{width:100%;height:clamp(220px,42svh,340px);margin:0 auto 14px;padding:10px;object-fit:contain;border:1px solid #cbb9ed;border-radius:12px;background:linear-gradient(135deg,#fffaf0,#f7e6fa)}
.actionPanel:has(.outfit-art) .actionBig{font-size:21px}
.mini-skyline{height:55px;margin:14px -8px -8px;overflow:hidden;pointer-events:none}
.mini-skyline img{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom;image-rendering:pixelated}
.close img,.info-button img{width:26px;height:26px;image-rendering:pixelated;vertical-align:middle}
.edit{display:inline-flex;align-items:center;justify-content:center;gap:5px}
.edit::before{content:'';width:18px;height:18px;flex:none;background:url('assets/interface-icons/settings.png') center/contain no-repeat;image-rendering:pixelated}
#wearBtn{display:flex;align-items:center;gap:8px}
#wearBtn::before{content:'';width:23px;height:23px;flex:none;background:url('assets/interface-icons/clothes-hanger.png') center/contain no-repeat;image-rendering:pixelated}
.setup-greeting{display:flex;align-items:center;gap:10px;margin-bottom:4px}
.setup-greeting>img{width:58px;height:58px;flex:none;image-rendering:pixelated}
.setup-greeting .setup-intro{margin:0;font-size:13px}
.welcome-screen .welcome-footnote{padding:10px 39px;min-height:48px;background:url('assets/decor/cloud-corner-left.png') left bottom/55px auto no-repeat,url('assets/decor/cloud-corner-right.png') right bottom/55px auto no-repeat}
.sample-info-intro{background:url('assets/decor/sparkle-cluster.png') right top/40px auto no-repeat;padding-right:22px}
@media(max-width:360px){.scene-slot{min-height:0}.scene-cosmos.has-artwork .moonBadge{width:84px;height:84px}.mini-skyline{height:45px}.welcome-screen .welcome-footnote{padding-left:34px;padding-right:34px}}
/* A single viewport-fitted frame for every route and dialog. */
:root{--frame-gap:12px;--frame-width:min(414px,calc(100vw - 24px));--frame-height:min(760px,calc(100svh - 24px))}
@supports(height:100dvh){:root{--frame-height:min(760px,calc(100dvh - 24px))}}
.app,dialog{width:var(--frame-width);max-width:var(--frame-width);height:var(--frame-height);max-height:var(--frame-height);border:2px solid #6263b4;border-radius:24px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.app{display:flex;flex-direction:column;margin:var(--frame-gap) auto;padding:10px 12px 6px}
.app>*{flex-shrink:0}
.app-footer{margin-top:auto;padding-top:6px}
.app>.welcome-screen,.app>.status-screen{margin-top:auto;margin-bottom:auto}
dialog{position:fixed;inset:var(--frame-gap) 0 auto;margin:0 auto}
dialog .modal{min-height:100%;padding-bottom:16px}
.modalTop{border-radius:21px 21px 0 0}
#dexName{text-transform:none;overflow-wrap:anywhere}
.profile-name{margin:8px 0 14px}
.avatar-picker{min-width:0;margin:0 0 16px;padding:0;border:0}
.avatar-picker legend{font-size:12px;margin-bottom:7px;padding:0}
.avatar-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.avatar-option{position:relative;min-width:0;cursor:pointer}
.avatar-option input{position:absolute;width:1px;height:1px;opacity:0;left:50%;top:50%;margin:0}
.avatar-tile{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-height:82px;padding:6px 2px;border:2px solid #d2bfe8;border-radius:10px;background:#fff8;gap:4px}
.avatar-tile img{width:100%;height:46px;image-rendering:pixelated;object-fit:contain}
.avatar-tile>span{font-size:10px;line-height:1.2;text-align:center;overflow-wrap:anywhere}
.avatar-option input:checked+.avatar-tile{border-color:#bd47ae;background:linear-gradient(#ffe5f6,#e8dbff);box-shadow:0 0 0 1px #fff inset}
.avatar-option input:checked+.avatar-tile::after{content:'✓';position:absolute;right:1px;top:1px;border-radius:50%;width:16px;height:16px;line-height:16px;text-align:center;background:#8c3298;color:white;font-size:11px;font-weight:bold}
.avatar-option input:focus-visible+.avatar-tile{outline:3px solid #6942b5;outline-offset:2px}
/* Image-led buttons: real scenes, with compact text below them. */
.welcome-actions img{width:88px;height:88px}
.welcome-actions button{min-height:178px;font-size:15px}
.dex-tabs button{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;padding:0;min-height:140px;overflow:hidden}
.dex-tabs .tile-picture{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:92px;overflow:hidden;border-bottom:1px solid #bba5df;background:linear-gradient(#e7dcff,#fff2fb)}
.dex-tabs .tile-picture .tile-scene{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;image-rendering:pixelated}
.dex-tabs .tile-picture>img:not(.tile-scene){position:relative;width:62px;height:62px;image-rendering:pixelated}
.dex-tabs .tile-picture.has-artwork>img:not(.tile-scene){position:absolute;bottom:5px;left:5px;width:26px;height:26px;background:#fff9;padding:2px;border-radius:50%}
.dex-tabs #starsTile.has-artwork>img:not(.tile-scene){width:54px;height:54px;left:50%;top:45%;bottom:auto;transform:translate(-50%,-50%);background:transparent;padding:0}
.dex-tabs #bodyTile .tile-scene{object-fit:contain;padding:3px}
.dex-tabs button>span:last-child{padding:8px 3px 9px;line-height:1.2;font-size:13px}
.dex-tabs small{margin-top:4px;font-size:10px}
@media(max-width:360px){.app{padding:8px 9px 5px;margin:var(--frame-gap) auto}.avatar-options{gap:4px}.avatar-tile{min-height:79px}.avatar-tile img{height:42px}.dex-tabs .tile-picture{height:78px}.dex-tabs button{min-height:129px}.welcome-actions img{width:74px;height:74px}.welcome-actions button{min-height:162px}}
