/* Session 66: larger typing workspace, compact header, friends and recurring goals. */
@media (min-width:761px){
 body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive):not(.mp-racing):not(.mp-preview){--ts35-type-pad-y:clamp(17px,calc(3.7dvh - 4px),34px)!important;--ts27-gap:clamp(4px,.64dvh,8px)!important;--ts27-key-h:clamp(18px,calc(6.7dvh - 30px),40px)!important}
 body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive):not(.mp-racing):not(.mp-preview)>.page-layout>.container{margin-top:clamp(8px,1.25dvh,18px)!important;padding-bottom:4px!important}
 body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive):not(.mp-racing):not(.mp-preview).ts20-manual>.page-layout{padding-top:clamp(8px,1.3dvh,18px)!important}
 body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive):not(.mp-racing):not(.mp-preview) #typingContainer{padding-block:var(--ts35-type-pad-y)!important;flex-shrink:0!important}
 body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive):not(.mp-racing):not(.mp-preview) #hintRow{margin-block:2px 3px!important;min-height:30px!important}
}
@media (min-width:761px) and (min-height:700px){body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive):not(.mp-racing):not(.mp-preview){--ts32-lines:4!important}}
@media (min-width:761px) and (max-height:540px){body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive):not(.mp-racing):not(.mp-preview){--ts35-type-pad-y:12px!important;--ts32-lines:3!important}body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive)>.page-layout>.container{margin-top:8px!important}}
@media(max-width:760px){body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive):not(.mp-racing):not(.mp-preview) #typingContainer{padding-block:clamp(14px,2.4dvh,22px)!important}body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive)>.page-layout>.container{margin-top:8px!important}}
@media (min-width:761px) and (max-height:900px){body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive) #ts24GuideMain{padding-block:2px!important}body.ts27-home:not(.ts27-main-active:not(.ts73-single)):not(.ts25-immersive) #ts24GuideMain .ts24-guide-head{margin-bottom:2px!important}}
/* Avoid the champion duration wrapping onto a second row. */
.ts23-topbar .champion-banner{min-width:0!important;flex:1 1 0!important;overflow:hidden;white-space:nowrap}
.ts23-topbar .champion-banner-inner{flex-wrap:nowrap!important;white-space:nowrap!important;gap:clamp(4px,.6vw,10px)!important;min-width:0}
.ts23-topbar .champion-name{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:0 1 auto}
.ts23-topbar .champion-stat,.ts23-topbar .champion-icon{flex:none;white-space:nowrap}
@media(max-width:1520px){.ts23-topbar .champion-label{display:none!important}}
@media(max-width:1100px){.ts23-topbar .champion-stat:not(.champion-mode){display:none!important}}
@media(max-width:760px){.ts23-topbar .champion-mode{display:none!important}}
/* Reserve the complete frame box inside the account chip. */
#tsAcctBtn{box-sizing:border-box!important;align-items:center!important;overflow:hidden!important;gap:7px!important;padding-inline:5px 8px!important;min-width:0}
#tsAcctBtn #tsAcctAvatar{width:clamp(22px,2.05vw,28px)!important;height:clamp(22px,2.05vw,28px)!important;flex:0 0 auto;isolation:isolate;overflow:hidden!important}
#tsAcctBtn #tsAcctAvatar[data-ts46-frame]:not([data-ts46-frame=""])::after{inset:0!important;filter:none!important}
#tsAcctBtn #tsAcctAvatar[data-ts46-frame]:not([data-ts46-frame=""])>img{width:77%!important;height:77%!important;object-fit:cover;border-radius:50%;margin:auto}
#tsAcctBtn .ts-acct-meta{min-width:0;overflow:hidden}
/* The daily passage is a redundant unranked practice shortcut. Keep its DOM hooks intact. */
#dailyChallengePanelOverlay .ts22-daily-panel{display:none!important}
/* Public profiles: readable hero, no frame or banner overflows, clear actions. */
#lbPlayerModalOverlay .lb-player-panel{width:min(100%,540px);max-width:540px}
#lbPlayerModalOverlay .profile-header{box-sizing:border-box;border:1px solid var(--border);border-radius:16px;padding:24px 18px 18px!important;gap:8px;min-height:0!important;overflow:hidden;background:var(--surface2);position:relative}
#lbPlayerModalOverlay .profile-header[data-ts46-banner]:not([data-ts46-banner='']){background:linear-gradient(180deg,#0b172e9e,#0b172edb),var(--ts47-banner-art)!important;background-position:center!important;background-size:cover!important}
#lbPlayerModalOverlay #lbPlayerAvatarLg{margin:7px auto 9px;width:74px;height:74px;flex:0 0 74px}
#lbPlayerModalOverlay #lbPlayerUsername{max-width:100%;overflow-wrap:anywhere;margin:4px 0;font-size:1.5rem;line-height:1.2}
#lbPlayerModalOverlay .profile-header :is(.name-modal-guest-note,.lb-player-mode-tag){font-size:.78rem;line-height:1.4;margin:0;color:var(--muted)}
#lbPlayerModalOverlay .profile-header[data-ts46-banner]:not([data-ts46-banner='']) :is(.name-modal-guest-note,.lb-player-mode-tag,.profile-xp-count,.profile-coins-pill){color:#fff!important;text-shadow:0 1px 3px #000}
#lbPlayerModalOverlay .profile-header[data-ts46-banner]:not([data-ts46-banner='']) .profile-xp-wrap{padding:9px;background:#07152c88;border:1px solid #ffffff33;border-radius:10px}
#lbPlayerModalOverlay .profile-header .ts30-bookmark{margin:0;max-width:100%}
#lbPlayerModalOverlay .profile-header[data-ts46-banner]:not([data-ts46-banner='']) #ts30BookmarkHint{color:#e1e7ef!important}
#lbPlayerModalOverlay .profile-stats-grid{gap:8px;margin-block:12px}
#lbPlayerModalOverlay .profile-stat-box{border:1px solid var(--border);background:var(--surface);border-radius:12px;padding:12px 7px;min-width:0}
#lbPlayerModalOverlay .profile-stat-box .lbl{overflow-wrap:anywhere;line-height:1.25}
#ts66ProfileActions{margin:10px 0 16px;padding:12px;background:var(--surface2);border:1px solid var(--border);border-radius:12px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}
#ts66ProfileActions[hidden],#ts66FriendForm[hidden]{display:none!important}
.ts66-profile-state{font-weight:700;color:var(--text);font-size:.84rem}
/* Reusable theme-aware social controls. */
.ts66-btn{font:inherit;font-size:.77rem;font-weight:700;line-height:1.2;display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:7px 11px;border-radius:9px;background:var(--surface);border:1px solid var(--border);color:var(--text);cursor:pointer;transition:background-color .16s,color .16s,border-color .16s,box-shadow .16s}
.ts66-btn:hover{background:var(--surface2);border-color:var(--accent)}.ts66-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ts66-primary{color:#fff!important;background:#2563eb!important;border-color:#1d4ed8!important}.ts66-primary:hover{background:#1d4ed8!important}
.ts66-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center;justify-content:flex-end}
.ts66-muted{color:var(--muted,var(--sub));font-size:.78rem;line-height:1.5;overflow-wrap:anywhere}
#ts66Friends{margin-top:16px;border-top:1px solid var(--border);padding-top:15px;display:grid;gap:10px;min-width:0}
#ts66Friends h3{font-size:1.1rem;margin:0}#ts66FriendForm{display:flex;gap:6px;flex-wrap:wrap}#ts66FriendForm input{flex:1 1 110px;min-width:0;padding:8px 10px;border:1px solid var(--border);background:var(--surface2);border-radius:8px;color:var(--text);font:inherit}
#ts66FriendsList{display:grid;gap:7px}.ts66-friend-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:10px;border-radius:10px;border:1px solid var(--border);background:var(--surface2)}
.ts66-friend-identity{display:flex;gap:9px;align-items:center;min-width:0}.ts66-friend-identity>div{display:grid;gap:3px;min-width:0}.ts66-friend-identity strong{font-size:.87rem;overflow-wrap:anywhere}.ts66-friend-avatar{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:50%;background:var(--accent);color:#fff;font-weight:750}.ts66-online{color:#15803d!important;font-weight:700}.dark-mode .ts66-online{color:#86efac!important}.ts66-online::before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:#16a34a;margin-right:5px;vertical-align:middle}
#ts28Bell{position:relative!important;overflow:visible!important}#ts28Bell #ts28BellDot{top:2px!important;right:2px!important;width:9px!important;height:9px!important;background:#dc2626!important;box-shadow:0 0 0 2px var(--surface)!important}
#ts28Bell[data-ts66-unread]::after{content:'';position:absolute;top:2px;right:2px;width:9px;height:9px;border-radius:50%;background:#dc2626;box-shadow:0 0 0 2px var(--surface);pointer-events:none}
#ts28NoticePanel{max-height:min(72dvh,480px);overflow-y:auto;overscroll-behavior:contain}#ts66FriendNotices:empty{display:none}#ts66FriendNotices{display:grid;gap:7px;padding:8px;border-top:1px solid var(--border)}.ts66-notice-head{font-size:.76rem;color:var(--sub);margin:0;text-transform:uppercase;letter-spacing:.045em}.ts66-notice-row{display:grid;gap:5px;padding:10px;border:1px solid var(--border);border-radius:9px;background:var(--surface2)}.ts66-notice-row strong{font-size:.81rem;overflow-wrap:anywhere}.ts66-notice-row small{color:var(--sub);font-size:.74rem;line-height:1.35}.ts66-notice-row .ts66-actions{justify-content:flex-start}
#ts66AutomaticGoals{padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface);margin:0 0 18px}#ts66AutomaticGoals h2{font-size:1.15rem;margin:0 0 6px}.ts66-goal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}.ts66-goal-card{padding:14px;border:1px solid var(--border);background:var(--surface2);border-radius:12px;display:grid;gap:9px;min-width:0}.ts66-goal-card h3{font-size:.95rem;line-height:1.3;margin:0}.ts66-goal-period{font-size:.71rem;font-weight:750;text-transform:uppercase;letter-spacing:.06em;color:var(--accent)}.ts66-goal-card progress{width:100%;height:8px;accent-color:var(--accent)}.ts66-goal-reward{font-size:.78rem;color:var(--accent)}.ts66-goal-card small{font-size:.75rem;line-height:1.3}
@media(max-width:650px){.ts66-goal-grid{grid-template-columns:1fr}.ts66-friend-row{align-items:flex-start}.ts66-actions{justify-content:flex-start}}
/* Certificate preview and printer-friendly inset border. */
.cert-viewer .cert-viewer-dialog{background:var(--surface);padding:12px;border-radius:16px;max-width:1040px;box-sizing:border-box;margin:auto;inset:12px;box-shadow:0 20px 60px #0003}
.cert-viewer .cert-viewer-bar{align-items:center;justify-content:flex-end;gap:10px;border-bottom:1px solid var(--border);padding:10px 12px 14px;margin-bottom:12px}
.cert-viewer .cert-viewer-bar .cert-btn{min-height:40px;border-radius:10px;font-weight:700}.cert-viewer .cert-viewer-bar .cert-btn-primary{background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.cert-viewer .cert-viewer-scroll{padding:0 12px 16px}
.cert-sheet{border:2px solid #253c60!important;box-shadow:inset 0 0 0 5px #fff,inset 0 0 0 6px #bea16b;background:#fff!important;color:#1c2c43!important;border-radius:0!important;position:relative}
.cert-sheet .cert-sheet-inner{gap:8px;padding:clamp(24px,4vw,46px) clamp(20px,4vw,48px)}
.cert-sheet .cert-brand{color:#28486b;letter-spacing:.17em;font-weight:800}.cert-sheet .cert-kicker{color:#253c60;letter-spacing:.025em;font-weight:700}.cert-sheet .cert-name{color:#28486b;border-color:#bea16b;padding:2px 24px 8px}.cert-sheet .cert-title{color:#21334f}.cert-sheet .cert-trust{background:#f8f8f4;border-color:#ded6c5;color:#344054}.cert-sheet .cert-foot{color:#475569}
@media print{body.cert-printing #certPrintRoot{width:281mm!important;height:194mm!important;overflow:visible!important;break-inside:avoid!important}body.cert-printing #certPrintRoot .cert-sheet{width:281mm!important;height:193mm!important;border:1mm solid #253c60!important;box-shadow:inset 0 0 0 2mm #fff,inset 0 0 0 2.3mm #bea16b!important;break-inside:avoid!important;box-sizing:border-box!important}body.cert-printing #certPrintRoot .cert-sheet-inner{padding:8mm 16mm!important;gap:2mm!important}body.cert-printing #certPrintRoot .cert-kicker{font-size:30pt!important}body.cert-printing #certPrintRoot .cert-name{font-size:26pt!important}body.cert-printing #certPrintRoot .cert-title{font-size:19pt!important}body.cert-printing #certPrintRoot .cert-trust{max-width:150mm!important;font-size:9pt!important}body.cert-printing #certPrintRoot .cert-foot{font-size:8pt!important}}
@media(prefers-reduced-motion:reduce){.ts66-btn{transition:none!important}}

/* Session 68: full-width race lobby, independent scrollable panels, frame-safe identity. */
#mpLobbyOverlay .pg-head,#mpLobbyOverlay .mp-grid{max-width:1680px;width:100%;min-width:0;box-sizing:border-box;margin-inline:auto}
#mpLobbyOverlay .mp-grid{gap:14px;align-items:start}
#mpLobbyOverlay .mp-grid>.name-modal{max-width:none;min-width:0;box-sizing:border-box;padding:16px;grid-area:race}
#mpLobbyOverlay .mp-stats{grid-area:record;min-width:0;box-sizing:border-box;padding:16px}
#mpLobbyOverlay .mp-social{grid-area:social;min-width:0;box-sizing:border-box;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:16px}
#mpLobbyOverlay #ts66Friends{margin:0;padding:0;border:0;gap:8px}
#mpLobbyOverlay .mp-social .ts22-friends{margin-top:14px;padding-top:12px}
#mpLobbyOverlay .mps-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
#mpLobbyOverlay .mps-row{padding:8px;gap:8px;min-width:0}
#mpLobbyOverlay .mps-mid{flex:1;overflow-wrap:anywhere}
#mpLobbyOverlay .mps-list{min-height:0}
#mpLobbyOverlay .mp-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:'race' 'record' 'social'}
@media(min-width:761px){
 #mpLobbyOverlay .mp-grid{grid-template-columns:minmax(235px,.95fr) minmax(0,1.5fr);grid-template-areas:'race record' 'social record';align-items:stretch}
}
@media(min-width:1200px){
 #mpLobbyOverlay .mp-grid{grid-template-columns:minmax(220px,.85fr) minmax(300px,1.4fr) minmax(235px,1fr);grid-template-areas:'race record social';align-items:start}
}
@media(min-width:761px) and (min-height:550px){
 html:has(body[data-view="multiplayer"]){overflow:hidden}
 body[data-view="multiplayer"]{height:100dvh;min-height:0!important;overflow:hidden!important}
 body[data-view="multiplayer"]>#mpLobbyOverlay.show{display:flex!important;flex:1 1 0;min-height:0;flex-direction:column;gap:12px;padding:12px clamp(12px,1.6vw,24px) 12px}
 body[data-view="multiplayer"]>#mpLobbyOverlay>.pg-head{flex:0 0 auto}
 body[data-view="multiplayer"]>#mpLobbyOverlay .mp-grid{flex:1 1 0;min-height:0;grid-template-rows:minmax(0,.95fr) minmax(0,1fr);align-items:stretch;overflow:hidden}
 #mpLobbyOverlay .mp-grid>.name-modal,#mpLobbyOverlay .mp-stats,#mpLobbyOverlay .mp-social{min-height:0;max-height:100%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--border) transparent}
 #mpLobbyOverlay .mp-stats{display:flex;flex-direction:column}
 #mpLobbyOverlay #mpStatsBody{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
 #mpLobbyOverlay #mpStatsBody>.mps-grid{flex:0 0 auto}
 #mpLobbyOverlay .mps-list{overflow-y:auto;flex:1 1 auto;min-height:95px;overscroll-behavior:contain;scrollbar-width:thin}
 #mpLobbyOverlay .mps-list>.mps-row{flex:0 0 auto}
 #mpLobbyOverlay .mps-note{flex:none}
 body[data-view="multiplayer"]>#ts28Footer{flex:0 0 auto}
}
@media(min-width:1200px) and (min-height:550px){
 body[data-view="multiplayer"]>#mpLobbyOverlay .mp-grid{grid-template-rows:minmax(0,1fr)}
 #mpLobbyOverlay .mp-grid>.name-modal{align-self:start;max-height:100%}
}
@media(max-width:760px){#mpLobbyOverlay .mp-social{padding:12px}#mpLobbyOverlay .mp-grid>.name-modal,#mpLobbyOverlay .mp-stats{padding:12px}#mpLobbyOverlay .mp-grid{gap:10px}}
/* A profile frame extends beyond the photograph. Reserve its whole visual box,
   not just the image width; keep the text in its own non-overlapping column. */
#lbPlayerModalOverlay .profile-header{display:grid!important;grid-template-columns:106px minmax(0,1fr)!important;grid-template-areas:'avatar identity' 'bookmark bookmark' 'xp xp'!important;align-items:center;gap:12px 16px!important;padding:18px!important;text-align:left!important}
#lbPlayerModalOverlay #lbPlayerAvatarLg{grid-area:avatar;grid-row:auto;justify-self:center;align-self:center;width:76px!important;height:76px!important;margin:0!important;flex:none;box-sizing:border-box}
#lbPlayerModalOverlay #lbPlayerAvatarLg[data-ts46-frame]:not([data-ts46-frame=''])::after{inset:-14%!important}
#lbPlayerModalOverlay .ts68-profile-identity{grid-area:identity;display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;max-width:100%;text-align:left;overflow-wrap:anywhere}
#lbPlayerModalOverlay #lbPlayerUsername{margin:0!important;line-height:1.24;font-size:1.35rem;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left!important}
#lbPlayerModalOverlay #lbPlayerUsername .ts46-crest{vertical-align:middle;flex:none;margin-inline-start:5px}
#lbPlayerModalOverlay .ts68-profile-identity :is(#lbPlayerJoinDate,.lb-player-rank-pill,#lbPlayerModeTag,#lbPlayerGuestBadge){margin:0!important;max-width:100%;overflow-wrap:anywhere;text-align:left!important}
#lbPlayerModalOverlay .profile-header .ts30-bookmark{grid-area:bookmark}
#lbPlayerModalOverlay #lbPlayerXpWrap{grid-area:xp;width:100%;max-width:none;box-sizing:border-box}
#lbPlayerModalOverlay .profile-header[data-ts46-banner]:not([data-ts46-banner='']) #lbPlayerJoinDate{color:#f4f7fc!important}
#profileModalOverlay .profile-header{column-gap:18px!important}
#profileModalOverlay #avatarEditWrap{width:106px!important;height:106px!important;display:flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box}
#profileModalOverlay #profileAvatarLg{width:76px!important;height:76px!important;margin:0!important;flex:none}
#profileModalOverlay #profileAvatarLg[data-ts46-frame]:not([data-ts46-frame=''])::after{inset:-14%!important}
#profileModalOverlay #profileUsername{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal}
@media(max-width:450px){
 #lbPlayerModalOverlay .profile-header{grid-template-columns:80px minmax(0,1fr)!important;gap:9px 12px!important;padding:12px!important}
 #lbPlayerModalOverlay #lbPlayerAvatarLg{width:57px!important;height:57px!important}
 #lbPlayerModalOverlay #lbPlayerUsername{font-size:1.14rem}
 #profileModalOverlay #avatarEditWrap{width:82px!important;height:82px!important}
 #profileModalOverlay #profileAvatarLg{width:58px!important;height:58px!important}
 #profileModalOverlay .profile-header{column-gap:12px!important}
}
/* Keep compact lobby controls and a single-row lifetime summary where space allows. */
#mpLobbyOverlay .pg-head{gap:4px 10px}
#mpLobbyOverlay .pg-head .pg-desc{max-width:none;flex-basis:100%;margin:0;font-size:.82rem;line-height:1.4}
#mpLobbyOverlay .mp-stats{container-type:inline-size}
@container (min-width:400px){#mpLobbyOverlay .mps-grid{grid-template-columns:repeat(4,minmax(0,1fr))}#mpLobbyOverlay .mps-stat{padding:8px;gap:3px}}
#mpLobbyOverlay .mps-val{font-size:1.22rem}
#mpLobbyOverlay .mps-sub{margin:12px 0 6px}
#mpLobbyOverlay .mps-note{line-height:1.35}
#mpLobbyOverlay{container-type:inline-size}
@media(min-width:761px) and (min-height:550px){
 body[data-view="multiplayer"]>#mpLobbyOverlay.show{gap:9px}
 body[data-view="multiplayer"]>#mpLobbyOverlay .mp-grid{grid-template-rows:minmax(200px,1.2fr) minmax(0,1fr)}
 #mpLobbyOverlay .mp-grid>.name-modal{padding:12px}
 #mpLobbyOverlay .mp-grid>.name-modal>h2{margin:0 0 5px}
 #mpLobbyOverlay .mp-grid>.name-modal>p{margin:0 0 8px}
 #mpLobbyOverlay .mp-grid>.name-modal>button,#mpLobbyOverlay .mp-grid>.name-modal>input{min-height:35px;padding-block:7px;margin-block:4px!important}
}
@container (min-width:850px){
 #mpLobbyOverlay .mp-grid{grid-template-columns:minmax(205px,.85fr) minmax(280px,1.4fr) minmax(220px,1fr);grid-template-areas:'race record social'}
 @media(min-height:550px){body[data-view="multiplayer"]>#mpLobbyOverlay .mp-grid{grid-template-rows:minmax(0,1fr)}#mpLobbyOverlay .mp-grid>.name-modal{align-self:start;max-height:100%}}
}
@media(min-width:1200px) and (min-height:550px){body[data-view="multiplayer"]>#mpLobbyOverlay .mp-grid{grid-template-rows:minmax(0,1fr)}}
/* The modal body may scroll, but its header and identity must never flex-shrink. */
#lbPlayerModalOverlay .lb-player-card{min-height:0;overflow-y:auto!important;overscroll-behavior:contain}
#lbPlayerModalOverlay .lb-player-card>*{flex-shrink:0!important}
#lbPlayerModalOverlay .profile-header{min-height:max-content!important;flex:0 0 auto!important}
#mpLobbyOverlay .mp-social{container-type:inline-size;overflow-x:hidden}
#mpLobbyOverlay .mp-social :is(.ts66-friend-row,.ts66-friend-identity,.ts66-friend-row .ts66-actions,.ts22-friend-form,.ts22-friend-row){min-width:0;max-width:100%;box-sizing:border-box}
#mpLobbyOverlay .mp-social :is(.ts66-friend-identity,.ts66-friend-row .ts66-actions){flex-wrap:wrap}
#mpLobbyOverlay .mp-social :is(#ts66FriendName,#ts22FriendInput){width:100%;min-width:0;max-width:100%;box-sizing:border-box}
#mpLobbyOverlay .mp-social .ts22-friend-row{flex-wrap:wrap}
@container (max-width:300px){#mpLobbyOverlay .mp-social :is(#ts66FriendForm,.ts22-friend-form){display:grid;grid-template-columns:minmax(0,1fr);gap:6px}#mpLobbyOverlay .mp-social .ts66-actions{justify-content:flex-start}#mpLobbyOverlay .mp-social .ts66-friend-row{padding:8px}}
#lbPlayerModalOverlay .ts68-profile-identity #lbPlayerModeTag{align-self:flex-start;text-align:left!important}
#lbPlayerModalOverlay .profile-header[data-ts46-banner]:not([data-ts46-banner='']) #ts22SavePlayer{color:#fff!important;background:#ffffff12;border-color:#ffffff6b}
#lbPlayerModalOverlay .profile-header[data-ts46-banner]:not([data-ts46-banner='']) #ts22SavePlayer:hover{background:#ffffff26}

/* Session 69: incoming requests, notification visibility and compact statistics. */
#ts28Bell[data-ts66-unread]::after{width:10px;height:10px;top:1px;right:1px;background:#dc2626;box-shadow:0 0 0 2px var(--surface);z-index:2}
#navMultiplayer{position:relative}#navMultiplayer[data-ts69-friend-pending]::after{content:'';position:absolute;top:6px;right:6px;width:9px;height:9px;border-radius:50%;background:#dc2626;box-shadow:0 0 0 2px var(--surface);pointer-events:none}
#ts69FriendPending{display:inline-flex;vertical-align:middle;align-items:center;margin-left:8px;padding:3px 7px;border-radius:999px;background:#fee2e2;color:#991b1b;font-size:.68rem;font-weight:750;line-height:1.2}#ts69FriendPending[hidden]{display:none!important}
.ts66-friend-row.ts69-incoming{border-color:#e87979;background:color-mix(in srgb,#ef4444 7%,var(--surface))}
#tsToastContainer .ts69-friend-toast{pointer-events:auto;display:flex;align-items:center;gap:10px;max-width:min(390px,100%);padding:12px 14px;border:1px solid #e87979;border-left:4px solid #dc2626;background:var(--surface);color:var(--text);box-shadow:0 6px 24px #0002;font-weight:650;line-height:1.4}
#tsToastContainer .ts69-friend-toast .ts-toast-icon{color:#dc2626;font-size:1.2rem}#tsToastContainer .ts69-friend-toast>span{flex:1;min-width:0}#tsToastContainer .ts69-toast-view{pointer-events:auto;flex:none;font:inherit;font-size:.78rem;padding:7px 10px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--surface);cursor:pointer}#tsToastContainer .ts69-toast-view:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#profileActivityNote[hidden]{display:none!important}.ts27-community-foot{justify-content:flex-end}
.ts27-community-grid article.ts69-time-card{container-type:inline-size}#communityTime{display:block;white-space:nowrap;overflow-wrap:normal;font-size:clamp(.76rem,calc(140cqi / var(--ts69-time-chars,12)),2.4rem);letter-spacing:-.025em;line-height:1.15;transition:none!important}

/* Session 70: give race selection a stronger visual hierarchy. */
#mpLobbyOverlay .mp-grid>.ts70-race-choice{width:100%;padding:clamp(15px,1.6vw,23px);border:1px solid color-mix(in srgb,var(--accent) 36%,var(--border));border-radius:16px;background:linear-gradient(155deg,color-mix(in srgb,var(--accent) 7%,var(--surface)),var(--surface) 66%);box-shadow:0 8px 28px #0000000c;text-align:left;align-self:start}
#mpLobbyOverlay .ts70-race-choice .name-modal-icon{margin:0 0 10px;width:40px;height:40px;border-radius:12px;background:color-mix(in srgb,var(--accent) 13%,var(--surface));color:var(--accent);display:grid;place-items:center}
#mpLobbyOverlay .ts70-race-choice>h2{font-size:clamp(1.12rem,1.5vw,1.32rem);letter-spacing:-.025em;line-height:1.25;margin-bottom:5px}
#mpLobbyOverlay .ts70-race-choice>#mpLobbySubtitle{color:var(--sub);margin-bottom:12px}
#mpLobbyOverlay .ts70-race-choice>#mpQueueBtn{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:59px!important;padding:11px 13px!important;text-align:left;border-radius:11px;background:var(--accent);color:var(--surface);border:1px solid var(--accent);box-shadow:0 3px 10px color-mix(in srgb,var(--accent) 18%,transparent);transition:background-color .16s,filter .16s,box-shadow .16s}
#mpLobbyOverlay .ts70-race-choice>#mpQueueBtn:hover{filter:brightness(.94);box-shadow:0 4px 14px color-mix(in srgb,var(--accent) 27%,transparent)}
#mpLobbyOverlay .ts70-race-choice>#mpQueueBtn>span{flex:1;min-width:0;display:grid;gap:3px}
#mpLobbyOverlay .ts70-race-choice>#mpQueueBtn strong{font-size:.94rem;line-height:1.25}
#mpLobbyOverlay .ts70-race-choice>#mpQueueBtn small{font-size:.69rem;font-weight:500;line-height:1.3;opacity:.88}
#mpLobbyOverlay .ts70-race-choice>#mpQueueBtn:disabled{opacity:.68;cursor:wait}
#mpLobbyOverlay .ts70-race-choice>:is(#mpCreateRoomBtn,#mpJoinRoomBtn,#mpJoinCodeInput,#mpLobbyCloseBtn){width:100%;box-sizing:border-box;min-height:39px;border-radius:9px}
#mpLobbyOverlay .ts70-race-choice>#mpLobbyCloseBtn{background:transparent;box-shadow:none;color:var(--sub);font-weight:600}
@container(min-width:850px){#mpLobbyOverlay .mp-grid{grid-template-columns:minmax(240px,1.07fr) minmax(280px,1.30fr) minmax(210px,.96fr)}}
@media(min-width:761px) and (max-height:650px){#mpLobbyOverlay .mp-grid>.ts70-race-choice{padding:13px}#mpLobbyOverlay .ts70-race-choice .name-modal-icon{width:32px;height:32px;margin-bottom:7px}#mpLobbyOverlay .ts70-race-choice>:is(#mpCreateRoomBtn,#mpJoinRoomBtn,#mpJoinCodeInput,#mpLobbyCloseBtn){min-height:35px}}
/* Hide only the multiplayer header's live counter; online friend presence still works. */
body[data-view="multiplayer"] #ts34Active{display:none!important}
/* Native modal: no guest queueing until the player explicitly confirms a name. */
#ts70GuestNameDialog{position:fixed;inset:0;margin:auto;width:min(410px,calc(100% - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid var(--border);border-radius:17px;background:var(--surface);color:var(--text);box-shadow:0 16px 60px #0004;font-family:var(--sans,inherit);box-sizing:border-box}
#ts70GuestNameDialog::backdrop{background:#0b152780;backdrop-filter:blur(3px)}
#ts70GuestNameDialog[open]{animation:ts70ModalIn .18s ease-out both}
@keyframes ts70ModalIn{from{opacity:0;transform:translateY(7px) scale(.99)}to{opacity:1;transform:none}}
#ts70GuestForm{display:grid;gap:10px}#ts70GuestTitle{font-size:1.35rem;line-height:1.25;margin:0}#ts70GuestHelp{font-size:.85rem;line-height:1.5;color:var(--sub);margin:0 0 5px}#ts70GuestForm label{font-size:.82rem;font-weight:700}#ts70GuestName{font:inherit;min-height:44px;width:100%;box-sizing:border-box;color:var(--text);background:var(--surface2);border:1px solid var(--border);border-radius:9px;padding:10px 12px;outline:none}#ts70GuestName:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.ts70-guest-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:color-mix(in srgb,var(--accent) 13%,var(--surface));color:var(--accent)}.ts70-guest-hint{font-size:.74rem;color:var(--sub);line-height:1.4}#ts70GuestError{color:var(--wrong,#b91c1c);font-size:.8rem;margin:0}#ts70GuestError[hidden]{display:none!important}.ts70-guest-actions{display:grid;grid-template-columns:.8fr 1.2fr;gap:8px;margin-top:8px}.ts70-guest-actions>button{min-height:42px;border:1px solid var(--border);border-radius:9px;padding:8px;font:inherit;font-weight:700;font-size:.85rem;background:var(--surface2);color:var(--text);cursor:pointer;transition:background-color .16s,box-shadow .16s}.ts70-guest-actions>#ts70GuestContinue{background:#2563eb;color:#fff;border-color:#1d4ed8}.ts70-guest-actions>#ts70GuestContinue:hover{background:#1d4ed8}.ts70-guest-actions>button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* A visible toast should never depend on the hidden typing toolbar. */
body #tsToastContainer{visibility:visible!important;opacity:1!important;display:flex!important;z-index:10020!important;isolation:isolate;pointer-events:none;max-width:min(400px,calc(100vw - 24px));right:12px}
body.ts27-main-active #tsToastContainer,body.ts25-immersive #tsToastContainer,body.mp-racing #tsToastContainer{top:max(12px,env(safe-area-inset-top,0px))!important;bottom:auto!important;right:max(12px,env(safe-area-inset-right,0px))!important}
#tsToastContainer .ts69-friend-toast{background:var(--surface);color:var(--text);padding:13px 14px;min-height:52px;font-size:.85rem;box-shadow:0 8px 30px #0003;border-left-width:4px}
#ts28NoticePanel.ts70-detached{position:fixed!important;top:max(16px,env(safe-area-inset-top,0px))!important;right:12px!important;width:min(380px,calc(100vw - 24px));max-height:min(70dvh,480px);z-index:10030!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important}
@media(prefers-reduced-motion:reduce){#ts70GuestNameDialog[open]{animation:none}.ts70-guest-actions>button,#mpLobbyOverlay .ts70-race-choice>#mpQueueBtn{transition:none}}
