:root {
    color-scheme: light;
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-soft: #f8faff;
    --surface-blue: #f1f6ff;
    --text: #172033;
    --muted: #5e687c;
    --subtle: #667085;
    --line: #dfe4ed;
    --line-strong: #cbd3e1;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eaf1ff;
    --primary-action: #2563eb;
    --primary-action-hover: #1d4ed8;
    --on-primary: #ffffff;
    --accent: #7c3aed;
    --success: #047857;
    --success-soft: #eaf8f0;
    --danger: #c33a4a;
    --danger-soft: #fff0f2;
    --shadow-sm: 0 1px 2px rgb(21 31 52 / .05), 0 7px 22px rgb(37 55 89 / .04);
    --header-height: 68px;
    --workspace-sidebar-width: 260px;
    --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-math: Cambria, "Times New Roman", serif;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1420;
    --surface: #151d2a;
    --surface-soft: #192333;
    --surface-blue: #172640;
    --text: #edf2fb;
    --muted: #aab4c6;
    --subtle: #8591a6;
    --line: #293548;
    --line-strong: #3a485d;
    --primary: #6d99ff;
    --primary-hover: #8aafff;
    --primary-soft: #1c3157;
    --primary-action: #3f6fd8;
    --primary-action-hover: #315dbd;
    --on-primary: #ffffff;
    --accent: #a879ff;
    --success: #56c98c;
    --success-soft: #17382b;
    --danger: #ff8291;
    --danger-soft: #46232b;
    --shadow-sm: 0 10px 28px rgb(0 0 0 / .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: var(--font-sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, textarea, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
button, a, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 26%, transparent); }
.ph { display: inline-block; line-height: 1; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; transform: translateY(-160%); padding: 10px 14px; border-radius: 6px; color: var(--on-primary); background: var(--primary-action); font-weight: 750; }
.skip-link:focus { transform: translateY(0); }

.app-header { position: sticky; z-index: 60; top: 0; display: flex; min-height: var(--header-height); align-items: center; justify-content: space-between; gap: 24px; padding: 0 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(12px); }
.brand { display: inline-flex; min-width: 0; align-items: center; gap: 12px; color: var(--text); font-size: 19px; font-weight: 800; letter-spacing: -.025em; }
.brand-mark { display: block; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 9px; object-fit: cover; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 22%, transparent); }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a, .site-nav button, .icon-only { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; padding: 8px 11px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; }
.site-nav a:hover, .site-nav button:hover { color: var(--text); background: var(--surface-soft); }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.site-nav .ph { font-size: 17px; }
.site-nav .theme-toggle { width: 44px; padding: 0; }
.site-nav .theme-toggle span { display: none; }
.icon-only { width: 44px; padding: 0; font-size: 19px; }
.menu-toggle { display: none; }

.mobile-workspace-bar { display: none; }
.workspace-grid { display: grid; min-height: calc(100vh - var(--header-height)); grid-template-columns: var(--workspace-sidebar-width) minmax(520px, 1fr) 340px; align-items: stretch; }
.workspace-sidebar { position: sticky; top: var(--header-height); display: flex; min-width: 0; height: calc(100vh - var(--header-height)); height: calc(100dvh - var(--header-height)); align-self: start; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-top { display: flex; gap: 8px; padding: 20px 17px 10px; }
.new-problem-button { display: flex; min-width: 0; min-height: 44px; flex: 1; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--on-primary); background: var(--primary-action); font-weight: 800; box-shadow: 0 7px 16px color-mix(in srgb, var(--primary-action) 17%, transparent); }
.new-problem-button:hover { background: var(--primary-action-hover); }
.desktop-sidebar-toggle { min-width: 40px; flex: 0 0 40px; border: 1px solid var(--line-strong); background: var(--surface); }
.desktop-sidebar-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.sidebar-section { padding: 12px; }
.sidebar-section h2 { margin: 0; font-size: 12px; letter-spacing: -.01em; }
.sidebar-heading-row { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-heading-title, .sidebar-heading-actions { display: flex; min-width: 0; align-items: center; gap: 6px; }
.sidebar-close { display: none; }
.history-section { display: flex; height: 210px; min-height: 210px; flex: 0 0 210px; flex-direction: column; padding-top: 4px; border-bottom: 1px solid var(--line); }
.history-count { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: 9px; font-weight: 800; }
.history-clear { width: 40px; min-height: 40px; color: var(--subtle); font-size: 15px; }
.history-clear:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.history-list { display: grid; min-height: 0; flex: 1; align-content: start; gap: 3px; margin: 0; padding: 0 3px 0 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; scrollbar-width: thin; }
.history-list button { display: grid; width: 100%; min-height: 50px; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 7px; padding: 7px 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; text-align: left; }
.history-list button:hover, .history-list button.is-active { color: var(--primary); background: var(--primary-soft); }
.history-list .ph { font-size: 17px; }
.history-entry-copy { min-width: 0; }
.history-problem, .history-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-problem { color: currentColor; font-family: var(--font-math); font-size: 14px; }
.history-meta { margin-top: 1px; color: var(--subtle); font-size: 9px; }
.history-empty { display: flex; min-height: 96px; align-items: center; justify-content: center; gap: 9px; padding: 12px 8px; color: var(--subtle); text-align: left; }
.history-empty > .ph { font-size: 20px; }
.history-empty strong, .history-empty small { display: block; }
.history-empty strong { color: var(--muted); font-size: 11px; }
.history-empty small { max-width: 140px; margin-top: 2px; font-size: 9px; line-height: 1.4; }
.tools-section { display: flex; min-height: 0; flex: 1; flex-direction: column; padding-top: 4px; padding-bottom: 0; }
.tools-count { color: var(--subtle); font-size: 9px; font-weight: 750; }
.calculator-nav { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 3px 10px 0; scrollbar-width: thin; }
.calculator-group-label { margin: 15px 8px 5px; color: var(--subtle); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.calculator-nav a { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px; border-radius: 7px; color: var(--muted); }
.calculator-nav a:hover, .calculator-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.calculator-nav a + a { margin-top: 2px; }
.calculator-symbol { display: grid; min-width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--primary); background: var(--surface); font-family: var(--font-math); font-size: 14px; font-weight: 700; }
.calculator-nav strong, .calculator-nav small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calculator-nav strong { font-size: 12px; }
.calculator-nav small { margin-top: 1px; color: var(--subtle); font-size: 10px; }
.keyboard-tips { display: flex; min-height: 48px; flex: 0 0 48px; align-items: center; gap: 8px; margin: 0; padding: 0 14px; border: 0; border-top: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 700; }
.keyboard-tips:hover { color: var(--primary); background: var(--surface-soft); }
.keyboard-tips .ph:last-child { margin-left: auto; }

@media (min-width: 721px) {
    html[data-workspace-sidebar="collapsed"] { --workspace-sidebar-width: 72px; }
    html[data-workspace-sidebar="collapsed"] .sidebar-top { align-items: center; flex-direction: column; padding: 14px 12px 8px; }
    html[data-workspace-sidebar="collapsed"] .new-problem-button,
    html[data-workspace-sidebar="collapsed"] .desktop-sidebar-toggle { width: 46px; min-width: 46px; min-height: 44px; flex-basis: 44px; padding: 0; }
    html[data-workspace-sidebar="collapsed"] .new-problem-button span,
    html[data-workspace-sidebar="collapsed"] .history-section,
    html[data-workspace-sidebar="collapsed"] .tools-section > .sidebar-heading-row,
    html[data-workspace-sidebar="collapsed"] .calculator-group-label,
    html[data-workspace-sidebar="collapsed"] .calculator-nav a > span:last-child,
    html[data-workspace-sidebar="collapsed"] .keyboard-tips { display: none; }
    html[data-workspace-sidebar="collapsed"] .tools-section { padding: 6px 12px; }
    html[data-workspace-sidebar="collapsed"] .calculator-nav { padding: 0; }
    html[data-workspace-sidebar="collapsed"] .calculator-nav a { display: flex; min-height: 44px; align-items: center; justify-content: center; padding: 6px; }
    html[data-workspace-sidebar="collapsed"] .calculator-nav a + a { margin-top: 3px; }
}

.workspace-main { min-width: 0; padding: 14px; background: var(--bg); }
.problem-panel, .solution-panel, .inspector-panel { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.problem-panel { border-radius: 8px; }
.problem-panel-heading { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 18px; padding: 9px 15px 7px; }
.problem-heading-copy { min-width: 0; }
.problem-panel-heading h1 { margin: 0; font-size: 13px; letter-spacing: -.01em; }
.problem-panel-heading p { overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.workspace-breadcrumb { min-width: 0; margin: 0 0 2px; color: var(--subtle); font-size: 9px; line-height: 1.25; }
.workspace-breadcrumb ol, .workspace-breadcrumb li { display: flex; min-width: 0; align-items: center; }
.workspace-breadcrumb ol { gap: 5px; margin: 0; padding: 0; list-style: none; }
.workspace-breadcrumb li { gap: 5px; }
.workspace-breadcrumb li:last-child { overflow: hidden; }
.workspace-breadcrumb li:last-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-breadcrumb a:hover { color: var(--primary); }
.workspace-breadcrumb .ph { flex: 0 0 auto; font-size: 8px; }
.problem-editor { display: flex; height: 84px; align-items: stretch; margin: 0 15px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.problem-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 11%, transparent); }
.problem-editor textarea { min-width: 0; min-height: 0; flex: 1; resize: none; padding: 14px 16px; border: 0; border-radius: inherit; color: var(--text); background: transparent; font-family: var(--font-math); font-size: clamp(20px, 2.3vw, 29px); line-height: 1.3; }
.editor-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 12px; }
.operation-select select { min-height: 42px; padding: 0 30px 0 10px; border: 0; color: var(--text); background: var(--surface); font-size: 12px; font-weight: 750; }
.solve-button { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 16px; border: 0; border-radius: 7px; color: var(--on-primary); background: var(--primary-action); font-size: 13px; font-weight: 800; }
.solve-button:hover { background: var(--primary-action-hover); }
.interpretation-row { display: flex; min-height: 39px; align-items: center; justify-content: space-between; gap: 12px; margin: 0 15px; color: var(--muted); font-size: 11px; }
.interpretation-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.interpretation-row strong { color: var(--text); font-family: var(--font-math); font-size: 13px; }
.input-status { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: var(--success); font-weight: 750; }
.input-status.is-invalid { color: var(--danger); }
.example-strip { display: none; align-items: center; gap: 6px; overflow-x: auto; padding: 8px 15px 10px; border-top: 1px solid var(--line); white-space: nowrap; scrollbar-width: thin; }
.example-strip > span { color: var(--subtle); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.example-strip button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-soft); font-family: var(--font-math); font-size: 11px; }
.example-strip button:hover { border-color: var(--primary); color: var(--primary); }

