/* V4 — Race Control. An opt-in, photographic timing-desk interface. */
.v4-masthead,.v4-navigation{display:none}
html.ui-v4{--v4-ink:#111312;--v4-deep:#0d0f0e;--v4-surface:#191c1a;--v4-surface-2:#202421;--v4-line:#363d38;--v4-rule:#697069;--v4-paper:#e7e5df;--v4-muted:#a1aaa1;--v4-amber:#d9a05d;--v4-green:#9cbd9c;--bg:var(--v4-ink);--panel:var(--v4-surface);--panel2:var(--v4-surface-2);--line:var(--v4-line);--text:var(--v4-paper);--muted:var(--v4-muted);--red:var(--v4-amber);--red2:var(--v4-amber);--cuh-blue:var(--v4-amber);--cuh-cyan:var(--v4-amber);--cuh-panel:var(--v4-surface);--cuh-line:var(--v4-line);--font-body:'Inter Tight',Arial,sans-serif;--font-head:'Inter Tight',Arial,sans-serif;--display:'Inter Tight',Arial,sans-serif;background:var(--v4-ink);color:var(--v4-paper);font-family:'Inter Tight',Arial,sans-serif}
html.ui-v4 body{background:var(--v4-ink)!important;color:var(--v4-paper);font-family:'Inter Tight',Arial,sans-serif;overflow-x:hidden}
html.ui-v4 body::before,html.ui-v4 .app-shell::before{display:none!important;content:none!important}
html.ui-v4 .app-shell{display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);min-height:100dvh;background:#151817!important;isolation:auto!important}
html.ui-v4 main{display:contents!important}
html.ui-v4 .sidebar,html.ui-v4 .mobile-menu-button{display:none!important}
html.ui-v4 .topbar{grid-column:1;grid-row:1;position:relative;z-index:3;display:flex!important;align-items:center!important;flex-wrap:wrap!important;justify-content:flex-end!important;gap:13px!important;min-height:70px!important;margin:0!important;padding:0 28px!important;border:0!important;border-bottom:1px solid #343a35!important;background:var(--v4-deep)!important;color:var(--v4-paper)!important;box-shadow:none!important;backdrop-filter:none!important}
html.ui-v4 .v3-top-brand,html.ui-v4 .v3-top-issue{display:none!important}
html.ui-v4 .v4-masthead{order:0;display:flex;align-items:center;gap:12px;flex:1;min-width:190px;min-height:69px}
html.ui-v4 .v4-brandbox{display:grid;place-items:center;min-width:52px;height:31px;padding:0 4px;border:1px solid #bec3bc;color:var(--v4-paper);font:800 22px/1 'Inter Tight',Arial,sans-serif;letter-spacing:-.08em}
html.ui-v4 .v4-masthead strong{display:block;color:var(--v4-paper);font:700 12px/1.15 'Inter Tight',Arial,sans-serif;letter-spacing:.17em;white-space:nowrap}
html.ui-v4 .v4-masthead small{display:block;margin-top:3px;color:#89938a;font:400 9px/1.1 'DM Mono',monospace;letter-spacing:.11em;white-space:nowrap}
html.ui-v4 .top-cloud{order:1;display:flex!important;align-items:center;gap:7px;flex:0 0 auto;margin:0!important;color:#b5bdb3!important;font:500 10px 'DM Mono',monospace!important;letter-spacing:.07em!important;white-space:nowrap}
html.ui-v4 .top-cloud svg{display:none!important}
html.ui-v4 .top-cloud b{order:-1;display:block;width:6px;height:6px;background:var(--v4-green)!important;box-shadow:0 0 8px #9cbd9c70!important}
html.ui-v4 .ui-version-switch{order:2;display:inline-flex;align-items:center;gap:1px;flex:0 0 auto;padding:3px;border:1px solid #454d45;background:transparent;color:#a2aba1;box-shadow:none}
html.ui-v4 .ui-version-switch>span{padding:0 7px;color:#a2aba1;font:500 9px 'DM Mono',monospace;letter-spacing:.08em}
html.ui-v4 .ui-version-switch button{min-width:33px;min-height:28px;padding:4px 7px;color:#a8b0a6;background:none;font:500 10px 'DM Mono',monospace}
html.ui-v4 .ui-version-switch button[aria-pressed="true"]{background:var(--v4-paper);color:var(--v4-ink)}
html.ui-v4 .header-actions{order:3;display:flex!important;align-items:center;justify-content:flex-end;flex:0 0 calc(100% + 56px);width:auto!important;min-height:47px;margin:0 -28px!important;padding:6px 28px!important;gap:8px!important;border-top:1px solid #303630!important;background:#181b19!important}
html.ui-v4 .header-actions select,html.ui-v4 .admin-perspective{height:34px;min-width:130px;max-width:220px;padding:5px 9px;border:1px solid #495249!important;border-radius:0!important;background:#111513!important;color:var(--v4-paper)!important;box-shadow:none!important;font:500 11px 'Inter Tight',Arial,sans-serif}
html.ui-v4 .admin-perspective>span{color:var(--v4-muted);font:500 9px 'DM Mono',monospace;text-transform:uppercase}
html.ui-v4 .v4-navigation{grid-column:1;grid-row:2;display:block;background:#151817;color:var(--v4-paper)}
html.ui-v4 .v4-major-nav{display:flex;align-items:center;gap:25px;min-height:47px;padding:0 28px;border-bottom:1px solid #363d37}
html.ui-v4 .v4-minor-nav{display:flex;align-items:center;gap:24px;min-height:39px;padding:0 28px;border-bottom:1px solid #363d37}
html.ui-v4 .v4-navigation button{width:auto;padding:12px 0;border:0;border-bottom:2px solid transparent;background:transparent;color:#a1aba0;cursor:pointer;white-space:nowrap}
html.ui-v4 .v4-major-nav button{font:500 10px 'DM Mono',monospace;letter-spacing:.1em;text-transform:uppercase}
html.ui-v4 .v4-minor-nav button{padding:10px 0;color:#aab2a9;font:500 12px 'Inter Tight',Arial,sans-serif}
html.ui-v4 .v4-major-nav button.active{border-bottom-color:var(--v4-amber);color:var(--v4-paper)}
html.ui-v4 .v4-minor-nav button.active{color:var(--v4-amber)}
html.ui-v4 .v4-navigation button:focus-visible{outline:2px solid var(--v4-amber);outline-offset:2px}
html.ui-v4 .view.active{grid-column:1;grid-row:3;display:block!important;min-width:0;max-width:1560px;width:100%;margin:0 auto!important;padding:0 30px 62px!important;background:#151817!important;color:var(--v4-paper)!important;overflow:visible!important}
html.ui-v4 .view .eyebrow{margin:0 0 7px;color:var(--v4-amber)!important;font:500 10px 'DM Mono',monospace!important;letter-spacing:.16em!important;text-shadow:none!important}
html.ui-v4 .view :is(h1,h2,h3,h4){color:var(--v4-paper)!important;font-family:'Inter Tight',Arial,sans-serif!important;font-weight:600!important;letter-spacing:-.025em!important;text-shadow:none!important;box-shadow:none!important}
html.ui-v4 .section-intro,html.ui-v4 .overview-hero{position:relative;isolation:isolate;display:flex!important;align-items:center;justify-content:space-between;gap:20px;width:calc(100% + 60px)!important;max-width:none!important;min-height:204px;margin:0 -30px 23px!important;padding:28px 30px!important;border:0!important;border-bottom:1px solid #626a61!important;background:linear-gradient(90deg,rgba(7,10,8,.94) 0%,rgba(7,10,8,.72) 42%,rgba(7,10,8,.2) 100%),url('v4-night-track.jpg') center 64%/cover no-repeat!important;overflow:hidden}
html.ui-v4 .section-intro:not(.results-page-intro){display:block!important;padding-top:46px!important}
html.ui-v4 .section-intro>div,html.ui-v4 .overview-hero>div:first-child{position:relative;z-index:1;min-width:0}
html.ui-v4 .section-intro h2,html.ui-v4 .overview-hero h1{max-width:840px;margin:0 0 9px!important;color:var(--v4-paper)!important;font:700 clamp(2.7rem,5vw,4.6rem)/.98 'Inter Tight',Arial,sans-serif!important;letter-spacing:-.055em!important;text-transform:uppercase;overflow-wrap:anywhere}
html.ui-v4 .section-intro p:last-child{max-width:540px;margin:0;color:#d0d3cb!important;font:400 14px/1.5 'Inter Tight',Arial,sans-serif!important;letter-spacing:0!important}
html.ui-v4 .section-intro.results-page-intro{align-items:center!important}
html.ui-v4 .section-intro.results-page-intro>.ghost{align-self:flex-end;position:relative;z-index:1;flex:none}
html.ui-v4 .overview-hero{min-height:288px;margin-bottom:0!important}
html.ui-v4 .overview-hero>div:first-child{padding:0!important;background:transparent!important}
html.ui-v4 .overview-hero h1{font-size:clamp(3.1rem,5.5vw,5rem)!important}
html.ui-v4 .overview-hero>p,html.ui-v4 .overview-hero>div>span,html.ui-v4 .v2-race-wire,html.ui-v4 .v2-feature,html.ui-v4 .v2-editorial,html.ui-v4 .v3-overview-editorial{display:none!important}
html.ui-v4 .library-count{display:inline-grid;place-items:center;min-width:27px;height:27px;vertical-align:middle;margin-left:8px;padding:0 5px;border:1px solid #8b9389;border-radius:0;background:#1d221e;color:var(--v4-paper)!important;font:500 12px 'DM Mono',monospace}
html.ui-v4 .view :is(.panel,.entity-card,.battle-card,.metric,.event-card,.account-row,.crew-social-card,.time-trial-row,.profile-history-event,.specialist-card,.live-racer-card){border-radius:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html.ui-v4 .view :is(.panel,.entity-card,.battle-card,.metric,.event-card,.account-row,.crew-social-card,.time-trial-row,.profile-history-event,.specialist-card){background:var(--v4-surface)!important;color:var(--v4-paper)!important;border-color:var(--v4-line)!important}
html.ui-v4 .view :is(.panel,.entity-card,.battle-card,.metric,.event-card,.account-row,.crew-social-card,.time-trial-row,.profile-history-event,.specialist-card) :is(h2,h3,h4,strong,b,span,td,dd,legend){color:var(--v4-paper)!important;text-shadow:none!important}
html.ui-v4 .view :is(.panel,.entity-card,.battle-card,.metric,.event-card,.account-row,.crew-social-card,.time-trial-row,.profile-history-event,.specialist-card) :is(small,p,dt){color:var(--v4-muted)!important}
html.ui-v4 .view .panel{padding:20px!important;border:1px solid var(--v4-line)!important}
html.ui-v4 .view .panel-head{align-items:end;padding-bottom:13px;margin-bottom:12px;border-bottom:1px solid #697069}
html.ui-v4 .view .panel-head h2,html.ui-v4 .view .panel h3{font:600 1.4rem 'Inter Tight',Arial,sans-serif!important;letter-spacing:-.025em!important;text-transform:uppercase}
html.ui-v4 input,html.ui-v4 select,html.ui-v4 textarea{min-width:0;border:1px solid #4b544a!important;border-radius:0!important;background:#111513!important;color:var(--v4-paper)!important;box-shadow:none!important;font-family:'Inter Tight',Arial,sans-serif}
html.ui-v4 input::placeholder,html.ui-v4 textarea::placeholder{color:#808c80}
html.ui-v4 :is(input,select,textarea):focus{border-color:var(--v4-amber)!important;outline:2px solid #d9a05d44;outline-offset:0}
html.ui-v4 select option{background:#111513;color:var(--v4-paper)}
html.ui-v4 :is(.primary,.ghost,.danger,.edit-button,.crew-roster-toggle){border:1px solid #697269!important;border-radius:0!important;background:#262b26!important;color:var(--v4-paper)!important;box-shadow:none!important;transform:none!important;text-transform:uppercase;font:500 10px 'DM Mono',monospace!important;letter-spacing:.03em!important;white-space:nowrap}
html.ui-v4 .primary{border-color:var(--v4-amber)!important;background:var(--v4-amber)!important;color:#151817!important}
html.ui-v4 .primary:hover{filter:brightness(1.08)}
html.ui-v4 .danger{border-color:#b46b61!important;background:#824139!important;color:white!important}
html.ui-v4 .view .empty{border:1px dashed #596158!important;background:#1b211c!important;color:#a4aca1!important}
html.ui-v4 .view .tag{padding:3px 7px;border:1px solid #6a786b!important;border-radius:0!important;background:#232c25!important;color:#d5dfd1!important;font:500 10px 'DM Mono',monospace!important}
html.ui-v4 .view label,html.ui-v4 .view legend,html.ui-v4 .view .field-label{color:#aab3a8!important;font:500 11px 'Inter Tight',Arial,sans-serif!important;letter-spacing:.06em;text-transform:uppercase}
html.ui-v4 .view .form-help{color:var(--v4-muted)!important}
html.ui-v4 .view table{border-collapse:collapse}
html.ui-v4 .view table th{padding:11px 8px;border-color:#626a61!important;color:#9da89b!important;font:500 10px 'DM Mono',monospace!important;letter-spacing:.08em;text-transform:uppercase}
html.ui-v4 .view table td{padding:13px 8px;border-color:#343d34!important;color:var(--v4-paper)!important;font-size:13px}
html.ui-v4 .view table tr:nth-child(even){background:#1c211d}
html.ui-v4 .view .rank,html.ui-v4 .view .position-one{color:var(--v4-amber)!important;font-family:'DM Mono',monospace!important}
html.ui-v4 .view .icon-button{color:#9ca69c!important}
html.ui-v4 .view .choice span{border-color:#4c564a!important;border-radius:0!important;background:#252c26!important;color:var(--v4-paper)!important;box-shadow:none!important}
html.ui-v4 .view .choice input:checked+span{border-color:var(--v4-amber)!important;background:var(--v4-amber)!important;color:#101411!important}

/* Overview is a timing strip and two editorial result columns, not a tile dashboard. */
html.ui-v4 #overview.active{display:grid!important;grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr);grid-template-areas:'hero hero' 'metrics metrics' 'activity specialists' 'gauntlet gauntlet';gap:0 28px;align-items:start}
html.ui-v4 #overview .overview-hero{grid-area:hero}
html.ui-v4 #overview .metric-grid{grid-area:metrics;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:0!important;width:calc(100% + 60px);margin:0 -30px 25px!important;border-bottom:1px solid #596059;background:var(--v4-surface-2)}
html.ui-v4 #overview .metric{display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;min-height:104px!important;margin:0!important;padding:16px 23px!important;border:0!important;border-right:1px solid #454d45!important;background:var(--v4-surface-2)!important;text-align:left!important}
html.ui-v4 #overview .metric:last-child{border-right:0!important}
html.ui-v4 #overview .metric::before,html.ui-v4 #overview .metric-icon{display:none!important}
html.ui-v4 #overview .metric>div{display:grid!important;justify-items:start!important;gap:4px}
html.ui-v4 #overview .metric div>span{color:#9ba59b!important;font:500 10px 'DM Mono',monospace!important;letter-spacing:.08em}
html.ui-v4 #overview .metric strong,html.ui-v4 #overview .metric strong.compact{margin:0!important;color:var(--v4-paper)!important;font:600 clamp(1.35rem,2.5vw,2.15rem)/1 'Inter Tight',Arial,sans-serif!important;letter-spacing:-.04em!important;overflow-wrap:anywhere}
html.ui-v4 #overview .metric small{display:block;color:#a0aaa0!important;font-size:11px!important;line-height:1.25}
html.ui-v4 #overview .dashboard-grid{display:contents!important}
html.ui-v4 #overview .activity-panel{grid-area:activity}
html.ui-v4 #overview .specialists-panel{grid-area:specialists}
html.ui-v4 #overview .leaderboard-panel{grid-area:gauntlet;margin-top:28px}
html.ui-v4 #overview :is(.activity-panel,.specialists-panel,.leaderboard-panel){padding:0!important;border:0!important;background:transparent!important}
html.ui-v4 #overview :is(.activity-panel,.specialists-panel,.leaderboard-panel) .panel-head h2{font-size:1.5rem!important}
html.ui-v4 #overview .activity{min-height:65px;padding:12px 0;border-bottom:1px solid #343d35;color:var(--v4-paper)}
html.ui-v4 #overview .activity :is(strong,time){color:var(--v4-paper)!important}
html.ui-v4 #overview .activity p{color:var(--v4-muted)!important}
html.ui-v4 #overview .activity .place{display:none!important}
html.ui-v4 #overview .activity-list{border-top:0}
html.ui-v4 #overview .live-feed{color:var(--v4-muted);font:500 10px 'DM Mono',monospace}
html.ui-v4 #overview .specialists-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:0 16px!important}
html.ui-v4 #overview .specialist-card{min-height:90px;padding:15px 0!important;border:0!important;border-bottom:1px solid #343d35!important;background:transparent!important}
html.ui-v4 #overview .specialist-card svg{width:25px;height:25px;stroke:var(--v4-amber);filter:none}
html.ui-v4 #overview .specialist-card strong{font:600 1.28rem 'Inter Tight',Arial,sans-serif!important;letter-spacing:-.02em}

/* Index and administration pages use a ledger at left and a working desk at right. */
html.ui-v4 :is(.racer-search-bar,.crew-search-bar,.garage-search-bar,.admin-roster-filter-bar){margin:0 0 16px!important;padding:13px 16px!important;border:0!important;border-bottom:1px solid #6d766b!important;border-radius:0!important;background:#202620!important;color:var(--v4-paper)!important;box-shadow:none!important}
html.ui-v4 :is(.racer-search-bar,.crew-search-bar,.garage-search-bar,.admin-roster-filter-bar) :is(span,strong,label){color:var(--v4-paper)!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#events) .split{display:grid!important;grid-template-columns:minmax(0,1.75fr) minmax(275px,.65fr)!important;gap:25px!important;align-items:start}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#events) .split>.entity-grid,html.ui-v4 #events .split>.event-list{grid-column:1;grid-row:1;min-width:0}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#events) .split>form{grid-column:2;grid-row:1;min-width:0;margin:0!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#events).permission-readonly .split{grid-template-columns:1fr!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#events).permission-readonly .split>.entity-grid,html.ui-v4 #events.permission-readonly .split>.event-list{grid-column:1/-1;grid-row:auto}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#crews) .entity-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:0!important;background:transparent!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#crews) .entity-card{min-height:110px!important;margin:0!important;padding:17px 6px!important;border:0!important;border-bottom:1px solid #3b443b!important;background:transparent!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#crews) .entity-card:first-child{border-top:1px solid #6b746a!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#crews) .entity-card .card-top strong{font:600 1.3rem 'Inter Tight',Arial,sans-serif!important;letter-spacing:-.02em!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#crews) .entity-card .card-top small{color:var(--v4-muted)!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#crews) .entity-card .entity-stats{display:flex;flex-wrap:wrap;gap:18px;margin-top:9px;padding-top:0}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#crews) .entity-card .entity-stats span{font:600 1.1rem 'Inter Tight',Arial,sans-serif!important}
html.ui-v4 :is(#racers,#tracks,#cars,#points,#crews) .entity-card .entity-stats small{color:var(--v4-muted)!important;font:400 9px 'DM Mono',monospace!important;letter-spacing:.06em;text-transform:uppercase}
html.ui-v4 #crews .crew-library-layout{display:block!important}
html.ui-v4 #crews .crew-library-layout>form{display:none!important}
html.ui-v4 #crews #crew-list{grid-template-columns:1fr!important}
html.ui-v4 #crews #crew-list>.crew-card{min-height:128px!important}
html.ui-v4 #events .event-list{display:grid!important;grid-template-columns:1fr!important;gap:0!important}
html.ui-v4 #events .event-card{margin:0!important;border:0!important;border-bottom:1px solid #3b443b!important;background:transparent!important}

/* Competition keeps the complete real forms and records, but treats them as a working timing desk. */
html.ui-v4 #race.active{display:grid!important;grid-template-columns:minmax(290px,.55fr) minmax(0,1.45fr);grid-template-areas:'intro intro' 'form history';gap:0 24px;align-items:start}
html.ui-v4 #race>.section-intro{grid-area:intro}
html.ui-v4 #race>#race-form{grid-area:form;min-width:0;margin:0}
html.ui-v4 #race .time-trial-history{grid-area:history;display:grid!important;grid-template-columns:1fr!important;gap:0!important;min-width:0;margin-top:0!important}
html.ui-v4 #race .time-trial-row{min-width:0;margin:0!important;padding:15px 5px!important;border:0!important;border-bottom:1px solid #3b443b!important;background:transparent!important}
html.ui-v4 #race .time-trial-row:first-child{border-top:1px solid #6b746a!important}
html.ui-v4 #race .time-trial-filter-head{padding-bottom:12px;border-bottom:1px solid #6b746a}
html.ui-v4 #race .time-trial-filter-head label{min-width:180px}
html.ui-v4 #race .time-trial-row :is(.time-trial-times,.time-trial-date) b{font:500 1rem 'DM Mono',monospace!important;white-space:nowrap}
html.ui-v4 :is(#gauntlet,#battles) .battle-layout{display:grid!important;grid-template-columns:1fr!important;gap:18px!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-form{margin:0!important;background:var(--v4-surface)!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-form .form-title-row{border-bottom:1px solid var(--v4-line)}
html.ui-v4 :is(#gauntlet,#battles) .battle-format-badge{border:1px solid var(--v4-amber)!important;background:var(--v4-amber)!important;color:#151817!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-list{display:grid!important;grid-template-columns:1fr!important;gap:18px!important;margin:0!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-card{margin:0!important;border:1px solid #515a50!important;background:var(--v4-surface)!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-card-head{background:var(--v4-surface)!important;color:var(--v4-paper)!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-card-head h3{font:600 1.55rem 'Inter Tight',Arial,sans-serif!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-score{font-family:'DM Mono',monospace!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-card :is(.battle-score strong,.round-winner,.round-score){color:var(--v4-amber)!important}
html.ui-v4 :is(#gauntlet,#battles) .battle-card :is(.battle-detail,.round-history,.round-card,.battle-bans-editor,.battle-rules){border-color:var(--v4-line)!important;background:#161c17!important;color:var(--v4-paper)!important}
html.ui-v4 #battles .battle-crew-filter{margin:0 0 18px!important;border:0!important;border-bottom:1px solid #667065!important;background:#202620!important}
html.ui-v4 #battles .lineup-grid fieldset{border-color:var(--v4-line)!important;background:#151a16!important;color:var(--v4-paper)!important}
html.ui-v4 #battles .driver-picker label{color:var(--v4-paper)!important}
html.ui-v4 #battles .driver-picker .choice{border-color:var(--v4-line)!important;background:#202620!important;color:var(--v4-paper)!important}

/* Personal and crew identity pages stay photographic, with an archival record below. */
html.ui-v4 :is(#my-profile,#racer-profile)>.profile-page-title{margin-bottom:0!important}
html.ui-v4 :is(.my-profile-hero,.crew-profile-hero){margin:0!important;border:1px solid var(--v4-line)!important;background:var(--v4-surface)!important;box-shadow:none!important;backdrop-filter:none!important}
html.ui-v4 :is(.my-profile-banner,.crew-profile-cover){height:170px!important;border:0!important;background-position:center!important;filter:saturate(.7)}
html.ui-v4 .my-profile-banner[style*="cuh-dashboard-bg.png"],html.ui-v4 .crew-profile-cover:not([style]){background-image:linear-gradient(90deg,rgba(7,10,8,.74),rgba(7,10,8,.08),rgba(7,10,8,.55)),url('v4-night-track.jpg')!important;background-size:cover!important;filter:none!important}
html.ui-v4 .profile-favorite-cars svg{stroke:var(--v4-amber)!important;filter:none!important}
html.ui-v4 .profile-favorite-cars article>span,html.ui-v4 .profile-crew-tag{color:var(--v4-amber)!important}
html.ui-v4 :is(.my-profile-main,.crew-profile-main){background:#1a201b!important;color:var(--v4-paper)!important}
html.ui-v4 :is(.my-profile-main,.crew-profile-main)>img{border:1px solid #8c958a!important;border-radius:0!important;background:#111513!important;box-shadow:none!important;transform:none!important}
html.ui-v4 :is(.my-profile-identity,.crew-profile-identity) h2{color:var(--v4-paper)!important;font:600 clamp(2.2rem,4vw,4rem)/1 'Inter Tight',Arial,sans-serif!important;letter-spacing:-.045em!important;text-shadow:none!important}
html.ui-v4 :is(.my-profile-identity,.crew-profile-identity) :is(p,small,span){color:#bec6ba!important}
html.ui-v4 :is(.my-profile-stats,.crew-profile-stats){border:0!important;border-top:1px solid var(--v4-line)!important;background:#202520!important;color:var(--v4-paper)!important}
html.ui-v4 :is(.my-profile-stats,.crew-profile-stats) span{border-color:#454d44!important}
html.ui-v4 :is(.my-profile-stats,.crew-profile-stats) strong{color:var(--v4-paper)!important;font:600 1.9rem 'Inter Tight',Arial,sans-serif!important;letter-spacing:-.04em}
html.ui-v4 :is(.my-profile-stats,.crew-profile-stats) small{color:#aab5a8!important;font:400 9px 'DM Mono',monospace!important;letter-spacing:.08em}
html.ui-v4 :is(.my-profile-grid,.crew-profile-grid){gap:16px!important;margin-top:18px!important}
html.ui-v4 :is(.my-profile-side,.my-profile-primary,.crew-profile-column){gap:16px!important}
html.ui-v4 :is(.my-profile-grid,.crew-profile-grid) :is(.panel,.crew-social-card){margin:0!important}
html.ui-v4 :is(.profile-favorite-cars article,.profile-history-event,.profile-roster-row,.crew-record-grid>div,.profile-car-picker,.profile-track-picker){border-color:var(--v4-line)!important;background:#202620!important;color:var(--v4-paper)!important}
html.ui-v4 .profile-history-event-head{background:#252c26!important;color:var(--v4-paper)!important}
html.ui-v4 .profile-street-art{display:none!important}
html.ui-v4 .crew-profile{margin-top:18px}
html.ui-v4 .crew-profile-actions .primary{border-color:var(--v4-amber)!important;background:var(--v4-amber)!important;color:#151817!important}

/* Broadcast, account controls and conversation overlays use the same materials. */
html.ui-v4 #live-racers .live-racer-status{color:var(--v4-muted)!important}
html.ui-v4 #live-racers .live-racer-grid{display:grid!important;grid-template-columns:1fr!important;gap:16px!important}
html.ui-v4 #live-racers .live-racer-card{display:grid!important;grid-template-columns:minmax(220px,38%) minmax(0,1fr);min-height:220px;border:1px solid var(--v4-line)!important;background:var(--v4-surface)!important;color:var(--v4-paper)!important}
html.ui-v4 #live-racers .live-racer-thumb{height:100%;min-height:220px;aspect-ratio:auto!important;filter:saturate(.75)}
html.ui-v4 #live-racers .live-racer-info{align-self:center;padding:21px!important}
html.ui-v4 #live-racers .live-racer-info :is(strong,h3,b,span){color:var(--v4-paper)!important}
html.ui-v4 #live-racers .live-racer-info :is(p,small){color:var(--v4-muted)!important}
html.ui-v4 #accounts .account-access-layout{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:18px!important}
html.ui-v4 #accounts :is(.admin-rosters-panel,.audit-panel){margin-top:18px!important}
html.ui-v4 #accounts .account-row{border:0!important;border-bottom:1px solid var(--v4-line)!important;background:var(--v4-surface)!important;color:var(--v4-paper)!important}
html.ui-v4 #accounts .admin-roster-card{border:1px solid var(--v4-line)!important;background:var(--v4-surface)!important;color:var(--v4-paper)!important}
html.ui-v4 #accounts .admin-roster-heading{border-color:var(--v4-line)!important;background:#252c26!important}
html.ui-v4 #accounts .admin-roster-members,html.ui-v4 #accounts .admin-roster-add{background:var(--v4-surface)!important;color:var(--v4-paper)!important}
html.ui-v4 #points .points-strip span{border-top:2px solid var(--v4-amber)!important;background:#252c26!important}
html.ui-v4 .race-footer{position:relative!important;z-index:1!important;left:0!important;right:0!important;bottom:auto!important;display:flex!important;width:auto!important;padding:13px 28px!important;border:0!important;border-top:1px solid #4a5349!important;background:var(--v4-deep)!important;color:#919b90!important;box-shadow:none!important;font:400 10px 'DM Mono',monospace!important;letter-spacing:.1em}
html.ui-v4 .race-footer :is(strong,span){color:#919b90!important}
html.ui-v4 .chat-dock{left:auto!important;right:14px;bottom:14px;z-index:80;justify-items:end}
html.ui-v4 .chat-launchers button{min-width:120px;height:38px;padding:0 12px;border:1px solid #636e61!important;background:#171d18!important;color:var(--v4-paper)!important;box-shadow:none!important;font:500 10px 'DM Mono',monospace!important}
html.ui-v4 .chat-launchers button.active{border-color:var(--v4-amber)!important}
html.ui-v4 .chat-launchers button svg{color:var(--v4-amber)}
html.ui-v4 .chat-launchers button b{background:var(--v4-amber)!important;box-shadow:none!important}
html.ui-v4 .chat-popover{width:min(440px,calc(100vw - 30px));border:1px solid #697269!important;background:#1a201b!important;color:var(--v4-paper)!important;box-shadow:0 18px 55px #0008!important}
html.ui-v4 .social-head{border-bottom:1px solid #596258!important;background:#121713!important;color:var(--v4-paper)!important}
html.ui-v4 .social-head :is(strong,small){color:var(--v4-paper)!important}
html.ui-v4 .social-messages{background:#1a201b!important;color:var(--v4-paper)!important}
html.ui-v4 .social-message{border-color:#566053!important;background:#252d26!important;color:var(--v4-paper)!important;box-shadow:none!important}
html.ui-v4 .social-row.own .social-message{border-color:#876b49!important;background:#373025!important;color:var(--v4-paper)!important}
html.ui-v4 .social-message :is(strong,span,p){color:var(--v4-paper)!important}
html.ui-v4 .social-compose{border-color:#596258!important;background:#121713!important}
html.ui-v4 .social-compose textarea{background:#1b211c!important;color:var(--v4-paper)!important}
html.ui-v4 .crew-announcement{border-color:#596258!important;background:#252c26!important;color:var(--v4-paper)!important}
html.ui-v4 dialog:not(.live-stream-overlay),html.ui-v4 .leaderboard-dialog,html.ui-v4 #announcement-dialog,html.ui-v4 #confirm-dialog{border:1px solid #929b8d!important;border-radius:0!important;background:#1a211b!important;color:var(--v4-paper)!important;box-shadow:0 25px 75px #000a!important}
html.ui-v4 dialog :is(h3,strong,p,label,span){color:var(--v4-paper)!important}
html.ui-v4 .live-stream-overlay{background:#090d0acb!important}
html.ui-v4 .live-stream-dialog{border:1px solid #929b8d!important;background:#1a211b!important;color:var(--v4-paper)!important}
html.ui-v4 .live-stream-head{background:#111713!important;color:var(--v4-paper)!important}
html.ui-v4 .live-stream-head :is(h3,p){color:var(--v4-paper)!important}
html.ui-v4 #toast{border-left-color:var(--v4-amber);background:#242b24;color:var(--v4-paper)}
html.ui-v4.crew-design-active .view :is(.panel,.entity-card,.battle-card,.crew-profile-hero,.crew-social-card){border-color:var(--crew-primary)!important}

@media(max-width:1050px){
  html.ui-v4 .top-cloud{display:none!important}
  html.ui-v4 #overview .metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html.ui-v4 #overview .metric:nth-child(3){border-right:0!important}
  html.ui-v4 #overview .metric:nth-child(-n+3){border-bottom:1px solid #454d45!important}
  html.ui-v4 :is(#racers,#tracks,#cars,#points,#events) .split{grid-template-columns:minmax(0,1fr)!important}
  html.ui-v4 :is(#racers,#tracks,#cars,#points,#events) .split>.entity-grid,html.ui-v4 #events .split>.event-list{grid-column:1;grid-row:2}
  html.ui-v4 :is(#racers,#tracks,#cars,#points,#events) .split>form{grid-column:1;grid-row:1}
  html.ui-v4 #race.active{grid-template-columns:1fr;grid-template-areas:'intro' 'form' 'history'}
  html.ui-v4 #race .time-trial-history{margin-top:18px!important}
  html.ui-v4 #accounts .account-access-layout{grid-template-columns:1fr!important}
}
@media(max-width:750px){
  html.ui-v4 .app-shell{grid-template-rows:auto auto minmax(0,1fr);min-height:100dvh}
  html.ui-v4 .topbar{padding:0 14px!important;gap:7px!important}
  html.ui-v4 .v4-masthead{min-width:0;min-height:58px}
  html.ui-v4 .v4-brandbox{min-width:45px;height:29px;font-size:19px}
  html.ui-v4 .v4-masthead strong{font-size:10px}
  html.ui-v4 .v4-masthead small{font-size:8px}
  html.ui-v4 .ui-version-switch{margin-left:auto}
  html.ui-v4 .ui-version-switch>span{display:none}
  html.ui-v4 .ui-version-switch button{min-width:29px;padding:3px 5px}
  html.ui-v4 .header-actions{flex-basis:calc(100% + 28px);margin:0 -14px!important;padding:5px 14px!important;min-height:42px}
  html.ui-v4 .header-actions #crew-filter{display:block!important;min-width:0;max-width:160px}
  html.ui-v4 .header-actions #crew-filter.view-hidden{display:none!important}
  html.ui-v4 .header-actions #app-scale{display:none!important}
  html.ui-v4 .header-actions .admin-perspective{max-width:100%;min-width:0;height:auto;display:flex!important;align-items:center;flex:1 1 190px}
  html.ui-v4 .header-actions .admin-perspective[hidden]{display:none!important}
  html.ui-v4 .header-actions .admin-perspective select:not([hidden]){display:block!important;min-width:0!important;flex:1}
  html.ui-v4 .header-actions .admin-perspective select[hidden]{display:none!important}
  html.ui-v4 .v4-major-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px;min-height:0;padding:0 14px}
  html.ui-v4 .v4-major-nav button{padding:11px 0 9px;text-align:left;font-size:9px}
  html.ui-v4 .v4-minor-nav{flex-wrap:wrap;gap:0 17px;padding:0 14px}
  html.ui-v4 .v4-minor-nav button{padding:10px 0;font-size:12px}
  html.ui-v4 .view.active{padding:0 14px 76px!important}
  html.ui-v4 .section-intro,html.ui-v4 .overview-hero{width:calc(100% + 28px)!important;margin-inline:-14px!important;padding:22px 14px!important}
  html.ui-v4 .section-intro{min-height:190px}
  html.ui-v4 .section-intro h2,html.ui-v4 .overview-hero h1{font-size:clamp(2.2rem,10vw,3.9rem)!important}
  html.ui-v4 #overview.active{grid-template-columns:1fr;grid-template-areas:'hero' 'metrics' 'activity' 'specialists' 'gauntlet';gap:0}
  html.ui-v4 #overview .overview-hero{min-height:260px}
  html.ui-v4 #overview .metric-grid{width:calc(100% + 28px);margin:0 -14px 22px!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.ui-v4 #overview .metric{min-height:88px!important;padding:13px!important;border-bottom:1px solid #454d45!important}
  html.ui-v4 #overview .metric:nth-child(odd){border-right:1px solid #454d45!important}
  html.ui-v4 #overview .metric:nth-child(even){border-right:0!important}
  html.ui-v4 #overview .specialists-panel{margin-top:25px}
  html.ui-v4 #overview .leaderboard-panel{margin-top:25px}
  html.ui-v4 .view .panel-head{align-items:flex-start;flex-direction:column}
  html.ui-v4 :is(.my-profile-grid,.crew-profile-grid){grid-template-columns:1fr!important}
  html.ui-v4 #live-racers .live-racer-card{grid-template-columns:1fr!important}
  html.ui-v4 #live-racers .live-racer-thumb{height:auto;min-height:0;aspect-ratio:16/9!important}
  html.ui-v4 .chat-dock{left:0!important;right:0!important;bottom:0!important;padding:0 8px calc(8px + env(safe-area-inset-bottom));justify-items:stretch}
  html.ui-v4 .chat-popover{width:100%;height:calc(100dvh - 70px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
  html.ui-v4 .race-footer{display:none!important}
}
@media(max-width:500px){
  html.ui-v4 .v4-masthead{flex:1 0 100%;min-height:54px}
  html.ui-v4 .ui-version-switch{margin:0 0 6px}
  html.ui-v4 .header-actions{justify-content:flex-start}
  html.ui-v4 .header-actions .admin-perspective{width:100%}
  html.ui-v4 .section-intro.results-page-intro{align-items:flex-start!important;flex-direction:column}
  html.ui-v4 :is(.my-profile-main,.crew-profile-main){grid-template-columns:76px minmax(0,1fr)!important}
  html.ui-v4 :is(.my-profile-actions,.crew-profile-actions){grid-column:1/-1}
  html.ui-v4 #overview .specialists-grid{grid-template-columns:1fr!important}
  html.ui-v4 #race .form-grid{grid-template-columns:1fr}
}
