/* Scoped to training; platform typography, colors and logo remain authoritative. */
#practice-editor{min-width:0;max-width:100%;margin-block:12px;direction:rtl}
#practice-editor [hidden]{display:none!important}
:is(#practice-editor,#custom-expression-wrap) math-field.practice-step-field{display:block;direction:ltr!important;text-align:left;min-height:84px;width:100%;max-width:100%;padding:12px;border:1px solid var(--control-line,var(--line));border-radius:12px;background:var(--paper);color:var(--text);font-size:24px;overflow-x:auto;box-sizing:border-box;--caret-color:var(--accent);--selection-background-color:var(--soft)}
:is(#practice-editor,#custom-expression-wrap) math-field.practice-step-field:focus-within{outline:2px solid var(--accent);outline-offset:2px}
:is(#practice-editor,#custom-expression-wrap) math-field.practice-step-field.practice-invalid{border:2px solid var(--orange);outline-color:var(--orange)}
:is(#practice-editor,#custom-expression-wrap) .practice-editor-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:10px 0}
:is(#practice-editor,#custom-expression-wrap) .practice-editor-actions button{min-height:44px;font-size:12px}
#practice-keyboard{padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
:is(#practice-editor,#custom-expression-wrap) .practice-edit-tools{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}
:is(#practice-editor,#custom-expression-wrap) .practice-edit-tools button{min-width:44px;min-height:44px;padding:6px 9px;font-size:12px;border:1px solid var(--control-line,var(--line));border-radius:8px;background:var(--paper);color:var(--text)}
:is(#practice-editor,#custom-expression-wrap) .practice-key-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-bottom:10px}
:is(#practice-editor,#custom-expression-wrap) .practice-key-tabs button{padding:7px 3px;min-height:48px;font-size:12px;line-height:1.5;border:1px solid var(--control-line,var(--line));border-radius:9px;background:var(--paper);color:var(--text)}
:is(#practice-editor,#custom-expression-wrap) .practice-key-tabs [aria-selected=true]{background:var(--accent);color:var(--paper)}
:is(#practice-editor,#custom-expression-wrap) .practice-key-grid{display:grid;grid-template-columns:repeat(var(--practice-columns),minmax(0,1fr));gap:6px;direction:ltr}
:is(#practice-editor,#custom-expression-wrap) .practice-key-grid button{position:relative;min-width:0;min-height:64px;padding:6px 2px;border:1px solid var(--control-line,var(--line));border-radius:9px;background:var(--paper);color:var(--text);touch-action:manipulation;overflow:hidden}
:is(#practice-editor,#custom-expression-wrap) .practice-key-grid button>*{pointer-events:none}
:is(#practice-editor,#custom-expression-wrap) .practice-key-symbol{display:flex;justify-content:center;align-items:center;min-height:30px;font-size:17px;direction:ltr}
:is(#practice-editor,#custom-expression-wrap) .practice-key-symbol .katex-display{margin:0}
:is(#practice-editor,#custom-expression-wrap) .practice-key-grid small{display:block;font-size:10px;line-height:1.4;color:var(--muted);white-space:normal}
:is(#practice-editor,#custom-expression-wrap) .practice-understood{padding:12px;margin-top:12px;border:1px solid var(--line);border-radius:10px;background:var(--soft);font-size:12px}
#practice-understood-math{max-width:100%;overflow-x:auto;padding-top:8px;min-height:38px;font-size:16px;direction:ltr}
#practice-input-error{padding:10px;margin:10px 0;border-inline-start:3px solid var(--orange);font-size:13px;line-height:1.7;color:var(--text);background:var(--soft)}
#practice-editor button:disabled{opacity:.55}
@media(max-width:420px){#practice-keyboard{padding:7px}:is(#practice-editor,#custom-expression-wrap) .practice-key-grid{gap:4px}:is(#practice-editor,#custom-expression-wrap) .practice-key-grid button{min-height:62px}:is(#practice-editor,#custom-expression-wrap) .practice-key-tabs button{font-size:11px}:is(#practice-editor,#custom-expression-wrap) .practice-key-symbol{font-size:16px}}

:is(#practice-editor,#custom-expression-wrap) .practice-key-symbol math-field{pointer-events:none;min-width:0;max-width:100%;border:0;background:transparent;padding:0;margin:0;font-size:inherit;color:inherit;--caret-color:transparent}
#practice-understood-math math-field{display:block;min-width:0;max-width:100%;border:0;padding:0;background:transparent;color:var(--text);font-size:19px;pointer-events:none}

.practice-step-field::part(virtual-keyboard-toggle){display:none}

:is(#practice-editor,#custom-expression-wrap) .practice-key-grid button>.practice-key-hit{position:absolute;inset:0;z-index:1;pointer-events:auto}
/* Step rows retain existing platform colors and font stack. */
#practice-step-list{display:grid;gap:12px;min-width:0}
:is(#practice-editor,#custom-expression-wrap) .practice-step-row{min-width:0;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--paper)}
:is(#practice-editor,#custom-expression-wrap) .practice-step-heading,:is(#practice-editor,#custom-expression-wrap) .practice-step-actions,#practice-step-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-block:8px}
:is(#practice-editor,#custom-expression-wrap) .practice-step-heading select{max-width:100%;min-height:44px;font-size:12px}
:is(#practice-editor,#custom-expression-wrap) .practice-step-actions button,#practice-step-controls button{min-height:44px;white-space:normal}
:is(#practice-editor,#custom-expression-wrap) .practice-step-status{font-size:13px;line-height:1.8;margin-bottom:0;overflow-wrap:anywhere}
:is(#practice-editor,#custom-expression-wrap) .practice-step-locked{background:var(--soft)}
:is(#practice-editor,#custom-expression-wrap) .practice-step-row[data-status=correct_progress]{border-inline-start:4px solid var(--accent)}
:is(#practice-editor,#custom-expression-wrap) .practice-step-row[data-status=correct_rewrite]{border-inline-start:4px solid var(--muted)}
:is(#practice-editor,#custom-expression-wrap) .practice-step-row[data-status=incorrect],:is(#practice-editor,#custom-expression-wrap) .practice-step-row[data-status=invalid]{border-inline-start:4px solid var(--orange)}
:is(#practice-editor,#custom-expression-wrap) .practice-step-row[data-status=unknown]{border-inline-start:4px dashed var(--muted)}
:is(#practice-editor,#custom-expression-wrap) .practice-step-detail{direction:ltr;overflow-x:auto;max-width:100%}
:is(#practice-editor,#custom-expression-wrap) .practice-step-detail math-field{background:transparent;border:0;max-width:100%;pointer-events:none}
@media(max-width:420px){:is(#practice-editor,#custom-expression-wrap) .practice-step-row{padding:8px}:is(#practice-editor,#custom-expression-wrap) math-field.practice-step-field{font-size:21px;padding:8px}}
.custom-practice{margin-block:16px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--bg);min-width:0}
.custom-practice summary{cursor:pointer;font-weight:700;color:var(--accent)}
.custom-practice label{display:block;margin-top:8px}
#custom-expression{direction:ltr;text-align:left;user-select:text;-webkit-user-select:text;-webkit-touch-callout:default}
:is(#practice-editor,#custom-expression-wrap) .practice-clipboard-message{font-size:12px;overflow-wrap:anywhere}
.custom-practice input:not([type=checkbox]),.custom-practice select,.custom-practice textarea{width:100%;max-width:100%;min-height:44px;box-sizing:border-box}
.custom-practice button{min-height:44px;margin-block:5px}
.custom-image{border:1px dashed var(--line);border-radius:10px;padding:10px;margin-block:12px}
#custom-preview{overflow-x:auto;max-width:100%;padding:8px;border:1px solid var(--line);background:var(--paper)}
#custom-preview math-field{max-width:100%;border:0;background:transparent;pointer-events:none}

.practice-session-tools button,#practice-retry-top,#practice-retry{min-height:44px;margin-block:6px;white-space:normal}
.practice-progress{margin-block:10px 18px}.practice-progress progress{width:100%;height:12px;accent-color:var(--accent)}

/* Numbered training flow: equal typography and touch geometry for both actions. */
#exercises .training-stage{font-size:16px;margin:18px 0 12px;line-height:1.7}
#exercises .training-source{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
#exercises .training-source button{flex:1;min-height:48px;font:inherit}
#exercises .training-source [aria-pressed=true]{background:var(--accent);color:var(--paper)}
#exercises .training-flow-action{display:flex;align-items:center;justify-content:center;width:100%;min-height:56px;border-width:1px;border-style:solid;padding:14px 18px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.6;letter-spacing:normal;box-sizing:border-box}
#exercises [hidden]{display:none!important}
