.sheet.company-sheet{width:min(1000px,calc(100vw - 24px));max-width:1000px}
.company-view{gap:12px;max-height:78vh}.company-view p{line-height:1.5}.company-view .card{margin-bottom:10px}
.company-hero{text-align:center;padding:12px;background:#202d45;border:2px solid #3c516f;margin-bottom:12px}
.company-hero h3{margin:6px 0 4px}.company-hero>.rebirth-badge+h3{margin-top:10px}.company-hero p{margin:0}.company-multiplier{font-size:26px;color:#ffd24a;margin:14px 0}
.rebirth-badge{display:inline-flex;align-items:center;justify-content:center;gap:5px;color:var(--rebirth-color);border:2px solid var(--rebirth-color);box-shadow:2px 2px 0 #080e19;background:#141e32;padding:4px 7px;font-size:12px;white-space:nowrap}
.leaderboard-meta{display:flex;align-items:center;gap:5px;min-height:18px;line-height:18px;min-width:0}
.leaderboard-meta>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.leaderboard-player-info{display:flex!important;align-items:center;gap:4px;white-space:nowrap}
.leaderboard-player-name{flex:none}
.leaderboard-meta-rest{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.founder-badge-wrap{position:relative;display:inline-block;flex:none;width:17px;height:17px;vertical-align:middle;overflow:hidden;clip-path:polygon(18% 0,82% 0,100% 18%,100% 82%,82% 100%,18% 100%,0 82%,0 18%);filter:drop-shadow(1px 1px 0 #241706)}
.founder-badge{display:block;width:100%;height:100%;image-rendering:pixelated}
.founder-badge-wrap::before{content:"";position:absolute;z-index:1;top:-30%;bottom:-30%;left:-45%;width:28%;transform:translateX(-180%) rotate(24deg);background:linear-gradient(90deg,transparent,rgba(255,255,228,.92),rgba(255,222,120,.5),transparent);animation:founder-badge-shine 5.2s ease-in-out infinite;pointer-events:none}
.founder-badge-wrap i{position:absolute;z-index:2;right:1px;top:1px;width:5px;height:5px;background:#fff8c8;clip-path:polygon(40% 0,60% 0,60% 40%,100% 40%,100% 60%,60% 60%,60% 100%,40% 100%,40% 60%,0 60%,0 40%,40% 40%);opacity:0;transform:scale(.35);filter:drop-shadow(0 0 2px #fff2a8);animation:founder-badge-bling 5.2s steps(1,end) infinite;pointer-events:none}
@keyframes founder-badge-shine{0%,55%{transform:translateX(-180%) rotate(24deg)}72%,100%{transform:translateX(620%) rotate(24deg)}}
@keyframes founder-badge-bling{0%,67%,82%,100%{opacity:0;transform:scale(.35)}72%,76%{opacity:1;transform:scale(1)} }
.visit-title .founder-badge-wrap{width:19px;height:19px;margin-inline:2px}
@media(prefers-reduced-motion:reduce){.founder-badge-wrap::before,.founder-badge-wrap i{animation:none}.founder-badge-wrap i{display:none}}
.leaderboard-meta .rebirth-badge{flex:none;height:17px;box-sizing:border-box;padding:0 4px;border-width:1px;box-shadow:1px 1px 0 #080e19;gap:3px;font-size:10px;line-height:15px}
.leaderboard{display:grid;gap:5px;min-width:0}
.leaderboard-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px;padding:0 2px}
.leaderboard-caption{color:#aebbd0;font:700 10px/1 var(--pixel);letter-spacing:.04em;text-transform:uppercase}
.leaderboard-online{color:#8de0a8;font-size:11px;font-weight:800;white-space:nowrap}
.leaderboard .seg{gap:4px;margin:0 0 2px}
.leaderboard .seg button{min-height:34px;padding:4px 7px;font-size:11px}
.leaderboard-publish{justify-self:start;max-width:100%;min-height:30px;padding:5px 8px;border:1px solid #526783;background:#1c2b40;color:#dce8f6;font:700 10px/1.35 var(--pixel);text-align:left;white-space:normal;box-shadow:1px 1px 0 #080e19}
.gamecenter-actions{gap:6px}.gamecenter-actions .leaderboard-publish{flex:1;justify-self:stretch;text-align:center}
.expansion-overview{display:grid;gap:6px;padding:10px;background:#202d45;border:2px solid #526783;box-shadow:2px 2px 0 #080e19}.expansion-overview-top{display:flex;align-items:center;gap:9px;min-width:0}.expansion-overview-top .grow{display:grid;gap:2px;min-width:0}.expansion-overview-top .grow>b{font:700 13px/1.2 var(--pixel);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.expansion-overview-icon{display:grid;place-items:center;flex:none;width:38px;height:38px;background:#162238;border:1px solid #647b9d;font-size:22px;box-shadow:2px 2px 0 #080e19}.expansion-eyebrow{color:#93b7dd;font:700 8px/1 var(--pixel);letter-spacing:.06em}.expansion-level{flex:none;padding:5px 7px;background:#644f25;border:1px solid #e8c36b;color:#ffe08a;font:700 10px/1 var(--pixel)}.expansion-progress{height:9px;padding:2px;background:#0c1423;border:1px solid #71809a;box-shadow:inset 1px 1px 0 #050a12}.expansion-progress i{display:block;height:100%;background:repeating-linear-gradient(90deg,#68d48d 0 8px,#4db976 8px 10px);box-shadow:1px 0 #b6ffc7}.expansion-progress-label{display:flex;justify-content:space-between;color:#aebbd0;font:700 9px/1 var(--pixel)}.expansion-section-title{display:flex;align-items:center;gap:7px;margin:4px 0 0;color:#dce8f6}.expansion-section-title>b{flex:1;font:700 10px/1.2 var(--pixel)}.expansion-section-title>.small{white-space:nowrap;color:#ffe08a;font-weight:700}.expansion-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.expansion-card{display:flex;flex-direction:column;gap:7px;min-width:0;padding:9px;background:linear-gradient(180deg,#263750,#1b2940);border:2px solid #506987;box-shadow:2px 2px 0 #080e19}.expansion-card.is-locked{background:linear-gradient(180deg,#222b3a,#192234);border-color:#48566c}.expansion-card-top{display:flex;align-items:center;gap:7px;min-width:0;min-height:40px}.expansion-card-top .grow{display:grid;gap:3px;min-width:0}.expansion-card-top .grow>b{font:700 10px/1.2 var(--pixel);color:#f2f5fb}.expansion-card-top .small{font-size:10px;line-height:1.3;color:#b9c5d7}.expansion-icon{display:grid;place-items:center;flex:none;width:34px;height:34px;background:#121d30;border:1px solid #617793;font-size:19px;box-shadow:1px 1px 0 #080e19}.expansion-lock{flex:none;max-width:86px;padding:4px;background:#493829;border:1px solid #a97e49;color:#ffd28a;font:700 7px/1.2 var(--pixel);text-align:center}.expansion-buy{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:6px 8px;font:700 9px/1.2 var(--pixel)}.expansion-buy span{white-space:nowrap}.expansion-complete{display:flex;align-items:center;min-height:34px;padding:6px 7px;background:#17392f;border:1px solid #397e5b;color:#9ce2b4;font:700 8px/1.35 var(--pixel)}.expansion-quick{border-top:1px solid #3a4c66;padding-top:5px}.expansion-quick summary,.expansion-doors summary{cursor:pointer;color:#b9c9df;font:700 8px/1.3 var(--pixel)}.expansion-quick .btn{margin-top:5px}.expansion-doors{display:grid;gap:8px;padding:9px;background:#19263a;border:1px solid #405470}.expansion-doors[open] summary{color:#f1cc72}
.expansion-short{color:#ffca80;font:700 8px/1 var(--pixel)}
@media(max-width:600px){.expansion-grid{grid-template-columns:1fr;gap:7px}.expansion-card{gap:6px;padding:8px}.expansion-card-top{min-height:34px}.expansion-overview{padding:8px}.expansion-section-title{margin-top:2px}.expansion-section-title>b{font-size:9px}}
.leaderboard-row{position:relative;gap:7px;min-height:48px;padding:5px 7px;background:#19263a;border:1px solid #354762;box-shadow:1px 1px 0 #0b1220}
.leaderboard-row.is-mine{outline:1px solid #65b8ff!important;outline-offset:0}
.leaderboard-rank{display:grid;place-items:center;flex:none;width:24px;height:26px;background:#273750;color:#dce6f5;font:700 11px/1 var(--pixel);box-shadow:1px 1px 0 #0b1220}
.leaderboard-row.podium-1 .leaderboard-rank{background:#725c2c;color:#ffe08a}
.leaderboard-row.podium-2 .leaderboard-rank{background:#46566d;color:#edf3fa}
.leaderboard-row.podium-3 .leaderboard-rank{background:#624a3c;color:#e7b493}
.leaderboard-copy{gap:2px!important}
.leaderboard-workshop{overflow:hidden;color:#f0f4fa;font:700 12px/1.15 var(--pixel);text-overflow:ellipsis;white-space:nowrap}
.leaderboard-workshop i{color:#82c9ff;font-size:9px;font-style:normal}
.leaderboard-meta{min-height:13px;line-height:13px;font-size:9px}
.leaderboard-meta .rebirth-badge{height:14px;font-size:8px;line-height:12px}
.leaderboard-value{flex:none;color:#f4cd70;font:700 10px/1.2 var(--pixel);white-space:nowrap}
.leaderboard-visit{display:flex;align-items:center;justify-content:center;gap:5px;flex:none;min-width:84px;min-height:40px;padding:6px 10px;border:2px solid #647e9e;background:#2a3d59;color:#f3f7fd;font:700 11px/1 var(--pixel);box-shadow:2px 2px 0 #0b1220;cursor:pointer}
.leaderboard-visit span{color:#f4cd70;font-size:17px}
.leaderboard-block{display:flex;align-items:center;justify-content:center;flex:none;min-width:30px;min-height:30px;padding:3px;border:1px solid #6b3a44;background:#3a2230;color:#ffd7dc;font-size:13px;line-height:1;cursor:pointer}
.leaderboard-empty{padding:12px 8px;text-align:center;background:#172338;border:1px solid #354762;line-height:1.35}
.leaderboard-total{padding:2px 0;color:#8595ae;font-size:9px;text-align:center}
@media(max-width:600px){.leaderboard{gap:4px}.leaderboard-row{min-height:44px;padding:4px 5px;gap:5px}.leaderboard-rank{width:22px;height:24px}.leaderboard-workshop{font-size:11px}.leaderboard-meta{font-size:8px}.leaderboard-value{font-size:9px}.leaderboard-visit{min-width:0;min-height:28px;padding:3px 5px;border-width:1px;font-size:9px;box-shadow:1px 1px 0 #0b1220}.leaderboard-visit span{font-size:14px}.leaderboard .seg button{min-height:32px;padding-inline:4px;font-size:10px}}
.company-goal{display:flex;gap:12px;align-items:center;padding:12px 4px;border-bottom:1px solid #34435d}.company-goal>span{font-size:24px}.company-goal .complete{color:#46d27c}
.company-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.company-columns .card{display:flex;flex-direction:column;gap:8px}
.company-tree{position:relative;overflow:auto;height:365px;border:2px solid #42516b;background:#111a2c;touch-action:pan-x pan-y;overscroll-behavior:contain;cursor:grab}
.company-tree-board{position:relative;width:900px;height:710px;background-image:radial-gradient(#31405a 1px,transparent 1px);background-size:16px 16px}
.company-tree-board svg{position:absolute;left:0;top:0;pointer-events:none}.company-tree-board path{fill:none;stroke:#45536b;stroke-width:4;shape-rendering:crispEdges}.company-tree-board path.bought{stroke:#46d27c}
.company-branch{position:absolute;top:15px;width:180px;text-align:center}.company-node{position:absolute;width:180px;height:86px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:10px;background:#202d45;color:#eef3ff;border:3px solid var(--branch-color);box-shadow:3px 3px 0 #080d17;font:inherit;text-align:center;cursor:pointer}.company-node.locked{background:#1b2435;color:#a5b0c6}.company-node.bought{background:#203e39}.company-node.selected{outline:2px solid #fff;outline-offset:3px}.company-node .small{font-size:11px}.company-skill-detail{margin-top:12px}.company-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}.company-tabs button{flex:1}.company-equipment-img{height:62px;min-width:84px;display:flex;align-items:center;justify-content:center}.company-equipment-img img{width:84px;height:62px;max-height:62px;max-width:84px;object-fit:contain;image-rendering:pixelated}.rebirth-confirm{border-color:#ffc24a}
@media(max-width:600px){.sheet.company-sheet{width:100vw;max-width:100vw}.company-tree{height:290px}.company-columns{grid-template-columns:1fr}.company-multiplier{font-size:21px}.company-view{max-height:80vh}.company-tabs{gap:4px}}
.company-view{overflow-y:auto;min-height:0}
.company-tree{flex-shrink:0}
.company-finance summary,.company-confirm{padding:10px;line-height:1.5}
.company-finance summary{min-height:44px;box-sizing:border-box}
.company-subtabs{margin:12px 0}
.company-confirm{margin-top:12px;border:2px solid #ffc24a}
.company-tabs button[aria-pressed=true]{outline:2px solid #fff;outline-offset:-3px}
@media(max-width:600px){.company-view .btn{min-height:44px}.company-view .small{font-size:12px}.company-tabs{position:sticky;top:0;z-index:2;background:#141e32;padding:6px 0}.company-tree{height:250px}}

/* A flex-column sheet stretches bare images. Keep the authored sprite ratio. */
.equipment-preview{display:grid;place-items:center;min-width:0;padding:12px 0}
.equipment-preview .pic-st{display:block;width:auto;height:auto;max-width:100%;max-height:110px;object-fit:contain;image-rendering:pixelated}
@media(max-width:600px){.equipment-preview .pic-st{max-height:72px}}

.skill-pill{justify-content:center;gap:5px;min-width:76px;color:#e4d6ff}.skill-pill .skill-point{width:20px;height:20px;display:block;flex:none;shape-rendering:crispEdges;image-rendering:pixelated}.skill-pill .skill-unit{font-size:10px;color:#acb6cb;align-self:center}.skill-pill .num{font-size:17px;line-height:1;white-space:nowrap}.companion-preview{width:64px;height:80px;object-fit:contain;image-rendering:pixelated}.secret-preview{filter:brightness(0);opacity:.9;pointer-events:none}.pet-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}.pet-card{margin:0;min-width:0}.version-info.btn{font-family:var(--ui);font-size:16px;color:var(--text,#eef3ff);padding:0 14px;gap:8px;letter-spacing:.03em}
.version-info:hover{filter:brightness(1.15)}.version-info:focus-visible{outline:2px solid #7fcaff;outline-offset:3px}
.version-info-icon{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;border:2px solid #aebbd5;box-sizing:border-box;font-size:16px;line-height:1;color:#d9e7ff}
.release-dialog{font-family:var(--ui);color:var(--text,#eef3ff);background:#172238;width:min(560px,calc(100vw - 32px));max-height:85vh;overflow:auto;padding:20px;border:3px solid #6d87ad;box-shadow:5px 5px 0 #080d17;box-sizing:border-box}
.release-dialog::backdrop{background:#060b16bd}.release-dialog h2{font-family:var(--pixel);font-size:28px;margin:0}.release-items p.card{font-size:19px;line-height:1.35;margin:12px 0;padding:14px;gap:0}.release-items p.card br{display:none}.release-items p.card b{font-size:22px;margin-bottom:5px}.release-items b{color:#7fcaff}@media(max-width:600px){.skill-pill{min-width:60px;gap:3px}.skill-pill .num{font-size:15px}.skill-pill .skill-point{width:18px;height:18px}.skill-pill .skill-unit{font-size:9px}.pet-cards{grid-template-columns:1fr}}

.company-tree-board{margin:0 auto}
.company-skill-backdrop{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(4,8,17,.8)}
.company-skill-backdrop .company-skill-detail{width:480px;max-width:100%;max-height:calc(100dvh - 32px);overflow:auto;margin:0;border:3px solid #6d87ad;box-shadow:5px 5px 0 #080d17}
.company-skill-detail>.btn{margin-top:12px}

.rebirth-secret{display:inline-block;filter:blur(3px) contrast(2.4);text-shadow:2px 0 currentColor,-2px 0 currentColor,0 2px currentColor,0 -2px currentColor;user-select:none}

.company-tree .connected-tree{width:1120px;height:800px;margin:0;}
.connected-tree .company-node{width:130px;height:96px;padding:6px;gap:5px;font-size:11px;box-sizing:border-box}
.company-node-cost{display:block;background:#0b1220;color:#ffd24a;border:1px solid #8e7438;padding:4px 10px;font-size:14px;line-height:1;font-weight:900;white-space:nowrap}
.company-tree-root{position:absolute;width:160px;padding:12px;box-sizing:border-box;text-align:center;background:#263b51;border:3px solid #46d27c;color:#fff;}
.company-tree:has(.connected-tree){height:min(54vh,540px)}

.connected-tree{user-select:none}.connected-tree .company-node{touch-action:pan-x pan-y}

/* Rebirth is a milestone screen: show progress first and keep explanatory copy secondary. */
.rebirth-requirements,.rebirth-rewards{gap:12px;padding:16px}
.rebirth-next-unlock{gap:8px;padding:14px;background:#202d43;border:2px solid #e7b84a;box-shadow:3px 3px 0 #0a1120}
.rebirth-next-unlock p{margin:0;color:#e1e8f4;font-size:14px;line-height:1.45}
.rebirth-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.rebirth-section-head h4{font-size:22px;line-height:1.1;margin:3px 0 0}
.rebirth-eyebrow{font-size:11px;font-weight:900;letter-spacing:.12em;color:#91a5c8}
.rebirth-multiplier{font-size:23px;font-weight:900;color:#ffd24a;white-space:nowrap}
.rebirth-summary{display:flex;justify-content:space-between;align-items:center;font-size:14px;color:#d8e3f6}
.rebirth-overall-bar,.rebirth-goal-bar{display:block;height:8px;overflow:hidden;background:#101829;border:1px solid #475977;box-shadow:inset 1px 1px #080d17}
.rebirth-overall-bar i,.rebirth-goal-bar i{display:block;height:100%;background:#47d282;transition:width .25s ease}
.rebirth-goals-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.rebirth-goal-groups{display:grid;gap:6px}
.rebirth-goal-group{background:#182338;border:2px solid #3b4b66;box-shadow:2px 2px 0 #0c1321}
.rebirth-goal-group>summary{display:flex;align-items:center;gap:8px;min-height:39px;padding:6px 10px;list-style:none;cursor:pointer;touch-action:manipulation}
.rebirth-goal-group>summary::-webkit-details-marker{display:none}
.rebirth-goal-group>summary>b{flex:1;font-size:13px}
.rebirth-goal-group>summary>span{font-size:11px;color:#aab8d0;font-variant-numeric:tabular-nums}
.rebirth-goal-group>summary>i{font-style:normal;color:#ffd075;font-size:20px;line-height:1;transition:transform .15s ease}
.rebirth-goal-group[open]>summary>i{transform:rotate(90deg)}
.rebirth-goal-group>.rebirth-goals-grid{padding:0 7px 7px}
.rebirth-goal{display:flex;align-items:center;gap:9px;min-width:0;padding:9px;background:#1b263b;border:2px solid #3b4b66;box-shadow:2px 2px 0 #0c1321}
.rebirth-goal.is-met{border-color:#347d5a;background:#1b302d}
.rebirth-goal-mark{display:grid;place-items:center;flex:none;width:25px;height:25px;background:#303c52;color:#ffc24a;font-size:16px;font-weight:900}
.rebirth-goal.is-met .rebirth-goal-mark{background:#25533c;color:#8af0ad}
.rebirth-goal-main{display:grid;gap:5px;flex:1;min-width:0}

.rebirth-goal-main>b{font-size:13px;line-height:1.25;overflow-wrap:anywhere}
.rebirth-goal-progress{font-size:11px;color:#aab8d0;font-variant-numeric:tabular-nums}
.rebirth-goal-bar{height:5px}
.rebirth-goal-bar i{background:#f1bb4f}
.rebirth-goal-action{align-self:start;min-height:30px;margin-top:2px}
.rebirth-goal.is-met .rebirth-goal-bar i{background:#47d282}
.rebirth-goal-status{font-size:9px;letter-spacing:.05em;font-weight:900;color:#ffd075;white-space:nowrap}
.rebirth-goal.is-met .rebirth-goal-status{color:#8af0ad}
.rebirth-footnote{margin:0;color:#9eacc4;font-size:11px;line-height:1.35}
.rebirth-reward-icon{display:grid;place-items:center;flex:none;width:36px;height:36px;background:#403621;border:2px solid #ab873c;color:#ffdc73;font-size:23px}
.rebirth-reward-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.rebirth-reward-list>span{padding:9px;background:#1b263b;border-left:3px solid #e7b84a;font-size:13px;line-height:1.35}
.rebirth-reward-list small{color:#aab8d0;font-size:11px}
.rebirth-reset-details{border-top:1px solid #3b4b66;padding-top:9px;color:#cbd6e8}
.rebirth-reset-details summary{cursor:pointer;font-weight:700;font-size:12px;min-height:28px}
.rebirth-reset-details p{margin:7px 0 0}
@media(max-width:600px){.rebirth-requirements,.rebirth-rewards,.rebirth-next-unlock{padding:12px;gap:10px}.rebirth-goals-grid,.rebirth-reward-list{grid-template-columns:1fr}.rebirth-goal{padding:8px}.rebirth-section-head h4{font-size:19px}.rebirth-multiplier{font-size:21px}}
@media(prefers-reduced-motion:reduce){.rebirth-overall-bar i,.rebirth-goal-bar i{transition:none}}

/* Keep the common orders view scannable on a phone; reveal schedules and long tails on demand. */
.orders-body{gap:6px!important}
.orders-tabs{position:sticky;top:0;z-index:2}
.orders-body .order-bookings,.orders-body .order-bottleneck{padding:0}
.orders-body .order-bookings>summary,.orders-body .order-bottleneck>summary,.order-more>summary{display:flex;align-items:center;gap:8px;min-height:42px;padding:6px 10px;list-style:none;cursor:pointer;touch-action:manipulation}
.orders-body details>summary::-webkit-details-marker,.order-more>summary::-webkit-details-marker{display:none}
.orders-body .order-bookings>summary>b,.orders-body .order-bottleneck>summary>b{flex:1}
.orders-body .order-bookings>summary>span,.orders-body .order-bottleneck>summary>span{font-size:11px;color:#aab8d0;text-align:right}
.orders-body details>summary>i,.order-more>summary>i{font-style:normal;color:#ffd075;font-size:20px;line-height:1;transition:transform .15s ease}
.orders-body details[open]>summary>i,.order-more[open]>summary>i{transform:rotate(90deg)}
.order-bookings-list{display:grid;gap:6px;padding:0 10px 10px}
.order-list-row{gap:7px!important;padding:5px 7px!important}
.order-list-row .pic-car{width:48px;height:36px;object-fit:contain}
.order-list-row .small{font-size:11px;line-height:1.2}
.order-list-row .col{gap:2px!important;min-width:0}
.order-list-row .col>.small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-more{display:grid;gap:6px}
.order-more>summary{justify-content:center;background:#182338;border:2px solid #3b4b66;box-shadow:2px 2px 0 #0c1321;font-size:12px;font-weight:700}
.order-bottleneck>summary{flex-wrap:wrap}
.order-bottleneck>p{margin:0;padding:0 10px 10px;color:#cbd6e8}
.history-entry{display:flex;align-items:center;gap:8px;min-width:0;padding:7px 8px;background:#1b263b;border:2px solid #3b4b66;box-shadow:2px 2px 0 #0c1321}
.history-check{display:grid;place-items:center;flex:none;width:24px;height:24px;background:#25533c;color:#8af0ad;font-size:16px;font-weight:900}
.history-car{width:44px;height:34px;object-fit:contain;flex:none}
.history-main{display:grid;gap:3px;min-width:0;flex:1}
.history-title{gap:8px;align-items:flex-start}
.history-title>b{font-size:13px;line-height:1.2}
.history-title>strong{flex:none;color:#8af0ad;font-size:12px;font-variant-numeric:tabular-nums}
.history-main>.small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
.history-meta{display:flex;justify-content:space-between;gap:8px;color:#aab8d0;font-size:10px}
.history-bar{display:block;height:4px;background:#101829;border:1px solid #475977}
.history-bar>i{display:block;height:100%;background:#47d282}
@media(max-width:600px){.orders-body .order-list-row{min-height:50px}.order-list-row .pic-car{width:42px;height:32px}.orders-body .order-bookings>summary,.orders-body .order-bottleneck>summary{min-height:40px;padding-inline:8px}}

/* Parts inventory: a quick stock HUD, actionable low-stock list, and details on demand. */
.parts-body{gap:7px!important}
.parts-dashboard{display:grid;gap:6px;padding:9px 10px;background:#1b263b;border:2px solid #40516f;box-shadow:2px 2px 0 #0c1321}
.parts-dashboard-top{display:flex;align-items:center;gap:8px;min-width:0}
.parts-crate{display:grid;place-items:center;flex:none;width:32px;height:32px;background:#35445e;border:2px solid #576b8c;font-size:20px}
.parts-dashboard-top>.col{min-width:0}
.parts-dashboard-top>.col>b{font-size:14px}
.parts-dashboard-top .chip{flex:none}
.parts-capacity{height:7px;background:#101829;border:2px solid #475977;box-shadow:inset 1px 1px #0b1120}
.parts-capacity>i{display:block;height:100%;transition:width .25s steps(6,end)}
.parts-footnote{font-size:10px;color:#aab8d0}
.parts-clerk{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 9px;background:#202e46;border-left:3px solid #47d282;font-size:11px}
.parts-clerk.is-away{border-color:#edbc55}
.parts-clerk>b{line-height:1.25}
.parts-help{flex:none}
.parts-help>summary{list-style:none;cursor:pointer;color:#aab8d0;font-size:10px;text-decoration:underline;text-underline-offset:2px}
.parts-help>summary::-webkit-details-marker{display:none}
.parts-help[open]{position:relative}
.parts-help[open]>.small{position:absolute;z-index:4;right:0;top:calc(100% + 5px);width:min(260px,70vw);padding:9px;background:#101829;border:2px solid #506283;box-shadow:3px 3px 0 #0a1120;color:#d9e1ef}
.parts-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:3px;background:#111a2b;border:2px solid #34435d}
.parts-filters>button{min-height:34px;padding:4px 5px;background:#202c43;border:2px solid #3b4b66;color:#cbd6e8;font-size:10px;font-weight:800;line-height:1.2}
.parts-filters>button.on{background:#d7e0ee;color:#111a2b;border-color:#f4f7fc;box-shadow:inset 0 -3px #90a2bd}
.parts-items{display:grid;gap:5px}
.parts-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0;padding:6px 7px;background:#1b263b;border:2px solid #3b4b66;box-shadow:2px 2px 0 #0c1321}
.parts-item.is-low{border-left:4px solid #e4b34d}
.parts-item-main{display:grid;gap:3px;min-width:0}
.parts-item-title{display:flex;align-items:center;gap:5px;min-width:0;flex-wrap:wrap}
.parts-item-title>b{font-size:12px;line-height:1.15}
.parts-item-title .chip{font-size:9px;padding:1px 4px}
.parts-item-track{height:5px;background:#101829;border:1px solid #475977}
.parts-item-track>i{display:block;height:100%;transition:width .2s steps(4,end)}
.parts-item-main>.small{font-size:9px;line-height:1.2;color:#aab8d0;overflow-wrap:anywhere}
.parts-item.is-low .parts-item-main>.small{color:#f1c96b}
.parts-item-buy{display:flex;gap:4px}
.parts-item-buy>.btn{display:grid;gap:1px;min-width:48px;min-height:36px;padding:3px 5px;font-size:11px;line-height:1.1}
.parts-item-buy>.btn>span{font-size:8px;white-space:nowrap;opacity:.82}
.parts-more,.parts-deliveries,.parts-special{padding:0;background:#182338;border:2px solid #3b4b66;box-shadow:2px 2px 0 #0c1321}
.parts-more>summary,.parts-deliveries>summary,.parts-special>summary{display:flex;align-items:center;gap:7px;min-height:38px;padding:5px 9px;list-style:none;cursor:pointer;font-size:11px;font-weight:800;touch-action:manipulation}
.parts-more>summary::-webkit-details-marker,.parts-deliveries>summary::-webkit-details-marker,.parts-special>summary::-webkit-details-marker{display:none}
.parts-more>summary>i,.parts-deliveries>summary>i,.parts-special>summary>i{margin-left:auto;color:#ffd075;font-style:normal;font-size:18px;transition:transform .15s ease}
.parts-more[open]>summary>i,.parts-deliveries[open]>summary>i,.parts-special[open]>summary>i{transform:rotate(90deg)}
.parts-more-list{display:grid;gap:5px;padding:0 5px 6px}
.parts-deliveries>div{display:grid;gap:5px;padding:0 8px 8px}
.parts-delivery{display:flex;align-items:center;gap:6px;min-width:0;padding:5px;background:#202e46;font-size:11px}
.parts-delivery>b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.parts-special>summary>.small{margin-left:auto;color:#aab8d0;font-size:9px;font-weight:500}
.parts-special>.small{display:block;padding:0 9px 9px;line-height:1.35;color:#cbd6e8}
.parts-empty{display:grid;justify-items:center;gap:3px;padding:14px 8px;background:#1b263b;border:2px dashed #43536e;text-align:center}
.parts-empty>span{font-size:20px}
.parts-empty>b{font-size:12px}
.parts-empty>small{font-size:10px;color:#aab8d0}
@media(max-width:600px){.parts-item{gap:5px;padding:5px}.parts-item-buy{gap:3px}.parts-item-buy>.btn{min-width:43px;padding-inline:3px}.parts-filters>button{font-size:9px}.parts-clerk{align-items:flex-start}.parts-special>summary>.small{max-width:115px;text-align:right}}
@media(prefers-reduced-motion:reduce){.parts-capacity>i,.parts-item-track>i,.parts-more>summary>i,.parts-deliveries>summary>i,.parts-special>summary>i{transition:none}}

/* Economy: lead with the daily result, keep accounting detail one tap away. */
.economy-body{gap:8px!important}
.economy-note{margin:0;color:#aab8d0;font-size:10px;line-height:1.3}
.economy-hero{display:grid;gap:5px;padding:11px;background:#1b263b;border:2px solid #40516f;box-shadow:3px 3px 0 #0c1321}
.economy-hero.is-positive{border-top:4px solid #47d282}
.economy-hero.is-negative{border-top:4px solid #ed766d}
.economy-eyebrow{color:#aab8d0;font-size:9px;font-weight:900;letter-spacing:.08em}
.economy-hero-value{font-size:26px;line-height:1.05;font-variant-numeric:tabular-nums;color:#8af0ad;text-shadow:2px 2px #142437}
.economy-hero.is-negative .economy-hero-value{color:#ff958a}
.economy-hero-caption{font-size:11px;font-weight:700;color:#d9e1ef}
.economy-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:4px}
.economy-kpis>div{display:grid;gap:2px;min-width:0;padding:6px;background:#111a2b;border:2px solid #34435d}
.economy-kpis small{font-size:9px;line-height:1.1;color:#aab8d0}
.economy-kpis b{font-size:11px;line-height:1.2;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.economy-breakdown{border-top:1px solid #40516f;padding-top:4px}
.economy-breakdown>summary{display:flex;align-items:center;min-height:32px;cursor:pointer;color:#ffd075;font-size:11px;font-weight:800;list-style:none}
.economy-breakdown>summary::-webkit-details-marker{display:none}
.economy-breakdown>summary:after{content:'›';margin-left:auto;font-size:18px;transition:transform .15s ease}
.economy-breakdown[open]>summary:after{transform:rotate(90deg)}
.economy-trend{display:grid;gap:6px;padding:9px 10px;background:#202e46;border:2px solid #40516f;box-shadow:2px 2px 0 #0c1321}
.economy-trend>.row{gap:8px}
.economy-trend>.row>b{font-size:12px}
.economy-trend>.row>.small{font-size:9px;color:#aab8d0}
.economy-mini-chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));align-items:end;gap:5px;height:66px;padding:4px 4px 0;background:#111a2b;border-bottom:2px solid #8391a8}
.economy-mini-day{display:flex;align-items:center;justify-content:flex-end;flex-direction:column;gap:2px;height:100%;min-width:0}
.economy-mini-day>i{display:block;width:min(70%,18px);min-height:3px;border:1px solid rgba(255,255,255,.24);box-shadow:1px 1px #0c1321}
.economy-mini-day>i.positive{background:#47d282}
.economy-mini-day>i.negative{background:#ed766d}
.economy-mini-day>small{font-size:8px;color:#aab8d0}
.economy-chart-legend{display:flex;align-items:center;gap:9px;font-size:9px;color:#aab8d0}
.economy-chart-legend>span{display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
.economy-chart-legend i{display:inline-block;width:7px;height:7px;border:1px solid rgba(255,255,255,.25)}
.economy-chart-legend i.positive{background:#47d282}
.economy-chart-legend i.negative{background:#ed766d}
.economy-chart-legend>.grow{white-space:normal;text-align:right}
.economy-trend-empty{grid-template-columns:auto 1fr;align-items:center;min-height:54px}
.economy-trend-empty>span{font-size:22px}
.economy-trend-empty>div{display:grid;gap:3px}
.economy-trend-empty small{font-size:10px;color:#aab8d0}
.economy-full-chart>summary{min-height:38px}
.economy-contracts>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:40px;color:var(--accent);font-weight:900}
.economy-contracts>summary::-webkit-details-marker{display:none}
.economy-contracts>summary>.small{color:#aab8d0;font-size:10px;text-align:right}
.economy-contracts .menu-detail-content{display:grid;gap:8px}
.economy-contract{display:grid;gap:5px;padding:8px;background:#202e46;border:1px solid #40516f}
.economy-contract>p{margin:0}
.economy-contract-facts{display:grid;gap:2px}
.economy-pricing .pixel-range{display:block;width:100%;height:26px;margin:8px 0 2px;padding:0;background:transparent;appearance:none;-webkit-appearance:none;cursor:pointer;touch-action:pan-y}
.economy-pricing .pixel-range:focus-visible{outline:2px solid #ffd36a;outline-offset:4px}
.economy-pricing .pixel-range::-webkit-slider-runnable-track{height:10px;border:2px solid #8392ad;background:linear-gradient(to right,#47d282 0 var(--range-progress,50%),#111a2c var(--range-progress,50%) 100%);box-shadow:2px 2px 0 #0a1120;border-radius:0}

/* Pull the company, Rebirth and economy screens into the shared semantic pixel
   palette used by the rest of the game's reusable cards and feedback. */
.company-multiplier,.company-node-cost,.economy-breakdown>summary{color:var(--cozy-gold,#f2c96d)}
.company-goal .complete,.company-tree-board path.bought,.economy-hero.is-positive{color:var(--cozy-mint,#83d5a0)}
.company-tree-board path.bought{stroke:var(--cozy-mint,#83d5a0)}
.economy-hero.is-positive{border-top-color:var(--cozy-mint,#83d5a0)}
.rebirth-next-unlock,.rebirth-confirm,.company-confirm{border-color:var(--cozy-lilac,#c0a5e8)}
.skill-pill{color:#d6c3f2}
.economy-mini-day>i.positive,.economy-chart-legend i.positive{background:var(--cozy-mint,#83d5a0)}
.company-tabs button:focus-visible,.company-subtabs button:focus-visible,.company-node:focus-visible{outline:3px solid var(--cozy-gold,#f2c96d);outline-offset:2px}
.economy-pricing .pixel-range::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;margin-top:-7px;border:3px solid #e7edf7;border-right-color:#8291aa;border-bottom-color:#8291aa;background:#ffd36a;box-shadow:2px 2px 0 #0a1120;border-radius:0}
.economy-pricing .pixel-range::-moz-range-track{height:6px;border:2px solid #8392ad;background:#111a2c;box-shadow:2px 2px 0 #0a1120;border-radius:0}
.economy-pricing .pixel-range::-moz-range-progress{height:6px;background:#47d282}
.economy-pricing .pixel-range::-moz-range-thumb{width:14px;height:14px;border:3px solid #e7edf7;border-right-color:#8291aa;border-bottom-color:#8291aa;background:#ffd36a;box-shadow:2px 2px 0 #0a1120;border-radius:0}
@media(max-width:600px){.economy-hero{padding:9px}.economy-hero-value{font-size:23px}.economy-kpis{gap:3px}.economy-kpis>div{padding:5px 4px}.economy-kpis b{font-size:10px}.economy-chart-legend{gap:6px;font-size:8px}.economy-mini-chart{height:58px}}
@media(prefers-reduced-motion:reduce){.economy-breakdown>summary:after{transition:none}}

/* Standalone used-car business: same crisp, compact pixel-art language as the workshop. */
.dealership-view{gap:10px}
.dealer-hero{display:grid;grid-template-columns:minmax(150px,240px) minmax(0,1fr);align-items:center;gap:14px;padding:12px;background:#1b263b;border:2px solid #40516f;box-shadow:3px 3px 0 #0a1120}
.dealer-hero-image{display:block;width:100%;height:150px;object-fit:contain;image-rendering:pixelated;image-rendering:crisp-edges}
.dealer-hero h3{margin:5px 0 8px;font-size:25px}.dealer-hero p{margin:0;line-height:1.45}
/* the three display spots, as they stand in the showroom: a car and its price, or a free spot */
.dealer-spots{display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:7px}
.dealer-spot{display:grid;gap:3px;min-width:0;padding:8px;background:#1a2336;border:2px dashed #4a5a76;text-align:center}
.dealer-spot.taken{background:#202d45;border-style:solid;border-color:#d6b062}
.dealer-spot span{font-size:11px;color:#aab8d0}.dealer-spot b{font-size:13px;overflow-wrap:anywhere}.dealer-spot small{font-size:11px;color:#aab8d0}.dealer-spot.taken small{color:#f3dc9c}
.dealer-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.dealer-stats>div{display:grid;gap:3px;min-width:0;padding:8px;background:#202d45;border:2px solid #3b4b66;text-align:center}
.dealer-stats span,.dealer-car-value>span{font-size:11px;color:#aab8d0}.dealer-stats b{font-size:16px;overflow-wrap:anywhere}
.dealer-flow{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding:10px;background:#192538;border:1px solid #40516f}
.dealer-flow>b{grid-column:1/-1}.dealer-flow>span{display:flex;align-items:center;gap:7px;font-size:12px;line-height:1.25}.dealer-flow i{display:grid;place-items:center;flex:none;width:22px;height:22px;background:#34435d;color:#ffd24a;font-style:normal;font-weight:900}
.dealer-section{display:grid;gap:8px}.dealer-section h4{margin:0}.dealer-section>.row{align-items:center}
.dealer-car-card{display:grid;gap:9px;margin:0;padding:12px}.dealer-car-card>.row{align-items:center}.dealer-car-icon{display:grid;place-items:center;flex:none;width:54px;height:44px;background:#141e32;border:1px solid #475977;font-size:25px}
.dealer-car-value{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:8px;background:#141e32;border-left:3px solid #ffd24a}.dealer-car-value>b{font-size:19px;color:#ffe08a}.dealer-repair-actions{display:grid;gap:6px}.dealer-repair-actions>.row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.dealer-repair-actions .btn{min-width:0;min-height:48px;white-space:normal;line-height:1.2}.dealer-repair-actions .btn small{display:block;font-size:10px;color:inherit;opacity:.8}
.dealer-ready{padding:8px;background:#1b302d;color:#8af0ad}.dealer-service-status,.dealer-buyer-offer{display:grid;gap:6px;padding:9px;background:#1b302d;border:1px solid #456c5a;color:#a6f2bd}.dealer-service-status>.btn{justify-self:start;min-height:42px;white-space:normal}.dealer-buyer-offer{background:#352f1d;border-color:#8d7540;color:#ffe08a}.dealer-buyer-offer>b:before{content:"";display:inline-block;width:5px;height:5px;margin:0 10px 1px 2px;background:#ffd47a;box-shadow:0 6px 0 #7297bb,-5px 10px 0 #7297bb,0 10px 0 #7297bb,5px 10px 0 #7297bb;image-rendering:pixelated}.dealer-price-actions{display:grid;gap:6px;padding:9px;background:#141e32;border:1px solid #475977}.dealer-price-actions>.row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.dealer-price-actions .btn{min-width:0;min-height:44px;white-space:normal;line-height:1.15}.dealer-car-card>.btn{min-height:46px}.dealer-offer{display:flex;align-items:center;gap:10px;min-width:0;padding:10px;background:#1b263b;border:2px solid #3b4b66}.dealer-offer>.col{min-width:0;gap:3px}.dealer-buy{align-items:flex-end;flex:none}.dealer-buy>b{white-space:nowrap;color:#ffe08a}.dealer-buy .btn{min-height:42px;white-space:nowrap}.dealer-empty{display:grid;gap:5px;margin:0;text-align:center}.dealer-footnote{margin:0;text-align:center;color:#9eacc4}
@media(max-width:600px){.dealer-hero{grid-template-columns:minmax(96px,34%) minmax(0,1fr);gap:9px;padding:9px}.dealer-hero-image{height:110px}.dealer-hero h3{font-size:20px}.dealer-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.dealer-flow{grid-template-columns:1fr}.dealer-flow>b{grid-column:auto}.dealer-repair-actions>.row{grid-template-columns:1fr}.dealer-repair-actions .btn{min-height:44px}.dealer-offer{align-items:flex-start;flex-wrap:wrap}.dealer-offer .dealer-car-icon{width:42px}.dealer-offer>.col.grow{flex:1 1 calc(100% - 60px)}.dealer-buy{width:100%;align-items:stretch;flex-direction:row!important;justify-content:space-between}.dealer-buy .btn{flex:1}}
/* the same compact layout whenever the sheet itself is narrow (the side sheet on a phone held sideways) */
.dealership-view{container-type:inline-size}
@container (max-width:520px){.dealer-hero{grid-template-columns:minmax(96px,34%) minmax(0,1fr);gap:9px;padding:9px}.dealer-hero-image{height:110px}.dealer-hero h3{font-size:20px}.dealer-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.dealer-flow{grid-template-columns:1fr}.dealer-flow>b{grid-column:auto}.dealer-repair-actions>.row{grid-template-columns:1fr}.dealer-repair-actions .btn{min-height:44px}.dealer-offer{align-items:flex-start;flex-wrap:wrap}.dealer-offer .dealer-car-icon{width:42px}.dealer-offer>.col.grow{flex:1 1 calc(100% - 60px)}.dealer-buy{width:100%;align-items:stretch;flex-direction:row!important;justify-content:space-between}.dealer-buy .btn{flex:1}}
@media(prefers-reduced-motion:reduce){.dealership-view *{scroll-behavior:auto}}

.dealer-management{background:#1b263b;border:2px solid #40516f;box-shadow:3px 3px 0 #0a1120}
.dealer-management>summary{display:flex;justify-content:space-between;gap:8px;align-items:center;min-height:48px;padding:9px 12px;cursor:pointer;list-style:none}.dealer-management>summary::-webkit-details-marker{display:none}.dealer-management>summary span{font-size:12px;color:#aab8d0}.dealer-management-body{display:grid;gap:9px;padding:0 10px 10px}.dealer-facility-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:6px}.dealer-facility{margin:0;padding:8px}.dealer-facility .row{gap:5px;flex-wrap:wrap}.dealer-build-actions,.dealer-hiring>.row{display:flex;flex-wrap:wrap;gap:6px}.dealer-build-actions .btn,.dealer-hiring .btn{min-height:42px;white-space:normal}.dealer-hiring{display:grid;gap:7px;padding:9px;background:#202d45;border:2px solid #3b4b66}.dealer-employee{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 8px;background:#1a2336;border-left:3px solid #d6b062}.dealer-employee span,.dealer-employee small{color:#aab8d0}

/* Staff roster cards use the same crisp, game-like frame as the work-order list. */
.staff-group{gap:6px!important}
.staff-group>.row:first-child{margin:5px 1px 1px!important;color:#dce6f5}
.staff-roster-row{gap:8px!important;padding:6px 8px!important;background:#1b263b!important;border:2px solid #3b4b66!important;box-shadow:2px 2px 0 #0c1321!important;min-height:62px}
.staff-roster-row .pic-p{width:34px;height:46px;flex:none;object-fit:contain;image-rendering:pixelated}
.staff-roster-row .col{gap:2px!important;min-width:0}
.staff-roster-row .col>.row{gap:5px;min-width:0;flex-wrap:wrap}
.staff-roster-row .col>.row>b{font-size:13px;line-height:1.2}
.staff-roster-row .small{font-size:11px;line-height:1.2}
.staff-roster-row .statbar{height:5px!important;margin-top:1px}
@media(max-width:600px){.staff-roster-row{min-height:58px;padding:5px 6px!important;gap:6px!important}.staff-roster-row .pic-p{width:30px;height:42px}.staff-roster-row .small{font-size:10px}}
.staff-detail-body{gap:9px!important}
.company-view .staff-detail-body{display:flex;flex-direction:column;gap:9px}
.staff-damage-stats{gap:7px}
.staff-stats-title{font:700 12px var(--pixel);color:#f3f5fa}
.staff-profile-card,.staff-xp-card,.staff-condition-card{padding:10px;background:#1b263b;border:1px solid #3b4b66;box-shadow:none}
.staff-profile-card{display:flex;align-items:center;gap:11px;min-width:0;border-left:3px solid #e6b94f}
.staff-profile-portrait{width:58px;height:78px;flex:none;object-fit:contain;image-rendering:pixelated}
.staff-profile-main{display:flex;flex:1;flex-direction:column;gap:5px;min-width:0}
.staff-profile-name{font:700 15px/1.25 var(--pixel);overflow-wrap:anywhere}
.staff-name-field{display:flex;flex-direction:column;gap:3px;color:#ffd24a;font:700 10px var(--pixel)}
.staff-name-field input{width:100%;min-width:0;height:34px;box-sizing:border-box;padding:4px 7px;border:2px solid #536783;border-radius:0;background:#111a2b;color:#f3f5fa;font:700 13px var(--pixel)}
.staff-profile-role{gap:5px;align-items:center;flex-wrap:wrap}
.staff-profile-role>b{font:700 12px var(--pixel);color:#dce6f5}
.staff-profile-activity{color:#aab8cf;font-size:11px;line-height:1.25}
.staff-profile-facts{display:flex;gap:6px;margin-top:1px}
.staff-profile-facts>span{display:flex;flex:1;flex-direction:column;gap:2px;padding:5px 7px;background:#131e30;border:1px solid #354660;min-width:0}
.staff-profile-facts small,.staff-xp-card>small{color:#aab8cf;font-size:10px;line-height:1.25}
.staff-profile-facts b{font:700 12px var(--pixel);color:#f3f5fa}
.staff-xp-card{display:flex;flex-direction:column;gap:6px}
.staff-xp-card .row{align-items:flex-start;gap:8px;font-size:11px}
.staff-xp-card .row>b{font:700 12px var(--pixel);color:#f3f5fa}
.staff-xp-track,.staff-condition-track{height:8px;overflow:hidden;border:2px solid #101827;background:#36445c;box-shadow:inset 0 1px 0 #202d42}
.staff-xp-track>i,.staff-condition-track>i{display:block;height:100%;background:repeating-linear-gradient(90deg,#e6ae3f 0 6px,#ffd45b 6px 12px)}
.staff-condition-card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px}
.staff-condition{display:flex;flex-direction:column;gap:4px;min-width:0}
.staff-condition .row{font-size:11px}
.staff-condition .row>b{font-size:12px}
.staff-condition-track>i{background:repeating-linear-gradient(90deg,#35b978 0 6px,#61dc91 6px 12px)}
.staff-condition-track>i.mid{background:repeating-linear-gradient(90deg,#d69432 0 6px,#f5c04b 6px 12px)}
.staff-condition-track>i.low{background:repeating-linear-gradient(90deg,#ce4e55 0 6px,#f06e70 6px 12px)}
.staff-skills-details,.staff-training-panel{grid-column:1/-1;padding:0 8px;border:1px solid #3b4b66;background:#172235}
.staff-training-panel{padding:0 9px;border:1px solid #3b4b66;background:#1b263b;box-shadow:none}
.staff-training-panel>summary{gap:8px;color:#e7edf8}
.staff-training-panel>summary>b{font:700 12px var(--pixel)}
.staff-training-panel>summary>small{color:#aab8cf;font-size:10px}
.staff-training-panel>summary::after{content:'+';margin-left:auto;color:#ffd45b;font:700 16px var(--pixel)}
.staff-training-panel[open]>summary{border-bottom:1px solid #3b4b66}
.staff-training-panel[open]>summary::after{content:'−'}
@media(max-width:600px){.staff-profile-card{gap:8px;padding:8px}.staff-profile-portrait{width:48px;height:68px}.staff-profile-facts{gap:4px}.staff-profile-facts>span{padding:4px 5px}.staff-profile-facts small{font-size:9px}.staff-profile-facts b{font-size:11px}.staff-condition-card{gap:8px;padding:8px}.staff-training-panel>summary{min-height:44px}}
@media(max-width:900px) and (orientation:landscape) and (max-height:540px){.staff-name-field input{font-size:16px}}

/* Shared UI system: tune the reusable primitives used by the game sheets, cards,
   action rows and dialogs in one place. Keep the pixel frames and established
   navy palette while removing duplicated whitespace between nested sections. */
:root {
  --ui-space-1: 4px;
  --ui-space-2: 6px;
  --ui-space-3: 8px;
  --ui-space-4: 12px;
  --ui-space-5: 16px;
  --ui-space-6: 20px;
  --ui-card-pad-y: 10px;
  --ui-card-pad-x: 12px;
  --ui-sheet-pad-x: 14px;
  --ui-control-height: 44px;
  --ui-control-height-compact: 38px;
  --ui-focus: var(--cozy-gold, #f2c96d);
  --ui-divider: var(--cozy-separator, rgba(145, 200, 237, .28));
}

.sheet {
  box-sizing: border-box;
  width: 100%;
  max-height: min(88vh, 920px);
  max-height: min(88dvh, 920px);
  overscroll-behavior: contain;
}
.sheet header {
  gap: var(--ui-space-2);
  padding: 12px var(--ui-sheet-pad-x) 8px;
  min-height: 48px;
  box-sizing: border-box;
}
.sheet header h2 {
  min-width: 0;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.sheet .body {
  gap: var(--ui-space-3);
  padding: 8px var(--ui-sheet-pad-x) 14px;
}
.sheet .body > * { min-width: 0; }
.col { gap: var(--ui-space-2); }
.row { gap: var(--ui-space-3); }
.card {
  gap: var(--ui-space-2);
  padding: var(--ui-card-pad-y) var(--ui-card-pad-x);
  min-width: 0;
}
/* Purpose-built rows (e.g. the leaderboard) keep their tuned proportions. */
.list-row:not(.leaderboard-row) {
  min-height: var(--ui-control-height);
  gap: var(--ui-space-3);
  padding: 7px 10px;
  line-height: 1.2;
}
.box {
  gap: var(--ui-space-1);
  padding: 8px 10px;
  min-width: 0;
}
.sec {
  line-height: 1.1;
  text-wrap: balance;
}
.btn {
  min-height: var(--ui-control-height);
  padding: 7px 12px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.btn.s {
  min-height: var(--ui-control-height-compact);
  padding: 6px 10px;
}
.btn:disabled { filter: saturate(.55); }
.x { min-width: 44px; min-height: 44px; }
.field { gap: var(--ui-space-1); }
.field input, .field select, .field textarea,
input[type=text], input[type=password], select, textarea {
  box-sizing: border-box;
  max-width: 100%;
}
textarea { min-height: 88px; }
dialog.panel {
  max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  overscroll-behavior: contain;
}
.sheet, .sheet .body, dialog.panel { scrollbar-gutter: stable; }
.sheet .body, dialog.panel { overflow-wrap: anywhere; }
.btn:focus-visible, .x:focus-visible,
button.list-row:focus-visible, button.thumb:focus-visible,
.seg button:focus-visible, .speed button:focus-visible {
  outline-color: var(--ui-focus);
}
@media (max-width: 600px), (orientation: landscape) and (max-height: 540px) {
  :root {
    --ui-card-pad-y: 9px;
    --ui-card-pad-x: 10px;
    --ui-sheet-pad-x: 12px;
  }
  .sheet { max-height: min(90vh, 920px); max-height: min(90dvh, 920px); }
  /* Bottom sheets start at the screen edge; a top safe-area inset here creates a large empty band above the title. */
  .sheet header { min-height: 46px; padding-top: 3px; }
  .sheet .body { gap: var(--ui-space-3); padding-top: 7px; padding-bottom: 12px; }
  .btn.s { min-height: 44px; }
  .list-row { padding: 6px 8px; }
  dialog.panel { width: min(560px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .x, button.list-row, button.thumb { transition: none !important; }
}

/* A landscape phone keeps the workshop visible beside an open sheet. The
   shared `.sheet { width:100% }` rule above is loaded after index.html and
   otherwise overrides its landscape dock. Pin the scrim to the viewport (the
   overlay itself has safe-area padding) and restore the dock after that rule. */
@media (orientation: landscape) and (max-height: 540px) {
  .sheet-wrap {
    position: fixed;
    inset: 0;
    align-items: stretch;
    justify-content: flex-end;
  }
  .sheet-wrap > .sheet {
    box-sizing: border-box;
    width: calc(min(400px, 52vw) + env(safe-area-inset-right, 0px));
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 16px 0 0 16px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
}

/* the skill tree as a list on narrow screens (phone held upright) */
.company-tree-hidden{display:none}
.skill-list{display:flex;flex-direction:column;gap:12px}
.skill-list-branch{border-left:4px solid var(--branch-color);padding-left:8px;display:flex;flex-direction:column;gap:6px}
.skill-list-branch h4{margin:0;display:flex;align-items:baseline;gap:6px;color:var(--branch-color);font-size:16px}
.skill-list-branch h4 small{margin-left:auto;color:#9aa7bf;font-size:11px;font-weight:700}
.skill-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 10px;width:100%;text-align:left;padding:9px 10px;background:#202d45;border:2px solid #3a4a66;color:#e7edf8;font:inherit;cursor:pointer;min-height:48px}
.skill-row.bought{border-color:var(--branch-color)}
.skill-row.locked{opacity:.62}
.skill-row.selected{outline:2px solid #fff0a0;outline-offset:1px}
.skill-row-main{display:flex;flex-direction:column;gap:5px;min-width:0}
.skill-row-main b{font-size:14px;overflow-wrap:anywhere}
.skill-row-pips{display:flex;gap:3px}.skill-row-pips i{width:14px;height:6px;background:#0b1220;border:1px solid #42516b}.skill-row-pips i.on{background:var(--branch-color);border-color:var(--branch-color)}
.skill-row-max{color:#46d27c;font-weight:900;font-size:13px}
.skill-row-need{grid-column:1/-1;color:#9aa7bf;font-size:11px;line-height:1.3}
.dealer-car-thumb{width:54px;height:44px;object-fit:contain;image-rendering:pixelated;image-rendering:crisp-edges}