.solution-panel { margin-top: 12px; border-radius: 8px; overflow: hidden; }
.solution-header { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.solution-header > div:first-child { min-width: 0; }
.solution-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.panel-label { display: block; color: var(--subtle); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.solution-header h2 { margin: 1px 0 0; font-size: 15px; }
.solution-header button, .answer-panel button { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 750; }
.solution-header button:hover, .answer-panel button:hover { border-color: var(--primary); color: var(--primary); }
.result-empty { display: grid; min-height: 360px; place-items: center; align-content: center; padding: 40px; text-align: center; }
.empty-mark { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 25px; }
.result-empty h3 { margin: 14px 0 4px; font-size: 16px; }
.result-empty p { max-width: 360px; margin: 0; color: var(--muted); font-size: 12px; }
.result-content[hidden], .result-empty[hidden], .error-panel[hidden] { display: none; }
.solution-introduction { padding: 16px 18px 15px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 48%, var(--surface)), var(--surface)); }
.solution-introduction > p { margin: 0 0 10px; color: var(--text); font-size: 15px; font-weight: 700; }
.solution-problem { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.solution-problem span { flex: 0 0 auto; color: var(--subtle); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.solution-problem strong { min-width: 0; overflow-wrap: anywhere; color: var(--text); font-family: var(--font-math); font-size: clamp(19px, 2.1vw, 25px); font-weight: 500; }
.result-visual { padding: 16px 18px 18px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.result-visual[hidden] { display: none; }
.result-visual-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.result-visual-heading h3 { margin: 2px 0 0; font-size: 15px; }
.result-visual-heading > p { max-width: 390px; margin: 0; color: var(--muted); font-size: 10px; text-align: right; }
.fraction-visual-equation { display: flex; align-items: center; justify-content: center; gap: 12px; overflow-x: auto; padding: 4px 0; }
.fraction-model { min-width: 112px; text-align: center; }
.fraction-diagram { display: flex; min-height: 74px; align-items: center; justify-content: center; gap: 5px; }
.fraction-diagram svg { width: 62px; height: 62px; flex: 0 0 62px; filter: drop-shadow(0 2px 2px rgb(21 31 52 / .08)); }
.fraction-slice { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.fraction-slice.is-filled { fill: var(--primary); stroke: color-mix(in srgb, var(--primary) 72%, var(--line)); }
.fraction-progress { fill: none; stroke: var(--primary); stroke-width: 16px; transform: rotate(-90deg); transform-origin: 50% 50%; }
.fraction-more { color: var(--muted); font-size: 12px; font-weight: 800; }
.fraction-model > div:last-child { margin-top: 6px; }
.fraction-label { display: block; color: var(--subtle); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.fraction-model strong { display: block; margin-top: 1px; font-family: var(--font-math); font-size: 19px; font-weight: 500; }
.fraction-model small { display: block; color: var(--muted); font-size: 9px; }
.fraction-operator { flex: 0 0 auto; color: var(--text); font-family: var(--font-math); font-size: 23px; }
.graph-shell { display: grid; gap: 12px; }
.graph-canvas-wrap { min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.graph-canvas { display: block; width: 100%; }
.graph-window-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.graph-window-controls label span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 750; }
.graph-window-controls input { width: 100%; min-height: 42px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface); font: inherit; font-size: 12px; }
.graph-window-controls input:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); outline: none; }
.graph-window-controls button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 5px; padding: 0 13px; border: 0; border-radius: 6px; color: var(--on-primary); background: var(--primary-action); font-size: 11px; font-weight: 800; }
.graph-window-controls button:hover { background: var(--primary-action-hover); }
.graph-feature-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; }
.graph-feature-list div { display: flex; align-items: baseline; gap: 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.graph-feature-list dt, .graph-feature-list dd { margin: 0; }
.graph-feature-list dt { color: var(--subtle); font-size: 9px; font-weight: 750; text-transform: capitalize; }
.graph-feature-list dd { font-family: var(--font-math); font-size: 12px; }
.lcm-model-shell { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.lcm-factor-list { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.lcm-factor-row { display: grid; grid-template-columns: minmax(44px, auto) 18px minmax(0, 1fr); align-items: center; gap: 7px; padding: 10px 12px; }
.lcm-factor-row + .lcm-factor-row { border-top: 1px solid var(--line); }
.lcm-factor-row strong { font-family: var(--font-math); font-size: 17px; font-weight: 600; }
.lcm-factor-row span { color: var(--subtle); text-align: center; }
.lcm-factor-row code { overflow-wrap: anywhere; color: var(--text); font-family: var(--font-math); font-size: 16px; }
.lcm-selection { overflow: hidden; border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line)); border-radius: 8px; background: var(--surface-blue); }
.lcm-result-row { display: grid; grid-template-columns: minmax(105px, .8fr) minmax(0, 1fr) auto minmax(48px, auto); align-items: center; gap: 9px; padding: 12px; }
.lcm-result-row + .lcm-result-row { border-top: 1px solid color-mix(in srgb, var(--primary) 16%, var(--line)); }
.lcm-result-copy { min-width: 0; }
.lcm-result-copy strong, .lcm-result-copy span { display: block; }
.lcm-result-copy strong { color: var(--text); font-size: 11px; font-weight: 800; }
.lcm-result-copy span { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.lcm-power-list { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; }
.lcm-power-list > span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--primary); background: var(--surface); font-family: var(--font-math); font-size: 13px; font-weight: 600; }
.lcm-equals { color: var(--subtle); font-family: var(--font-math); font-size: 18px; }
.lcm-result-value { color: var(--success); font-family: var(--font-math); font-size: 23px; font-weight: 600; text-align: right; }
.lcm-result-row--gcd .lcm-power-list > span, .lcm-result-row--gcd .lcm-result-value { color: var(--accent); }
.ratio-model-shell { display: grid; gap: 13px; }
.ratio-equation { display: flex; align-items: center; justify-content: center; gap: 13px; font-family: var(--font-math); font-size: 20px; }
.ratio-equation .ph { color: var(--subtle); font-size: 17px; }
.ratio-equation strong { color: var(--success); font-size: 24px; font-weight: 600; }
.ratio-original { color: var(--muted); }
.ratio-bars { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.ratio-bar-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(30px, auto); align-items: center; gap: 9px; }
.ratio-bar-label { color: var(--subtle); font-size: 9px; font-weight: 750; }
.ratio-bar-track { height: 18px; overflow: hidden; border-radius: 5px; background: var(--surface-soft); }
.ratio-bar-fill { display: block; min-height: 100%; border-radius: inherit; background: var(--primary); }
.ratio-bar-row:nth-child(even) .ratio-bar-fill { background: var(--accent); }
.ratio-bar-value { font-family: var(--font-math); font-size: 15px; font-weight: 600; text-align: right; }
.ratio-equivalents { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ratio-equivalents > span { margin-right: 3px; color: var(--muted); font-size: 10px; font-weight: 750; }
.ratio-equivalents strong { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-family: var(--font-math); font-size: 12px; font-weight: 600; }
.steps-list { margin: 0; padding: 0 15px; list-style: none; counter-reset: solution-step; }
.step-item { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 16px 0; counter-increment: solution-step; }
.step-item:not(:last-child) { border-bottom: 1px solid var(--line); }
.step-item::before { display: grid; width: 24px; height: 24px; place-items: center; margin-top: 1px; border-radius: 50%; color: var(--on-primary); background: var(--primary-action); content: counter(solution-step); font-size: 11px; font-weight: 800; }
.step-item:not(:last-child)::after { position: absolute; top: 37px; bottom: -14px; left: 11px; width: 1px; background: color-mix(in srgb, var(--primary) 28%, var(--line)); content: ""; }
.step-body { min-width: 0; }
.step-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.step-heading h3 { margin: 2px 0 5px; font-size: 14px; line-height: 1.35; }
.step-toggle { display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 5px; color: var(--muted); background: transparent; }
.step-toggle:hover { background: var(--surface-soft); }
.step-body.is-collapsed .step-details { display: none; }
.step-body.is-collapsed .step-toggle { transform: rotate(-90deg); }
.step-explanation { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.step-workings { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.working-row { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 10px 12px; }
.working-row + .working-row { border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.working-expression { min-width: 0; flex: 1; overflow-wrap: anywhere; color: var(--text); font-family: var(--font-math); font-size: clamp(17px, 1.8vw, 22px); line-height: 1.45; }
.working-note { max-width: 42%; flex: 0 1 auto; color: var(--muted); font-size: 10px; line-height: 1.35; text-align: right; }
.working-note::before { content: "("; }
.working-note::after { content: ")"; }
.working-row:last-child .working-expression { color: color-mix(in srgb, var(--text) 86%, var(--primary)); }
.working-row.is-fraction { padding-top: 12px; padding-bottom: 12px; }
.working-row.is-fraction .working-expression { display: flex; align-items: center; gap: 10px; }
.working-relation { flex: 0 0 auto; }
.math-fraction { display: inline-grid; min-width: 34px; grid-template-rows: auto auto; text-align: center; vertical-align: middle; }
.math-numerator { padding: 0 5px 2px; border-bottom: 1.5px solid currentColor; line-height: 1.15; }
.math-denominator { padding: 2px 5px 0; line-height: 1.15; }
.step-math { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.step-math div { min-width: 0; }
.step-math small { display: block; margin-bottom: 3px; color: var(--subtle); font-family: var(--font-sans); font-size: 9px; }
.step-math span { display: block; overflow-wrap: anywhere; font-family: var(--font-math); font-size: clamp(15px, 1.65vw, 19px); }
.step-math > i { color: var(--muted); font-style: normal; text-align: center; }
.step-why { display: flex; align-items: flex-start; gap: 5px; margin: 8px 0 0; padding: 8px 9px; border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--line)); border-radius: 5px; color: var(--muted); background: var(--surface-blue); font-size: 10px; line-height: 1.45; }
.step-why .ph { margin-top: 2px; color: var(--primary); }
.answer-panel { display: flex; align-items: center; gap: 12px; padding: 14px 15px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--success-soft) 58%, var(--surface)); }
.answer-check { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--success); }
.answer-panel > div { min-width: 0; flex: 1; }
.answer-panel > div span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; }
.answer-panel strong { display: block; overflow-wrap: anywhere; font-family: var(--font-math); font-size: 20px; font-weight: 500; }
.error-panel { margin: 16px; padding: 14px; border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line)); border-radius: 7px; color: var(--danger); background: var(--danger-soft); }
.error-panel strong, .error-panel span { display: block; }
.error-panel span { margin-top: 4px; font-size: 12px; }
.solution-panel.is-loading { opacity: .72; }
.solution-panel.is-loading .result-empty::after { width: 24px; height: 24px; margin-top: 16px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; content: ""; animation: spin .7s linear infinite; }

