/* These responsive rules also cover a narrow browser window. Safe areas and the
   visual viewport are measured by CharacterUI, including an open app keyboard. */
@media(max-width:620px){
 #characters{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
 #characters .trainer-station{gap:12px}
 #characters .station-header{gap:10px;padding-bottom:12px}
 #characters .station-header .station-eyebrow{font-size:8px;letter-spacing:1.6px}
 #characters .station-header h1{font-size:25px!important;letter-spacing:-.6px;margin:6px 0}
 #characters .station-header p{font-size:11px;line-height:1.4;max-width:260px}
 #characters .station-header>.station-secondary{min-height:44px;padding:8px 11px;font-size:10px}
 #characters .journey-selection{gap:12px;padding:2px}
 #characters .journey-heading h2{font-size:14px}
 #characters .journey-heading>span{font-size:10px;padding:4px 9px}
 #characters .journey-slots{grid-template-columns:1fr;gap:12px;margin:0}
 #characters .journey-card{padding:12px;border-radius:12px}
 #characters .journey-card-top{font-size:9px;letter-spacing:1.3px}
 #characters .journey-mode{font-size:9px;padding:3px 7px}
 #characters .journey-slot{display:grid;grid-template-columns:68px minmax(0,1fr);grid-template-rows:auto auto;gap:8px 12px;text-align:left;padding-top:5px}
 #characters .journey-portrait{grid-column:1;grid-row:1/3;width:68px;height:91px;align-self:center;background:radial-gradient(ellipse 29px 8px at 50% 91%,#71954e66,transparent 95%)}
 #characters .journey-portrait canvas.trainer-sprite{width:64px!important;height:80px!important}
 #characters .empty-slot{width:46px;height:46px;font-size:27px}
 #characters .journey-copy{gap:3px;grid-column:2;grid-row:1;align-self:end}
 #characters .journey-copy strong{font-size:19px}
 #characters .journey-copy small{font-size:10px}
 #characters .journey-party{grid-column:2;grid-row:2;min-height:34px;margin:0;padding:0;border:0;gap:3px;align-self:start}
 #characters .journey-party-member{max-height:33px;aspect-ratio:1}
 #characters .journey-party canvas{max-width:33px}
 #characters .journey-party-shiny{font-size:8px;top:-4px}
 #characters .journey-party.journey-invitation{font-size:9px;gap:2px}
 #characters .journey-invitation small{font-size:10px;line-height:1.4}
 #characters .journey-cta{grid-column:1/-1;min-height:42px;display:grid;place-items:center;font-size:12px;padding:9px}
 #characters .journey-selection-footer{font-size:10px;gap:5px;justify-content:center;text-align:center;margin-top:auto}
 #characters .journey-manage{justify-content:center}
 #characters .journey-manage button{min-height:44px;font-size:11px}
 #characters[data-character-view=create] .station-header{padding-bottom:0;border:0}
 #characters[data-character-view=create] .station-header h1{font-size:22px!important;margin-bottom:0}
 #characters[data-character-view=create] .station-header p{display:none}
 #characters .trainer-editor{border-radius:12px!important}
 #characters .wizard-bar{min-height:55px;padding:6px 12px;gap:10px}
 #characters .station-back{font-size:11px;min-height:40px}
 #characters .wizard-progress{gap:10px}
 #characters .wizard-progress li{gap:4px;font-size:10px}
 #characters .wizard-progress li>span{width:24px;height:24px}
 #characters .wizard-progress li:not([aria-current=step]) b{display:none}
 #characters .wizard-workspace{display:flex;flex-direction:column}
 #characters .trainer-showcase{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:12px;padding:8px 14px;flex:none;height:126px;overflow:hidden;border:0;border-bottom:1px solid #b9c8a5;text-align:left}
 #characters .trainer-editor[data-step='0'] .trainer-showcase{display:none}
 #characters .trainer-podium{width:108px;height:108px;max-width:none}
 #characters .trainer-podium canvas{width:108px;height:108px;max-width:none}
 #characters .showcase-copy{align-items:flex-start;flex:1;gap:4px}
 #characters .trainer-showcase h2{font-size:20px;line-height:1.15}
 #characters .trainer-showcase .station-eyebrow{font-size:8px;letter-spacing:1.2px}
 #characters .trainer-model-name{font-size:10px}
 #characters .trainer-angle{margin-top:3px;min-height:36px;font-size:11px;padding:6px;max-width:230px}
 #characters .preview-note{display:none}
 #characters .wizard-content{flex:1;min-height:0}
 #characters .wizard-step{padding:18px 15px 24px;scroll-padding:12px}
 #characters .wizard-step-heading{margin-bottom:19px}
 #characters .wizard-step-heading .station-eyebrow{font-size:8px}
 #characters .wizard-step-heading h2{font-size:22px;margin:6px 0}
 #characters .wizard-step-heading p{font-size:11px;line-height:1.5}
 #characters .wizard-name{margin-bottom:20px}
 #characters #trainer-nickname{font-size:16px;height:48px}
 #characters .wizard-name small{font-size:10px}
 #characters .trainer-mode{padding:12px;min-height:100px;gap:10px}
 #characters .mode-icon{width:34px;height:34px;font-size:22px}
 #characters .mode-copy{font-size:11px;gap:4px}
 #characters .mode-copy strong{font-size:14px}
 #characters .wizard-help{font-size:10px}
 #characters .wizard-look .wizard-step-heading{display:none}
 #characters .trainer-roster{gap:8px;margin-bottom:12px}
 #characters .trainer-choice{grid-template-columns:36px minmax(0,1fr);padding:7px 8px;gap:2px 7px;min-height:66px}
 #characters .trainer-choice .trainer-sprite{width:35.84px!important;height:44.8px!important}
 #characters .trainer-choice>span{font-size:13px}
 #characters .trainer-choice>small{font-size:9px}
 #characters .wardrobe-tabs .wardrobe-tab{min-height:45px;font-size:11px;padding:7px 3px}
 #characters .wardrobe-panel{padding:10px 8px}
 #characters .wardrobe-toolbar{gap:8px}
 #characters .wardrobe-toolbar strong{font-size:10px}
 #characters .wardrobe-toolbar input{font-size:16px;min-height:44px}
 #characters .trainer-look-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 #characters .trainer-wardrobe .wardrobe-card{font-size:10px;min-height:88px;padding:5px 2px}
 #characters .trainer-look-description{font-size:10px}
 #characters .trainer-part-colors{gap:9px}
 #characters .trainer-part-colors button,#characters .trainer-part-colors input[type=color]{width:38px;height:38px;min-height:38px}
 #characters .wizard-summary{padding:16px;gap:9px}
 #characters .wizard-summary>strong{font-size:23px}
 #characters .wizard-look-summary{font-size:11px;gap:7px 12px;grid-template-columns:76px 1fr}
 #characters .wizard-rules{padding-block:16px}
 #characters .wizard-rules p{font-size:11px;line-height:1.6}
 #characters .starter-note{flex-direction:column;align-items:flex-start;gap:5px;padding:12px;font-size:10px}
 #characters .starter-parade{grid-template-columns:repeat(6,32px)}
 #characters .wizard-navigation{padding:10px 12px;gap:9px}
 #characters .wizard-navigation button{min-width:0;min-height:47px;padding:10px 13px;font-size:12px}
 #characters .wizard-navigation>.station-primary{flex:1}
 #characters .wizard-navigation>.wizard-previous{flex:0 0 84px}
 #characters .station-error:not(:empty){font-size:11px;max-height:68px;padding:8px 10px}
 #characters .character-dialog-body{padding:19px}
 #characters .character-dialog-actions{padding:12px;gap:8px}
 #characters .character-dialog-actions button{min-width:0;flex:1;padding:9px;font-size:11px}
}
/* A landscape phone keeps the trainer alongside the scrollable choices. */
@media(min-width:621px) and (max-height:560px){
 #characters{padding:max(8px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
 #characters .trainer-station{gap:9px}
 #characters .station-header{padding:0 0 7px}
 #characters .station-header .station-eyebrow{font-size:8px}
 #characters .station-header h1{font-size:23px!important;margin:3px 0}
 #characters .station-header p{display:none}
 #characters .station-header>.station-secondary{min-height:40px;font-size:11px;padding:8px 12px}
 #characters .journey-selection{gap:8px}
 #characters .journey-heading h2{font-size:13px}
 #characters .journey-heading>span{padding:3px 9px;font-size:10px}
 #characters .journey-slots{gap:10px;margin:0}
 #characters .journey-card{padding:10px}
 #characters .journey-card-top{font-size:8px;letter-spacing:.6px}
 #characters .journey-mode{font-size:8px}
 #characters .journey-slot{display:grid;grid-template-columns:58px minmax(0,1fr);gap:5px 6px;text-align:left}
 #characters .journey-portrait{width:58px;height:65px}
 #characters .journey-portrait canvas.trainer-sprite{width:51.2px!important;height:64px!important}
 #characters .journey-copy strong{font-size:15px}
 #characters .journey-copy small{font-size:9px}
 #characters .empty-slot{width:38px;height:38px;font-size:24px}
 #characters .journey-party{grid-column:1/-1;margin:0 0 5px;min-height:28px;padding:4px 0;gap:2px}
 #characters .journey-party-member{max-height:29px}
 #characters .journey-party canvas{max-width:29px}
 #characters .journey-party.journey-invitation{font-size:9px;letter-spacing:1px;min-height:40px}
 #characters .journey-invitation small{font-size:9px}
 #characters .journey-cta{grid-column:1/-1;font-size:11px;padding:10px;min-height:40px}
 #characters .journey-selection-footer{font-size:10px}
 #characters .wizard-bar{padding:3px 14px;min-height:44px}
 #characters .station-back{min-height:36px;font-size:11px}
 #characters .wizard-progress{gap:14px}
 #characters .wizard-progress li{font-size:10px}
 #characters .wizard-progress li>span{width:22px;height:22px}
 #characters .wizard-workspace{grid-template-columns:170px minmax(0,1fr)}
 #characters .trainer-showcase{padding:10px;gap:6px;justify-content:safe center}
 #characters .trainer-podium,#characters .trainer-podium canvas{width:110px;height:110px}
 #characters .trainer-showcase h2{font-size:17px}
 #characters .trainer-showcase .station-eyebrow,#characters .preview-note,#characters .trainer-model-name{display:none}
 #characters .showcase-copy{gap:5px}
 #characters .trainer-angle{font-size:10px;min-height:34px;margin:0;padding:6px}
 #characters .wizard-step{padding:15px 18px 22px}
 #characters .wizard-step-heading{margin-bottom:14px}
 #characters .wizard-step-heading h2{font-size:21px}
 #characters .wizard-step-heading p{font-size:11px}
 #characters .wizard-name{margin-bottom:16px}
 #characters .trainer-mode{min-height:80px;padding:12px}
 #characters .wizard-look .wizard-step-heading{display:none}
 #characters .trainer-roster{margin-bottom:12px}
 #characters .trainer-choice{min-height:58px}
 #characters .trainer-choice .trainer-sprite{width:35.84px!important;height:44.8px!important}
 #characters .wizard-navigation{padding:7px 13px;gap:10px}
 #characters .wizard-navigation button{min-height:40px;min-width:135px;font-size:11px;padding:9px 14px}
 #characters .trainer-look-options{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
 #characters .trainer-wardrobe .wardrobe-card{min-height:85px;font-size:10px}
}
@media(max-height:470px) and (max-width:620px){
 #characters .station-header .station-eyebrow,#characters .station-header p{display:none}
 #characters .station-header h1{font-size:20px!important;margin:0}
 #characters .trainer-station{gap:7px}
 #characters .wizard-bar{min-height:45px;padding-block:2px}
 #characters .trainer-showcase{height:76px;padding:4px 12px;gap:10px}
 #characters .trainer-podium,#characters .trainer-podium canvas{width:68px;height:68px}
 #characters .trainer-showcase .station-eyebrow,#characters .trainer-model-name{display:none}
 #characters .trainer-showcase h2{font-size:16px}
 #characters .trainer-angle{min-height:32px;font-size:10px;margin:0;padding:4px}
 #characters .wizard-navigation{padding:6px 10px}
 #characters .wizard-navigation button{min-height:42px}
 #characters .wizard-step{padding:12px}
}
@media(max-width:350px){#characters{padding-inline:8px}#characters .station-header h1{font-size:22px!important}#characters .wizard-progress{gap:6px}#characters .wizard-progress li{font-size:9px}#characters .wizard-step{padding-inline:11px}#characters .wardrobe-tabs .wardrobe-tab{font-size:10px}#characters .trainer-look-options{grid-template-columns:repeat(2,minmax(0,1fr))}#characters .wizard-summary{grid-template-columns:1fr}#characters .wizard-mode{justify-self:start}#characters .trainer-podium,#characters .trainer-podium canvas{width:94px;height:94px}}
