/* V11 fitted, paged viewport — no document, panel or mobile navigation scrolling. */
:root{--header:68px}
html,body{width:100%;height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none;scroll-behavior:auto}
#app{height:100%;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
.shell-header{position:relative;top:auto;height:var(--header);min-height:var(--header);flex:0 0 var(--header);padding:0 20px;z-index:45}
.header-controls{flex-shrink:0}.action-balance{display:none}
.game-shell{height:calc(100dvh - var(--header));min-height:0;max-height:calc(100dvh - var(--header));width:100%;overflow:hidden;flex:1}
.sidebar{height:100%;overflow:hidden}
.sidebar-inner{position:relative;top:auto;height:100%;max-height:none;min-height:0;overflow:hidden;padding:9px 11px 7px}
.sidebar-nav{min-height:0;display:flex;flex-direction:column;justify-content:center;gap:0}
.nav-group{margin-bottom:8px}.nav-group-title{padding:0 11px 2px;font-size:9px}
.btn.nav-link{min-height:29px;margin:0;padding:5px 10px;font-size:11px;gap:9px}
.btn.nav-link svg{height:15px;width:15px}.sidebar-footer{margin:2px 9px 0}.sidebar-footer p{display:none}
.workspace{height:100%;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:10px 17px 8px}
.workspace-label{flex:none;margin-bottom:4px;font-size:9px}
.workspace-viewport{min-height:0;flex:1;overflow:hidden;position:relative}
.page-frame{height:100%;width:100%;overflow:hidden;display:flex;flex-direction:column;gap:0;min-height:0}
.page-frame > *{max-height:100%;min-height:0}
.page-frame .card{margin-bottom:0;box-shadow:0 4px 14px #142b4207;overflow:hidden;max-height:100%;padding:14px 16px}
.page-frame .card h3{font-size:15px;margin-bottom:9px}
.page-frame .page-intro{height:auto;overflow:hidden;padding-top:2px}
.page-frame .section-heading{margin-bottom:11px}
.page-frame .section-heading h2{font-size:21px}
.page-frame .section-heading p{font-size:11px;margin-top:3px}
.page-frame .metrics-grid{margin-bottom:7px}
.page-frame .metric{padding:11px 12px}.page-frame .metric-value{margin:3px 0;font-size:22px}
.page-frame .data-pair{padding:6px 0;font-size:12px}
.page-frame .progress-row{margin:7px 0 10px}
.page-frame .form-field{margin:8px 0;gap:4px}
.page-frame .form-field input,.page-frame .form-field select{height:37px;padding:6px 10px}
.page-frame .action-wrap{margin:8px 0 0;gap:7px}
.page-frame .btn{min-height:33px;padding:7px 10px}
.page-frame .btn.mini{min-height:28px;padding:5px 9px}
.page-frame .person-row{padding:8px 11px;min-height:42px}
.page-frame .fixture{padding:8px}
.page-frame .compact-row{padding:7px 0}
.page-frame .info-note{margin:6px 0;padding:8px}
.workspace-tools{flex:none;min-height:0;display:flex;align-items:center;gap:8px}
.workspace-tools:empty{display:none}.workspace-tools .segmented{margin:1px 0 7px;gap:3px;padding:3px}.workspace-tools .segmented .btn{min-height:28px;padding:5px 9px;font-size:10px}
.subtab-select{display:none}
.resources-bar{display:flex;align-items:center;flex:none;gap:14px;padding:5px 10px;background:#e8f5f2;border:1px solid #d0e6df;border-radius:9px;color:#42706d;font-size:10px;white-space:nowrap;margin-bottom:7px}
.resources-bar strong{font-size:12px;color:#123f4a;margin-left:5px}.resources-bar .resource-divider{height:13px;width:1px;background:#c0ded4}.resources-bar .resource-date{margin-left:auto;font-size:10px;color:#64818b}
.page-controls{flex:0 0 43px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:7px;background:var(--canvas)}
.page-count{display:flex;flex-direction:column;align-items:center;line-height:1.3;min-width:0;font-size:11px;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.page-count strong{color:var(--teal)}.page-count span{color:var(--muted);overflow:hidden;text-overflow:ellipsis;max-width:100%}
.page-controls .pager-btn{font-size:12px;min-height:32px;padding:5px 12px;min-width:89px;background:white}
.measure-stage{position:fixed;left:-150vw;top:0;visibility:hidden;z-index:-1;pointer-events:none;max-height:none;overflow:visible}
.measure-stage>.card{margin:0}.measure-stage .page-intro{padding-top:2px}.measure-stage .card{padding:14px 16px}.measure-stage .metric{padding:11px 12px}
.page-frame .screen-part{flex:1;min-height:0}
.page-frame .tight-layout{font-size:11px;line-height:1.26}.page-frame .tight-layout .data-pair{padding:3px 0}.page-frame .tight-layout .form-field{margin:4px 0}
.standings-table{display:grid;grid-template-columns:1fr;gap:2px}.table-record{display:grid;grid-template-columns:21px minmax(0,1fr) auto auto;align-items:center;gap:8px;border-bottom:1px solid #edf0f5;padding:8px 0;font-size:11px}.table-record small{color:#8494a4}.medical-record,.case-record{padding:8px 0;border-bottom:1px solid #e7edf3}.medical-record .action-wrap,.case-record .action-wrap{margin-top:7px}
.overlay{overflow:hidden}.dialog{overflow:hidden;max-height:calc(100dvh - 24px);padding:17px 21px}.dialog .form-field{margin:7px 0}.dialog h2{font-size:21px;margin:5px 0}.dialog p{margin:4px 0 9px}.dialog-icon{width:36px;height:36px;margin-bottom:7px}.choices{gap:5px}.btn.choice-btn{min-height:48px;padding:8px;font-size:12px}.event-dialog .event-prompt{font-size:15px;margin-bottom:10px}.event-dialog>small{margin-top:7px}
.welcome-layout{height:calc(100dvh - var(--header));max-height:calc(100dvh - var(--header));margin:0 auto;padding:12px 18px;overflow:hidden;align-items:center}
.welcome-main{min-height:0;height:100%;max-height:650px;padding:30px 35px 130px}.welcome-main h1{font-size:clamp(32px,4.1vw,54px)}.welcome-art{height:170px}.setup-card{margin:0;padding:20px 27px;align-self:center}.setup-card .setup-icon{height:45px;width:45px;margin-bottom:10px}.setup-card h2{font-size:24px}.setup-card p{margin-bottom:10px}.setup-card .form-field{margin:7px 0}.setup-card .form-field input,.setup-card .form-field select{height:38px}.setup-disclaimer{margin-top:9px}.btn.start-life{margin-top:8px}
@media(max-height:720px){.sidebar-footer{display:none}.sidebar-inner{padding-top:4px}.nav-group{margin-bottom:4px}.nav-group-title{font-size:8px;padding-bottom:1px}.btn.nav-link{min-height:26px;padding:3px 9px}.workspace{padding-top:6px}.page-frame .card{padding:10px 13px}.page-frame .card h3{margin-bottom:6px}.resources-bar{padding:3px 7px;margin-bottom:4px}.page-controls{flex-basis:38px;padding-top:2px}.page-frame .metrics-grid{gap:6px}.page-frame .metric-value{font-size:18px}.page-frame .metric{padding:7px}.page-frame .section-heading h2{font-size:19px}}
@media(max-width:950px){.sidebar{display:none}.game-shell{display:block}.workspace{height:100%;padding:6px 12px 6px}.mobile-nav{display:none}.header-brand{min-width:0}.resources-bar{margin-bottom:6px}.workspace-label{margin-bottom:4px}}
@media(max-width:680px){:root{--header:60px}.shell-header{height:var(--header);min-height:var(--header);padding:0 9px;gap:4px}.header-timeline{gap:3px;margin-left:auto}.header-controls{gap:3px}.header-brand{min-width:0}.brand-mark{width:32px;height:32px}.brand-type strong{font-size:17px}.brand-type small{font-size:7px}.btn.age-button{padding:8px 9px;min-height:36px;font-size:11px}.workspace{padding:4px 9px}.resources-bar{padding:4px 7px;gap:10px;font-size:9px}.resources-bar strong{font-size:11px}.resources-bar .resource-date{display:none}.workspace-tools .segmented{display:none}.workspace-tools .subtab-select{display:block;width:100%;padding:5px 9px;margin:0 0 6px;border-radius:9px;border:1px solid var(--line-dark);background:#fff;color:var(--ink);font-size:12px}.workspace-label{margin-bottom:2px}.page-frame .card{padding:10px 11px;border-radius:12px}.page-frame .metric-icon{height:21px;width:21px}.page-frame .metric{padding:7px 8px}.page-frame .metric-value{font-size:18px}.page-frame .section-heading p{font-size:10px}.page-frame .page-intro{padding:0}.page-frame .section-heading h2{font-size:19px}.page-frame .person-hero{padding:12px}.page-frame .person-hero h2{font-size:20px}.page-frame .action-wrap{gap:5px}.page-frame .btn{font-size:11px;min-height:31px;padding:6px 9px}.page-controls .pager-btn{padding:5px 8px;min-width:77px;font-size:11px}.page-controls{flex-basis:39px}.welcome-main{display:none}.welcome-layout{display:flex;justify-content:center;padding:8px}.setup-card{width:min(100%,460px);padding:15px 18px}.setup-card h2{font-size:23px}.setup-card .setup-icon{margin-bottom:6px}.setup-card p{margin-bottom:7px}.setup-card .form-field{margin:5px 0}.setup-disclaimer{margin-top:7px}.welcome-layout:has(.resume-panel) .setup-card{padding:9px 12px}.resume-panel{padding-top:7px;margin-top:6px;gap:3px}}
@media(max-width:375px){.header-controls .icon-button{display:none}.header-timeline{margin-left:auto}.brand-mark{width:28px;height:28px}.brand-type strong{font-size:15px}.brand-type small{display:none}.page-frame .metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-frame .metric-sub{display:none}.page-frame .card h3{font-size:13px}.resources-bar{gap:7px}.page-controls .pager-btn{min-width:70px}.page-count{font-size:10px}}

.main-nav-select{display:none}
.page-slide{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-content:start;width:100%;height:100%;min-height:0;overflow:hidden}
.page-slide .slide-item{min-width:0;max-height:none}
.page-slide .slide-item.slide-wide{grid-column:1/-1}
.page-slide.single-panel .slide-item{grid-column:1/-1}
.page-slide .slide-item.card{height:fit-content}
.measure-stage .page-slide{height:auto;overflow:visible}
.page-frame .page-slide{max-height:100%}
@media(max-width:680px){
 .main-nav-select{display:block;min-width:0;max-width:150px;min-height:26px;border:1px solid #d7e6eb;border-radius:8px;background:#fff;font-size:11px;font-weight:700;color:#156f70;padding:3px 7px;margin-left:auto}
 .workspace-label{display:flex;align-items:center;gap:3px}.workspace-label>span:not(:first-child){display:none}
 .page-slide{grid-template-columns:1fr;gap:7px}
 .page-slide .slide-item{grid-column:1/-1}
 .resources-bar{font-size:9px}
}
/* V13: compact, single-screen education, personal athlete records and finances. */
.dashboard-first{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:10px;align-items:start;width:100%}
.dashboard-first .card{margin:0}
.dashboard-first .progress-row{margin:4px 0 7px}
.dashboard-balances{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px}
.dashboard-balances>div{display:flex;flex-direction:column;min-width:0;gap:3px}
.dashboard-balances span{color:var(--muted);font-size:10px}
.dashboard-balances strong{font-size:14px;letter-spacing:-.25px;white-space:nowrap}
.dashboard-balances>.btn{grid-column:1/-1;justify-self:start}
.education-priority .stack{min-width:0}
.compact-grades{display:grid;gap:3px}
.compact-grades .progress-row{margin:0}
.compact-grades .progress-head{font-size:11px;margin-bottom:1px}
.compact-grades .track{height:5px}
.school-average{margin-top:8px;padding-top:6px;border-top:1px solid var(--line);display:flex;justify-content:space-between;font-size:12px}
.school-classmates{display:grid;gap:4px}
.school-classmates>.hstack{margin-bottom:3px}
.school-classmates .hstack .btn{min-width:27px;padding:2px 5px}
.classmate-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0;border-top:1px solid var(--line);min-width:0}
.classmate-item>div{display:flex;flex-direction:column;gap:1px;min-width:0}
.classmate-item strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.classmate-item small{color:var(--muted);font-size:9px}
.classmate-item .btn{flex-shrink:0}
.school-reputation{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
.school-reputation .data-pair{min-width:0}
.season-board .season-board-status{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11px;color:var(--muted);margin-bottom:7px}
.season-board .season-board-status strong{color:var(--teal)}
.season-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;align-content:start}
.fixture-mini{border:1px solid var(--line);border-radius:9px;padding:6px 7px;min-width:0;min-height:59px;background:#fafcfd;display:flex;flex-direction:column;justify-content:space-between;gap:3px}
.fixture-mini.fixture-completed{background:#f3f8f7}
.fixture-mini.fixture-next{border-color:#4ba99f;background:#f0fbf8}
.fixture-mini-top{display:flex;align-items:center;gap:5px;min-width:0}
.fixture-mini-top b{flex:none;font-size:9px;display:grid;place-items:center;min-width:16px;height:16px;color:#196a68;background:#dcefeb;border-radius:5px}
.fixture-mini-top span{font-size:10px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fixture-mini-bottom{display:flex;justify-content:space-between;gap:4px;align-items:center;min-width:0;font-size:10px}
.fixture-mini-bottom strong.positive{color:#0a8b67}.fixture-mini-bottom strong.negative{color:#b75a5a}
.fixture-mini-bottom small{font-size:9px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fixture-mini-bottom .btn{min-height:20px;padding:2px 8px;font-size:10px}
.athlete-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:7px}
.athlete-stats>div{display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:7px;background:#f6fafb;border:1px solid var(--line);border-radius:8px;min-width:0}
.athlete-stats small{font-size:10px;color:var(--muted)}.athlete-stats strong{font-size:16px;font-variant-numeric:tabular-nums}
.athlete-stats span{font-size:9px;color:var(--muted)}
.record-note{margin-top:8px;font-size:10px;color:var(--muted)}
.season-archive .form-field{margin:5px 0}.season-archive .form-field select{height:32px}
@media(max-width:680px){
 .dashboard-first{grid-template-columns:1fr;gap:6px}
 .dashboard-balances{padding:8px;gap:3px}
 .dashboard-balances strong{font-size:12px}
 .dashboard-balances>.btn{grid-column:auto;grid-column:1/-1;min-height:23px!important;padding:2px 6px!important}
 .season-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 .fixture-mini{min-height:53px;padding:4px;gap:2px}
 .fixture-mini-top span{font-size:9px}
 .fixture-mini-bottom small{font-size:8px}
 .fixture-mini-bottom .btn{min-height:19px;padding:1px 5px}
 .athlete-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
 .athlete-stats>div{padding:5px}.athlete-stats strong{font-size:14px}
}
@media(max-height:680px){.fixture-mini{min-height:45px}.fixture-mini-top b{height:14px;min-width:14px}.season-grid{gap:3px}}
.education-hero{width:100%}
.edu-hero-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.edu-hero-grid section{min-width:0}
.edu-hero-grid h4{font-size:12px;color:#2c5262;margin:2px 0 5px}
@media(max-width:680px){.edu-hero-grid{grid-template-columns:1fr;gap:7px}.edu-hero-grid h4{margin:0 0 3px;font-size:11px}.education-hero .compact-grades .progress-row{margin:0}.education-hero .classmate-item{padding:2px 0}}
/* Keep both school performance and visible classmates on the first viewport. */
@media(max-width:680px){
 .education-hero .edu-hero-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);gap:9px}
 .education-hero .compact-grades .progress-head{font-size:9px}
 .education-hero .compact-grades .progress-head strong{font-size:9px}
 .education-hero .compact-grades .track{height:4px}
 .education-hero .school-average{font-size:9px;gap:3px}
 .education-hero .classmate-item{gap:3px;padding:4px 0}
 .education-hero .classmate-item strong{font-size:9px}
 .education-hero .classmate-item small{font-size:8px}
 .education-hero .classmate-item .btn{font-size:9px;min-height:23px;padding:3px 5px}
 .education-hero .school-classmates>.hstack small{font-size:8px}
 .education-hero .school-classmates>.hstack .hstack{gap:2px}
 .education-hero .school-classmates>.hstack .hstack .btn{min-height:23px;padding:3px}
}
/* Toasts must not block the fixed Previous/Next buttons. */
.toast{pointer-events:none}.toast .btn{pointer-events:auto}

/* V15: education grades use the full width; classmates live underneath. */
.education-hero .edu-hero-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
@media(max-width:680px){.education-hero .edu-hero-grid{grid-template-columns:minmax(0,1fr);gap:10px}}

.education-hero .school-classmates{grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 14px}
.education-hero .school-classmates>.hstack{grid-column:1/-1}
.education-hero .compact-grades .track{height:6px}
.education-hero .compact-grades .progress-head,
.education-hero .compact-grades .progress-head strong{font-size:11px}
@media(max-width:680px){
  .education-hero .school-classmates{grid-template-columns:minmax(0,1fr);gap:0}
  .education-hero .classmate-item strong{font-size:11px}
  .education-hero .classmate-item small{font-size:9px}
  .education-hero .classmate-item .btn{font-size:11px;min-height:27px;padding:4px 9px}
  .education-hero .school-classmates>.hstack small{font-size:10px}
}
/* V15: new company controls appear inside Business ownership on page one. */
.business-launch{margin-top:10px;border-top:1px solid var(--line);padding-top:9px}
.business-launch h3{font-size:14px;margin:0 0 7px}
.business-launch-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.business-launch-fields .form-field{margin:0}
.business-launch-footer{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-top:7px}
.business-launch-footer small{color:var(--muted)}
@media(max-width:680px){.business-launch{margin-top:7px;padding-top:6px}.business-launch-fields{gap:6px}.business-launch h3{font-size:12px}.business-launch-footer .btn{font-size:10px}}
@media(max-width:375px){.business-launch-fields{grid-template-columns:1fr;gap:3px}}
/* V15: Finance categories are pages, not a dropdown or segmented subnav. */
.finance-page-opening{min-width:0;display:flex;flex-direction:column;gap:8px}
.finance-page-opening>h2{font-size:18px;line-height:1.2;color:var(--ink-strong);margin:0}
.finance-page-opening>.card{margin:0}
@media(max-width:680px){.finance-page-opening{gap:5px}.finance-page-opening>h2{font-size:16px}}

.version-label{display:inline-block;vertical-align:super;font-size:10px;font-style:normal;font-weight:750;letter-spacing:0;color:var(--teal);margin-left:4px}
@media(max-width:375px){.version-label{font-size:8px;margin-left:2px}}

/* V15.1: refine Business ownership and fully separate School performance from Classmates. */
.education-performance-card .compact-grades{gap:8px}
.education-performance-card .progress-row{margin:0 0 6px}
.education-performance-card .progress-head,.education-performance-card .progress-head strong{font-size:13px}
.education-performance-card .track{height:8px}
.education-performance{display:grid;gap:6px}
.education-classmates-card .school-classmates{grid-template-columns:minmax(0,1fr);gap:0}
.education-classmates-card .classmate-item{padding:9px 0}
.education-classmates-card .classmate-item strong{font-size:13px}
.education-classmates-card .classmate-item small{font-size:11px}
.business-ownership-layout{margin-top:14px}
.business-launch-panel .card-body{display:grid;gap:12px}
.business-launch-card{display:grid;gap:12px}
.business-launch-card .block-gap{margin:0}
.business-launch-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.business-launch-fields .form-field{margin:0}
.business-launch-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.business-launch-footer small{color:var(--muted);font-size:12px}
@media(max-width:680px){
  .education-performance-card .progress-head,.education-performance-card .progress-head strong{font-size:12px}
  .education-performance-card .track{height:7px}
  .business-ownership-layout{margin-top:10px}
  .business-launch-card,.business-launch-panel .card-body{gap:10px}
  .business-launch-fields{grid-template-columns:minmax(0,1fr);gap:8px}
  .business-launch-footer{align-items:flex-start}
}

/* V16: keep Month and Year controls accessible side by side without page scrolling. */
.header-controls .year-button{min-height:40px;padding:9px 11px;border-radius:10px;white-space:nowrap}
@media(max-width:680px){.header-controls .year-button{padding:7px 8px;min-height:36px;font-size:11px}.header-controls{gap:4px}}
@media(max-width:375px){.header-controls .year-button{padding:6px 7px;font-size:10px}.header-controls .age-button{padding:8px 7px}.header-controls .year-button span{font-size:10px}}

/* V16.1: played season tiles open player-only game box scores. */
.fixture-inspect{font:inherit;text-align:left;width:100%;color:inherit;cursor:pointer;appearance:none}
.fixture-inspect:hover{border-color:var(--teal);background:#eaf8f5}
.fixture-inspect:focus-visible{outline:3px solid #58b6a9;outline-offset:2px}
.sport-game-dialog{max-width:520px}
.sport-game-dialog h2{font-size:21px;line-height:1.2}
.sport-game-dialog .hstack>.btn{flex:none}
.sport-game-stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:13px}
.sport-game-stats>div{min-width:0}
.sport-game-stats strong{font-variant-numeric:tabular-nums}
@media(max-width:375px){.sport-game-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* V17 — consistent, keyboard-accessible viewport navigation. */
.workspace-label{display:flex;align-items:center;gap:7px;min-width:0}
.workspace-label>span:first-of-type{white-space:nowrap}
.workspace-back,.workspace-help,.workspace-settings{width:28px;height:27px;flex:0 0 28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line-dark);border-radius:8px;background:var(--paper);color:var(--teal);font-weight:750;font-size:14px;padding:0;cursor:pointer}
.workspace-back:disabled{opacity:.35;cursor:not-allowed}
.workspace-help{margin-left:auto}
.workspace-settings{margin-left:0}
.workspace-settings svg{width:15px;height:15px}
.workspace-label .main-nav-select{margin-left:0;max-width:min(40vw,180px)}
.workspace-back:focus-visible,.workspace-help:focus-visible,.workspace-settings:focus-visible{outline:3px solid #82cbbb;outline-offset:2px}
.dashboard-fixed-vitals{width:100%;min-width:0}
.dashboard-widgets{display:contents}
.dashboard-widget{min-width:0}
.dashboard-widget .card{height:100%}
.dashboard-widget .dashboard-balances{min-width:0}
.page-slide .dashboard-fixed-vitals{grid-column:1/-1}
/* Preferences modal is paginated, never a long settings form. */
.settings-dialog{max-width:520px}
.settings-dialog h2{margin:0}
.settings-options{display:grid;gap:14px}
.settings-options fieldset{border:1px solid var(--line);border-radius:12px;padding:10px 12px;min-width:0}
.settings-options legend{font-weight:760;color:var(--ink);padding:0 5px}
.settings-options .btn{min-width:92px}
.settings-cards{display:grid;gap:6px}
.setting-card-row{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:5px 2px;border-bottom:1px solid var(--line);font-size:12px;font-weight:650}
.setting-card-row>span{min-width:0;flex:1}
.setting-card-actions{display:flex;align-items:center;gap:4px;flex:none}
.setting-card-actions .btn{min-height:27px;min-width:29px;padding:4px 7px;font-size:11px}
.settings-pager{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:13px;border-top:1px solid var(--line);padding-top:11px;font-size:12px;color:var(--muted)}
.action-guide-list{display:grid;gap:6px;max-height:min(54dvh,440px);overflow-y:auto}
.action-guide-list>div{border-bottom:1px solid var(--line);padding:6px 0;display:grid;gap:3px}
.action-guide-list strong{font-size:12px}
.action-guide-list small{color:var(--muted);font-size:11px}
/* Compact density affects spacing, not fonts or gameplay calculations. */
html[data-ll-density="compact"] .page-frame .card{padding:7px 10px}
html[data-ll-density="compact"] .page-slide{gap:5px}
html[data-ll-density="compact"] .page-frame .metrics-grid{gap:4px}
html[data-ll-density="compact"] .page-frame .data-pair{padding:3px 0}
html[data-ll-density="compact"] .page-frame .card h3{margin-bottom:5px}
html[data-ll-density="compact"] .workspace{padding-top:4px}
/* Dark theme: override design tokens and hard-coded light surfaces without changing fonts. */
html[data-ll-theme="dark"]{color-scheme:dark;--canvas:#101b28;--paper:#1a293a;--ink:#e2edf7;--ink-strong:#f5f8fc;--muted:#a9bbcd;--subtle:#98b0c5;--line:#31465a;--line-dark:#42576c;--teal:#74ded0;--teal-dark:#3bb5ad;--teal-light:#173e42;--blue-light:#183954;--green-light:#163c38;--amber-light:#51401f;--coral-light:#47303a;--purple-light:#3d3354;--shadow:0 8px 35px rgba(0,0,0,.13)}
html[data-ll-theme="dark"] body,html[data-ll-theme="dark"] #app{background:var(--canvas);color:var(--ink)}
html[data-ll-theme="dark"] .shell-header{background:#172637;border-color:var(--line)}
html[data-ll-theme="dark"] .sidebar,html[data-ll-theme="dark"] .sidebar-inner{background:#172637}
html[data-ll-theme="dark"] .card,html[data-ll-theme="dark"] .metric,html[data-ll-theme="dark"] .dialog,html[data-ll-theme="dark"] .setup-card,html[data-ll-theme="dark"] .dashboard-balances,html[data-ll-theme="dark"] .page-frame .card{background:var(--paper);border-color:var(--line);color:var(--ink)}
html[data-ll-theme="dark"] .workspace-back,html[data-ll-theme="dark"] .workspace-help,html[data-ll-theme="dark"] .workspace-settings,html[data-ll-theme="dark"] .person-row,html[data-ll-theme="dark"] .btn:not(.primary):not(.danger):not(.active):not(.selected),html[data-ll-theme="dark"] .subtab-select,html[data-ll-theme="dark"] .main-nav-select{background:var(--paper);color:var(--ink);border-color:var(--line-dark)}
html[data-ll-theme="dark"] .form-field input,html[data-ll-theme="dark"] .form-field select,html[data-ll-theme="dark"] textarea,html[data-ll-theme="dark"] input,html[data-ll-theme="dark"] select{background:#172637;color:var(--ink);border-color:var(--line-dark)}
html[data-ll-theme="dark"] .data-pair strong,html[data-ll-theme="dark"] .section-heading h2,html[data-ll-theme="dark"] .card h3,html[data-ll-theme="dark"] h1,html[data-ll-theme="dark"] h2,html[data-ll-theme="dark"] h3,html[data-ll-theme="dark"] h4{color:var(--ink-strong)}
html[data-ll-theme="dark"] .data-pair>span,html[data-ll-theme="dark"] .timeline-item small,html[data-ll-theme="dark"] .metric-sub,html[data-ll-theme="dark"] .section-heading p{color:var(--muted)}
html[data-ll-theme="dark"] .classmate-item,html[data-ll-theme="dark"] .compact-row,html[data-ll-theme="dark"] .job-row,html[data-ll-theme="dark"] .person-row,html[data-ll-theme="dark"] .data-pair{border-color:var(--line)}
html[data-ll-theme="dark"] .fixture-mini,html[data-ll-theme="dark"] .athlete-stats>div,html[data-ll-theme="dark"] .business-card,html[data-ll-theme="dark"] .career-year{background:#203348;border-color:var(--line);color:var(--ink)}
html[data-ll-theme="dark"] .resources-bar{background:#193a40;color:#d5f6f2;border-color:#2e6167}
html[data-ll-theme="dark"] .toast{background:#1c4241;color:#dffdf5;border-color:#397f78}
html[data-ll-theme="dark"] .toast.error{background:#4d2835;color:#ffe5eb;border-color:#9b5163}
html[data-ll-theme="dark"] .settings-options fieldset{border-color:var(--line)}
@media(max-width:680px){
  .workspace-back,.workspace-help,.workspace-settings{width:25px;height:25px;flex-basis:25px}
  .workspace-label{gap:4px}
  .workspace-label .main-nav-select{margin-left:auto;max-width:125px}
  .settings-dialog{padding:16px}
  .setting-card-row{padding:3px 0}
}
@media(max-width:375px){.workspace-label>span:first-of-type{font-size:8px;letter-spacing:.6px}.workspace-label .main-nav-select{max-width:112px}}
@media(max-height:600px){.settings-dialog{padding:10px 14px}.settings-dialog h2{font-size:19px}.setting-card-row{padding:2px 0}.settings-pager{margin-top:6px;padding-top:6px}.dialog p{margin-bottom:7px}}
/* V17 contrast pass: legacy hard-coded text colors must remain readable on dark surfaces. */
html[data-ll-theme="dark"] .brand-type strong,
html[data-ll-theme="dark"] .timeline-age strong,
html[data-ll-theme="dark"] .progress-head strong,
html[data-ll-theme="dark"] .metric-value,
html[data-ll-theme="dark"] .athlete-stats strong,
html[data-ll-theme="dark"] .page-count strong,
html[data-ll-theme="dark"] .setting-card-row,
html[data-ll-theme="dark"] .form-field,
html[data-ll-theme="dark"] .business-head strong,
html[data-ll-theme="dark"] .person-body strong{color:var(--ink-strong)}
html[data-ll-theme="dark"] .progress-head span,
html[data-ll-theme="dark"] .page-count span,
html[data-ll-theme="dark"] .timeline-age,
html[data-ll-theme="dark"] .timeline-date,
html[data-ll-theme="dark"] .metric-top,
html[data-ll-theme="dark"] .school-average,
html[data-ll-theme="dark"] .resource-date{color:var(--muted)}
html[data-ll-theme="dark"] .resources-bar strong{color:#e5fffb}
html[data-ll-theme="dark"] .btn.primary,
html[data-ll-theme="dark"] .btn.age-button{background:#087e7b;border-color:#0a9994;color:#fff}
html[data-ll-theme="dark"] .btn.primary:hover{background:#0a9290}
html[data-ll-theme="dark"] .brand-type strong span{color:var(--teal)}
html[data-ll-theme="dark"] .track{background:#31485b}
html[data-ll-theme="dark"] .metrics-grid .metric-icon{background:#264454}

/* V18: compact NPC personality details (separate cards fit through existing pagination). */
.npc-trait-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;margin-top:8px}
.npc-trait-grid .progress-head{font-size:10px}
.npc-trait-grid .track{height:5px}
@media(max-width:400px){.npc-trait-grid{gap:5px 8px}}

/* V19 Journal: extra storyline, biography, and world views remain viewport-contained. */
.journal-story-tabs{display:flex;flex-wrap:wrap;gap:4px;overflow:visible;padding:3px}
.journal-story-tabs .btn{min-width:0;flex:1 1 auto;padding:6px 9px;font-size:11px;min-height:31px}
.journal-panel .bio-chapter p{line-height:1.55}
.journal-panel .story-choice{padding:5px 0;border-top:1px solid var(--line);font-size:11px}
.journal-panel .story-choice small{color:var(--muted);font-size:10px}
@media(max-width:375px){.journal-story-tabs .btn{font-size:10px;padding:5px 6px;min-height:28px}}

/* V20 school cards: keep schooling controls compact across mobile and desktop. */
.school-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.school-summary>div{display:flex;flex-direction:column;gap:2px;min-width:0;border:1px solid var(--line);border-radius:9px;padding:7px}
.school-summary span,.school-assignment small,.school-staff-row small{color:var(--muted);font-size:10px}
.school-summary strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.school-assignment,.school-staff-row{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid var(--line);padding:7px 0;min-width:0}
.school-assignment>div,.school-staff-row>div{display:flex;flex-direction:column;min-width:0;gap:2px}
.school-assignment strong,.school-staff-row strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.school-assignment .btn,.school-staff-row .btn{flex-shrink:0}
.school-sports-extra{display:flex;flex-direction:column;gap:6px;margin-top:9px}
.school-sports-extra small{color:var(--muted)}
@media(max-width:375px){.school-summary{gap:4px}.school-summary>div{padding:5px}.school-summary strong{font-size:9px}}

/* V21: University records and coursework; existing fonts and global layout unchanged. */
.uni-course-list{display:grid;gap:7px}
.uni-course{border:1px solid var(--line);background:var(--paper);border-radius:10px;padding:10px;display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.uni-course>div{min-width:0;display:flex;flex-direction:column;gap:3px}
.uni-course strong{font-size:12px;overflow-wrap:anywhere}
.uni-course small{font-size:10px;color:var(--muted)}
.uni-course .btn{flex-shrink:0}
.uni-term{border:1px solid var(--line);border-radius:10px;padding:10px;margin:6px 0;display:grid;gap:4px;min-width:0}
.uni-term>strong{font-size:12px}
.uni-term .data-pair{gap:8px;min-width:0}
.uni-term .data-pair span{min-width:0;overflow-wrap:anywhere}
.uni-term .data-pair strong{text-align:right;white-space:nowrap}
.university-housing .form-field,.university-organizations .form-field{margin:5px 0}
@media(max-width:680px){.uni-course{padding:7px}.uni-course strong{font-size:11px}.uni-term{padding:7px}.uni-term .data-pair strong{white-space:normal}}

/* V26: keep each career interview choice with its application button during page splitting. */
.career-job-entry{display:flex;align-items:end;flex-wrap:wrap;gap:10px 13px;padding:12px 0;border-bottom:1px solid var(--line);min-width:0}
.career-job-entry>div:first-child{flex:1 1 145px;min-width:0;display:grid;gap:3px}
.career-job-entry>div:first-child small{color:var(--muted);font-size:11px}
.career-job-controls{flex:1 1 200px;min-width:0;display:flex;align-items:end;gap:8px}
.career-job-controls .form-field{flex:1;min-width:0;margin:0}
.career-job-controls select{max-width:100%}
.career-job-controls .btn{flex:none}
@media(max-width:375px){.career-job-controls{flex-wrap:wrap}.career-job-controls .btn{min-height:32px}}

.career-offer-controls{display:grid;gap:8px}
.career-offer-controls .form-field{margin:0}
.career-offer-controls .btn{justify-self:start}

/* V31: expose the current date on small devices and persistent health alerts. */
@media(max-width:680px){.resources-bar .resource-date{display:inline-flex!important;margin-left:auto;font-size:10px;font-weight:700;color:#17505b;white-space:nowrap}.resources-bar{gap:6px;padding-left:6px;padding-right:6px}}
.v31-health-alert{display:flex;align-items:center;justify-content:space-between;gap:7px;flex:none;padding:5px 9px;margin-bottom:5px;border:1px solid #e2be79;border-radius:8px;background:#fff5da;color:#704e0b;font-size:11px;font-weight:700}
.v31-health-alert.critical{background:#fee9e7;border-color:#dc8b83;color:#a02e27}
.v31-health-alert .btn{flex:none;min-height:26px;font-size:10px;padding:4px 8px}
