/* Secondary UI uses the shared density/preferences contract; no world or account rules. */
html[data-md-mobile=true] {
  --md-secondary-title: clamp(18px, calc(22px * var(--md-ui-scale)), 26px);
  --md-secondary-body: clamp(11px, calc(12px * var(--md-ui-scale)), 15px);
  --md-secondary-subtitle: clamp(13px, calc(16px * var(--md-ui-scale)), 19px);
  --md-secondary-space: clamp(5px, calc(8px * var(--md-ui-scale)), 10px);
}
html[data-md-mobile=true] .account-ranks-screen .ranks-heading h1,
html[data-md-mobile=true] #app .information-panel h1,
html[data-md-mobile=true] #app .account-shell h1,
html[data-md-mobile=true] #app .terms-modal header h2,
html[data-md-mobile=true] #app :is(.towers-reference,.enemies-reference) > h2,
html[data-md-mobile=true] #app.daily-rewards-page .depot-page-header h1 {
  font-size: var(--md-secondary-title); line-height: 1.15;
}
html[data-md-mobile=true] .account-ranks-screen .ranks-list { gap: var(--md-secondary-space); }
html[data-md-mobile=true] .account-ranks-screen .ranks-entry {
  min-height: clamp(104px, calc(118px * var(--md-ui-scale)), 140px);
  padding: clamp(8px, calc(10px * var(--md-ui-scale)), 13px);
  grid-template-columns: clamp(40px, calc(48px * var(--md-ui-scale)), 58px) minmax(0,1fr) clamp(28px,calc(32px * var(--md-ui-scale)),38px);
  gap: var(--md-secondary-space);
}
html[data-md-mobile=true] .account-ranks-screen .ranks-token img { width: 100%; height: clamp(48px,calc(58px * var(--md-ui-scale)),70px); object-fit: contain; }
html[data-md-mobile=true] .account-ranks-screen .ranks-entry h2 { font-size: var(--md-secondary-subtitle); line-height: 1.25; }
html[data-md-mobile=true] .account-ranks-screen .ranks-entry p { font-size: var(--md-secondary-body); line-height: 1.4; }
html[data-md-mobile=true] .account-ranks-screen .ranks-meter { height: clamp(22px,calc(25px * var(--md-ui-scale)),30px); }
html[data-md-mobile=true] .account-ranks-screen .ranks-meter > strong { font-size: var(--md-secondary-body); }
html[data-md-mobile=true] .account-ranks-screen .ranks-entry-number { font-size: clamp(28px,calc(34px * var(--md-ui-scale)),40px); }
html[data-md-mobile=true] .account-ranks-screen .ranks-back { min-height: var(--md-control-height); font-size: var(--md-secondary-body); }

html[data-md-mobile=true] #app.daily-rewards-page .depot-track-heading h2,
html[data-md-mobile=true] #app.daily-rewards-page .depot-pass-heading h2 { font-size: clamp(12px,calc(15px * var(--md-ui-scale)),18px); line-height: 1.3; }
html[data-md-mobile=true] #app.daily-rewards-page .reward-track { gap: var(--md-secondary-space); }
html[data-md-mobile=true] #app.daily-rewards-page .reward-track-section.premium .reward-day { flex-basis: clamp(158px,calc(176px * var(--md-ui-scale)),206px); width: clamp(158px,calc(176px * var(--md-ui-scale)),206px); }
html[data-md-mobile=true] #app.daily-rewards-page .reward-track-section.free .reward-day { flex-basis: clamp(138px,calc(150px * var(--md-ui-scale)),175px); width: clamp(138px,calc(150px * var(--md-ui-scale)),175px); }
html[data-md-mobile=true] #app.daily-rewards-page .reward-day { font-size: var(--md-secondary-body); padding: clamp(6px,calc(8px * var(--md-ui-scale)),10px); }
html[data-md-mobile=true] #app.daily-rewards-page .reward-day :is(.reward-day-label,.reward-amounts,.reward-currency-line) { font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #app.daily-rewards-page .reward-currency-line > span { overflow-wrap: normal; word-break: normal; }
html[data-md-mobile=true] #app.daily-rewards-page :is(.depot-track-controls button,.reward-day button,.rewards-back) { min-height: var(--md-control-height); font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #app.daily-rewards-page .depot-track-controls button { min-width: var(--md-control-height); }
html[data-md-mobile=true] #app.daily-rewards-page .season-pass-terms > summary { display: flex; align-items: center; min-height: var(--md-control-height); padding: 4px 0; box-sizing: border-box; }

html[data-md-mobile=true] #app .account-shell :is(h2,h3) { font-size: var(--md-secondary-subtitle); }
html[data-md-mobile=true] #app .account-content { font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #app .account-content :is(p,label,small,.badge) { font-size: var(--md-secondary-body); line-height: 1.45; }
html[data-md-mobile=true] #app .account-content :is(button,input:not([type=checkbox]):not([type=radio])) { min-height: var(--md-control-height); }
html[data-md-mobile=true] #app .account-content button { font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #app .account-achievements .badge { padding: var(--md-secondary-space); min-height: calc(54px * var(--md-ui-scale)); }