.workspace-inspector { min-width: 0; padding: 14px; border-left: 1px solid var(--line); background: var(--bg); }
.inspector-panel { border-radius: 8px; }
.inspector-panel + .inspector-panel { margin-top: 12px; }
.keypad-panel { overflow: hidden; }
.keypad-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.keypad-tabs button { min-height: 48px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; }
.keypad-tabs button:hover { color: var(--text); }
.keypad-tabs button[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary); }
.keypad-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 12px; }
.keypad-grid[hidden] { display: none; }
.keypad-grid button { min-height: 47px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface); font-family: var(--font-math); font-size: 16px; box-shadow: 0 1px 1px rgb(12 25 49 / .04); }
.keypad-grid button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.keypad-grid .key-primary { color: var(--on-primary); border-color: var(--primary-action); background: var(--primary-action); font-family: var(--font-sans); font-weight: 800; }
.keypad-grid .key-primary:hover { color: var(--on-primary); background: var(--primary-action-hover); }
.keypad-grid .key-wide { grid-column: span 2; }
.verification-card, .setting-card { padding: 14px; }
.inspector-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inspector-heading h2 { margin: 0; font-size: 13px; }
.inspector-heading > .ph { color: var(--success); font-size: 23px; }
.status-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 9px; font-weight: 850; }
.status-pill.is-neutral { color: var(--muted); background: var(--surface-soft); }
.status-pill.is-danger { color: var(--danger); background: var(--danger-soft); }
.verification-card > p, .setting-card > p { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.verification-card { transition: border-color .2s, box-shadow .2s; }
.verification-card.is-highlighted { border-color: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 16%, transparent); }
.candidate-checks { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.candidate-checks li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid var(--line); font-family: var(--font-math); font-size: 12px; }
.candidate-checks strong, .candidate-checks small { display: block; }
.candidate-checks small { margin-top: 2px; color: var(--muted); font-family: var(--font-sans); font-size: 9px; }
.candidate-checks .ph { color: var(--success); font-size: 16px; }
.setting-card label { display: block; margin: 9px 0 5px; color: var(--muted); font-size: 10px; }
.setting-card select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface-soft); font-size: 11px; }
.no-script-note { margin: 12px 0; padding: 12px; border: 1px solid var(--danger); color: var(--danger); }

