:root {
  --bg:#f5f9ff;
  --ink:#17324d;
  --blue:#175cd3;
  --sky:#cce7ff;
  --muted:#506780;
  --line:#d5e4f3;
}

* {
  box-sizing:border-box;
}

html {
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body {
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Arial,Helvetica,sans-serif;
  font-size:18px;
  line-height:1.6;
}

button,input,select {
  font:inherit;
}

button,a,input,select {
  -webkit-tap-highlight-color:transparent;
}

button {
  -webkit-appearance:none;
  appearance:none;
  cursor:pointer;
  min-height:44px;
  line-height:1.4;
  touch-action:manipulation;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:3px solid #077ea4;
  outline-offset:4px;
}

header,main,footer {
  max-width:1160px;
  margin:auto;
}

header {
  height:100px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid var(--line);
}

a {
  text-decoration:none;
  color:inherit;
}

.brand {
  display:flex;
  align-items:center;
  font-size:22px;
  font-weight:800;
  letter-spacing:-1px;
}

.brand-icon {
  background:var(--blue);
  color:var(--sky);
  border-radius:12px;
  font-size:36px;
  line-height:1;
  letter-spacing:0;
  width:43px;
  height:43px;
  display:grid;
  place-items:center;
  margin-right:12px;
  font-weight:400;
}

.brand-end {
  font-weight:400;
  color:#506780;
}

.header-note {
  font-size:16px;
  color:var(--muted);
}

.intro {
  padding:52px 0 42px;
  position:relative;
}

.eyebrow {
  font-size:14px;
  font-weight:700;
  letter-spacing:1.5px;
  color:#37668d;
}

h1 {
  font-size:66px;
  letter-spacing:-3.5px;
  line-height:1.12;
  margin:17px 0 20px;
  position:relative;
  width:fit-content;
}

h2,h3 {
  line-height:1.3;
}

h1 span {
  color:#1763bb;
}

h1 svg {
  position:absolute;
  width:45%;
  right:0;
  bottom:-12px;
  fill:none;
  stroke:#80c6f8;
  stroke-width:5;
}

.intro>p {
  font-size:18px;
  line-height:1.7;
  color:#506780;
}

.intro-badges {
  position:absolute;
  right:0;
  bottom:50px;
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  font-size:14px;
  color:#486b89;
}

.tabs {
  display:flex;
  gap:34px;
  border-bottom:1px solid var(--line);
  margin-bottom:34px;
}

.tabs button {
  font-size:18px;
  border:0;
  background:none;
  color:#506780;
  padding:15px 0 19px;
  font-weight:600;
  border-bottom:3px solid transparent;
  margin-bottom:-1px;
}

.tabs button span {
  font-size:14px;
  margin-right:8px;
  font-weight:400;
}

.tabs button.active {
  color:var(--blue);
  border-bottom-color:var(--blue);
}

.panel h2 {
  font-size:27px;
  letter-spacing:-.8px;
  margin:10px 0 18px;
}

.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.little-note {
  font-family:Georgia,serif;
  font-style:italic;
  color:#526d88;
}

.rows {
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:10px;
  margin:10px 0 27px;
}

.rows button {
  height:54px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#ffffff;
  font-size:19px;
  color:var(--ink);
  transition:transform .15s,background .15s;
}

@media (hover:hover) and (pointer:fine) {
  .rows button:hover {
    transform:translateY(-3px);
    background:#e3f1ff;
  }
}

.rows button.active {
  background:var(--blue);
  color:white;
  border-color:var(--blue);
  box-shadow:0 4px 0 #123d84;
}

.learn-grid {
  display:grid;
  grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);
  gap:23px;
}

.visual-card {
  min-width:0;
  padding:27px 30px;
  border:1px solid #c8def5;
  background:#e9f3ff;
  border-radius:18px;
}

.card-top {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  justify-content:space-between;
  align-items:center;
  font-size:16px;
  color:#426482;
}

.pill {
  font-size:14px;
  line-height:1.4;
  font-weight:bold;
  letter-spacing:.6px;
  background:#d4e9ff;
  padding:8px 10px;
  border-radius:5px;
}

.visual-card h3 {
  font-size:39px;
  letter-spacing:-1px;
  margin:27px 0;
}

.dots {
  display:grid;
  gap:9px;
  width:fit-content;
  max-width:100%;
  margin:0 auto 20px;
  min-height:125px;
  align-content:center;
}

.dot {
  width:14px;
  height:14px;
  background:#2164b4;
  border-radius:50%;
}

.dots .dot:nth-child(2n) {
  background:#4a8dd6;
}

.stepper {
  display:flex;
  align-items:center;
  gap:12px;
  margin:25px 0;
  font-size:16px;
  color:#426482;
}

.stepper button {
  background:#ffffff;
  border:1px solid #bfd7ef;
  border-radius:50%;
  width:44px;
  height:44px;
  font-size:24px;
  color:var(--blue);
  flex-shrink:0;
}

.stepper input {
  width:100%;
  min-width:0;
  min-height:44px;
  accent-color:var(--blue);
}

.stepper label {
  white-space:nowrap;
}

.tip {
  display:flex;
  gap:12px;
  border-top:1px solid #c5dcf3;
  padding-top:20px;
  font-size:18px;
}

.tip>span {
  font-size:25px;
  color:#3274bb;
}

.tip p {
  margin:6px 0 0;
  line-height:1.6;
  color:#426482;
}

.sequence-card {
  min-width:0;
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:25px;
}

.sequence-card h3 {
  font-size:21px;
  margin:0 0 7px;
}

.sequence-card>p {
  font-size:16px;
  color:var(--muted);
  margin-bottom:16px;
}

#sequence {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px 14px;
  margin-bottom:18px;
}

.sequence-line {
  background:#f3f8ff;
  padding:9px 12px;
  border-radius:6px;
  font-size:20px;
  gap:8px;
  line-height:1.5;
  display:flex;
  justify-content:space-between;
  color:#506780;
}

.sequence-line.highlight {
  background:#ddecff;
  color:var(--blue);
}

.sequence-line strong {
  color:var(--ink);
}

.primary {
  border:0;
  background:var(--blue);
  color:#fff;
  border-radius:9px;
  padding:14px 20px;
  font-weight:600;
  font-size:18px;
}

@media (hover:hover) and (pointer:fine) {
  .primary:hover {
    background:#124da9;
  }
}

.primary.full {
  width:100%;
  display:flex;
  justify-content:space-between;
}

.bottom-strip {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:26px;
  margin-top:37px;
  padding:28px 0;
  border-bottom:1px solid var(--line);
}

.bottom-strip>div {
  display:flex;
  gap:15px;
  align-items:flex-start;
}

.feature-icon {
  font-size:25px;
  color:#2f74b9;
}

.bottom-strip strong {
  font-size:18px;
}

.bottom-strip p {
  font-size:16px;
  color:var(--muted);
  line-height:1.6;
  margin:7px 0;
}

footer {
  display:flex;
  flex-wrap:wrap;
  gap:16px 24px;
  justify-content:space-between;
  align-items:center;
  padding:27px 0;
  font-size:14px;
  color:#506780;
}

.footer-brand {
  font-weight:bold;
  color:#426482;
}

