/* Home-only typing studio. Shared exam and battle pages keep their own layout. */
html body.ui-page.exam-page.practice-home {
    height: auto; min-height: 100vh; min-height: 100svh; margin: 0; overflow: auto;
    background: var(--bg); color: var(--text); overscroll-behavior: auto;
    --studio-font: clamp(23px, 2.35vw, 31px);
    --studio-line: clamp(39px, 3.9vw, 52px);
}
.practice-home .practice-header {
    display:flex; align-items:center; flex-wrap:wrap; gap:8px 18px;
    width:min(1240px,calc(100% - 64px)); margin:0 auto; padding:18px 0;
    border-bottom:1px solid var(--line);
}
.practice-home .practice-brand {
    font:800 23px/1.2 Arial,sans-serif; letter-spacing:-.9px;
    color:var(--text); text-decoration:none; white-space:nowrap;
}
.practice-home .practice-brand .logo-e {color:#e8414e;}
.practice-home .practice-nav {display:flex; align-items:center; flex-wrap:wrap; gap:3px; margin-left:auto;}
.practice-home .practice-nav :is(a,button) {
    display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:7px 10px;
    background:transparent; border:1px solid transparent; border-radius:8px; color:var(--muted);
    font:600 12px/1.4 inherit; font-family:inherit; font-size:12px; font-weight:600; text-decoration:none; cursor:pointer;
}
.practice-home .practice-nav :is(a,button):hover {background:var(--panel); color:var(--text);}
.practice-home .site-theme-slot {margin:0; flex:none;}
.practice-home .site-theme-slot .theme-control {margin:0; gap:5px;}
.practice-home .site-theme-slot .theme-select {min-height:36px; border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--panel); font-size:12px;}
html .ui-page.exam-page.practice-home .exam-workspace {
    display:flex; flex-direction:column; width:min(1060px,calc(100% - 64px)); height:auto;
    min-height:calc(100svh - 85px); box-sizing:border-box; margin:0 auto; padding:clamp(26px,6vh,62px) 0 18px;
    gap:0; overflow:visible;
}
.practice-controls {
    display:flex; align-items:center; justify-content:center; align-self:center; flex-wrap:wrap;
    max-width:100%; gap:8px 12px; margin:0; padding:6px;
    border:1px solid var(--line); border-radius:14px; background:var(--panel);
}
.practice-modes {display:flex; gap:2px; padding-inline-end:10px; border-inline-end:1px solid var(--line);}
.practice-modes a,.practice-new {
    display:inline-flex; align-items:center; justify-content:center; gap:6px;
    min-height:36px; padding:7px 12px; border-radius:8px; font-family:inherit; font-size:13px;
    font-weight:650; text-decoration:none; line-height:1.35;
}
.practice-modes a {color:var(--muted);}
.practice-modes a[aria-current=page] {color:var(--primary); background:var(--theme-soft,var(--bg));}
.practice-modes a:hover,.practice-tools-actions button:not(:disabled):hover {color:var(--primary); background:var(--theme-soft,var(--bg));}
.practice-options {display:flex; align-items:center; gap:8px 13px; min-width:0;}
.practice-options label {display:flex; align-items:center; flex-wrap:nowrap; gap:5px; min-width:0; margin:0; color:var(--muted); font-size:11px;}
.practice-options select {
    width:auto; min-width:0; max-width:180px; min-height:36px; padding:5px 4px; margin:0;
    border:0; border-radius:6px; background:var(--panel); color:var(--text); font-family:inherit; font-size:13px; font-weight:650; cursor:pointer;
}
.practice-home .practice-new {width:auto; margin:0; border:1px solid transparent; background:var(--theme-soft,var(--bg)); color:var(--primary); cursor:pointer;}
.practice-new:hover {border-color:var(--primary);}
.practice-new svg {width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;}
html .ui-page.exam-page.practice-home .practice-session,
.practice-home .practice-summary {
    flex:none; width:100%; min-height:0; box-sizing:border-box; margin:auto 0;
}
html .ui-page.exam-page.practice-home .practice-session {
    display:block; padding:clamp(36px,7vh,76px) 0 clamp(30px,6vh,68px);
    border:0; border-radius:0; box-shadow:none; background:transparent; overflow:visible;
}
.practice-session-head {display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:18px 30px; margin:0 0 clamp(20px,3.6vh,36px);}
.practice-story-title {flex:1 1 320px; min-width:0;}
.studio-eyebrow {display:flex; align-items:center; gap:8px; margin:0 0 10px; color:var(--muted); font:500 10px/1.4 var(--focus-mono); text-transform:uppercase; letter-spacing:.12em;}
.studio-eyebrow>span:first-child {width:19px; height:2px; background:var(--primary);}
.studio-eyebrow .studio-slash {color:var(--muted);}
.practice-session h1 {margin:0; color:var(--text); font-size:clamp(22px,2.3vw,32px); line-height:1.16; letter-spacing:-.035em; font-weight:650; overflow-wrap:anywhere;}
.studio-context {margin:7px 0 0; color:var(--muted); font-size:12px; line-height:1.5;}
.studio-context span {padding:0 3px;}
.practice-live,.practice-extra-stats {display:flex; align-items:center; flex-wrap:wrap; gap:12px 24px; margin:0;}
.practice-live div,.practice-extra-stats div {display:grid; gap:5px; min-width:0;}
.practice-live dt,.practice-extra-stats dt {color:var(--muted); font-size:11px; line-height:1.5;}
.practice-live dd,.practice-extra-stats dd {margin:0; color:var(--text); font-family:var(--focus-mono); font-variant-numeric:tabular-nums; font-weight:500;}
.practice-live dd {font-size:clamp(20px,1.8vw,25px); letter-spacing:-.05em; line-height:1.2;}
.practice-live .practice-clock dd {color:var(--primary);}
.practice-live >div {min-width:6ch;}
.practice-live >div:last-child {min-width:8ch;}
.practice-surface {
    position:relative; padding:4px 0; border-radius:8px; background:var(--bg);
    cursor:text; outline-offset:6px;
}
.practice-surface:has(#typingInput:focus-visible) {outline:1px solid var(--line);}
.practice-home[data-calm-view=on].is-writing .practice-surface {outline-color:transparent;}
html .ui-page.exam-page.practice-home #passageViewport {
    display:block; flex:none; position:relative; height:calc(var(--studio-line) * 3); min-height:0; max-height:none;
    box-sizing:content-box; padding:0; margin:0; border:0; border-radius:0; overflow:hidden;
    background:var(--bg); box-shadow:none;
}
html .ui-page.exam-page.practice-home #passageTrack {
    font-family:var(--focus-mono); font-size:var(--studio-font); font-weight:400;
    line-height:var(--studio-line); letter-spacing:.005em; text-align:left; color:var(--muted);
    font-variant-ligatures:none;
}
/* The textarea remains the native editor and touch target. Only the passage paints glyphs. */
html .ui-page.exam-page.practice-home .practice-surface #typingInput {
    position:absolute; inset:0; z-index:1; display:block; opacity:0; width:100%; height:100%; max-height:none;
    min-height:0; margin:0; padding:0; border:0; border-radius:0; overflow:hidden; resize:none;
    font:normal var(--studio-font)/var(--studio-line) var(--focus-mono); cursor:text; touch-action:manipulation;
}
.practice-sr-only {position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;}
.studio-progress {display:flex; align-items:center; gap:12px; margin:18px 0 5px;}
.practice-home .studio-progress .exam-progress-track {flex:1; height:2px; min-height:0; padding:0; background:var(--line);}
.studio-progress #progressText {color:var(--muted); font:500 11px/1.3 var(--focus-mono); min-width:4ch; text-align:right;}
.practice-tools {display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:9px 14px;}
.practice-state,.practice-tools-actions {display:flex; align-items:center; gap:7px 12px; flex-wrap:wrap;}
.practice-state #surfaceHint {color:var(--muted); font-size:12px;}
.practice-home:has(#statusPill.running) #surfaceHint {display:none;}
.ui-page.exam-page.practice-home .practice-state .exam-status {display:inline-flex; align-items:center; gap:6px; padding:0; min-height:32px; border:0; color:var(--primary); background:transparent; font-size:11px;}
.ui-page.exam-page.practice-home .practice-state .status-dot {width:6px; height:6px; background:currentColor; box-shadow:none;}
.practice-tools-actions {gap:4px;}
.ui-page.exam-page.practice-home .practice-tools-actions button {
    display:inline-flex; align-items:center; gap:5px; width:auto; min-height:36px; margin:0; padding:6px 9px;
    border:1px solid transparent; border-radius:8px; background:transparent; color:var(--muted); box-shadow:none;
    font-family:inherit; font-size:12px; font-weight:550; cursor:pointer;
}
.ui-page.exam-page.practice-home .practice-tools-actions #calmViewToggle[aria-pressed=true] {color:var(--primary); background:var(--theme-soft,var(--panel));}
.ui-page.exam-page.practice-home .practice-tools-actions .exam-fullscreen span {display:inline;}
.ui-page.exam-page.practice-home .practice-tools-actions button:disabled {cursor:default; opacity:.6;}
.practice-details {margin:10px 0 0; color:var(--muted); font-size:12px; line-height:1.65;}
.practice-details summary {width:fit-content; max-width:100%; padding:4px 0; cursor:pointer;}
.practice-details[open] summary {color:var(--primary);}
.practice-extra-stats {margin:12px 0;}
.practice-extra-stats dd {font-size:14px;}
.practice-details p {margin:6px 0;}
.practice-home [hidden] {display:none !important;}
.practice-footnote {display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 12px; margin:0; padding:13px 0 0; border-top:1px solid var(--line); color:var(--muted); font-size:12px;}
.practice-footnote a {color:var(--primary); text-decoration:none;}
.practice-footnote a:hover {text-decoration:underline;}
.practice-home :is(a,button,select,summary):focus-visible {outline:2px solid var(--primary); outline-offset:3px;}
.practice-home[data-calm-view=on].is-writing .studio-context {visibility:hidden;}
@media (max-width:900px) {
    .practice-home .practice-header {width:calc(100% - 36px); gap:6px 10px;}
    .practice-home .practice-nav :is(a,button) {padding:7px 8px;}
    html .ui-page.exam-page.practice-home .exam-workspace {width:calc(100% - 48px);}
    .practice-options {gap:8px;}
}
@media (max-width:680px) {
    html body.ui-page.exam-page.practice-home {--studio-font:22px; --studio-line:38px;}
    .practice-home .practice-header {padding:10px 0; width:calc(100% - 28px);}
    .practice-home .practice-brand {font-size:20px;}
    .practice-home .site-theme-slot {margin-left:auto;}
    html[data-theme][data-theme-mode] .ui-page.practice-home .site-theme-slot .theme-select {width:124px; max-width:124px;}
    .practice-home .site-theme-slot .theme-control-icon {display:none;}
    .practice-home .practice-nav {order:3; width:100%; gap:0 3px; margin:0;}
    html .ui-page.exam-page.practice-home .exam-workspace {width:calc(100% - 32px); min-height:calc(100svh - 116px); padding:20px 0 12px;}
    .practice-controls {display:grid; grid-template-columns:1fr auto; width:100%; gap:4px 6px; padding:6px 8px; box-sizing:border-box;}
    .practice-modes {border:0; padding:0;}
    .practice-modes a,.practice-new {min-height:35px; padding:7px 9px; font-size:12px;}
    .practice-options {grid-column:1/-1; grid-row:2; gap:10px; padding:1px 4px 0; border-top:1px solid var(--line);}
    .practice-options label:last-child {flex:1 1 auto;}
    .practice-options label:last-child select {flex:1 1 auto;}
    .practice-options select {max-width:100%; font-size:12px; min-height:33px;}
    .practice-session-head {gap:14px; margin-bottom:18px;}
    .practice-story-title {flex-basis:100%;}
    .practice-live {gap:20px;}
    .practice-live div {display:flex; flex-direction:column-reverse; gap:0; min-width:0;}
    .practice-live dd {font-size:21px;}
    .practice-tools {gap:3px 12px;}
    .practice-state #surfaceHint {font-size:11px;}
    .studio-progress {margin-top:10px;}
    html .ui-page.exam-page.practice-home .practice-session {padding:28px 0;}
    .practice-footnote {font-size:11px;}
}
@media (max-width:360px) {
    .practice-home .practice-header {width:calc(100% - 24px);}
    .practice-home .practice-brand {font-size:18px;}
    html[data-theme][data-theme-mode] .ui-page.practice-home .site-theme-slot .theme-select {width:112px; max-width:112px;}
    .practice-home .practice-nav :is(a,button) {padding:6px 7px; font-size:11px;}
}
@media (max-height:680px) and (min-width:681px) {
    html .ui-page.exam-page.practice-home .exam-workspace {padding-top:16px;}
    html .ui-page.exam-page.practice-home .practice-session {padding:20px 0;}
    .practice-session-head {margin-bottom:12px;}
    .studio-progress {margin-top:10px;}
}

.practice-home .practice-summary {
    padding: 24px; border: 1px solid var(--line); border-radius: 16px;
    background: var(--panel); color: var(--text);
}
.practice-home .practice-summary h2 { margin: 0 0 8px; color: var(--text); font-size: 25px; letter-spacing: -.03em; }
.practice-home .practice-summary p { color: var(--muted); line-height: 1.6; }
.practice-home .practice-result-stats {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
    margin: 24px 0;
}
.practice-home .practice-result-stats div { min-width: 0; }
.practice-home .practice-result-stats dt { color: var(--muted); font-size: 12px; }
.practice-home .practice-result-stats dd { margin: 6px 0 0; color: var(--primary); font-family: var(--focus-mono); font-size: 28px; }
.practice-home .practice-summary .btn { min-height: 40px; padding: 10px 16px; font-size: 13px; border-radius: 9px; }
.practice-dialog {
    width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 40px);
    padding: 30px; margin: auto; overflow: auto; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: 20px; background: var(--panel);
    color: var(--text); box-shadow: 0 24px 80px #0003;
}
.practice-dialog::backdrop { background: #0008; }
.practice-dialog h2 { margin: 8px 0 12px; font-size: 25px; letter-spacing: -.035em; color: var(--text); }
.practice-dialog p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.practice-dialog .dialog-close {
    display: block; margin: -14px -14px 0 auto; min-width: 36px; min-height: 36px;
    padding: 3px 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--muted); font-size: 23px; cursor: pointer;
}
.practice-dialog .dialog-close:hover { background: var(--bg); color: var(--text); }
.practice-dialog label { display: block; margin: 18px 0 7px; color: var(--text); font-size: 12px; font-weight: 650; }
.practice-dialog input:not([type=hidden]) {
    width: 100%; min-height: 46px; margin: 0; padding: 11px 12px; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font-size: 16px;
}
.practice-dialog form > .btn { width: 100%; margin-top: 18px; min-height: 44px; border-radius: 9px; }
.practice-dialog a { color: var(--primary); }
.practice-dialog .alert { margin: 12px 0; }
.practice-dialog .code-input-wrap { display: flex; align-items: center; position: relative; }
.practice-dialog .code-input-wrap input { padding-right: 65px; }
.practice-dialog .code-toggle {
    position: absolute; right: 5px; padding: 8px; min-height: 36px; border: 0;
    border-radius: 7px; background: transparent; color: var(--primary); cursor: pointer;
}
@media (max-width: 680px) {
    .practice-home .practice-result-stats {grid-template-columns:repeat(2,minmax(0,1fr));}
    .practice-home .practice-summary {padding:20px;}
    .practice-dialog {padding:24px;}
}