.mobile-keypad-sheet { display: none; }
.keyboard-dialog { width: min(480px, calc(100% - 30px)); padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); box-shadow: 0 24px 70px rgb(0 0 0 / .24); }
.keyboard-dialog::backdrop { background: rgb(9 16 29 / .54); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; font-size: 16px; }
.keyboard-dialog dl { margin: 0; padding: 10px 17px 17px; }
.keyboard-dialog dl div { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.keyboard-dialog dl div:last-child { border-bottom: 0; }
.keyboard-dialog dt, .keyboard-dialog dd { margin: 0; }
.keyboard-dialog dd { color: var(--muted); font-size: 12px; }
kbd { padding: 2px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-soft); font-size: 10px; }

.content-page main { min-height: 70vh; }
.content-hero { max-width: 1120px; margin: 0 auto; padding: 70px 24px 38px; }
.content-hero > p, .directory-group > div:first-child > p { margin: 0 0 7px; color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.content-hero h1 { max-width: 820px; margin: 0; font-size: clamp(35px, 5vw, 58px); line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
.content-hero > span { display: block; max-width: 720px; margin-top: 17px; color: var(--muted); font-size: 17px; }
.content-layout { display: grid; max-width: 1120px; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; margin: 0 auto; padding: 0 24px 80px; }
.content-card, .content-aside { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-sm); }
.content-card { padding: 10px 34px; }
.content-card section { padding: 25px 0; border-bottom: 1px solid var(--line); }
.content-card section:last-child { border-bottom: 0; }
.content-card h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.025em; }
.content-card p { max-width: 750px; margin: 0; color: var(--muted); }
.content-aside { align-self: start; padding: 20px; }
.content-aside h2 { margin: 0 0 10px; font-size: 17px; }
.content-aside a { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.content-aside a:last-child { border-bottom: 0; }
.content-aside a:hover { color: var(--primary); }
.trust-hero { max-width: 1020px; padding-bottom: 32px; }
.trust-hero > span { max-width: 780px; line-height: 1.7; text-wrap: pretty; }
.trust-meta { display: flex; flex-wrap: wrap; gap: 9px 22px; margin-top: 22px; color: var(--subtle); font-size: 11px; font-weight: 700; }
.trust-meta span { display: inline-flex; align-items: center; gap: 6px; }
.trust-meta .ph { color: var(--primary); font-size: 15px; }
.trust-contact-channel { display: flex; max-width: 780px; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; padding: 18px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.trust-contact-channel > div { min-width: 0; }
.trust-contact-channel strong, .trust-contact-channel span { display: block; }
.trust-contact-channel strong { font-size: 13px; }
.trust-contact-channel span { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.trust-contact-channel a { display: inline-flex; min-height: 44px; flex: 0 0 auto; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--primary-action); border-radius: 7px; color: var(--on-primary); background: var(--primary-action); font-size: 13px; font-weight: 800; }
.trust-contact-channel a:hover { background: var(--primary-action-hover); }
.trust-layout { display: grid; max-width: 1020px; grid-template-columns: 210px minmax(0, 1fr); align-items: start; gap: 54px; margin: 0 auto; padding: 0 24px 88px; }
.trust-toc { position: sticky; top: calc(var(--header-height) + 24px); padding-top: 17px; border-top: 1px solid var(--line-strong); }
.trust-toc > strong { font-size: 13px; }
.trust-toc ol { display: grid; gap: 9px; margin: 14px 0 22px; padding: 0; list-style: none; }
.trust-toc a { color: var(--muted); font-size: 12px; line-height: 1.45; }
.trust-toc a:hover { color: var(--primary); }
.trust-home-link { display: flex; align-items: center; gap: 7px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--primary) !important; font-weight: 800; }
.trust-body { min-width: 0; }
.trust-body > section { padding: 0 0 36px; scroll-margin-top: calc(var(--header-height) + 20px); }
.trust-body > section + section { padding-top: 36px; border-top: 1px solid var(--line); }
.trust-body h2, .trust-related h2 { margin: 0 0 13px; font-size: 26px; line-height: 1.24; letter-spacing: -.028em; text-wrap: balance; }
.trust-body p { max-width: 72ch; margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.75; text-wrap: pretty; }
.trust-list { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.trust-list li { position: relative; padding-left: 27px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.trust-list li::before { position: absolute; top: .55em; left: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); content: ""; }
.trust-steps { display: grid; gap: 14px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: trust-steps; }
.trust-steps li { position: relative; min-height: 36px; padding: 5px 0 5px 48px; color: var(--muted); font-size: 15px; line-height: 1.65; counter-increment: trust-steps; }
.trust-steps li::before { position: absolute; top: 0; left: 0; display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); content: counter(trust-steps); font-size: 12px; font-weight: 850; }
.trust-note { margin-top: 22px; padding: 17px 19px; border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.trust-note strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 13px; }
.trust-note p { margin: 0; color: color-mix(in srgb, var(--text) 76%, var(--primary)); font-size: 14px; line-height: 1.65; }
.trust-table-wrap { margin-top: 22px; overflow-x: auto; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.trust-table-wrap table { width: 100%; min-width: 540px; border-collapse: collapse; text-align: left; }
.trust-table-wrap caption { padding: 13px 0; color: var(--text); font-size: 13px; font-weight: 800; text-align: left; }
.trust-table-wrap th, .trust-table-wrap td { padding: 13px 14px; border-top: 1px solid var(--line); vertical-align: top; font-size: 13px; line-height: 1.55; }
.trust-table-wrap thead th { color: var(--subtle); background: var(--surface-soft); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.trust-table-wrap tbody th { width: 31%; color: var(--text); font-weight: 750; }
.trust-table-wrap td { color: var(--muted); }
.trust-sources ul { display: grid; gap: 9px; margin: 18px 0 0; padding: 0; list-style: none; }
.trust-sources li { padding-top: 9px; border-top: 1px solid var(--line); }
.trust-sources a { color: var(--primary); font-size: 13px; font-weight: 750; }
.trust-sources .ph { margin-left: 6px; }
.trust-sources a:hover { text-decoration: underline; text-underline-offset: 3px; }
.trust-related { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 40px; margin-top: 10px; padding-top: 36px; border-top: 1px solid var(--line-strong); }
.trust-related > div:first-child p { margin: 0; font-size: 14px; line-height: 1.65; }
.trust-related > div:last-child { border-top: 1px solid var(--line); }
.trust-related a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.trust-related a > span { min-width: 0; }
.trust-related strong, .trust-related small { display: block; }
.trust-related strong { font-size: 14px; }
.trust-related small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.trust-related a > .ph { flex: 0 0 auto; color: var(--subtle); }
.trust-related a:hover strong, .trust-related a:hover > .ph { color: var(--primary); }
.directory-section { max-width: 1120px; margin: 0 auto; padding: 0 24px 80px; }
.directory-group { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; padding: 30px 0; border-top: 1px solid var(--line); }
.directory-group h2 { margin: 0; font-size: 20px; }
.directory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.directory-grid a { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.directory-grid a:hover { border-color: var(--primary); transform: translateY(-1px); }
.directory-grid .calculator-symbol { width: 42px; height: 42px; }
.directory-grid strong, .directory-grid small { display: block; }
.directory-grid strong { font-size: 14px; }
.directory-grid small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.directory-grid > a > .ph { color: var(--subtle); }

.site-breadcrumb { max-width: 1180px; margin: 0 auto; padding: 10px 24px 0; color: var(--muted); font-size: 11px; }
.site-breadcrumb ol { display: flex; min-width: 0; align-items: center; gap: 7px; margin: 0; padding: 0; list-style: none; }
.site-breadcrumb li { display: flex; min-width: 0; align-items: center; gap: 7px; }
.site-breadcrumb a:hover { color: var(--primary); }
.site-breadcrumb li:last-child { overflow: hidden; }
.site-breadcrumb li:last-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-breadcrumb .ph { color: var(--subtle); font-size: 10px; }

.learning-hub { max-width: 1120px; margin: 0 auto; padding: 72px 24px 88px; content-visibility: auto; contain-intrinsic-size: auto 4200px; }
.learning-header { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: end; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.learning-header > div > p { margin: 0 0 8px; color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.learning-header h2 { margin: 0; font-size: 32px; line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; }
.learning-header > p { max-width: 650px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; text-wrap: pretty; }
.table-of-contents { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.table-of-contents strong { font-size: 13px; }
.table-of-contents ol { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; counter-reset: toc; list-style: none; }
.table-of-contents li { counter-increment: toc; }
.table-of-contents a { color: var(--muted); font-size: 12px; font-weight: 650; }
.table-of-contents a::before { margin-right: 6px; color: var(--subtle); content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums; }
.table-of-contents a:hover { color: var(--primary); }
.seo-prose { max-width: 760px; margin: 0 auto; padding: 14px 0 28px; }
.seo-prose > section { padding: 34px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-height) + 18px); }
.seo-prose h2, .faq-heading h2, .related-learning h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.25; letter-spacing: -.025em; text-wrap: balance; }
.seo-prose p { margin: 0 0 15px; color: var(--muted); font-size: 16px; line-height: 1.75; text-wrap: pretty; }
.seo-prose p:last-child { margin-bottom: 0; }
.instruction-list { display: grid; gap: 10px; margin: 20px 0; padding: 0; list-style: none; counter-reset: instructions; }
.instruction-list li { position: relative; min-height: 32px; padding: 4px 0 4px 44px; color: var(--muted); line-height: 1.65; counter-increment: instructions; }
.instruction-list li::before { position: absolute; top: 0; left: 0; display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); content: counter(instructions); font-size: 12px; font-weight: 850; }
.formula-collection { display: grid; gap: 10px; margin: 22px 0; }
.formula-card { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.formula-card > span { color: var(--muted); font-size: 12px; font-weight: 750; }
.formula-expression { display: flex; min-width: 0; align-items: center; gap: 10px; overflow-wrap: anywhere; font-family: var(--font-math); font-size: 22px; }
.formula-expression i { font-style: normal; }
.content-fraction { display: inline-grid; grid-template-rows: auto auto; text-align: center; }
.content-fraction > span:first-child { padding: 0 7px 3px; border-bottom: 1.5px solid currentColor; }
.content-fraction > span:last-child { padding-top: 3px; }
.guide-sources { display: grid; max-width: 760px; grid-template-columns: 190px minmax(0, 1fr); gap: 10px 24px; margin: 0 auto; padding: 24px 0 32px; border-bottom: 1px solid var(--line); }
.guide-sources h2 { grid-row: 1 / span 2; margin: 0; font-size: 15px; line-height: 1.4; }
.guide-sources p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.guide-sources ul { display: flex; flex-wrap: wrap; gap: 7px 18px; margin: 0; padding: 0; list-style: none; }
.guide-sources a { color: var(--primary); font-size: 12px; font-weight: 750; }
.guide-sources .ph { margin-left: 5px; }
.guide-sources a:hover { text-decoration: underline; text-underline-offset: 3px; }
.related-learning { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 44px; padding: 38px 0; border-bottom: 1px solid var(--line); }
.related-learning > div:first-child p, .faq-heading p { margin: 0; color: var(--muted); }
.related-link-list { display: grid; }
.related-link-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.related-link-list a:first-child { padding-top: 0; }
.related-link-list a:last-child { border-bottom: 0; }
.related-link-list strong { font-size: 14px; }
.related-link-list span { color: var(--muted); font-size: 12px; }
.related-link-list .ph { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--subtle); }
.related-link-list a:hover strong, .related-link-list a:hover .ph { color: var(--primary); }
.faq-section { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; padding-top: 42px; scroll-margin-top: calc(var(--header-height) + 18px); }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; cursor: pointer; font-size: 14px; font-weight: 750; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary .ph { flex: 0 0 auto; color: var(--primary); transition: transform .18s ease-out; }
.faq-list details[open] summary .ph { transform: rotate(45deg); }
.faq-list details p { max-width: 68ch; margin: -2px 34px 17px 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.blog-hero { padding-bottom: 48px; }
.blog-index { max-width: 1120px; margin: 0 auto; padding: 0 24px 88px; }
.featured-article { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; padding: 36px; border-radius: 12px; color: #fff; background: #1e40af; }
.featured-article span { color: #dbeafe; font-size: 12px; font-weight: 750; }
.featured-article h2 { max-width: 760px; margin: 10px 0; font-size: 34px; line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
.featured-article p { max-width: 720px; margin: 0; color: #e8efff; font-size: 15px; line-height: 1.7; }
.featured-article > strong { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.featured-article:hover > strong { text-decoration: underline; text-underline-offset: 4px; }
.article-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 32px; border-top: 1px solid var(--line); }
.article-list article { min-width: 0; padding: 30px 30px 30px 0; border-bottom: 1px solid var(--line); }
.article-list article:nth-child(odd) { border-right: 1px solid var(--line); }
.article-list article:nth-child(even) { padding-right: 0; padding-left: 30px; }
.article-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--subtle); font-size: 11px; font-weight: 750; }
.article-list h2 { margin: 12px 0 9px; font-size: 21px; line-height: 1.3; letter-spacing: -.025em; text-wrap: balance; }
.article-list h2 a:hover { color: var(--primary); }
.article-list p { margin: 0 0 16px; color: var(--muted); line-height: 1.65; }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--primary); font-size: 12px; font-weight: 800; }

.article-page { padding-bottom: 88px; }
.article-hero { max-width: 900px; margin: 0 auto; padding: 60px 24px 42px; text-align: center; }
.article-hero > a { color: var(--primary); font-size: 12px; font-weight: 850; }
.article-hero h1 { margin: 13px auto 17px; font-size: clamp(38px, 5.5vw, 64px); line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.article-hero > p { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: 18px; line-height: 1.65; text-wrap: pretty; }
.article-byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin-top: 24px; color: var(--muted); font-size: 12px; }
.article-byline > span + span::before { margin-right: 16px; color: var(--line-strong); content: "•"; }
.article-byline a { color: var(--text); font-weight: 750; }
.author-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--on-primary); background: var(--primary-action); font-weight: 850; }
.article-byline .author-mark::before, .article-byline .author-mark + span::before { content: none; }
.article-layout { display: grid; max-width: 1020px; grid-template-columns: 230px minmax(0, 720px); gap: 54px; margin: 0 auto; padding: 0 24px; align-items: start; }
.article-toc { position: sticky; top: calc(var(--header-height) + 24px); padding-top: 18px; border-top: 1px solid var(--line); }
.article-toc > strong { font-size: 13px; }
.article-toc ol { display: grid; gap: 10px; margin: 14px 0 22px; padding: 0; list-style: none; }
.article-toc a { color: var(--muted); font-size: 12px; line-height: 1.4; }
.article-toc a:hover { color: var(--primary); }
.article-tool-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--primary) !important; font-weight: 800; }
.article-body { min-width: 0; }
.article-lead { margin: 0 0 34px; padding: 20px 22px; border-radius: 10px; color: color-mix(in srgb, var(--text) 86%, var(--primary)); background: var(--primary-soft); font-size: 16px; line-height: 1.7; }
.article-body > section { padding: 0 0 34px; scroll-margin-top: calc(var(--header-height) + 18px); }
.article-body h2 { margin: 0 0 13px; font-size: 26px; line-height: 1.24; letter-spacing: -.028em; text-wrap: balance; }
.article-body p { margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.75; text-wrap: pretty; }
.article-formulas { display: grid; gap: 8px; margin: 20px 0; }
.article-formulas div { padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; background: var(--surface); font-family: var(--font-math); font-size: 20px; text-align: center; }
.article-sources { padding-top: 28px !important; border-top: 1px solid var(--line); }
.article-sources ul { margin: 0; padding-left: 20px; }
.article-sources li { margin: 8px 0; color: var(--muted); }
.article-sources a { color: var(--primary); font-size: 13px; font-weight: 700; }
.article-sources .ph { margin-left: 5px; }
.article-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 6px; padding: 24px; border-radius: 10px; color: #fff; background: #1e3a8a; }
.article-cta h2 { margin-bottom: 5px; font-size: 20px; }
.article-cta p { margin: 0; color: #dbeafe; font-size: 13px; }
.article-cta > a { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 10px 13px; border-radius: 8px; color: #1e3a8a; background: #fff; font-size: 12px; font-weight: 850; }
.more-articles { max-width: 1020px; margin: 70px auto 0; padding: 32px 24px 0; border-top: 1px solid var(--line); }
.more-articles > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.more-articles h2 { margin: 0; font-size: 25px; }
.more-articles > div:first-child a { color: var(--primary); font-size: 12px; font-weight: 800; }
.more-article-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; border-top: 1px solid var(--line); }
.more-article-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding: 20px 20px 20px 0; border-bottom: 1px solid var(--line); }
.more-article-list a + a { padding-left: 20px; border-left: 1px solid var(--line); }
.more-article-list span { color: var(--subtle); font-size: 10px; font-weight: 800; }
.more-article-list strong { grid-column: 1; font-size: 13px; line-height: 1.4; }
.more-article-list .ph { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--subtle); }
.more-article-list a:hover strong, .more-article-list a:hover .ph { color: var(--primary); }