.text-button {
  border:0;
  background:none;
  color:#306496;
  padding:8px;
  font-size:16px;
}

.settings {
  display:flex;
  flex-wrap:wrap;
  gap:20px;
  align-items:end;
  padding:25px;
  background:#e9f3ff;
  border-radius:15px;
}

.settings label {
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:16px;
}

.settings select {
  min-height:48px;
  font-size:18px;
  max-width:100%;
  padding:12px;
  border-radius:7px;
  border:1px solid var(--line);
  background:white;
  color:var(--ink);
}

.quiz {
  max-width:650px;
  margin:0 auto;
  text-align:center;
  padding:30px;
  background:#e9f3ff;
  border-radius:18px;
}

.quiz-top {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  font-size:16px;
}

.quiz progress {
  width:100%;
  accent-color:var(--blue);
  height:9px;
  margin-top:15px;
}

.quiz h2 {
  font-size:58px;
  margin:30px;
}

.quiz input {
  width:135px;
  padding:12px;
  font-size:28px;
  border:1px solid #8ab3df;
  border-radius:8px;
  text-align:center;
}

.quiz form {
  display:flex;
  gap:12px;
  justify-content:center;
}

#feedback {
  min-height:28px;
  line-height:1.6;
}

.result-score {
  font-size:clamp(32px,5vw,50px);
  line-height:1.25;
  margin:20px 0;
  color:var(--blue);
}

table {
  width:100%;
  border-collapse:collapse;
  margin:20px 0;
}

td,th {
  padding:12px;
  border-bottom:1px solid var(--line);
  text-align:left;
}

.history {
  font-size:16px;
  color:#506780;
}

.history h3 {
  font-size:18px;
}

.history-items {
  display:flex;
  flex-wrap:wrap;
  gap:15px;
}

.history-items span {
  padding:10px;
  background:#e9f3ff;
  border-radius:7px;
}

dialog {
  width:min(550px,calc(100% - 32px));
  max-height:calc(100vh - 32px);
  max-height:calc(100dvh - 32px);
  overflow-y:auto;
  font-size:18px;
  max-width:550px;
  border:1px solid var(--line);
  border-radius:15px;
  padding:30px;
  background:var(--bg);
  color:var(--ink);
}

dialog p {
  line-height:1.7;
}

dialog::backdrop {
  background:#102c5077;
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  overflow:hidden;
  clip:rect(0,0,0,0);
}

[hidden] {
  display:none!important;
}

@media(min-width:1450px) {
  .intro {
    padding-top:65px;
  }
}

@media(max-width:1220px) {
  header,main,footer {
    margin-left:30px;
    margin-right:30px;
  }
}

@media(max-width:1000px) {
  .intro-badges {
    position:static;
    margin-top:23px;
  }
  .learn-grid {
    grid-template-columns:1fr;
  }
}

@media(max-width:750px) {
  header {
    height:80px;
  }
  .header-note,.little-note {
    display:none;
  }
  .brand {
    font-size:18px;
  }
  .brand-icon {
    width:35px;
    height:35px;
    font-size:30px;
  }
  .intro {
    padding:35px 0 25px;
  }
  h1 {
    font-size:46px;
    letter-spacing:-2.5px;
  }
  .intro-badges {
    position:static;
    font-size:14px;
    gap:8px 14px;
    margin-top:23px;
  }
  .tabs {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:0;
  }
  .tabs button {
    min-width:0;
    min-height:68px;
    padding:12px 4px;
    font-size:16px;
    white-space:normal;
    hyphens:manual;
    overflow-wrap:normal;
  }
  .tabs button span {
    display:none;
  }
  .section-heading h2 {
    font-size:26px;
  }
  .rows {
    grid-template-columns:repeat(6,1fr);
    gap:8px;
  }
  .rows button {
    height:44px;
  }
  .bottom-strip {
    grid-template-columns:1fr;
    gap:17px;
  }
  .settings .primary {
    width:100%;
  }
  .visual-card {
    padding:23px 20px;
  }
  .dot {
    width:12px;
    height:12px;
  }
  .dots {
    gap:8px;
  }
  .stepper {
    gap:8px;
  }
  .stepper label {
    display:none;
  }
  footer {
    gap:18px;
  }
  footer>span {
    display:none;
  }
  header,main,footer {
    margin-left:20px;
    margin-right:20px;
  }
  .quiz {
    padding:20px 12px;
  }
  .quiz h2 {
    font-size:45px;
    margin:26px 0;
  }
  .quiz form {
    flex-wrap:wrap;
  }
  .sequence-card {
    padding:20px;
  }
  .sequence-line {
    padding:9px 10px;
  }
  td,th {
    padding:10px 8px;
    font-size:16px;
  }
  dialog {
    padding:24px;
  }
}

.visitor-count {
  display:inline-flex;
  align-items:center;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#e9f3ff;
  color:#426482;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

.result-actions,.pdf-actions {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:24px;
}

.secondary {
  border:1px solid #8ab3df;
  background:#ffffff;
  color:var(--blue);
  border-radius:9px;
  padding:13px 20px;
  font-weight:600;
  font-size:18px;
}

@media (hover:hover) and (pointer:fine) {
  .secondary:hover {
    background:#e9f3ff;
  }
}

#pdf-dialog {
  width:min(500px,calc(100% - 32px));
}

#pdf-dialog h2 {
  font-size:27px;
  letter-spacing:-.6px;
  margin-bottom:12px;
}

#pdf-dialog label {
  display:block;
  font-size:16px;
  font-weight:600;
  margin:22px 0 8px;
}

#pdf-first-name {
  display:block;
  width:100%;
  font-size:18px;
  min-height:48px;
  padding:13px;
  border:1px solid #8ab3df;
  border-radius:8px;
  background:white;
  color:var(--ink);
}

.pdf-actions {
  justify-content:flex-end;
}

.pdf-error {
  font-size:16px;
  color:#17324d;
}

.primary:disabled {
  cursor:wait;
  opacity:.7;
}

.training-mode {
  border:0;
  padding:0;
  margin:25px 0 12px;
  min-width:0;
}

.training-mode legend {
  font-size:16px;
  font-weight:600;
  margin-bottom:10px;
}

.mode-options {
  display:inline-flex;
  gap:5px;
  padding:5px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#e9f3ff;
  max-width:100%;
}

.mode-options label {
  position:relative;
  cursor:pointer;
}

.mode-options input {
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
}

.mode-options span {
  display:block;
  padding:12px 22px;
  border-radius:8px;
  font-size:18px;
  font-weight:600;
  color:#426482;
}

.mode-options input:checked+span {
  background:var(--blue);
  color:#ffffff;
  box-shadow:0 2px 4px #123d8420;
}

.mode-options input:focus-visible+span {
  outline:3px solid #077ea4;
  outline-offset:3px;
}

.training-hint {
  font-size:16px;
  line-height:1.6;
  color:var(--muted);
  margin:0 0 16px;
}

@media(max-width:400px) {
  header,main,footer {
    margin-left:16px;
    margin-right:16px;
  }
  .rows {
    gap:4px;
  }
  #sequence {
    grid-template-columns:1fr;
  }
  .settings {
    padding:20px;
  }
  .mode-options {
    display:flex;
  }
  .mode-options label {
    flex:1;
    text-align:center;
  }
  .mode-options span {
    padding:12px 14px;
  }
}

