.calculation-memory-page [hidden] { display: none !important; }
.calculation-memory-page .exercise-header { flex-wrap: wrap; padding: 16px 0; }
.calculation-memory-page .exercise-nav { min-width: 0; flex-wrap: wrap; }
.calculation-memory-page .exercise-nav a { width: auto; flex: 0 0 auto; padding: 0 15px; white-space: nowrap; }
.calculation-memory-page .exercise-nav a:first-child { width: auto; padding: 0 15px; white-space: nowrap; }
.calculation-memory-page .exercise-main { padding-top: 26px; }
.calculation-memory-page .exercise-intro { grid-template-columns: 1fr; gap: 0; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--st-line); }
.calculation-memory-page .intro-copy { max-width: 1040px; }
.calculation-memory-page .intro-copy h1 { max-width: none; margin: 0 0 8px; font-family: inherit; font-size: clamp(20px, 2vw, 26px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.35; }
.calculation-memory-page .intro-copy p { max-width: none; font-size: 13px; line-height: 1.65; }
.cm-settings { position: static; width: 100%; gap: 24px; padding: clamp(20px, 3vw, 36px); }
.cm-settings .settings-card__heading span { font-size: 20px; }
.cm-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 36px; }
.cm-settings .forsaj-setting { align-content: start; align-items: center; }
.cm-settings .forsaj-setting small { font-size: 12px; line-height: 1.5; max-width: 280px; }
.cm-settings .forsaj-setting strong { font-size: 14px; }
.cm-settings select { max-width: 180px; min-height: 44px; padding: 8px; border: 1px solid var(--st-line); border-radius: 11px; background: #19392b; color: var(--st-paper); font: inherit; font-size: 13px; }
.cm-settings .forsaj-setting output { min-width: 100px; }
.cm-settings .forsaj-setting input[type="range"] { direction: rtl; }
.cm-range, .cm-categories { min-width: 0; padding: 16px 0 0; margin: 0; border: 0; border-top: 1px solid var(--st-line); }
.cm-range legend, .cm-categories legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-size: 14px; font-weight: 750; }
.cm-range > div { display: flex; clear: both; gap: 16px; }
.cm-range label { grid-template-columns: auto minmax(0, 1fr); flex: 1; }
.cm-settings .cm-range input { width: 100%; }
.cm-range small, .cm-categories p { display: block; color: var(--st-muted); font-size: 11px; margin: 8px 0 0; line-height: 1.6; }
.cm-categories > div { display: flex; clear: both; flex-wrap: wrap; gap: 10px; }
.cm-settings .cm-categories label { display: flex; gap: 8px; padding: 11px 14px; border: 1px solid var(--st-line); border-radius: 12px; background: rgba(255,255,255,.035); cursor: pointer; }
.cm-categories input { width: 18px; height: 18px; accent-color: var(--st-mint); }
.cm-help { max-width: 750px; margin: 0; color: var(--st-muted); font-size: 13px; line-height: 1.8; }
.cm-settings .start-button { justify-self: start; }
.cm-error { color: #ffb5af; font-size: 14px; line-height: 1.7; margin: 0; }
.cm-session { padding: 24px; border: 1px solid var(--st-line); border-radius: 24px; background: #0b2118; }
.cm-session-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cm-session-header .eyebrow { margin: 0; }
#cm-progress { color: var(--st-muted); font-size: 13px; }
.cm-button { min-height: 48px; padding: 12px 22px; border: 1px solid transparent; border-radius: 14px; color: var(--st-ink); background: var(--st-mint); font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }
.cm-button--quiet { color: var(--st-paper); border-color: var(--st-line); background: rgba(255,255,255,.055); }
.cm-button:hover { filter: brightness(1.1); }
.calculation-memory-page :is(button, input, select):focus-visible { outline: 3px solid var(--st-mint); outline-offset: 4px; }
.cm-stage { min-height: 420px; display: grid; place-items: center; padding: 32px 0; }
.cm-countdown { color: var(--st-mint); font-size: clamp(50px, 9vw, 96px); text-align: center; }
.cm-countdown[data-phase="loading"] { max-width: 100%; font-size: 20px; line-height: 1.6; }
.cm-pair { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 5vw, 80px); width: 100%; }
.cm-pair-picture { width: min(48vw, 58dvh, 540px); flex: 0 0 auto; aspect-ratio: 1; border-radius: 26px; overflow: hidden; background: #fff; }
.cm-pair img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
#cm-number { color: var(--st-paper); font-size: clamp(44px, calc(42vw / var(--cm-number-characters, 1)), 176px); font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.cm-answer-panel { display: grid; justify-items: center; gap: 18px; text-align: center; max-width: 620px; }
.cm-stage-number { color: var(--st-mint); font-size: 30px; font-weight: 850; }
.cm-stage h2 { margin: 10px 0; font-size: clamp(26px, 4vw, 40px); }
.cm-stage p { color: var(--st-muted); font-size: 14px; line-height: 1.6; }
.cm-answer-panel p { margin: 0; }
.cm-answer-panel label { font-size: 13px; color: var(--st-muted); }
#cm-answer { width: min(300px, 100%); min-height: 76px; padding: 12px; border: 1px solid var(--st-line); border-radius: 16px; background: #183b2c; color: var(--st-paper); text-align: center; font-size: 38px; }
.cm-memory, .cm-results { width: min(100%, 940px); text-align: center; }
.cm-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 24px 0 18px; }
.cm-choice { position: relative; display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border: 3px solid transparent; border-radius: 18px; background: #f7f3e8; color: #183326; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.cm-choice img { width: 100%; aspect-ratio: 1; max-height: 140px; object-fit: contain; border-radius: 8px; background: #fff; }
.cm-choice[aria-pressed="true"] { border-color: var(--st-mint); box-shadow: 0 0 0 2px #377e59; }
.cm-choice[aria-pressed="true"]::after { position: absolute; top: 6px; right: 6px; min-width: 32px; height: 32px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; color: var(--st-ink); background: var(--st-mint); font-size: 18px; font-weight: 850; content: attr(data-selection-order); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.cm-results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 30px 0; }
.cm-results-grid article { padding: 24px 16px; border: 1px solid var(--st-line); border-radius: 20px; }
.cm-results-grid h3 { margin-top: 0; color: var(--st-muted); font-size: 14px; }
.cm-results-grid strong { color: var(--st-mint); font-size: 24px; }
.cm-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; padding: 0; margin: 24px 0; list-style: none; text-align: center; }
.cm-review li { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--st-line); border-radius: 14px; }
.cm-review li > span { color: var(--st-muted); font-size: 12px; }
.cm-review img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #fff; }
.cm-review strong { overflow-wrap: anywhere; font-size: 16px; }
.cm-review li.is-correct { border-color: var(--st-mint); }
.cm-review li.is-incorrect { border-color: var(--st-red); }
.cm-review small { color: var(--st-muted); line-height: 1.5; }
.cm-results > button { margin: 8px; }
.cm-active .exercise-header, .cm-active .exercise-intro { display: none; }
.cm-active .cm-session { position: fixed; inset: 0; z-index: 1200; border: 0; border-radius: 0; overflow-y: auto; padding: 24px max(24px, calc((100vw - 1100px) / 2)); }
.cm-active .cm-session-header { min-height: 54px; }
.cm-active .cm-stage { min-height: calc(100dvh - 110px); }
.cm-active { overflow: hidden; }
@media (max-width: 680px) {
  .calculation-memory-page .exercise-nav { order: 1; width: 100%; }
}
@media (max-width: 650px) {
  .cm-settings-grid { grid-template-columns: 1fr; gap: 16px; }
  .cm-settings .forsaj-setting small { max-width: 210px; }
  .cm-session-header { gap: 8px; flex-wrap: wrap; }
  .cm-session-header .eyebrow { font-size: 11px; }
  .cm-active .cm-session { padding: 16px; }
  .cm-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cm-choice { padding: 6px; font-size: 10px; border-radius: 12px; }
  .cm-pair { flex-direction: column; gap: 24px; }
  .cm-pair-picture { width: min(82vw, 48dvh, 400px); }
  #cm-number { font-size: clamp(44px, calc(120vw / var(--cm-number-characters, 1)), 104px); }
  .cm-results-grid { grid-template-columns: 1fr; }
  .cm-settings .start-button { justify-self: stretch; }
}