.html-sitemap { display: grid; max-width: 1120px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; margin: 0 auto; padding: 0 24px 88px; }
.html-sitemap > section { min-width: 0; }
.html-sitemap h2 { margin: 0 0 13px; padding-bottom: 11px; border-bottom: 1px solid var(--line); font-size: 18px; }
.html-sitemap ul { margin: 0; padding: 0; list-style: none; }
.html-sitemap li { border-bottom: 1px solid var(--line); }
.html-sitemap li a { display: block; padding: 10px 0; font-size: 13px; font-weight: 700; }
.html-sitemap li a:hover { color: var(--primary); }
.html-sitemap li span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner, .footer-bottom { display: flex; max-width: 1180px; align-items: center; justify-content: space-between; gap: 28px; margin: 0 auto; padding: 36px 24px; }
.footer-inner .brand { font-size: 15px; }
.footer-inner .brand-mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 14px; }
.footer-inner { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.7fr); align-items: start; gap: 70px; }
.footer-brand p { max-width: 300px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.footer-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.footer-nav h2 { margin: 0 0 11px; font-size: 12px; }
.footer-nav a { display: block; padding: 4px 0; color: var(--muted); font-size: 11px; font-weight: 650; }
.footer-nav a:hover { color: var(--primary); }
.footer-bottom { padding-top: 12px; padding-bottom: 18px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 10px; }
.footer-bottom > span:last-child { display: flex; gap: 14px; }
.footer-bottom a:hover { color: var(--primary); }
.footer-cookie-settings { display: inline-flex; min-height: 44px; align-items: center; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; }
.footer-cookie-settings:hover { color: var(--primary); }

.cookie-consent-banner { position: fixed; z-index: 120; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); left: 16px; display: grid; width: auto; max-width: 1080px; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 0 auto; padding: 17px 18px; border-radius: 12px; color: var(--text); background: var(--surface); box-shadow: 0 10px 30px rgb(8 15 28 / .22); animation: cookie-banner-in .2s cubic-bezier(.22, 1, .36, 1); }
.cookie-consent-banner[hidden] { display: none; }
.cookie-consent-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.cookie-consent-copy h2 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.cookie-consent-copy p { max-width: 690px; margin: 4px 0 3px; color: var(--muted); font-size: 12px; line-height: 1.5; text-wrap: pretty; }
.cookie-consent-copy a { color: var(--primary); font-size: 11px; font-weight: 750; }
.cookie-consent-copy a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cookie-consent-actions { display: flex; align-items: center; gap: 7px; }
.cookie-button { min-height: 44px; padding: 0 13px; border-radius: 7px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.cookie-button--quiet { border: 0; color: var(--muted); background: transparent; }
.cookie-button--quiet:hover { color: var(--text); background: var(--surface-soft); }
.cookie-button--secondary { border: 1px solid var(--line-strong); color: var(--text); background: var(--surface); }
.cookie-button--secondary:hover { border-color: var(--primary); color: var(--primary); }
.cookie-button--primary { border: 0; color: var(--on-primary); background: var(--primary-action); }
.cookie-button--primary:hover { background: var(--primary-action-hover); }

.cookie-preferences { position: fixed; width: min(620px, calc(100% - 30px)); max-height: min(82dvh, 700px); padding: 0; overflow: hidden; border: 0; border-radius: 12px; color: var(--text); background: var(--surface); box-shadow: 0 24px 70px rgb(0 0 0 / .28); }
.cookie-preferences[open] { display: flex; flex-direction: column; }
.cookie-preferences::backdrop { background: rgb(8 15 28 / .58); }
.cookie-preferences-header { display: flex; min-height: 70px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 16px 13px 20px; border-bottom: 1px solid var(--line); }
.cookie-preferences-header h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.cookie-preferences-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.cookie-preferences-close { flex: 0 0 40px; color: var(--muted); background: var(--surface-soft); }
.cookie-preferences-close:hover { color: var(--text); background: var(--primary-soft); }
.cookie-preferences-body { min-height: 0; padding: 0 20px; overflow-y: auto; overscroll-behavior: contain; }
.cookie-category { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cookie-category:last-child { border-bottom: 0; }
.cookie-category strong, .cookie-category label { display: inline-block; color: var(--text); font-size: 13px; font-weight: 800; }
.cookie-category p { max-width: 58ch; margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.cookie-category input { width: 20px; height: 20px; margin: 0 5px; accent-color: var(--primary); }
.cookie-category-status { padding: 5px 8px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 10px; font-weight: 850; white-space: nowrap; }
.cookie-preferences-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.cookie-preferences-footer > p { max-width: 220px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.cookie-preferences-footer > div { display: flex; gap: 8px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes keypad-sheet-in { from { transform: translateY(28px); } to { transform: translateY(0); } }
@keyframes cookie-banner-in { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1180px) {
    :root { --workspace-sidebar-width: 220px; }
    .workspace-grid { grid-template-columns: var(--workspace-sidebar-width) minmax(470px, 1fr) 300px; }
    .workspace-main, .workspace-inspector { padding: 10px; }
    .keypad-grid { gap: 5px; padding: 9px; }
    .keypad-grid button { min-height: 44px; }
}

@media (max-width: 980px) {
    .workspace-grid { grid-template-columns: var(--workspace-sidebar-width) minmax(0, 1fr); }
    .workspace-sidebar { grid-row: 1 / span 2; }
    .workspace-inspector { display: grid; grid-column: 2; grid-template-columns: minmax(0, 1.6fr) minmax(210px, 1fr); gap: 10px; border-top: 1px solid var(--line); border-left: 0; }
    .workspace-inspector .inspector-panel { margin: 0; }
    .workspace-inspector .setting-card:last-child { display: none; }
    .verification-card { grid-column: 2; grid-row: 1; }
    .setting-card { grid-column: 2; grid-row: 2; }
    .keypad-panel { grid-row: 1 / span 2; }
    .article-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 34px; }
    .footer-inner { grid-template-columns: 1fr; gap: 30px; }
    .html-sitemap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; }
    .site-nav { position: absolute; top: calc(100% + 1px); right: 12px; display: none; width: min(280px, calc(100vw - 24px)); align-items: stretch; flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
    .site-nav.is-open { display: flex; }
    .site-nav a, .site-nav .theme-toggle { width: 100%; justify-content: flex-start; }
    .site-nav .theme-toggle { padding: 8px 11px; }
    .site-nav .theme-toggle span { display: inline; }
}

@media (max-width: 720px) {
    :root { --header-height: 60px; }
    html.mobile-keypad-open, html.mobile-keypad-open body { overflow: hidden; }
    .app-header { padding: 0 12px; }
    .brand { gap: 8px; font-size: 15px; }
    .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 7px; font-size: 15px; }
    .mobile-workspace-bar { position: sticky; z-index: 40; top: var(--header-height); display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
    .mobile-workspace-bar button { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 750; }
    .mobile-workspace-bar > span { min-width: 0; overflow: hidden; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
    .workspace-grid { display: block; min-height: auto; }
    .workspace-sidebar { position: fixed; z-index: 80; top: 0; bottom: 0; left: 0; width: min(86vw, 300px); height: 100vh; height: 100dvh; transform: translateX(-105%); overflow-y: auto; border-right: 1px solid var(--line); box-shadow: 20px 0 60px rgb(0 0 0 / .18); transition: transform .2s ease; }
    .workspace-sidebar.is-open { transform: translateX(0); }
    .workspace-overlay { position: fixed; z-index: 70; inset: 0; background: rgb(8 15 28 / .48); }
    .workspace-overlay:not([hidden]) { display: block; }
    .sidebar-close { display: inline-flex; }
    .desktop-sidebar-toggle { display: none; }
    .history-section { height: 190px; min-height: 190px; flex-basis: 190px; }
    .workspace-main { padding: 10px; }
    .problem-panel-heading { align-items: flex-start; flex-direction: column; gap: 2px; padding: 12px 10px 8px; }
    .workspace-breadcrumb { display: none; }
    .problem-panel-heading h1 { font-size: 18px; }
    .problem-panel-heading p { max-width: 100%; text-align: left; }
    .problem-editor { height: 128px; flex-direction: column; }
    .problem-editor textarea { min-height: 72px; padding: 14px; font-size: 22px; }
    .editor-actions { justify-content: flex-end; padding: 7px; border-top: 1px solid var(--line); }
    .interpretation-row { align-items: flex-start; flex-direction: column; gap: 3px; padding: 8px 0; }
    .interpretation-row > span:first-child { width: 100%; }
    .example-strip { display: flex; }
    .result-empty { min-height: 250px; }
    .solution-introduction { padding: 14px 12px; }
    .solution-problem { align-items: flex-start; flex-direction: column; gap: 4px; }
    .result-visual { padding: 14px 12px 16px; }
    .result-visual-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .result-visual-heading > p { max-width: none; text-align: left; }
    .fraction-visual-equation { justify-content: flex-start; gap: 9px; }
    .fraction-model { min-width: 98px; }
    .fraction-diagram svg { width: 54px; height: 54px; flex-basis: 54px; }
    .graph-window-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .graph-window-controls button { grid-column: 1 / -1; min-height: 44px; }
    .lcm-model-shell { grid-template-columns: 1fr; }
    .lcm-result-row { grid-template-columns: minmax(0, 1fr) auto minmax(48px, auto); }
    .lcm-result-copy { grid-column: 1 / -1; }
    .steps-list { padding-right: 10px; padding-left: 10px; }
    .working-row { align-items: flex-start; flex-direction: column; gap: 4px; padding: 10px; }
    .working-note { max-width: 100%; text-align: left; }
    .working-row.is-fraction .working-expression { width: 100%; }
    .step-math { grid-template-columns: 1fr; gap: 5px; }
    .step-math > i { transform: rotate(90deg); }
    .answer-panel { align-items: flex-start; flex-wrap: wrap; }
    .answer-panel button { min-height: 44px; margin-left: 40px; }
    .solution-actions button { width: 44px; min-height: 44px; justify-content: center; padding: 0; }
    .solution-actions button span { display: none; }
    .workspace-inspector { display: block; padding: 10px; border-top: 1px solid var(--line); }
    .workspace-inspector > .keypad-panel { display: none; }
    .workspace-inspector .inspector-panel + .inspector-panel { margin-top: 10px; }
    .workspace-inspector .setting-card:last-child { display: block; }
    .mobile-keypad-sheet { position: fixed; z-index: 100; inset: auto 0 0; width: 100%; max-width: none; max-height: min(88dvh, 680px); margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 14px 14px 0 0; color: var(--text); background: var(--surface); box-shadow: 0 -12px 34px rgb(8 15 28 / .24); }
    .mobile-keypad-sheet[open] { display: flex; flex-direction: column; animation: keypad-sheet-in .2s cubic-bezier(.22, 1, .36, 1); }
    .mobile-keypad-sheet::backdrop { background: rgb(8 15 28 / .56); }
    .mobile-keypad-handle { width: 38px; height: 4px; flex: 0 0 auto; margin: 8px auto 2px; border-radius: 999px; background: var(--line-strong); }
    .mobile-keypad-heading { display: flex; min-height: 52px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 12px 9px 16px; border-bottom: 1px solid var(--line); }
    .mobile-keypad-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
    .mobile-keypad-heading span { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
    .mobile-keypad-close { width: 44px; min-height: 44px; flex: 0 0 44px; color: var(--muted); background: var(--surface-soft); }
    .mobile-keypad-close:hover { color: var(--text); background: var(--primary-soft); }
    .mobile-keypad-editor { flex: 0 0 auto; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
    .mobile-keypad-editor label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
    .mobile-keypad-editor textarea { display: block; width: 100%; min-height: 66px; max-height: 112px; resize: none; padding: 10px 12px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: var(--surface); font-family: var(--font-math); font-size: 19px; line-height: 1.35; caret-color: var(--primary); }
    .mobile-keypad-editor textarea:focus { border-color: var(--primary); }
    .mobile-keypad-editor p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
    .mobile-keypad-slot { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
    .mobile-keypad-slot .keypad-panel { display: block; border-radius: 0; }
    .mobile-keypad-slot .keypad-tabs { position: sticky; z-index: 1; top: 0; background: var(--surface); }
    .mobile-keypad-slot .keypad-tabs button { min-height: 44px; }
    .keypad-grid button { min-height: 50px; }
    .site-footer { margin-top: 0; }
    .footer-inner { align-items: flex-start; flex-direction: column; }
    .footer-inner nav { justify-content: flex-start; }
    .footer-bottom { align-items: flex-start; flex-direction: column; gap: 4px; }
    .footer-bottom > span:last-child { flex-wrap: wrap; }
    .footer-bottom a { display: inline-flex; min-height: 44px; align-items: center; }
    .cookie-consent-banner { right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; grid-template-columns: 34px minmax(0, 1fr); gap: 10px 12px; padding: 14px; }
    .cookie-consent-icon { width: 34px; height: 34px; font-size: 18px; }
    .cookie-consent-actions { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cookie-consent-actions .cookie-button { width: 100%; }
    .cookie-consent-actions .cookie-button--primary { grid-column: 1 / -1; }
    .cookie-preferences { inset: auto 0 0; width: 100%; max-width: none; max-height: min(90dvh, 720px); margin: 0; border-radius: 14px 14px 0 0; }
    .cookie-preferences-header { padding-right: 12px; padding-left: 16px; }
    .cookie-preferences-body { padding-right: 16px; padding-left: 16px; }
    .cookie-preferences-footer { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
    .cookie-preferences-footer > p { max-width: none; }
    .cookie-preferences-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
    .content-hero { padding: 48px 18px 28px; }
    .content-hero h1 { font-size: 37px; }
    .content-hero > span { font-size: 15px; }
    .content-layout { grid-template-columns: 1fr; padding: 0 14px 60px; }
    .content-card { padding: 4px 20px; }
    .trust-hero { padding-right: 16px; padding-left: 16px; }
    .trust-layout { grid-template-columns: 1fr; gap: 30px; padding-right: 16px; padding-bottom: 64px; padding-left: 16px; }
    .trust-toc { position: static; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px 20px; }
    .trust-toc ol { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
    .trust-home-link { align-self: start; }
    .trust-body h2, .trust-related h2 { font-size: 23px; }
    .trust-related { grid-template-columns: 1fr; gap: 20px; }
    .directory-section { padding: 0 14px 60px; }
    .directory-group { grid-template-columns: 1fr; gap: 14px; }
    .directory-grid { grid-template-columns: 1fr; }
    .site-breadcrumb { padding-right: 14px; padding-left: 14px; }
    .learning-hub { padding: 52px 14px 64px; }
    .learning-header { grid-template-columns: 1fr; gap: 16px; }
    .learning-header h2 { font-size: 27px; }
    .table-of-contents { grid-template-columns: 1fr; gap: 12px; }
    .table-of-contents ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .seo-prose > section { padding: 28px 0; }
    .seo-prose h2, .faq-heading h2, .related-learning h2 { font-size: 22px; }
    .formula-card { grid-template-columns: 1fr; gap: 8px; }
    .guide-sources { grid-template-columns: 1fr; gap: 8px; }
    .guide-sources h2 { grid-row: auto; }
    .related-learning, .faq-section { grid-template-columns: 1fr; gap: 26px; }
    .blog-index { padding-right: 14px; padding-bottom: 64px; padding-left: 14px; }
    .featured-article { grid-template-columns: 1fr; align-items: start; padding: 26px; }
    .featured-article h2 { font-size: 29px; }
    .article-list { grid-template-columns: 1fr; }
    .article-list article, .article-list article:nth-child(even) { padding: 24px 0; border-right: 0; }
    .article-hero { padding: 44px 16px 32px; text-align: left; }
    .article-hero h1 { margin-right: 0; margin-left: 0; font-size: 40px; }
    .article-hero > p { margin-left: 0; font-size: 16px; }
    .article-byline { justify-content: flex-start; }
    .article-layout { grid-template-columns: 1fr; gap: 30px; padding-right: 16px; padding-left: 16px; }
    .article-toc { position: static; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
    .article-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .article-cta { align-items: flex-start; flex-direction: column; }
    .more-articles { margin-top: 42px; padding-right: 16px; padding-left: 16px; }
    .more-article-list { grid-template-columns: 1fr; }
    .more-article-list a, .more-article-list a + a { padding: 17px 0; border-left: 0; }
    .html-sitemap { grid-template-columns: 1fr; padding-right: 16px; padding-bottom: 64px; padding-left: 16px; }
    .footer-inner { grid-template-columns: 1fr; gap: 30px; }
    .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
    .example-strip { padding-right: 10px; padding-left: 10px; }
    .problem-editor, .interpretation-row { margin-right: 10px; margin-left: 10px; }
    .solution-header { align-items: flex-start; }
    .solution-header h2 { font-size: 13px; }
    .solution-header button { padding: 5px 7px; }
    .fraction-operator { font-size: 19px; }
    .graph-feature-list { display: grid; grid-template-columns: 1fr 1fr; }
    .lcm-selection { grid-template-columns: minmax(0, 1fr) auto auto; }
    .ratio-bar-row { grid-template-columns: 45px minmax(0, 1fr) 28px; gap: 6px; }
    .step-item { grid-template-columns: 30px minmax(0, 1fr); }
    .keypad-grid { gap: 4px; padding: 8px; }
    .keypad-grid button { min-height: 47px; }
    .table-of-contents ol, .article-toc ol { grid-template-columns: 1fr; }
    .formula-expression { font-size: 19px; }
    .article-hero h1 { font-size: 35px; }
    .article-byline > span + span::before { margin-right: 9px; }
    .footer-nav { gap: 22px 16px; }
    .cookie-consent-banner { grid-template-columns: 1fr; }
    .cookie-consent-icon { display: none; }
    .cookie-category { gap: 14px; }
    .cookie-preferences-footer > div { grid-template-columns: 1fr; }
    .trust-toc { grid-template-columns: 1fr; }
    .trust-toc ol { grid-column: 1; grid-row: auto; }
    .trust-contact-channel { align-items: flex-start; flex-direction: column; gap: 14px; }
    .trust-contact-channel a { width: 100%; min-width: 0; max-width: 100%; justify-content: center; text-align: center; overflow-wrap: anywhere; }
    .trust-table-wrap { margin-right: -2px; margin-left: -2px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
    .app-header, .workspace-sidebar, .workspace-inspector, .mobile-workspace-bar, .calculator-intro, .problem-panel, .site-footer, .cookie-consent-banner, .cookie-preferences, .result-empty, .solution-header button, .answer-panel button { display: none !important; }
    body, .workspace-main { color: #111; background: #fff; }
    .workspace-grid { display: block; }
    .workspace-main { padding: 0; }
    .solution-panel { margin: 0; border: 0; box-shadow: none; }
    .result-content[hidden] { display: block; }
}