html[data-md-mobile=true] #app .information-content { font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #app .information-content :is(p,.faq-entry p) { font-size: var(--md-secondary-body); line-height: 1.55; }
html[data-md-mobile=true] #app .faq-category h2 { font-size: var(--md-secondary-subtitle); }
html[data-md-mobile=true] #app .faq-entry summary { display: flex; align-items: center; min-height: var(--md-control-height); box-sizing: border-box; padding: var(--md-secondary-space); font-size: clamp(12px,calc(13px * var(--md-ui-scale)),16px); }
html[data-md-mobile=true] #app :is(.information-categories button,.information-back) { min-height: var(--md-control-height); font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #app .terms-content-layout .terms-section { padding: clamp(9px,calc(12px * var(--md-ui-scale)),15px) !important; }
html[data-md-mobile=true] #app .terms-content-layout .terms-section h3 { font-size: clamp(12px,calc(14px * var(--md-ui-scale)),17px); }
html[data-md-mobile=true] #app .terms-content-layout .terms-section p { font-size: var(--md-secondary-body); line-height: 1.55; }
html[data-md-mobile=true] #app .terms-modal .terms-close { min-height: var(--md-control-height); font-size: var(--md-secondary-body); }

/* Table headings wrap within a card instead of forcing narrow database columns wider. */
html[data-md-mobile=true] #app :is(.tower-reference-card,.enemy-reference-card) { min-width: 0; font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #app :is(.tower-reference-card,.enemy-reference-card) h3 { font-size: var(--md-secondary-subtitle); }
html[data-md-mobile=true] #app :is(.tower-reference-card,.enemy-reference-card) p { font-size: var(--md-secondary-body); line-height: 1.45; }
html[data-md-mobile=true] #app .tower-reference-card table { width: 100%; table-layout: fixed; }
html[data-md-mobile=true] #app .tower-reference-card :is(th,td) { padding: 3px 2px; white-space: normal; overflow-wrap: anywhere; font-size: clamp(10px,calc(11px * var(--md-ui-scale)),13px); }
html[data-md-mobile=true] #app .tower-reference-card:has(>img):has(table) { grid-template-columns: clamp(42px,calc(56px * var(--md-ui-scale)),65px) minmax(0,1fr); align-content: start; }
html[data-md-mobile=true] #app .tower-reference-card:has(>img):has(table) > img { grid-column: 1; grid-row: 1 / 3; align-self: center; }
html[data-md-mobile=true] #app .tower-reference-card:has(>img):has(table) > div { display: contents; }
html[data-md-mobile=true] #app .tower-reference-card:has(>img):has(table) > div > :is(h3,p) { grid-column: 2; margin: 0; }
html[data-md-mobile=true] #app .tower-reference-card:has(>img):has(table) > div > table { grid-column: 1 / -1; }
html[data-md-mobile=true] #app .enemy-reference-card :is(dt,dd) { font-size: var(--md-secondary-body); overflow-wrap: anywhere; }
html[data-md-mobile=true] #app :is(.towers-back,.enemies-back) { min-height: var(--md-control-height); font-size: var(--md-secondary-body); }
/* A viewport-sized database panel must fit below the shared rank header too. */
html[data-md-mobile=true] #app :is(.towers-reference,.enemies-reference) { max-height: calc(100% - 12px) !important; }
html[data-md-mobile=true] #app .information-panel .android-build-version { font-size: clamp(10.5px,calc(10px * var(--md-ui-scale)),12px); line-height: 1.4; min-height: 1.4em; }

html[data-md-mobile=true] #atomcore-screen h1 { font-size: var(--md-secondary-title); }
html[data-md-mobile=true] #atomcore-screen :is(.atomcore-note,.atomcore-milestone-nav p,.atomcore-identity>span) { font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #atomcore-screen :is(.atomcore-earned-label,.atomcore-future h2,.atomcore-current-reward>div) { font-size: var(--md-secondary-subtitle); }
html[data-md-mobile=true] #atomcore-screen .atomcore-meter { min-height: clamp(34px,calc(42px * var(--md-ui-scale)),50px); }
html[data-md-mobile=true] #atomcore-screen .atomcore-meter strong { font-size: var(--md-secondary-subtitle); }
html[data-md-mobile=true] #atomcore-screen .atomcore-milestones article { flex-basis: clamp(145px,calc(170px * var(--md-ui-scale)),196px); padding: clamp(10px,calc(13px * var(--md-ui-scale)),16px); }
html[data-md-mobile=true] #atomcore-screen .atomcore-milestones article>strong { font-size: var(--md-secondary-subtitle); }
html[data-md-mobile=true] #atomcore-screen .atomcore-milestones article>div { font-size: var(--md-secondary-body); }
html[data-md-mobile=true] #atomcore-screen :is(.atomcore-back,.atomcore-milestone-prev,.atomcore-milestone-next) { min-height: var(--md-control-height); min-width: var(--md-control-height); font-size: var(--md-secondary-body); }
/* The legacy milestone navigation set32px!important; keep actual touch targets44px. */
html[data-md-mobile=true] #atomcore-screen .atomcore-milestone-nav button { min-height: var(--md-control-height) !important; }
