/* Dark is the default on every device, including devices with a light OS theme. */
.cube-settings{border:1px solid var(--line);border-radius:10px;padding:12px 16px;margin:0}
.cube-settings legend{font-size:12px;color:var(--ink);padding:0 6px}
.cube-settings-layout{display:grid;grid-template-columns:minmax(0,1fr) 110px;align-items:center;gap:16px}
.cube-settings .field{margin:10px 0}
.settings-cube-preview svg{width:100%;display:block}
.splits-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0}
.splits-heading h2{font-size:20px;font-weight:500;margin:0}
.splits-heading p{font-size:12px;line-height:1.6;margin-bottom:0}
.splits-heading button{flex-shrink:0}
.split-tracking-label{display:flex;gap:10px;align-items:center;margin:20px 0;font-size:12px}
.split-method-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px}
.split-method-card{border:1px solid var(--line);border-radius:12px;background:#19212e;padding:20px;min-width:0}
.split-method-card.selected{border-color:#91a5df;box-shadow:inset 0 0 0 1px #91a5df}
.split-method-card h2{font-size:15px;overflow-wrap:anywhere;font-weight:500;margin:0}
.split-method-card .card-top button{flex-shrink:0}
.split-word-list{padding-left:22px;margin:20px 0;color:var(--muted);font-size:13px;line-height:1.8;overflow-wrap:anywhere}
.split-method-actions{display:flex;justify-content:flex-end;gap:20px}
#split-preset{min-width:0;max-width:75%;text-overflow:ellipsis}
#split-editor-error{color:#efaaaa}
#settings-panel-splits>p a{text-decoration:underline;text-underline-offset:3px}
.settings-tabs{display:flex;border-bottom:1px solid var(--line);margin-bottom:20px}
.scramble-frame{display:block;font-size:11px;line-height:1.4;margin-bottom:4px;letter-spacing:0;text-transform:none}
.settings-tabs [role="tab"]{flex:1;min-height:44px;padding:10px 8px;border-bottom:3px solid transparent;color:var(--muted)}
.settings-tabs [aria-selected="true"]{border-color:#adbeef;color:var(--ink);background:#202d43}
#settings-panel-splits .splits-heading{flex-wrap:wrap}
#settings-panel-splits .split-method-card{padding:16px}
#settings-panel-app h3{font-size:16px;font-weight:500;margin:24px 0 8px}
#settings-panel-app .settings-actions{margin-top:12px;padding-top:0;border-top:0}
@media(max-width:480px){.splits-heading{align-items:flex-start}.splits-heading h2{font-size:18px}.cube-settings-layout{grid-template-columns:minmax(0,1fr) 90px;gap:12px}}
:root{color-scheme:dark;--ink:#d6deeb;--muted:#9caabe;--blue:#a3b4ff;--line:#2b3546;background:#10141c;color:var(--ink)}
body{background:#10141c}
.storage-warning{margin:12px 0;padding:12px 16px;border:1px solid #b98b43;border-radius:8px;background:#30291e;color:#f4d7a2;font-size:13px;line-height:1.5}
.storage-warning p{margin:0 0 8px}
.storage-actions{display:flex;flex-wrap:wrap;gap:8px}
body.focus-mode .storage-warning{position:fixed;top:env(safe-area-inset-top,0px);left:12px;right:12px;z-index:70;max-width:720px;margin:12px auto;box-shadow:0 8px 24px #0006}
.sidebar{background:#131923}
.nav-symbol{display:block}
a.nav{text-decoration:none}
a.lesson-card,a.practice-card-open,a.lesson-case-tile,.lesson-tabs a,.analysis-tabs a,a.text-button{color:inherit;text-decoration:none}
.lesson-tabs a,.analysis-tabs a{display:flex;align-items:center;justify-content:center;text-align:center}
@media(max-width:740px),(orientation:landscape) and (max-height:500px) and (max-width:1100px){.nav-symbol{width:22px;height:22px}}
input,textarea,select{background:#141c29;border-color:#354155;color:var(--ink)}
input::placeholder,textarea::placeholder{color:#8290a5}
.scramble-card,.steps-card,.session-card,.progress-card,.chart-card,.table-card,.stat,.puzzle-picker{background:#19212e;border-color:var(--line)}
.timer-card{background:linear-gradient(125deg,#19212e,#1c2638);border-color:var(--line)}
.clock{color:#dce5f5}
.brand small,.nav-label,.sidebar-note p,.topbar,.eyebrow,.puzzle-picker small,.muted,.card-top p,.page-heading p,.check-label,.timer-toolbar,.timer-hint,.timer-instruction,.touch-instruction,.step-name,.step-controls,.timer-footer,.recent-row small,.progress-stat p,.stat p,.chart-help,.import-note,.method-note,.field,.detail-date,.detail-split,.install-copy{color:#9caabe}
.nav{color:#a5b1c4}
.nav.active{background:#293650;color:#b8c6ff}
.shortcut{border-color:#485878;color:#b8c6ff}
.tiny-cube,.mini-grid,.finger-dots{color:#91a5df}
.avatar{background:#3a332a;color:#d7c3a2}
.breadcrumb strong{color:#bdc8d9}
.icon-button,.profile>button,.text-button,.view-history{color:#a3b4d2}
#update-app,#update-app:hover{color:#8fd6b2}
.icon-button:hover,.small-button:hover{background:#29364b;color:#c1ceff}
.small-button{background:#202a3a;border-color:#3a465a;color:#c9d4e7}
kbd{background:#202b3d;border-color:#465570;color:#b9c6dc}
.timer-footer,.step-controls,.recent-row,.session-metrics>div+div{border-color:var(--line)}
.switch span{background:#3a465b}
.switch span:after{background:#c4cfe1}
.switch input:checked+span{background:#657bd3}
.step:before{background:#354259}
.step-number{background:#19212e;border-color:#4a5870;color:#b1bed2}
.step-time{color:#aab9d2}
.step.current .step-number{background:#2a3a60;border-color:#879ee9;color:#c5d2ff}
.step.done .step-number{background:#657bd3;border-color:#879ee9;color:#f1f5ff}
.step.done .step-time{color:#b1c2ff}
.session-metrics,.session-tip,.detail-scramble,.info-box{background:#202b3d}
.session-metrics span,.progress-stat>span,.stat>span,.recent-index,.session-tip p,.session-tip strong,.round-icon,.pagination,.legend,.bar-row,.empty,.footer{color:#9eacc1}
.round-icon{background:#263247}
.session-tip>span,.recent-row.best .recent-time,.empty strong{color:#b0c1ff}


th{background:#202b3d;color:#afbdd3}
th,td{border-color:var(--line)}
td:first-child,td small{color:#a2b0c6}
.badge{background:#2b3a59;color:#bdcdff}

.bar-track{background:#2b3649}
.bar-fill{background:#8299e6}
svg text{fill:#a7b5cd}
svg line[stroke="#eef1f6"]{stroke:#303d53}
svg circle[data-id]{fill:#8197d8}
svg circle[data-id]:hover{fill:#c0ceff}
svg path[stroke="#bdc9ed"]{stroke:#7288bc}
svg path[stroke="#7489d4"]{stroke:#acbdff}
dialog{background:#19212e;color:var(--ink);border-color:#46546b;box-shadow:0 20px 100px #0008}
dialog::backdrop{background:#06090ebd}
.close{color:#b0bdd1}
.info-box{color:#b3c2df}
.upload-zone{background:#1e2a3f;border-color:#6277a5}
.upload-zone strong,.upload-zone>span{color:#bccbff}
.upload-zone small{color:#acbad2}
.penalty-controls button{background:#202a3a;border-color:#3a465a}
.penalty-controls button.active{background:#30436b;border-color:#98adef;color:#d2deff}
.primary-button{background:#5268c9;color:#f4f6ff}
.primary-button:hover{background:#6076d7}
.danger-button{color:#eca9ad}
.detail-scramble{color:#b7c5dd}
#toast{background:#2b3a53;color:#e5ecf8;border:1px solid #536585}
.timer-card.arming .clock{color:#e2bd82}
.timer-card.armed{background:#182d29}
.timer-card.armed .clock{color:#8fd6b2}
.timer-card.running .clock{color:#b3c5ff}
.timer-card.running .timer-hint{color:#adbeef}

/* Keep the timer and controls first; supporting text is shown only when needed. */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.sidebar nav{margin-top:46px}
.side-bottom{padding-bottom:24px}
.timer-toolbar{min-height:28px;margin:11px 15px 0;justify-content:flex-end}
#timer-pad{padding:16px 12px 30px}
.timer-footer{justify-content:flex-end;padding:9px 18px}
.timer-hint{font-size:12px;margin:0 0 8px}
.touch-instruction{display:none}
.steps-card .card-top h2,.session-card .card-top h2,.chart-card .card-top h2{margin-bottom:0}
.step-controls{justify-content:flex-end}
.count{font:11px var(--mono);color:#9caabe}
.session-card{padding-top:22px}
.progress-content{margin-top:0}
.progress-stat strong{margin-bottom:5px}
.stat strong{margin-bottom:0}
.dialog-heading h2{margin-top:0}
.keyboard-help{display:flex;flex-wrap:wrap;gap:14px;font-size:10px;color:#9caabe;margin:22px 0}
.keyboard-help span{display:flex;align-items:center;gap:6px}
.filter-bar>select{font-size:11px}
@media(max-width:740px){.page,.sidebar nav{touch-action:pan-y pinch-zoom}}
@media(max-width:950px){.sidebar nav{margin-top:42px}}
@media(max-width:740px){
 .sidebar nav{margin-top:0}
 .side-bottom{padding:0}
 #timer-pad{padding:15px 8px 25px}
 .touch-instruction{display:block;margin-top:14px}
 .steps-card{padding:17px 14px}
 .filter-bar>select{font-size:10px;max-width:100%}
 .progress-card{padding-top:17px;padding-bottom:17px}
}

/* Fullscreen changes the surrounding app chrome, never the timer contents. */
.cube-preview{pointer-events:none}
.scramble-line{white-space:normal}
body.focus-mode{overflow:hidden;overscroll-behavior:none}

body.focus-mode main{margin:0;padding:0;max-width:none}
body.focus-mode #timer-card{position:fixed;inset:0;z-index:50;width:100%;height:100%;height:100dvh;margin:0;border:0;border-radius:0;background:#10141c}


body.focus-mode .timer-footer{display:none}
.cube-preview svg{display:block;width:100%;height:auto}
@media(max-width:740px){
 .sidebar{position:fixed;inset:auto 0 0;z-index:20;width:100%;height:calc(68px + env(safe-area-inset-bottom));padding:6px max(12px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));border-top:1px solid var(--line);border-bottom:0;gap:4px;background:#131923}
 .sidebar .brand{display:none}
 .sidebar nav{flex:3;display:flex;gap:4px;align-items:stretch}
 .sidebar .side-bottom{flex:1;display:flex;margin:0;padding:0}
 .sidebar .nav{display:flex;flex:1;flex-direction:column;justify-content:center;align-items:center;gap:6px;min-width:0;min-height:54px;padding:7px 3px;font-size:10px;line-height:1.1;border-radius:9px;text-align:center}
 .sidebar .nav>span:first-child{width:auto;line-height:20px;font-size:23px}
 .sidebar #open-import{display:none}
 main{padding-bottom:calc(90px + env(safe-area-inset-bottom))}
 .scramble{font-size:18px;line-height:1.9;letter-spacing:0;min-height:0;padding:12px 0 18px}
 .scramble-line{display:block;white-space:nowrap}
 #toast{bottom:calc(84px + env(safe-area-inset-bottom))}
}
@media(pointer:coarse){.timer-instruction{display:none}.touch-instruction{display:block}}

@media(max-width:740px){
 .sidebar .nav{font-size:12px}
 h2,.steps-card .card-top h2,.session-card .card-top h2{font-size:16px}
 .muted,.count,.scramble-card .card-top .muted{font-size:12px}
 .check-label{font-size:14px;line-height:1.5;gap:8px}
 .check-label input{width:18px;height:18px;flex-shrink:0}
 .icon-button{min-width:44px;min-height:44px}
 .text-button,.small-button,.view-history{font-size:14px;min-height:44px;padding:10px 12px}
 .touch-instruction,.timer-hint{font-size:14px;line-height:1.5}
 .timer-footer{padding:6px 12px}
 .steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
 .step{display:grid;grid-template-columns:24px 1fr;align-items:center;column-gap:8px;text-align:left}
 .step:before{display:none}
 .step-number{grid-row:span 2;margin:0;font-size:12px}
 .step-name{font-size:13px;min-height:0;line-height:1.4}
 .step-time{grid-column:2;font-size:13px}
 .recent-list{grid-template-columns:1fr}
 .recent-row{padding:14px 2px;gap:12px}
 .recent-index{font-size:12px}
 .recent-time{font-size:20px}
 .recent-row small{font-size:13px}
 .session-metrics span,.progress-stat>span,.stat>span{font-size:12px;line-height:1.5;letter-spacing:.5px}
 .session-metrics strong{font-size:28px}
 .stat strong{font-size:32px}
 .legend,.bar-row{font-size:12px}
 .filter-bar>select,.filter-bar input,.field input,.field select,.field textarea,input,select,textarea{font-size:16px;min-height:44px}
 .primary-button,.danger-button,.penalty-controls button{font-size:16px;min-height:48px}
 .table-card th,.table-card td{font-size:14px;padding:14px}
 .table-card td:nth-child(2){font-size:13px}
 .table-card td small,.badge,.pagination{font-size:12px}
 .field,.detail-date,.detail-split,.install-copy,dialog p{font-size:14px;line-height:1.6}
 .keyboard-help{font-size:12px}
 .empty{font-size:14px}
 #main-chart{overflow-x:auto}
 #main-chart svg{min-width:600px}
 svg text{font-size:20px}
}

@media(min-width:741px){
 .nav{font-size:14px}
 h2,.steps-card .card-top h2,.session-card .card-top h2,.chart-card .card-top h2{font-size:18px}
 .scramble{font-size:20px;line-height:1.8;letter-spacing:.3px}
 .muted,.count{font-size:13px}
 .check-label{font-size:14px;line-height:1.5;gap:8px}
 .check-label input{width:17px;height:17px}
 .text-button,.small-button,.view-history{font-size:14px;min-height:40px;padding:9px 12px}
 .timer-instruction,.touch-instruction{font-size:14px}
 .timer-hint{font-size:20px}
 body.focus-mode .timer-hint{font-size:24px}
 kbd{font-size:12px}
 .steps-card{container-type:inline-size;padding:24px}
 .steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px 18px;margin:26px 0}
 .step{display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:10px;align-content:start;text-align:left}
 .step:before{display:none}
 .step-number{grid-row:span 2;width:30px;height:30px;margin:0;font-size:14px}
 .step-name{font-size:16px;line-height:1.45;min-height:0;overflow-wrap:anywhere;color:#bdc9dc}
 .step-time{grid-column:2;font-size:18px;line-height:1.5;margin-top:5px}
 .step-controls{font-size:14px;padding-top:18px}
 .recent-index{font-size:12px}
 .recent-time{font-size:18px}
 .recent-row small{font-size:12px}
 .session-metrics span,.progress-stat>span,.stat>span{font-size:12px;line-height:1.5;letter-spacing:.5px}
 .session-metrics strong{font-size:22px}
 .stat strong{font-size:34px}
 .legend,.pagination{font-size:13px}
 .bar-row{font-size:15px;grid-template-columns:minmax(115px,1fr) 2fr 65px;gap:14px}
 .bar-row strong{font-size:16px}
 .filter-bar>select,.filter-bar input,.field input,.field select,.field textarea{font-size:16px}
 .table-card th,.table-card td{font-size:14px}
 .table-card td small,.badge{font-size:12px}
 .field,.detail-date,.install-copy,dialog p,.empty{font-size:15px;line-height:1.6}
 .detail-split{font-size:16px;line-height:1.6}
 .detail-scramble{font-size:16px;line-height:1.8}
 .primary-button,.danger-button,.penalty-controls button{font-size:16px;min-height:44px}
 .keyboard-help{font-size:13px}
 svg text{font-size:16px}
 @container(max-width:620px){.steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
}
/* Retain the compact icon rail at tablet widths. */
@media(min-width:741px) and (max-width:950px){.sidebar .nav{font-size:0}}

@media(max-width:740px){
 #history-page .table-card{width:100%;max-width:100%}
 #history-page table{width:100%;table-layout:fixed}
 #history-page th,#history-page td{padding:12px 8px}
 #history-page .history-index,#history-page .history-splits{display:none}
 #history-page .history-date{width:44%;white-space:normal;overflow-wrap:break-word}
 #history-page .history-time{width:33%}
 #history-page td.history-time{font-size:clamp(15px,4vw,17px);letter-spacing:-.5px}
 #history-page .history-action{width:23%;text-align:right}
 #history-page .history-action button{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;min-height:44px;padding:0;font-size:20px}
 #history-page .history-details-label{display:none}
 #history-page .pagination{flex-wrap:wrap;padding:14px 12px;gap:12px}
 #history-page .pagination>span,#history-page .pagination>div{width:100%}
 #history-page .pagination>div{justify-content:space-between}
}

/* The history viewport holds its filters and pagination in place. */
body:has(#history-page:not([hidden])){overflow:hidden}
main:has(#history-page:not([hidden])){padding-bottom:0}
#history-page:not([hidden]){display:flex;flex-direction:column;height:var(--history-available-height,calc(100dvh - 140px));min-height:0}
#history-page>.filter-bar{flex-shrink:0}
#history-page .table-card{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;margin-bottom:0}
.history-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}
.history-scroll thead{position:sticky;top:0;z-index:1}
#history-page .pagination{flex-shrink:0}
.settings-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}
#main-chart{overflow:visible}
#main-chart svg{display:block;width:100%;height:auto;min-width:0}
#main-chart svg text{font:12px var(--mono)}
.insight-grid{align-items:start}
#distribution{max-height:360px;overflow-y:auto;scrollbar-width:thin;padding-right:6px}
.insight-comparison{margin:20px 0 -12px;color:var(--muted);font-size:13px;line-height:1.5}
.stat-change{display:block;margin-top:10px;font:600 14px var(--mono);line-height:1.5}
.stat-change span{font:400 12px/1.5 var(--sans,"DM Sans",system-ui,sans-serif)}
.stat-change.good{color:#71d9a1}
.stat-change.bad{color:#ff8999}
.stat-change.neutral{color:var(--muted)}
.legend{flex-wrap:wrap;justify-content:flex-end}
.legend .fastest-legend i{background:#71d9a1}
.legend .slowest-legend i{background:#ff8999}
#main-chart .solve-point.fastest,svg .split-point.fastest{fill:#71d9a1}
#main-chart .solve-point.slowest:not(.fastest),svg .split-point.slowest:not(.fastest){fill:#ff8999}
svg .solve-point.fastest.slowest,svg .split-point.fastest.slowest{stroke:#ff8999;stroke-width:2}

/* Recent history uses spare desktop space without reducing smaller timers. */
.timer-recent{display:none}
@media(min-width:1700px){
 body:not(.focus-mode) main:has(>#timer-page:not([hidden])){max-width:none}
 body:not(.focus-mode) #timer-page:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:24px;align-items:start}
 body:not(.focus-mode) #timer-page>#timer-card{grid-column:1;grid-row:1;min-width:0}
 body:not(.focus-mode) #timer-page>.timer-recent{grid-column:2;grid-row:1;min-width:0}
 body:not(.focus-mode) .timer-recent{display:flex;flex-direction:column;min-height:0;height:var(--timer-available-height,calc(100dvh - 114px));padding:18px 14px;background:#19212e;border:1px solid var(--line);border-radius:12px}
 .timer-recent>.card-top{flex-shrink:0;gap:8px;margin-bottom:8px;padding:0 4px}
 .timer-recent h2{margin:0;font-size:16px}
 .timer-recent .text-button{font-size:13px;padding:6px;white-space:nowrap}
 #recent-solves{list-style:none;padding:0;margin:0;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
 #recent-solves>li+li{border-top:1px solid var(--line)}
 .recent-solve{display:grid;grid-template-columns:30px minmax(0,1fr);gap:5px 10px;width:100%;padding:12px 7px;border:0;border-radius:6px;background:transparent;color:var(--ink);text-align:left}
 .recent-solve:hover,.recent-solve:focus-visible{background:#26344c}
 .recent-solve-index{grid-row:span 2;align-self:center;font:12px var(--mono);color:var(--muted)}
 .recent-solve-time{font:21px var(--mono);font-variant-numeric:tabular-nums}
 .recent-solve-time small{margin-left:6px;font-size:12px;color:var(--muted)}
 .recent-solve-date{font-size:12px;line-height:1.4;color:var(--muted)}
}



/* Per-step progress charts use one shared seconds scale. */
.split-progress{margin:24px 0 32px}
.split-progress>.card-top{margin-bottom:18px;flex-wrap:wrap}
.split-progress h2{display:flex;align-items:center;gap:12px}
.split-trend-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.split-trend-grid>.empty{grid-column:1/-1}
.split-trend-card{position:relative;margin:0;padding:22px 18px 12px;min-width:0}
.split-trend-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 15px}
.split-trend-heading h3{font-size:16px;line-height:1.4;margin:0;font-weight:550;overflow-wrap:anywhere}
.split-trend-heading strong{font:22px var(--mono);white-space:nowrap;color:#dce5f5}
.split-trend-card .split-change{margin:-6px 0 15px;font-size:14px;line-height:1.7;overflow-wrap:anywhere}
.split-trend-plot{width:100%;min-width:0}
.split-trend-plot svg{display:block;width:100%;height:auto;overflow:visible}
.split-trend-plot svg text{font:13px var(--mono);fill:#a7b5cd}
.split-trend-plot .split-grid-line{stroke:#303d53;stroke-width:1}
.split-trend-plot .split-raw-line{fill:none;stroke:#8fa5e0;stroke-width:1.5;opacity:.75;pointer-events:none}
.split-trend-plot .split-mean-line{fill:none;stroke:#c2d1ff;stroke-width:2.5;pointer-events:none}
.split-trend-plot .split-mean-dot{fill:#c2d1ff;pointer-events:none}
.split-trend-plot .split-point{fill:#8fa5e0;stroke:#19212e;stroke-width:1.5;cursor:pointer;outline:none}
.split-trend-plot .split-point:hover,.split-trend-plot .split-point:focus{fill:#edf2ff;stroke:#c2d1ff;stroke-width:3}
.split-trend-tooltip{position:absolute;top:62px;left:14px;right:14px;z-index:2;padding:9px 12px;background:#26334c;border:1px solid #6d80ac;border-radius:7px;font-size:13px;line-height:1.5;color:#edf2ff;pointer-events:none;box-shadow:0 5px 20px #0005}
#split-progress-legend i{background:#8fa5e0}
#split-progress-legend span+span i{background:#c2d1ff;width:18px;height:3px;border-radius:0}
@media(max-width:900px){.split-trend-grid{grid-template-columns:1fr}}
@media(max-width:740px){
 .split-progress{margin:22px 0}
 .split-progress>.card-top{gap:12px}
 .split-trend-grid{gap:16px}
 .split-trend-card{padding:18px 14px 8px}
 .split-trend-heading h3{font-size:16px}
 .split-trend-heading strong{font-size:22px}
}
@media(max-width:360px){
 #insight-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 #insight-stats .stat{min-width:0;padding:15px 10px}
 #insight-stats .stat strong{font-size:28px}
}

/* One timer surface, shared by regular and fullscreen views. */
main:has(>#timer-page:not([hidden])){padding-bottom:0}
#timer-card{position:relative;isolation:isolate;width:100%;height:var(--timer-available-height,calc(100dvh - 140px));min-height:320px;margin:0;border:1px solid #2c3c57;border-radius:12px;background:#10141c;overflow:hidden}
#timer-card .timer-toolbar{position:absolute;top:10px;left:12px;right:12px;display:flex;align-items:center;gap:8px;margin:0;z-index:2;letter-spacing:normal}
#timer-card .timer-actions{display:flex;align-items:center;gap:2px;margin-right:auto}
#timer-card .timer-toolbar .icon-button{margin:0;min-width:40px;min-height:40px;font-size:22px}
#fullscreen-track{display:inline-flex;align-items:center;gap:6px;min-width:0;min-height:40px;padding:7px 11px;font-size:13px}
.timer-split-control{position:relative;display:inline-flex;align-items:stretch;min-width:0;max-width:min(360px,calc(100% - 96px));--split-arrow-width:40px}
.split-toggle-icon{flex-shrink:0}
.split-selection-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#timer-card .timer-actions{flex-shrink:0}
.timer-split-control #fullscreen-track{border-top-right-radius:0;border-bottom-right-radius:0}
.timer-split-picker{position:relative;display:block;flex-shrink:0;width:var(--split-arrow-width);color:var(--toggle-color,var(--ink))}
.timer-split-picker::after{content:'';position:absolute;top:calc(50% - 4px);right:calc(var(--split-arrow-width)/2 - 4px);width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);pointer-events:none}
#timer-split-method{min-height:40px;padding:0;border:1px solid var(--toggle-border,#3a465a);border-left:0;border-radius:0 7px 7px 0;background:var(--toggle-background,#202a3a);cursor:pointer}
.timer-split-control:has(#timer-split-method:focus-visible){outline:3px solid #98a7f1;outline-offset:4px;border-radius:7px}
#timer-split-method:focus-visible{outline:none}
#timer-split-method[aria-expanded="true"]::after{transform:rotate(225deg);top:calc(50% - 1px)}
#timer-split-method:disabled{cursor:default}
.timer-split-menu{position:fixed;inset:auto;margin:0;padding:6px;width:240px;max-width:calc(100vw - 24px);overflow-y:auto;overscroll-behavior:contain;border:1px solid #46546b;border-radius:12px;background:#19212e;color:#d6deeb;box-shadow:0 12px 36px #0008;font:400 15px/1.4 'DM Sans',system-ui,sans-serif;text-align:left}
.split-menu-heading{padding:8px 12px 10px;font-size:11px;font-weight:600;letter-spacing:.08em;color:#9caabe}
.timer-split-menu button{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:44px;padding:11px 12px;border-radius:7px;color:#c9d4e7;text-align:left;font:inherit;overflow-wrap:anywhere}
.timer-split-menu button:hover,.timer-split-menu button:focus-visible{background:#29364b;color:#eff3ff;outline:none}
.timer-split-menu [aria-checked="true"]{background:#2b3b58;color:#dce7ff;font-weight:550}
.split-menu-check{flex-shrink:0;color:#b8caff;visibility:hidden}
.timer-split-menu [aria-checked="true"] .split-menu-check{visibility:visible}
#fullscreen-track[aria-pressed="true"]{background:#293d63;border-color:#839fe9;color:#d3dfff}
#timer-card #timer-pad{position:relative;display:grid;grid-template-rows:minmax(0,1fr);justify-items:center;gap:24px;width:100%;height:100%;padding:64px 24px 28px;text-align:center;touch-action:pan-y;cursor:pointer}
#timer-card .timer-center{grid-row:1;display:flex;flex-direction:column;align-items:center;justify-content:center;align-self:center;gap:20px;width:100%;max-width:calc(100% - 2 * clamp(210px,20vw,300px) - 64px);min-height:0;min-width:0;touch-action:none}
#timer-card .scramble-kind{font-size:12px;line-height:1.3;margin-bottom:-10px}
#timer-card .fullscreen-scramble{display:block;width:100%;margin:0;font:700 clamp(24px,2.2vw,32px)/1.5 var(--mono);color:#e0e8f6;text-align:center;flex-shrink:0}
#timer-card .scramble-line{display:block;white-space:nowrap}
#timer-card .cube-preview{display:block;position:static;width:clamp(180px,26vh,260px);aspect-ratio:180/188;flex-shrink:0;transform:none}
#timer-card .timer-readout{width:100%;min-width:0}
#timer-card .clock{font-size:clamp(80px,10.5vw,200px);letter-spacing:-.06em;max-width:100%;line-height:1.2}
#timer-card .timer-hint{font-size:24px;margin:0 0 12px}
#timer-card .fullscreen-splits{position:absolute;left:24px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:7px;width:clamp(210px,20vw,300px);max-height:calc(100% - 144px);min-height:0;overflow-y:auto;overscroll-behavior:contain;text-align:left;scrollbar-width:thin;touch-action:pan-y}
.split-row{display:grid;grid-template-columns:24px minmax(0,1fr) 78px;align-items:center;gap:10px;min-height:46px;padding:10px 8px;border:1px solid transparent;border-radius:9px;color:#9caabe}
.split-number{font:13px var(--mono);text-align:center;color:#8c9bb2}
.split-name{font-size:16px;line-height:1.35;overflow-wrap:anywhere}
.split-value{font:17px var(--mono);text-align:right;white-space:nowrap}
.split-row.done{color:#bdc9dc}
.split-row.done .split-number{color:#8fd6b2}
.split-row.current{background:#263757;border-color:#839fe9;color:#e0e9ff}
.split-row.current .split-number{color:#c3d3ff}
.split-row.current .split-name{font-weight:600}
#timer-card.running .cube-preview,#timer-card.running .fullscreen-scramble,#timer-card.running .scramble-kind{display:none}
#timer-card.running #timer-pad{touch-action:none}
#timer-card.has-solve-feedback #timer-pad{padding-bottom:104px}
@media(max-width:1100px){
 #timer-card #timer-pad{padding-right:18px;padding-left:18px}
 #timer-card .timer-center{max-width:100%;gap:10px}
 #timer-card .cube-preview{width:96px}
 #timer-card .clock{font-size:clamp(66px,12vw,100px)}
 #timer-card .fullscreen-scramble{font-size:22px;line-height:1.45}
 #timer-card.with-splits #timer-pad{grid-template-rows:max-content minmax(0,auto);align-content:center;gap:28px}
 #timer-card.with-splits .fullscreen-splits{position:static;grid-row:2;justify-self:start;align-self:center;transform:none;width:100%;max-width:460px;max-height:100%;gap:5px}
}
@media(max-width:740px){
 body:not(.focus-mode) main:has(>#timer-page:not([hidden])){padding-bottom:calc(80px + env(safe-area-inset-bottom))}
 body:not(.focus-mode) #timer-card{min-height:480px}
 body:not(.focus-mode) #timer-card.with-splits{min-height:560px}
 #timer-card #timer-pad{padding:56px 16px 16px;gap:14px}
 #timer-card .timer-toolbar{top:8px;left:8px;right:8px;gap:6px}
 #timer-card .timer-hint{font-size:18px;margin-bottom:8px}
 #timer-card .touch-instruction{margin-top:8px}
 .split-row{grid-template-columns:22px minmax(0,1fr) 68px;gap:8px;min-height:34px;padding:6px 8px}
 .split-name{font-size:15px}
 .split-value{font-size:16px}
}
@media(max-width:740px) and (max-height:650px){
 #timer-card #timer-pad{padding-top:52px;padding-bottom:12px;gap:8px}
 #timer-card .timer-center{gap:8px}
 #timer-card .fullscreen-scramble{font-size:20px;line-height:1.45}
 #timer-card .cube-preview{width:70px}
 #timer-card .clock{font-size:54px}
 #timer-card .timer-hint{display:none}
 #timer-card.with-splits #timer-pad{gap:8px}
 #timer-card.with-splits .fullscreen-splits{gap:3px}
 .split-row{min-height:28px;padding:3px 6px}
 .split-name{font-size:14px}
}
@media(max-width:1100px) and (min-height:651px){
 #timer-card.has-solve-feedback.with-splits #timer-pad{gap:60px}
}
@media(min-width:741px) and (max-height:600px){
 #timer-card #timer-pad,#timer-card.with-splits #timer-pad{grid-template-columns:minmax(180px,24%) minmax(0,1fr) minmax(180px,24%);grid-template-rows:minmax(0,1fr);padding-top:55px;padding-bottom:20px;gap:12px}
 #timer-card .timer-center{grid-column:2;max-width:100%;gap:10px}
 #timer-card .fullscreen-scramble{font-size:20px}
 #timer-card .cube-preview{width:70px}
 #timer-card .clock{font-size:70px}
 #timer-card.with-splits .fullscreen-splits{position:static;grid-column:1;grid-row:1;align-self:center;transform:none;width:100%;max-height:100%;max-width:280px}
 .split-row{min-height:32px;padding:5px 6px}
 .split-name{font-size:14px}
 .split-value{font-size:16px}
}

/* Feedback adds to the existing fullscreen readout and rows. */
.solve-good{color:#8fd6b2!important}
.solve-gold{color:#f1cd73!important}
.solve-feedback,.solve-ranking{display:none}
#timer-card .timer-readout{position:relative}
#timer-card .solve-feedback:not([hidden]){display:block;position:absolute;top:calc(100% + 12px);left:50%;transform:translateX(-50%);width:100%;max-width:560px;font-size:14px;line-height:1.65;color:#b8c5d9;text-align:center;pointer-events:none}
.feedback-number{font-family:var(--mono);font-variant-numeric:tabular-nums}
.feedback-pb{font-size:12px;color:#f1cd73;margin-bottom:2px}
.split-value.has-difference{position:relative;transform:translateY(-4px)}
.split-difference{position:absolute;top:100%;right:0;font:12px/1.1 var(--mono);color:#9caabe;white-space:nowrap}
#timer-card .solve-ranking:not([hidden]){display:block;position:absolute;bottom:max(20px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:3;width:calc(100% - 64px);max-width:620px;color:#9caabe;font-size:12px;line-height:1.5;pointer-events:none}
.ranking-meta,.ranking-ends{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.ranking-meta strong{color:#dce5f5;font:400 12px var(--mono);white-space:nowrap}
.ranking-track{position:relative;margin:12px auto 10px}
.ranking-squares{display:grid;grid-template-columns:repeat(var(--solve-count,50),minmax(0,1fr));gap:3px;align-items:center}
.ranking-squares span{display:block;width:100%;aspect-ratio:1;max-height:10px;background:#455168}
.ranking-marker{position:absolute;top:-4px;bottom:-4px;width:6px;transform:translateX(-50%);background:#bac8ec;border-radius:1px}
.ranking-marker.good{background:#8fd6b2}
.ranking-marker.gold{background:#f1cd73}
.ranking-ends{font-size:11px;color:#8e9eb5}
@media(max-width:740px){
 #timer-card .solve-feedback:not([hidden]){font-size:13px;line-height:1.5}
 #timer-card .solve-ranking:not([hidden]){width:calc(100% - 56px);bottom:max(18px,env(safe-area-inset-bottom))}
 .ranking-squares{gap:2px}
 .ranking-marker{width:5px}
 .ranking-track{margin:10px auto 9px}
 .split-difference{font-size:11px}
}
@media(max-width:1100px) and (max-height:750px){
 #timer-card.has-solve-feedback #timer-pad{padding-bottom:max(94px,calc(env(safe-area-inset-bottom) + 76px))}
 #timer-card.has-solve-feedback.with-splits .fullscreen-splits{padding-bottom:4px}
}
@media(max-height:650px){
 #timer-card .solve-feedback:not([hidden]){top:calc(100% + 5px);font-size:12px;line-height:1.3}
 .split-value.has-difference{transform:translateY(-3px)}
 .split-difference{font-size:10px}
}

/* Rotated phones need the height of an icon rail, not desktop or bottom navigation. */
@media(orientation:landscape) and (max-height:500px) and (max-width:1100px){
 .sidebar{inset:0 auto 0 0;width:68px;height:100dvh;padding:8px 6px 8px max(6px,env(safe-area-inset-left));flex-direction:column;align-items:stretch;justify-content:flex-start;gap:8px;border:0;border-right:1px solid var(--line)}
 .sidebar .brand,.sidebar #open-import{display:none}
 .sidebar nav[aria-label]{display:flex;flex-direction:column;flex:none;margin:0;gap:4px;min-width:0}
 .sidebar .side-bottom{display:flex;flex-direction:column;flex:none;margin-top:auto;padding:0}
 .sidebar .nav{display:flex;flex:none;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;min-width:0;min-height:44px;margin:0;padding:4px 2px;font-size:10px;line-height:1.2;text-align:center}
 .sidebar .nav>span:first-child{display:block;width:24px;height:24px;font-size:22px;line-height:24px}
 main{margin-left:68px;padding:0 max(12px,env(safe-area-inset-right)) 12px 12px;max-width:none}
 body:not(.focus-mode) main:has(>#timer-page:not([hidden])){padding-bottom:0}
 body:not(.focus-mode) #timer-card,body:not(.focus-mode) #timer-card.with-splits{min-height:180px}
 #timer-card{--landscape-split-width:clamp(230px,30%,300px);--landscape-gap:clamp(20px,3vw,36px)}
 #timer-card #timer-pad,#timer-card.with-splits #timer-pad{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);padding:56px max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));gap:var(--landscape-gap);touch-action:none}
 #timer-card.with-splits #timer-pad{grid-template-columns:var(--landscape-split-width) minmax(0,1fr)}
 #timer-card .timer-center{grid-column:1;grid-row:1;max-width:100%;max-height:100%;gap:clamp(5px,2vh,10px)}
 #timer-card.with-splits .timer-center{grid-column:2}
 #timer-card .fullscreen-scramble{font-size:clamp(16px,2.2vw,22px);line-height:1.4}
 #timer-card .cube-preview{width:clamp(48px,16vh,72px)}
 #timer-card .clock{font-size:clamp(48px,17vh,78px);line-height:1.1}
 #timer-card .timer-hint{display:block;font-size:16px;margin-bottom:4px}
 #timer-card .timer-instruction,#timer-card .touch-instruction{margin-top:5px;font-size:12px;line-height:1.3}
 #timer-card.with-splits .fullscreen-splits{position:static;grid-column:1;grid-row:1;align-self:center;justify-self:stretch;transform:none;width:100%;max-width:none;height:min(100%,280px);max-height:100%;display:grid;grid-auto-rows:minmax(24px,1fr);gap:2px;overflow-x:hidden;overflow-y:auto}
 #timer-card .split-row{grid-template-columns:20px minmax(0,1fr) 66px;gap:6px;min-height:24px;padding:2px 4px}
 #timer-card .split-number{font-size:12px}
 #timer-card .split-name{font-size:14px;line-height:1.2;white-space:nowrap;overflow-wrap:normal}
 #timer-card .split-value{font-size:15px}
 #timer-card.has-solve-feedback #timer-pad{padding-bottom:max(76px,calc(env(safe-area-inset-bottom) + 64px))}
 #timer-card.has-solve-feedback .timer-center{gap:4px}
 #timer-card.has-solve-feedback .cube-preview{width:clamp(36px,12vh,52px)}
 #timer-card.has-solve-feedback .clock{font-size:clamp(44px,15vh,66px)}
 #timer-card .solve-ranking:not([hidden]){bottom:max(8px,env(safe-area-inset-bottom));font-size:11px;width:calc(100% - 40px)}
 #timer-card.with-splits .solve-ranking:not([hidden]){left:auto;right:max(16px,env(safe-area-inset-right));transform:none;width:calc(100% - var(--landscape-split-width) - var(--landscape-gap) - 32px)}
 #timer-card .ranking-track{margin:6px auto}
 #timer-card .ranking-ends{font-size:10px}
 #history-page .history-table-scroll{min-width:0}
 #history-page .pagination{flex-wrap:nowrap;gap:12px;padding:8px 12px;border-top:1px solid var(--line);font-size:12px}
 #history-page .pagination>span{width:auto;min-width:0}
 #history-page .pagination>div{flex-shrink:0;gap:8px;width:auto}
 #history-page .pagination .small-button{min-width:0;min-height:40px;padding:8px;font-size:12px}
 #history-page table{width:100%;table-layout:fixed}
 #history-page th{position:sticky;top:0;z-index:1}
 #history-page th,#history-page td{padding:8px 12px}
 #history-page th{font-size:12px}
 #history-page .history-index,#history-page .history-splits{display:none}
 #history-page .history-date{width:44%;white-space:normal}
 #history-page .history-date small{display:inline-block;margin:0 0 0 10px}
 #history-page .history-time{width:auto}
 #history-page td.history-time{font-size:17px}
 #history-page .history-action{width:64px;text-align:right}
 #history-page .history-details-label{display:none}
 #history-page .history-action button{width:40px;min-width:40px;min-height:40px;padding:6px;font-size:18px}
 #toast{bottom:max(12px,env(safe-area-inset-bottom))}
}
@media(orientation:landscape) and (max-height:350px) and (max-width:1100px){
 body:not(.focus-mode) #timer-page .timer-center{display:grid;grid-template-columns:44px minmax(0,1fr);gap:6px;align-content:center;align-items:center}
 body:not(.focus-mode) #timer-page .scramble-kind{display:none}
 body:not(.focus-mode) #timer-page .fullscreen-scramble{grid-column:1/-1;font-size:16px;line-height:1.3}
 body:not(.focus-mode) #timer-page .cube-preview{grid-column:1;grid-row:2;width:44px}
 body:not(.focus-mode) #timer-page .timer-readout{grid-column:2;grid-row:2}
 body:not(.focus-mode) #timer-page .clock{font-size:46px}
 body:not(.focus-mode) #timer-page .timer-instruction,body:not(.focus-mode) #timer-page .touch-instruction{font-size:10px}
}
.header-context{display:flex;align-items:center;min-width:0;max-width:100%}
.app-actions,.sync-attention{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;max-width:100%}
.app-actions{margin-left:auto;flex-wrap:wrap}
.sync-attention{flex:1 1 auto}
@media(max-width:740px){
 .app-actions{flex-wrap:nowrap}
}
@media(orientation:landscape) and (max-height:500px) and (max-width:1100px){
}

/* Brief motion supports changes of state; the live clock never animates digits. */
/* Page slides stay inside the content; scrollbar changes never move the app chrome. */
:root{--motion-ease:cubic-bezier(.2,.7,.2,1);scrollbar-gutter:stable}
:root:has(body.focus-mode){scrollbar-gutter:auto}
main{overflow-x:clip}
button,input,textarea,select{transition:background-color 150ms ease,border-color 150ms ease,color 150ms ease,opacity 150ms ease,translate 120ms var(--motion-ease)}
button:not(:disabled):active{translate:0 1px}
.sidebar nav .nav{transition:none;translate:none}
:root{view-transition-name:none}
::view-transition{pointer-events:none}
html[data-motion="page"] .page:not([hidden]){view-transition-name:page-content}
html[data-motion="page"] .page{pointer-events:none}
html[data-motion="page"]::view-transition{clip-path:inset(var(--page-clip-top,0px) 0 var(--page-clip-bottom,0px) var(--page-clip-left,0px))}
html[data-motion="focus"] #timer-card{view-transition-name:timer-surface}
html[data-motion="focus"] #fullscreen-scramble{view-transition-name:focus-scramble}
.scramble-move{display:inline-block}
html[data-motion="focus"] .scramble-move{view-transition-name:var(--focus-move)}
html[data-motion="focus"] #scramble-type:not(.sr-only){view-transition-name:focus-scramble-kind}
html[data-motion="focus"] #cube-preview{view-transition-name:focus-cube}
html[data-motion="focus"] #clock{view-transition-name:focus-clock}
html[data-motion="focus"] #timer-hint{view-transition-name:focus-hint}
html[data-motion="focus"] #timer-instruction{view-transition-name:focus-keyboard}
html[data-motion="focus"] #touch-instruction{view-transition-name:focus-touch}
html[data-motion="focus"] #new-scramble{view-transition-name:focus-refresh}
html[data-motion="focus"] #manual-entry{view-transition-name:focus-manual}
html[data-motion="focus"] #fullscreen-track{view-transition-name:focus-track}
html[data-motion="focus"] #fullscreen-lesson-title{view-transition-name:focus-lesson-title;transition:none}
html[data-motion="focus"] #focus{view-transition-name:focus-toggle}
html[data-motion="focus"] .split-row{view-transition-name:var(--focus-part)}
html[data-motion="focus"] .split-row .split-number{view-transition-name:var(--focus-number)}
html[data-motion="focus"] .split-row .split-name{view-transition-name:var(--focus-label)}
html[data-motion="focus"] .split-row .split-value{view-transition-name:var(--focus-value)}
html[data-motion="focus"] #solve-feedback{view-transition-name:focus-feedback}
html[data-motion="focus"] #solve-ranking{view-transition-name:focus-ranking}
html[data-motion="focus"] #ranking-count{view-transition-name:focus-rank-count}
html[data-motion="focus"] .ranking-meta>span:last-child{view-transition-name:focus-rank-total}
html[data-motion="focus"] #ranking-track{view-transition-name:focus-rank-track}
html[data-motion="focus"] .ranking-ends>span:first-child{view-transition-name:focus-rank-fastest}
html[data-motion="focus"] .ranking-ends>span:last-child{view-transition-name:focus-rank-slowest}
#timer-card #clock,#timer-card #timer-instruction,#timer-card #touch-instruction,#timer-card #timer-hint,#timer-card .scramble-kind{width:fit-content;margin-inline:auto}
#timer-card .split-name{width:fit-content;max-width:100%}
#timer-card .split-value{width:fit-content;justify-self:end}
#timer-card .solve-feedback:not([hidden]){width:max-content;max-width:100%}
html[data-motion="focus"]::view-transition-group(*){animation-duration:320ms;animation-timing-function:var(--motion-ease)}
html[data-motion="focus"]::view-transition-old(*){animation:none;opacity:0}
html[data-motion="focus"]::view-transition-new(*){animation:none;opacity:1;mix-blend-mode:normal}
html[data-motion="focus"]::view-transition-old(focus-lesson-title){animation:lesson-title-fade-out 220ms ease both;opacity:1}
html[data-motion="focus"]::view-transition-new(focus-lesson-title){animation:lesson-title-fade-in 220ms ease both}
@keyframes lesson-title-fade-in{from{opacity:0}to{opacity:1}}
@keyframes lesson-title-fade-out{from{opacity:1}to{opacity:0}}
::view-transition-group(page-content){animation:none;overflow:clip}
::view-transition-image-pair(page-content){isolation:isolate;overflow:clip}
::view-transition-old(page-content),::view-transition-new(page-content){mix-blend-mode:normal;animation:260ms var(--motion-ease) both;height:auto}
::view-transition-old(page-content){animation-name:page-slide-out}
::view-transition-new(page-content){animation-name:page-slide-in}
@keyframes page-slide-out{to{transform:translateX(calc(-100% * var(--page-direction,1)))}}
@keyframes page-slide-in{from{transform:translateX(calc(100% * var(--page-direction,1)))}}
::view-transition-group(timer-surface){animation-duration:260ms;animation-timing-function:var(--motion-ease)}
::view-transition-old(timer-surface),::view-transition-new(timer-surface){animation-duration:260ms;animation-timing-function:var(--motion-ease)}
@media(max-width:740px){.sidebar nav{flex:1}}
.split-row{transition:background-color 180ms ease,border-color 180ms ease,color 180ms ease}
#timer-card .clock{transition:color 220ms ease}
#timer-card.arming .clock,#timer-card.armed .clock{transition:none}
.ranking-marker{transition:left 240ms var(--motion-ease),background-color 180ms ease}
svg circle[data-id]{transition:fill 120ms ease,r 120ms ease}
.bar-fill{transform-origin:left;animation:bar-reveal 360ms var(--motion-ease) both}
@keyframes bar-reveal{from{transform:scaleX(0);opacity:.5}to{transform:scaleX(1);opacity:1}}

/* Native dialog state and focus change immediately; display/overlay only defer paint. */
dialog{opacity:0;transform:translateY(8px) scale(.99);transition:opacity 180ms ease,transform 220ms var(--motion-ease),display 220ms allow-discrete,overlay 220ms allow-discrete;pointer-events:none}
dialog[open]{opacity:1;transform:none;pointer-events:auto}
dialog::backdrop{background:#06090e00;transition:background-color 180ms ease,display 220ms allow-discrete,overlay 220ms allow-discrete}
dialog[open]::backdrop{background:#06090ebd}
#toast{opacity:0;translate:0 6px;transition:opacity 180ms ease,translate 220ms var(--motion-ease),display 220ms allow-discrete}
#toast:not([hidden]){opacity:1;translate:0 0}
@starting-style{
 dialog[open]{opacity:0;transform:translateY(8px) scale(.99)}
 dialog[open]::backdrop{background:#06090e00}
 #toast:not([hidden]){opacity:0;translate:0 6px}
}
@media(prefers-reduced-motion:reduce){
 *,*::before,*::after{animation:none!important;transition:none!important}
 dialog::backdrop{transition:none!important}
 ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}
}

/* Keep document and nested scrollbars on the same dark surfaces as the app. */
:root{color-scheme:dark;scrollbar-color:#465570 #10141c;scrollbar-width:thin}
*{scrollbar-width:thin}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:#10141c}
::-webkit-scrollbar-thumb{background:#465570;border:2px solid #10141c;border-radius:8px}
::-webkit-scrollbar-thumb:hover{background:#7182a2}
::-webkit-scrollbar-button{display:none}

.analysis-tabs{display:flex;gap:0;border-bottom:1px solid #35435b;margin-bottom:16px}
.analysis-tabs [role="tab"]{min-height:44px;padding:10px 24px;border-bottom:3px solid transparent;color:#acbad0;font-size:15px}
.analysis-tabs [aria-selected="true"]{border-color:#adbeef;color:#e0e9ff;background:#202d43}
@media(min-width:741px){
 .sidebar nav{display:flex;flex-direction:column;flex:1;padding-bottom:16px}
 .sidebar #open-settings{margin-top:auto}
}
@media(max-width:740px){
 .analysis-tabs{margin-bottom:12px}
 .analysis-tabs [role="tab"]{flex:1;padding:8px 16px}
}

main{padding-top:16px}
@media(min-width:741px){.sidebar nav{min-height:0;overflow-y:auto}.sidebar .brand{flex-shrink:0}}
@media(max-width:380px){
 #timer-card .timer-toolbar{gap:4px}
 #timer-card #fullscreen-track{padding-inline:7px;gap:4px}
}
@media(max-width:740px){
 .timer-split-control{--split-arrow-width:44px}
 .timer-split-control #fullscreen-track,#timer-split-method{min-height:44px}
}

/* Keep page filters visible alongside the content they affect. */
.page-filters{display:flex;align-items:center;gap:10px;margin:0 0 16px;flex-wrap:wrap}
.page-filters input,.page-filters select{min-height:44px;font-size:14px;margin:0;min-width:0}
.page-filters #search{flex:1;min-width:120px;max-width:360px}
.page-filters #manual-entry{width:44px;min-height:44px;flex-shrink:0;font-size:24px;border:1px solid var(--line);border-radius:8px;background:#202a3a;order:1}
#open-settings{position:relative}
.settings-dot{position:absolute;top:10px;right:10px;width:7px;height:7px;border-radius:50%;background:#e5b96f;box-shadow:0 0 0 2px #131923}
.settings-sync{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.settings-sync h3{font-size:13px;font-weight:500;margin:0 0 8px}
.settings-sync .sync-attention{justify-content:flex-start;flex-wrap:wrap;font-size:13px}
.settings-sync #sync-mobile{min-width:44px;min-height:44px}
@media(max-width:740px){
 .page-filters{gap:8px;margin-bottom:12px}
 .page-filters input,.page-filters select{font-size:16px}
 #history-scope{flex:1}
 .page-filters #search{order:2;flex-basis:100%;max-width:none}
 .settings-dot{top:5px;right:calc(50% - 20px)}
}

.settings-sync:not(:has(.sync-attention:not([hidden]))){display:none}