.daily-card {display:flex;align-items:center;justify-content:space-between;gap:24px;padding:26px;background:#e9f3ff;border:1px solid #c8def5;border-radius:18px;margin-bottom:28px;}
.daily-card h2 {font-size:27px;line-height:1.3;margin:10px 0;}
.daily-card p {margin:8px 0;color:var(--muted);}
.daily-card button {flex-shrink:0;max-width:100%;}
@media(max-width:750px) {.daily-card {flex-direction:column;align-items:stretch;padding:20px;}.daily-card button {width:100%;}}

.learning-guide {margin:40px 0;max-width:800px;line-height:1.7;}
.learning-guide h2 {font-size:28px;line-height:1.3;}
.learning-guide h3 {font-size:21px;margin:24px 0 8px;}
.learning-guide p {color:var(--muted);margin:10px 0;}

.daily-actions {display:flex;flex-direction:column;gap:10px;flex-shrink:0;max-width:100%;}.daily-actions .training-hint {text-align:center;margin:0;}

.quiz input {width:160px;max-width:100%;}
@media(max-width:400px) {.quiz h2 {font-size:36px;}.rows button {font-size:18px;}}

/* The compact keypad expands below the answer, reserving its own space. */
.answer-entry {display:inline-flex;align-items:center;gap:6px;max-width:100%;}
#keypad-toggle {display:grid;place-items:center;flex-shrink:0;width:44px;height:48px;padding:8px;border:1px solid #8ab3df;border-radius:8px;background:white;color:var(--blue);touch-action:manipulation;}
#keypad-toggle[aria-expanded="true"] {background:var(--blue);color:white;}
.number-pad {display:grid;grid-template-columns:repeat(3,1fr);gap:6px;width:186px;max-width:100%;margin:12px auto 0;padding:10px;border:1px solid #8ab3df;border-radius:12px;background:#fff;box-shadow:0 4px 12px #123d8415;}
.number-pad[hidden] {display:none;}
.number-pad button {min-width:44px;min-height:44px;padding:4px;border:1px solid #c8def5;border-radius:7px;background:#e9f3ff;color:var(--blue);font-size:22px;font-weight:600;touch-action:manipulation;}
.number-pad button:active {background:#c8def5;}
.number-pad button:disabled {opacity:.45;}
#answer-form {align-items:center;flex-wrap:wrap;}


.operation-switch {
  display:flex;
  gap:8px;
  padding:6px;
  margin-top:26px;
  border:1px solid #c8def5;
  border-radius:14px;
  background:#e9f3ff;
  width:fit-content;
  max-width:100%;
}
.operation-switch button {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 24px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#426482;
  font-size:20px;
  font-weight:600;
}
.operation-switch button span {font-size:27px;line-height:1;}
.operation-switch button.active {background:var(--blue);color:#fff;}
.operation-switch button:disabled {cursor:default;opacity:.65;}
.operation-switch + .intro {padding-top:32px;}
#intro-title {color:var(--ink);}
#intro-description {max-width:690px;}
.sequence-line {border:0;cursor:pointer;text-align:left;font-family:inherit;}
.sequence-line:hover {background:#ddecff;}
.dots.division-groups {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(110px,1fr));
  gap:12px;
  width:100%;
  margin-bottom:20px;
}
.division-group {border:2px solid #8ab3df;border-radius:12px;padding:12px 8px;background:#fff;}
.group-points {display:grid;grid-template-columns:repeat(4,12px);gap:6px;justify-content:center;align-content:center;min-height:48px;}
.group-points .dot {width:12px;height:12px;}
.group-count {display:block;text-align:center;margin-top:8px;font-size:16px;color:#426482;}
@media(max-width:750px) {
  .operation-switch {width:100%;}
  .operation-switch button {flex:1;min-width:0;padding:12px 8px;font-size:18px;}
  .dots.division-groups {grid-template-columns:repeat(auto-fit,minmax(95px,1fr));gap:8px;}
  #intro-description {max-width:100%;}
}

/* A short path from choosing a task to practising. */
.intro {padding:22px 0 20px;}
.operation-switch + .intro {padding-top:22px;}
h1 {font-size:40px;letter-spacing:-1.5px;line-height:1.2;margin:0 0 8px;}
.intro>p {margin:0;font-size:16px;}
.daily-card {padding:20px 24px;margin-bottom:22px;}
.daily-card h2 {font-size:24px;margin:0 0 4px;}
.daily-card p {font-size:16px;margin:0;}
.daily-actions {min-width:155px;gap:4px;}
.tabs {margin-bottom:24px;}
.row-picker {display:flex;align-items:center;gap:14px;margin:0 0 22px;font-weight:600;}
.row-picker select {min-height:48px;min-width:180px;max-width:100%;padding:10px 36px 10px 12px;border:1px solid #8ab3df;border-radius:8px;background:white;color:var(--ink);}
.training-mode {margin:0 0 18px;}
.session-settings {margin:18px 0 24px;}
summary {cursor:pointer;min-height:44px;padding:9px 0;color:#306496;font-size:16px;}
summary:focus-visible {outline:3px solid #077ea4;outline-offset:4px;border-radius:3px;}
.settings {padding:16px;margin:8px 0;}
.tip {display:block;padding-top:12px;}
.tip p {margin:4px 0 12px;}
.visual-card #equation {font-size:clamp(28px,4vw,39px);letter-spacing:-1px;margin:20px 0;}
.stepper {flex-wrap:wrap;gap:8px;margin:20px 0 12px;}
.stepper label {display:block;width:100%;}
.sequence-line {cursor:default;}
.sequence-line:hover {background:#f3f8ff;}
.sequence-line.highlight:hover {background:#ddecff;}
.history-details,.help-details {border-top:1px solid var(--line);margin-top:22px;padding-top:8px;}
.learning-guide {margin:10px 0 24px;}
.learning-guide h2 {font-size:22px;}
.history-items {padding:8px 0;}
.result-details {margin:18px 0;}
.result-details table {margin:8px 0;}
body[data-view="quiz"] header,body[data-view="quiz"] footer,
body[data-view="quiz"] .operation-switch,body[data-view="quiz"] .intro,
body[data-view="quiz"] .tabs,body[data-view="quiz"] .help-details,
body[data-view="quiz"] .history-details {display:none;}
body[data-view="quiz"] main {padding-top:24px;}
body[data-view="results"] .intro,body[data-view="results"] .help-details,
body[data-view="results"] .history-details,
body[data-view="train"] .history-details,body[data-view="test"] .history-details {display:none;}
@media(max-width:750px) {
  header {height:70px;}
  h1 {font-size:32px;letter-spacing:-1px;}
  .operation-switch {margin-top:16px;}
  .intro {padding:18px 0;}
  .daily-card {gap:14px;}
  .daily-actions {width:100%;}
  .tabs button {min-height:52px;font-size:18px;}
  .row-picker select {min-width:0;flex:1;}
  .session-settings .settings {gap:12px;}
  .visual-card {padding:20px;}
  .stepper label {display:block;}
}

/* A shared tablet, one independent touch keypad on each side. */
.dojo-heading {display:flex;gap:16px;align-items:center;margin:0 0 20px;}
.dojo-heading h2 {margin:0 0 6px;}
.dojo-heading p {margin:0;color:var(--muted);}
.dojo-mark {display:grid;place-items:center;flex-shrink:0;width:62px;height:62px;border-radius:18px;background:#17324d;color:#fff;font-size:32px;}
.dojo-tablet-note {padding:16px 20px;border:1px solid #c5dcf3;border-left:4px solid var(--blue);border-radius:10px;background:#e9f3ff;font-size:16px;max-width:850px;margin:0 0 26px;}
.dojo-tablet-note strong {display:block;font-size:18px;}
.dojo-settings {display:flex;flex-wrap:wrap;gap:20px;margin-bottom:26px;}
.dojo-settings label {display:flex;flex-direction:column;gap:8px;font-size:16px;font-weight:600;}
.dojo-settings select {min-height:48px;padding:10px 40px 10px 14px;border:1px solid #8ab3df;border-radius:8px;background:white;color:var(--ink);}
.dojo-row-choice {border:0;padding:0;margin:0;min-width:0;}
.dojo-row-choice legend {padding:0;margin-bottom:8px;font-weight:600;}
.dojo-row-choice .training-hint {margin-bottom:12px;}
.dojo-rules {max-width:850px;font-size:16px;color:var(--muted);margin:0 0 24px;}
.dojo-arena-top {display:flex;align-items:center;justify-content:space-between;gap:16px;}
.dojo-arena-name {font-weight:700;}
.dojo-arena-name span {margin-left:10px;font-size:16px;font-weight:400;color:var(--muted);}
.dojo-challenge {text-align:center;margin:0 auto 18px;}
#dojo-round {margin:0;font-size:16px;color:var(--muted);}
.dojo-challenge #dojo-question {margin:4px 0;font-size:clamp(40px,6vw,60px);line-height:1.15;letter-spacing:-1.5px;min-height:1.15em;font-variant-numeric:tabular-nums;}
#dojo-status {min-height:29px;margin:8px 0 0;font-size:18px;font-weight:600;}
.dojo-round-actions {display:flex;justify-content:center;flex-wrap:wrap;gap:10px;}
.dojo-round-actions:has(button:not([hidden])) {margin-top:12px;}
.dojo-round-actions button {padding:10px 18px;}
.dojo-players {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:26px;}
.dojo-player {--player-color:#175cd3;--player-light:#e9f3ff;min-width:0;border:2px solid #b9d2f0;border-top:5px solid var(--player-color);border-radius:18px;background:var(--player-light);padding:16px 22px 20px;}
.dojo-right {--player-color:#087b72;--player-light:#eaf7f3;border-color:#add8d0;border-top-color:var(--player-color);}
.dojo-player-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;}
.dojo-player h3 {font-size:22px;margin:0;color:var(--player-color);}
.dojo-score {white-space:nowrap;margin:0;color:var(--ink);font-size:16px;}
.dojo-score strong {font-size:28px;line-height:1;}
.dojo-answer {display:block;width:100%;height:58px;padding:5px 12px;text-align:center;background:white;color:var(--ink);border:2px solid var(--player-color);border-radius:10px;font-size:32px;font-weight:600;letter-spacing:2px;opacity:1;-webkit-text-fill-color:var(--ink);}
.dojo-answer::placeholder {color:#71849a;-webkit-text-fill-color:#71849a;}
.dojo-feedback {font-size:16px;line-height:1.4;min-height:23px;margin:8px 0;color:var(--player-color);}
.dojo-keypad {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.dojo-keypad button {min-width:0;min-height:50px;padding:4px;border:1px solid #b5cde5;border-radius:9px;background:#fff;color:var(--ink);font-size:26px;font-weight:600;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}
.dojo-right .dojo-keypad button {border-color:#add8d0;}
.dojo-keypad button:active {background:var(--player-light);border-color:var(--player-color);}
.dojo-keypad .dojo-submit {grid-column:1/-1;background:var(--player-color);color:#fff;border-color:var(--player-color);font-size:20px;}
.dojo-keypad button:disabled {opacity:.45;cursor:default;}
.dojo-player.dojo-winner {box-shadow:0 0 0 3px var(--player-color);}
.dojo-arena-note {text-align:center;font-size:14px;color:var(--muted);margin:16px 0 0;}
body[data-view="dojo-play"] header,body[data-view="dojo-play"] footer,
body[data-view="dojo-play"] .operation-switch,body[data-view="dojo-play"] .intro,
body[data-view="dojo-play"] .tabs,body[data-view="dojo-play"] .help-details,
body[data-view="dojo-play"] .history-details,body[data-view="dojo"] .history-details {display:none;}
body[data-view="dojo-play"] main {padding-top:12px;padding-bottom:16px;}
@media(max-width:750px) {
  .tabs {grid-template-columns:repeat(4,minmax(0,1fr));}
  .tabs button {font-size:16px;}
  .dojo-players {gap:16px;}
  .dojo-player {padding:14px;}
  .dojo-player h3 {font-size:20px;}
  .dojo-feedback {min-height:45px;}
}
@media(max-width:600px) {
  .dojo-heading {align-items:flex-start;}
  .dojo-mark {width:48px;height:48px;font-size:25px;border-radius:12px;}
  .dojo-heading h2 {font-size:24px;}
  .dojo-players {gap:12px;}
  .dojo-player {padding:10px 8px 12px;border-radius:12px;}
  .dojo-player-heading {flex-direction:column;gap:4px;}
  .dojo-player h3 {font-size:16px;}
  .dojo-score strong {font-size:24px;}
  .dojo-feedback {font-size:14px;min-height:60px;}
  .dojo-keypad {gap:4px;}
  .dojo-keypad button {font-size:21px;min-height:44px;}
  .dojo-keypad .dojo-submit {font-size:18px;}
  .dojo-answer {height:50px;font-size:28px;}
  .dojo-arena-note {font-size:14px;}
}
@media(max-height:750px) and (min-width:751px) {
  body[data-view="dojo-play"] main {padding-top:4px;}
  .dojo-challenge {margin-bottom:12px;}
  .dojo-challenge #dojo-question {font-size:48px;}
  .dojo-player {padding:12px 18px;}
  .dojo-player-heading {margin-bottom:8px;}
  .dojo-keypad button {min-height:44px;}
  .dojo-answer {height:50px;}
  .dojo-arena-note {margin-top:10px;}
}

#learn {max-width:760px;}
.learn-controls {display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:18px;}
.learn-controls .row-picker {margin:0;flex:1;}
.learn-controls .primary {min-width:100px;}
.learn-grid {display:block;}
.sequence-card {padding:4px 20px;margin-top:16px;}
.sequence-card summary {font-size:16px;}
#sequence {padding-top:10px;}
@media(max-width:400px) {.learn-controls .row-picker {flex-basis:100%;}.learn-controls .primary {width:100%;}}

/* Tablet and split-screen layouts share the same controls as the desktop. */
header,main,footer {min-width:0;}
.daily-card>div,.row-picker,.settings label,.dojo-settings label {min-width:0;}
.settings select,.dojo-settings select {width:100%;min-width:0;}
.row-picker select {flex:1;min-width:0;}
/* Native WebKit selects can ignore min-height; retain native selection menus. */
.row-picker select,.settings select,.dojo-settings select {
  -webkit-appearance:none;appearance:none;min-height:48px;line-height:1.4;
  padding-right:40px;background-color:white;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2317324d' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 14px center;background-size:12px 8px;
}
.answer-entry input {min-width:0;color:var(--ink);background:white;}
#answer {appearance:textfield;-moz-appearance:textfield;}
#answer::-webkit-inner-spin-button,#answer::-webkit-outer-spin-button {-webkit-appearance:none;margin:0;}
#answer:disabled {opacity:1;-webkit-text-fill-color:var(--ink);}
.result-details {max-width:100%;overflow-x:auto;}
dialog {overscroll-behavior:contain;}

/* Keep the whole slider easy to grab in Safari, Chromium and Firefox. */
#factor {-webkit-appearance:none;appearance:none;background:transparent;height:44px;padding:0;cursor:pointer;}
#factor::-webkit-slider-runnable-track {height:6px;border-radius:3px;background:#8ab3df;}
#factor::-webkit-slider-thumb {-webkit-appearance:none;width:28px;height:28px;margin-top:-11px;border:2px solid white;border-radius:50%;background:var(--blue);box-shadow:0 0 0 1px #8ab3df;}
#factor::-moz-range-track {height:6px;border-radius:3px;background:#8ab3df;}
#factor::-moz-range-thumb {width:24px;height:24px;border:2px solid white;border-radius:50%;background:var(--blue);box-shadow:0 0 0 1px #8ab3df;}

@media(max-width:1180px) {
  header {height:76px;}
  .operation-switch {margin-top:18px;}
  .tabs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
  .tabs button {min-width:0;min-height:52px;padding:12px 4px;}
}
@media(max-width:480px) {
  .tabs {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(min-width:601px) and (max-width:1100px) {
  .select-rows {grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;}
}
@media(min-width:601px) and (max-width:900px) {
  .daily-card {gap:16px;padding:18px 20px;}
  .daily-actions {min-width:140px;}
}
@media(max-width:600px) {
  .select-rows {grid-template-columns:repeat(6,minmax(0,1fr));}
  .settings label,.dojo-settings label {flex:1 1 150px;}
  .dojo-settings {gap:12px;}
  .daily-actions {min-width:0;}
}
@media(any-pointer:coarse) {
  .select-rows button {height:auto;min-height:48px;}
  .mode-options span {min-height:48px;}
  .number-pad button {min-height:48px;}
}
/* Browser toolbars reduce the available landscape height on smaller tablets. */
@media(min-width:751px) and (max-height:700px) {
  .dojo-arena-top {min-height:44px;}
  .dojo-challenge {margin-bottom:8px;}
  .dojo-round-actions:has(button:not([hidden])) {margin-top:0;}
  .dojo-challenge #dojo-question {font-size:40px;margin:0;}
  #dojo-status {margin-top:4px;font-size:16px;min-height:26px;}
  .dojo-player {padding:10px 16px;}
  .dojo-player-heading {margin-bottom:6px;}
  .dojo-player h3 {font-size:20px;}
  .dojo-answer {height:46px;font-size:28px;}
  .dojo-feedback {margin:4px 0;}
  .dojo-keypad {gap:6px;}
  .dojo-keypad button {min-height:44px;}
  .dojo-arena-note {display:none;}
}
@media(prefers-reduced-motion:reduce) {
  .rows button {transition:none;}
}

/* Three or four players face one another across a shared tablet. */
.dojo-opposite-side {transform:rotate(180deg);}
.dojo-table-mode {display:flex;flex-direction:column;gap:4px;}
.dojo-table-mode .dojo-opposite-side {order:1;}
.dojo-table-mode .dojo-arena-top {order:2;min-height:44px;font-size:14px;border-block:1px solid var(--line);}
.dojo-table-mode .dojo-near-side {order:3;}
.dojo-table-mode .dojo-arena-note {display:none;}
.dojo-table-mode .dojo-challenge {display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"question round actions" "question status actions";align-items:center;column-gap:12px;min-height:44px;margin:0 0 4px;}
.dojo-table-mode #dojo-question,.dojo-table-mode #dojo-question-opposite {grid-area:question;font-size:clamp(24px,3vw,32px);line-height:1.15;letter-spacing:-1px;margin:0;min-height:0;white-space:nowrap;}
.dojo-table-mode #dojo-round,.dojo-table-mode #dojo-round-opposite {grid-area:round;margin:0;font-size:14px;line-height:20px;}
.dojo-table-mode #dojo-status,.dojo-table-mode #dojo-status-opposite {grid-area:status;margin:0;min-height:0;font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.dojo-table-mode .dojo-challenge .dojo-round-actions {grid-area:actions;gap:6px;margin:0;}
.dojo-table-mode .dojo-round-actions button {min-height:44px;padding:4px 10px;font-size:16px;}
.dojo-table-mode .dojo-players {gap:12px;}
.dojo-table-mode .dojo-player {display:grid;grid-template-columns:minmax(140px,1fr) minmax(100px,.75fr);grid-template-rows:188px;grid-template-areas:"keypad details";gap:4px;padding:4px 8px;border-width:1px;border-top-width:3px;border-radius:12px;}
.dojo-table-mode .dojo-player-details {grid-area:details;display:flex;flex-direction:column;justify-content:space-between;gap:4px;min-width:0;}
.dojo-table-mode .dojo-player-heading {gap:8px;margin:0;}
.dojo-table-mode .dojo-player h3 {font-size:16px;white-space:nowrap;}
.dojo-table-mode .dojo-score {font-size:14px;}
.dojo-table-mode .dojo-score strong {font-size:20px;}
.dojo-table-mode .dojo-score span {display:none;}
.dojo-table-mode .dojo-answer {height:44px;min-height:44px;padding:4px;font-size:26px;flex-shrink:0;}
.dojo-table-mode .dojo-feedback {flex:1;min-height:18px;margin:0;font-size:13px;line-height:18px;white-space:normal;}
.dojo-table-mode .dojo-keypad {grid-area:keypad;grid-template-columns:repeat(3,minmax(44px,1fr));grid-template-rows:repeat(4,44px);gap:4px;margin:0;}
.dojo-table-mode .dojo-keypad button {height:44px;min-height:44px;font-size:22px;border-radius:7px;}
.dojo-table-mode .dojo-player .dojo-submit {min-height:44px;flex-shrink:0;margin:0;padding:4px;font-size:16px;}
.dojo-table-mode [data-dojo-player="2"] {--player-color:#9b3d12;--player-light:#fff3e9;}
.dojo-table-mode [data-dojo-player="3"] {--player-color:#7539a3;--player-light:#f5edfc;}
body.dojo-table-playing main {padding-top:4px;padding-bottom:4px;}
@media(max-width:600px) {
  .dojo-table-mode .dojo-player-heading {flex-direction:row;}
  .dojo-table-mode .dojo-player {padding-inline:4px;gap:4px;}
  .dojo-table-mode .dojo-players {gap:8px;}
  .dojo-table-mode .dojo-challenge {column-gap:6px;}
  .dojo-table-mode .dojo-round-actions button {font-size:14px;padding-inline:6px;}
}
@media(max-width:580px) {
  /* A narrow split-screen can scroll without shrinking the touch targets. */
  .dojo-table-mode .dojo-players {grid-template-columns:1fr;}
  .dojo-table-mode .dojo-challenge {grid-template-columns:1fr auto;grid-template-areas:"question actions" "round status";}
  .dojo-table-mode .dojo-opposite-side .dojo-players {direction:rtl;}
  .dojo-table-mode .dojo-player {direction:ltr;}
}

@media(min-width:581px) {
  .dojo-table-mode[data-players="3"] .dojo-opposite-side .dojo-player:not([hidden]) {grid-column:1/-1;width:calc((100% - 12px)/2);justify-self:center;}
}

/* A local burst celebrates the winner without covering the shared task. */
.dojo-player {position:relative;}
.dojo-player.dojo-winner .dojo-answer {border-color:#b77700;background:#fff8d5;box-shadow:0 0 0 2px #f6cb64;}
.dojo-player.dojo-celebrating .dojo-answer {animation:dojo-winner-flash 720ms ease-in-out 2;}
.dojo-confetti {position:absolute;inset:0;z-index:2;border-radius:inherit;overflow:hidden;pointer-events:none;user-select:none;-webkit-user-select:none;}
.dojo-confetti-piece {position:absolute;left:var(--burst-x);top:var(--burst-y);width:8px;height:12px;margin:-6px 0 0 -4px;border-radius:2px;opacity:0;animation:dojo-confetti-burst 1200ms cubic-bezier(.12,.65,.35,1) both;}
@keyframes dojo-winner-flash {
  0%,100% {background-color:#fff8d5;box-shadow:0 0 0 2px #f6cb64;}
  50% {background-color:#ffe176;box-shadow:0 0 0 5px #ffd16688,0 0 18px #eab52b80;}
}
@keyframes dojo-confetti-burst {
  0% {opacity:0;transform:translate(0,0) rotate(0) scale(.4);}
  12% {opacity:1;}
  65% {opacity:1;transform:translate(var(--burst-dx),var(--burst-dy)) rotate(var(--burst-turn)) scale(1);}
  100% {opacity:0;transform:translate(var(--burst-end-x),var(--burst-end-y)) rotate(var(--burst-turn)) scale(.7);}
}
@media(prefers-reduced-motion:reduce) {
  .dojo-player.dojo-celebrating .dojo-answer {animation:none;}
  .dojo-confetti {display:none;}
}

#dojo-question,#dojo-question-opposite {color:#bd2525;}

/* Division starts with the child's own actions: move, compare, share fairly. */
.daily-card #daily-goal {font-weight:600;color:var(--ink);margin:6px 0;}
.daily-card #daily-method {max-width:62ch;margin:6px 0;font-size:15px;line-height:1.5;}

.sharing-card {padding:24px;border:1px solid #bfd7ef;border-radius:18px;background:#e9f3ff;}
.sharing-heading {display:flex;align-items:flex-start;justify-content:space-between;gap:20px;}
.sharing-heading>div {min-width:0;}
.sharing-heading h2 {font-size:26px;line-height:1.25;margin:0 0 8px;letter-spacing:-.5px;}
.sharing-heading p {margin:0;color:#426482;font-size:18px;}
.sharing-total-picker {display:grid;gap:5px;font-size:16px;font-weight:600;flex-shrink:0;}
.sharing-total-picker select {min-width:90px;height:48px;min-height:48px;padding:8px 12px;border:1px solid #8ab3df;border-radius:8px;background:#fff;color:var(--ink);font-family:inherit;font-size:20px;}
#sharing-help {font-size:16px;line-height:1.5;color:#426482;margin:16px 0;}
.sharing-stock {border:2px dashed #b79b53;border-radius:14px;padding:12px;background:#fff8e7;}
.sharing-stock-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:16px;}
.sharing-stock-heading button {min-height:44px;font-size:15px;padding:4px 8px;}
.sharing-tray {display:flex;flex-wrap:wrap;gap:6px;align-content:flex-start;min-height:50px;max-height:200px;overflow-y:auto;padding:5px;}
.sharing-coin {position:relative;display:block;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;border:2px solid #a87514;border-radius:50%;background:radial-gradient(circle at 32% 28%,#ffe7a0,#e9b540 70%);box-shadow:0 2px 0 #ae7a17;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab;}
.sharing-coin::before {content:'';position:absolute;inset:6px;border:1px solid #b68123;border-radius:50%;pointer-events:none;}
.sharing-coin[aria-pressed="true"] {outline:3px solid #175cd3;outline-offset:2px;}
.sharing-coin:focus-visible {outline:3px solid #083e9d;outline-offset:2px;}
.sharing-coin.is-dragging {opacity:.25;}
.sharing-drag-ghost {position:fixed;z-index:10000;pointer-events:none;transform:translate(-50%,-50%);box-shadow:0 5px 12px #17324d40;}
.sharing-plates {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,176px),1fr));gap:12px;margin:20px 0;}
.sharing-plate {display:flex;flex-direction:column;align-items:stretch;min-width:0;min-height:190px;padding:12px;border:3px solid #8aafcc;border-radius:44%;background:radial-gradient(ellipse,#fff 60%,#e2effa 61%,#f9fcff 70%);box-shadow:0 3px 0 #c1d3e4;transition:border-color .15s,background-color .15s;}
.sharing-plate-target {align-self:center;min-height:44px;border:0;border-radius:12px;background:transparent;font:inherit;font-size:16px;font-weight:600;color:#2b5578;padding:6px 10px;}
.sharing-plate-target:focus-visible {outline:3px solid #175cd3;}
.sharing-plate-coins {display:flex;flex-wrap:wrap;gap:5px;justify-content:center;align-content:center;flex:1;min-height:54px;}
.sharing-plate-count {display:block;text-align:center;font-size:15px;color:#426482;margin:10px 0 4px;}
.sharing-stock.is-drop-target,.sharing-plate.is-drop-target {border-color:#175cd3;background:#d8ebff;box-shadow:0 0 0 3px #175cd340;}
.sharing-result {padding:16px 18px;background:#fff;border:1px solid #c8def5;border-radius:12px;}
#sharing-status {margin:0;font-size:17px;line-height:1.5;color:#426482;}
.sharing-equation {font-size:30px;font-weight:700;letter-spacing:-.5px;margin:8px 0 0;}
#sharing-proof {font-size:17px;margin:8px 0 0;color:#326348;}
.sharing-solved .sharing-result {background:#edf8ed;border-color:#94c69d;}
.sharing-solved #sharing-status {color:#245b36;}
.sharing-actions {display:flex;align-items:flex-start;gap:16px;margin-top:16px;flex-wrap:wrap;}
.sharing-actions>button {min-height:48px;}
.sharing-tip {flex:1;min-width:120px;}
.sharing-tip summary {display:flex;align-items:center;min-height:48px;cursor:pointer;color:#285e90;}
.sharing-tip summary::before {content:'▸';margin-right:6px;}
.sharing-tip[open] summary::before {content:'▾';}
.sharing-tip p {font-size:16px;line-height:1.5;margin:4px 0;color:#426482;}
@media(max-width:750px){.sharing-card {padding:18px;}.sharing-heading {gap:10px;}.sharing-heading h2 {font-size:24px;}}
@media(max-width:400px){.sharing-card {padding:14px;}.sharing-heading {flex-wrap:wrap;}.sharing-total-picker {display:flex;align-items:center;gap:12px;}.sharing-stock {padding:8px;}.sharing-stock-heading button {padding-left:0;}.sharing-plate {min-height:180px;}}
@media(prefers-reduced-motion:reduce){.sharing-plate {transition:none;}}

/* Keep the familiar 123 / 456 / 789 / C 0 delete keypad in every mode. */
.dojo-player {display:flex;flex-direction:column;}
.dojo-player-details {display:contents;}
.dojo-player-heading {order:0;}
.dojo-answer {order:1;}
.dojo-feedback {order:2;}
.dojo-keypad {order:3;}
.dojo-player .dojo-submit {order:4;min-height:50px;margin-top:8px;padding:4px;border:1px solid var(--player-color);border-radius:9px;background:var(--player-color);color:white;font-size:20px;font-weight:600;touch-action:manipulation;}
.dojo-player .dojo-submit:disabled {opacity:.45;cursor:default;}
.dojo-keypad [data-dojo-key="0"] {grid-column:2;grid-row:4;}
.dojo-keypad [data-dojo-key="clear"] {grid-column:1;grid-row:4;}
.dojo-keypad [data-dojo-key="delete"] {grid-column:3;grid-row:4;}
/* Explicit sizes win over the ordinary two-player card's flex layout. */
.dojo-table-mode .dojo-player {display:grid;}
.dojo-table-mode .dojo-player-details {display:flex;}
.dojo-table-mode .dojo-player .dojo-submit {min-height:44px;margin:0;font-size:16px;}

/* The result replaces every input and keypad at the end of a duel. */
.dojo-finished .dojo-players {display:none;}
.dojo-results {padding:16px;border:1px solid var(--line);border-radius:14px;background:white;}
.dojo-results h3 {margin:0 0 10px;font-size:24px;line-height:1.3;}
.dojo-ranking {display:grid;gap:6px;list-style:none;margin:0;padding:0;}
.dojo-ranking-row {position:relative;display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:48px;padding:6px 10px;border:1px solid var(--line);border-radius:9px;background:#f5f9ff;font-size:18px;line-height:1.4;}
.dojo-rank {display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#e1edfc;font-weight:700;}
.dojo-rank-score {font-weight:700;white-space:nowrap;}
.dojo-ranking-row.is-winner {border-color:#d6a529;background:#fff8d5;}
.dojo-ranking-row.is-winner .dojo-rank {background:#f6cb64;}
.dojo-ranking-row.dojo-celebrating {animation:dojo-winner-flash 720ms ease-in-out 2;}
.dojo-table-mode .dojo-results {padding:8px 12px;}
.dojo-table-mode .dojo-results h3 {font-size:20px;margin-bottom:6px;}
.dojo-table-mode .dojo-ranking {gap:4px;}
.dojo-table-mode .dojo-ranking-row {min-height:36px;padding:4px 8px;font-size:16px;line-height:24px;}
.dojo-table-mode .dojo-rank {width:24px;height:24px;}
@media(max-height:700px) and (min-width:751px) {
  .dojo-player .dojo-submit {min-height:44px;}
}
@media(prefers-reduced-motion:reduce) {
  .dojo-ranking-row.dojo-celebrating {animation:none;}
}

/* Reserve the feedback mark inside the input so answers never change the layout. */
.answer-field {position:relative;display:inline-flex;min-width:0;max-width:100%;}
#answer-button,#next {min-width:7em;}
.answer-field #answer {padding-right:40px;}
.answer-mark {position:absolute;right:10px;top:50%;transform:translateY(-50%);font-size:26px;font-weight:700;line-height:1;pointer-events:none;}
.answer-entry[data-result="correct"] #answer {background:#e5f5eb;border-color:#218149;box-shadow:0 0 0 1px #218149;}
.answer-entry[data-result="correct"] .answer-mark {color:#146b37;}
.answer-entry[data-result="incorrect"] #answer {background:#fde9e7;border-color:#b83030;box-shadow:0 0 0 1px #b83030;}
.answer-entry[data-result="incorrect"] .answer-mark {color:#ad2424;}

/* Each row states its quantity directly beside its points. */
.dot-row {display:flex;align-items:center;gap:12px;}
.dot-row-count {flex-shrink:0;min-width:1.6em;text-align:right;font-size:18px;font-weight:600;line-height:1;color:#456787;}
.dot-row-points {display:grid;grid-template-columns:repeat(var(--dots-per-row),max-content);gap:9px;}
@media(max-width:750px) {.dot-row-points {gap:8px;}}

/* Three arithmetic choices stay readable on narrow screens. */
.operation-switch {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:fit-content;}
.operation-switch button {min-width:0;}
.mixed-equation {font-size:clamp(26px,4vw,36px);font-weight:600;line-height:1.3;letter-spacing:-.7px;margin:10px 0 24px;color:var(--blue);}
@media(max-width:750px) {.operation-switch {width:100%;}.operation-switch button {flex-direction:column;gap:4px;padding:10px 6px;font-size:16px;}.operation-switch button span {font-size:22px;}.operation-switch button[data-operation="mixed"] {line-height:1.3;}}

/* A quiet selection, with the same symbol and label structure for all subjects. */
.operation-switch {gap:4px;padding:4px;background:#f0f6fd;border-color:#d5e4f3;}
.operation-switch button {flex-direction:column;gap:7px;min-height:90px;padding:10px 20px;border:1px solid transparent;font-size:18px;line-height:1.3;box-shadow:none;}
.operation-switch button .operation-symbol {display:grid;place-items:center;flex:none;width:44px;height:44px;min-height:44px;border:2px solid currentColor;border-radius:10px;background:#fff;color:#426482;line-height:1;}
.operation-switch .operation-symbol svg {display:block;width:32px;height:32px;fill:currentColor;}
.operation-switch button.active .operation-symbol {color:#174f92;border-color:#719fd4;}
.operation-switch button.active {background:#dceafb;border-color:#9cbce2;color:#174f92;box-shadow:none;}
.operation-switch button:hover {background:#e5effb;}
.operation-switch button.active:hover {background:#d5e6fa;}
.point-array {display:flex;align-items:stretch;justify-content:center;gap:12px;width:fit-content;max-width:100%;margin:24px auto;}
.point-array #dots {margin:0;min-height:0;}
.group-brace {position:relative;display:flex;align-items:center;justify-content:center;min-width:50px;padding-right:24px;color:#456787;}
.group-brace svg {position:absolute;right:0;top:var(--point-top-space,0px);width:20px;height:calc(100% - 2*var(--point-top-space,0px));overflow:visible;}
.group-brace path {fill:none;stroke:currentColor;stroke-width:1.8;vector-effect:non-scaling-stroke;}
.group-brace .group-count {margin:0;font-size:22px;line-height:1.2;font-weight:700;color:var(--ink);}
@media(max-width:750px) {.operation-switch button {padding:8px 6px;font-size:16px;}.operation-switch button span {font-size:22px;}}
@media(max-width:480px) {
  .point-array {gap:8px;}
  .group-brace {min-width:42px;padding-right:20px;}
  .group-brace svg {width:16px;}
  .group-brace .group-count {font-size:20px;}
  .dot-row {gap:8px;}
  .dot-row-count {min-width:1.2em;font-size:16px;}
  .dot-row-points {gap:5px;}
}


/* Each point keeps its identity while row and column exchange places. */
#dots.swap-points {
  --point-step:23px;--point-row-step:var(--point-step);--point-size:14px;--point-label-space:34px;
  display:block;position:relative;min-height:0;min-width:0;flex:0 0 auto;
  width:calc(var(--point-label-space) + (var(--point-columns) - 1)*var(--point-step) + var(--point-size));
  height:calc((var(--point-rows) - 1)*var(--point-row-step) + var(--point-size));
  transition:none;
}
.swap-point {position:absolute;left:calc(var(--point-label-space) + var(--point-column)*var(--point-step));top:calc(var(--point-row)*var(--point-row-step));width:var(--point-size);height:var(--point-size);transition:none;}
#dots.swap-points.is-swapping {transition:width .4s ease,height .4s ease;}
.is-swapping .swap-point {transition:left .4s ease,top .4s ease;}
.point-row-label {position:absolute;left:0;top:calc(var(--point-row)*var(--point-row-step) + var(--point-size)/2);transform:translateY(-50%);width:24px;text-align:right;font-size:18px;font-weight:600;line-height:1;color:#456787;}
.swap-controls {display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin:0 0 20px;}
.swap-controls .secondary {font-size:16px;padding:9px 14px;}
.swap-controls .training-hint {flex:1 1 240px;margin:0;}
.swap-controls button:disabled {cursor:default;opacity:.65;}
.fact-family {border-top:1px solid #c5dcf3;padding-top:20px;margin:24px 0 0;}
.fact-family h3 {font-size:21px;margin:0 0 8px;}
.fact-family h4 {font-size:16px;margin:20px 0 8px;color:#456787;}
.family-equations {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.family-equations p {margin:0;padding:12px 10px;border:1px solid #c5dcf3;border-radius:8px;background:#fff;font-size:clamp(18px,3vw,22px);font-weight:600;text-align:center;white-space:nowrap;}
.swap-help-area {margin-top:20px;border-top:1px solid var(--line);padding-top:12px;}
.swap-hint {text-align:left;margin:10px 0 0;padding:16px;border:1px solid #b7d1ed;border-radius:10px;background:#fff;}
#swap-hint-equation {font-size:24px;color:var(--blue);font-weight:600;margin:0 0 8px;}
#swap-hint-description {font-size:16px;margin:0;line-height:1.6;color:var(--muted);}
@media(max-width:750px) {#dots.swap-points {--point-step:20px;--point-size:12px;}}
@media(max-width:400px) {#dots.swap-points {--point-step:14px;--point-row-step:22px;--point-size:11px;--point-label-space:28px;}.point-row-label {width:20px;font-size:16px;}.family-equations {grid-template-columns:1fr;}}
@media(prefers-reduced-motion:reduce) {#dots.swap-points.is-swapping,.is-swapping .swap-point {transition:none;}}

/* Both braces label the sides of the same point array. */
.point-array {display:grid;grid-template-columns:max-content max-content;column-gap:12px;row-gap:6px;--point-label-space:34px;}
.point-array .group-brace {grid-column:1;grid-row:2;}
.point-array #dots {grid-column:2;grid-row:2;}
.row-brace {grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:stretch;gap:2px;padding-left:var(--point-label-space);color:#456787;contain:inline-size;min-width:0;}
.row-brace #point-count {text-align:center;font-size:20px;font-weight:700;line-height:1.2;color:var(--ink);}
.row-brace svg {display:block;width:100%;height:18px;overflow:visible;}
.row-brace path {fill:none;stroke:currentColor;stroke-width:1.8;vector-effect:non-scaling-stroke;}
#visual-aids-context {margin-top:14px;}
#large-swap-visual {max-width:320px;margin:16px auto 0;}
@media(max-width:480px) {.point-array {column-gap:8px;}}
@media(max-width:400px) {.point-array {--point-label-space:28px;}}

/* New Logo: Symbol 2 (1·1 Badge) + Spruch 6 (Zweizeilig Kompakt mit BETA) */
header .brand, .download-header .brand, .division-header .brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 11px !important;
  font-size: 21px !important;
  font-weight: 900 !important;
  letter-spacing: -0.8px !important;
  line-height: 1.05 !important;
  color: #17324d !important;
  text-decoration: none !important;
  flex-wrap: nowrap !important;
}
header .brand-icon, .download-header .brand-icon, .division-header .brand-icon {
  width: 46px !important;
  height: 44px !important;
  flex: 0 0 46px !important;
  border-radius: 13px !important;
  background: linear-gradient(145deg, #1d5eb3, #133e7a) !important;
  box-shadow: 3px 3px 0 #f5d96d !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 18px !important;
  letter-spacing: -1px !important;
  line-height: 1 !important;
  margin-right: 0 !important;
}
header .brand-icon .brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: #ffd859;
  display: inline-block;
  margin: 0 1px;
  font-size: 0;
  line-height: 0;
  color: transparent;
  flex-shrink: 0;
}
header .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  gap: 2px;
}
header .brand-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
header .brand-name {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: #17324d;
}
header .beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 99px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  margin-left: 0;
}
header .brand-end {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #19519a !important;
  letter-spacing: 0.3px !important;
  line-height: 1.1 !important;
}
@media (max-width: 400px) {
  header .brand, .download-header .brand, .division-header .brand {
    gap: 8px !important;
    height: auto !important;
  }
  header .brand-icon, .download-header .brand-icon, .division-header .brand-icon {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
    font-size: 15px !important;
    border-radius: 11px !important;
    margin-right: 0 !important;
  }
  header .brand-icon .brand-dot {
    width: 5px;
    height: 5px;
  }
  header .brand-name {
    font-size: 17px;
  }
  header .brand-end {
    font-size: 11.5px !important;
  }
  header .beta-badge {
    padding: 1px 5px;
    font-size: 9px;
  }
}

/* Upgraded Symbol Badges for Learning Tabs & Operations */
body[data-view] .operation-symbol {
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(23, 50, 77, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
body[data-view] .child-tabs button .nav-icon {
  width: 40px !important;
  height: 40px !important;
  padding: 7px;
  border-radius: 12px;
  border: 1.5px solid rgba(23, 50, 77, 0.14);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 2px 0 rgba(23, 50, 77, 0.06);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
body[data-view] .child-tabs button[data-tab="learn"] .nav-icon {
  color: #1f6d55;
  background: #d8efe3;
  border-color: #79b39a;
}
body[data-view] .child-tabs button[data-tab="train"] .nav-icon {
  color: #19519a;
  background: #dcebff;
  border-color: #8bb4e8;
}
body[data-view] .child-tabs button[data-tab="test"] .nav-icon {
  color: #5b4390;
  background: #ebe3fa;
  border-color: #ab98d4;
}
body[data-view] .child-tabs button[data-tab="trainer"] .nav-icon {
  color: #8a5610;
  background: #ffefc2;
  border-color: #dfb656;
}
body[data-view] .child-tabs button:hover .nav-icon {
  transform: translateY(-1px);
}
