.jarimatika-page { --jar-fold: #d56632; --jar-open: #186f69; background: #fffdf7; }
.jarimatika-page [hidden] { display: none !important; }
.jar-skip { position: absolute; top: -100px; left: 20px; z-index: 100; padding: 12px; background: var(--ink); color: white; }
.jar-skip:focus { top: 12px; }
.jar-shell { max-width: 1180px; margin: auto; padding: 0 32px 64px; }
.jar-hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 40px; padding: 48px 0 28px; }
.jar-hero h1 { font: 650 clamp(36px, 4.7vw, 60px)/1.08 var(--font-serif); letter-spacing: -.035em; margin: 14px 0 20px; }
.jar-hero h1 em, .jar-learn h2 em { color: var(--teal); font-weight: inherit; }
.jar-hero-copy > p:not(.learning-kicker) { font-size: 17px; line-height: 1.7; }
.jar-badge { display: inline-block; padding: 8px 15px; background: #f8e9c4; border-radius: 30px; font-size: 12px; font-weight: 800; margin-top: 10px; }
.jar-character { display: flex; align-items: center; gap: 0; }
.jar-character > img { width: 210px; height: 300px; object-fit: contain; }
.jar-speech { position: relative; padding: 20px; border: 1px solid #e6d7b8; background: #fff6df; border-radius: 22px 22px 22px 4px; font: 650 22px/1.3 var(--font-serif); }
.jar-speech > span { display: block; margin-top: 12px; font: 700 11px/1.5 var(--font-sans); color: #71654b; }
.jar-playground { padding: 30px; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: 0 15px 60px #173a3410; }
.jar-playground-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.jar-playground-top h2 { font: 650 clamp(22px, 3vw, 30px)/1.25 var(--font-serif); margin: 8px 0 0; }
.jar-modes { display: flex; gap: 4px; padding: 5px; background: #f1f3ed; border-radius: 30px; }
.jar-modes button { min-height: 44px; padding: 0 22px; background: transparent; border: 0; border-radius: 24px; color: var(--ink); font-weight: 750; cursor: pointer; }
.jar-modes [aria-pressed=true] { background: var(--ink); color: white; }
.jar-mode-hint { margin: 16px 0 0; color: #56675c; font-size: 14px; }
.jar-equation { display: flex; justify-content: center; gap: 18px; align-items: center; margin: 28px 0 20px; font-size: clamp(36px, 5vw, 52px); font-weight: 800; font-variant-numeric: tabular-nums; }
.jar-equation > span:first-child, .jar-equation > span:nth-child(3) { display: grid; place-items: center; min-width: 78px; min-height: 78px; background: #fff0d7; border-radius: 22px; }
.jar-times, .jar-equals { color: #6d7d70; font-weight: 400; }
.jar-equation [data-result] { color: var(--teal); min-width: 70px; }
.jar-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; font-size: 13px; }
.jar-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.jar-legend i { width: 12px; height: 12px; display: inline-block; border-radius: 3px; }
.jar-legend-fold { background: var(--jar-fold); }
.jar-legend-open { background: var(--jar-open); }
.jar-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; max-width: 700px; margin: 24px auto 0; }
.jar-hand-panel { text-align: center; }
.jar-hand-panel h3 { font-size: 14px; margin: 0 0 6px; }
.jar-hand-panel svg { width: 100%; max-width: 285px; height: auto; display: block; margin: auto; }
.jar-hand-panel svg text { font: 600 14px var(--font-sans); fill: var(--ink); }
.jar-palm { fill: #fff0d7; stroke: #77644b; stroke-width: 1.5; stroke-linejoin: round; }
.jar-finger-open { fill: #bfddd5; stroke: #186f69; stroke-width: 1.5; }
.jar-finger-fold { fill: #f3b186; stroke: #aa4822; stroke-width: 1.5; }
.jar-crease { fill: none; stroke: #796955; stroke-width: 1.2; opacity: .5; }
.jar-number-choices { display: flex; gap: 8px; justify-content: center; }
.jar-number-choices button { width: 48px; min-height: 46px; border: 1px solid #d8ded5; border-radius: 13px; background: white; color: var(--ink); font-weight: 800; font-size: 17px; cursor: pointer; }
.jar-number-choices button:hover { background: #edf5ef; }
.jar-number-choices [aria-pressed=true] { background: var(--ink); color: white; border-color: var(--ink); }
.jar-hand-count { font-size: 13px; margin: 12px 0 0; }
.jar-hand-count b { color: #aa4822; }
.jar-fold-guide { text-align: center; font-size: 13px; line-height: 1.8; margin: 24px 0; }
.jar-fold-guide span { color: #56675c; }
.jar-answer { border-top: 1px solid var(--line); padding-top: 24px; }
.jar-answer > label { display: block; font-weight: 750; margin-bottom: 12px; }
.jar-answer-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jar-answer input { width: 160px; min-height: 50px; border: 1px solid #c6d4c8; border-radius: 12px; padding: 12px 15px; font-size: 18px; }
.jar-feedback { font-size: 15px; min-height: 24px; line-height: 1.6; margin: 16px 0 0; }
.jar-feedback[data-status=wrong] { color: #a54323; }
.jar-feedback[data-status=correct] { color: var(--teal); font-weight: 700; }
.jar-calculation { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
.jar-visual-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.jar-step-heading { display: flex; gap: 10px; align-items: center; }
.jar-step-heading > span { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: #f8e9c4; font-size: 14px; font-weight: 800; }
.jar-step-heading h3 { font-size: 16px; margin: 0; }
.jar-step > p:not(.jar-step-equation) { margin: 12px 0; font-size: 13px; color: #56675c; line-height: 1.6; min-height: 42px; }
.jar-blocks, .jar-dots { display: flex; justify-content: center; align-items: center; min-height: 154px; }
.jar-blocks { gap: 9px; }
.jar-rod { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.jar-rod i { width: 16px; height: 9px; border-radius: 2px; background: var(--jar-fold); }
.jar-rod span { margin-top: 6px; font-size: 12px; font-weight: 650; }
.jar-dot-array { display: grid; gap: 10px; }
.jar-dot-array i { width: 22px; height: 22px; background: var(--jar-open); border-radius: 50%; }
.jar-step-equation { text-align: center; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; margin: 10px 0 0; }
.jar-total { margin-top: 28px; padding: 22px; background: #e9f3ed; border-radius: 18px; text-align: center; }
.jar-total > span { display: block; font-size: 12px; font-weight: 800; }
.jar-total > strong { display: block; font-size: clamp(28px, 4vw, 40px); font-variant-numeric: tabular-nums; margin: 8px 0; }
.jar-total > p { margin: 0; font-size: 14px; }
.jar-live, .jarimatika-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.jar-learn { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin: 60px 0 32px; scroll-margin-top: 100px; }
.jar-learn h2 { font: 650 34px/1.2 var(--font-serif); margin: 14px 0; }
.jar-learn p { font-size: 14px; line-height: 1.8; }
.jar-parent-note { border-left: 3px solid #e5b752; padding-left: 26px; }
.jar-parent-note h3 { margin: 0; font-size: 17px; }
.jar-back { display: inline-block; font-size: 14px; font-weight: 750; margin-top: 14px; }
.jar-back:hover { text-decoration: underline; }
.jar-footer { max-width: 1180px; margin: auto; padding: 24px 32px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); font-size: 12px; }
.jar-footer > a { font-weight: 850; }
@media(max-width:900px) { .jar-character > img { width: 170px; height: 250px; } .jar-speech { font-size: 18px; padding: 15px; } .jar-hero { gap: 20px; } }
@media(max-width:650px) {
  .jar-shell { padding: 0 18px 40px; }
  .jarimatika-page .learning-header { height: auto; min-height: 76px; padding: 12px 18px; gap: 14px; }
  .jarimatika-page .learning-brand { width: 132px; }
  .jarimatika-page .learning-header nav { gap: 12px; font-size: 11px; }
  .jarimatika-page .learning-header nav a:last-child { display: none; }
  .jar-hero { grid-template-columns: 1fr; padding-top: 28px; gap: 12px; }
  .jar-hero h1 { margin-bottom: 12px; }
  .jar-character { justify-content: center; }
  .jar-character > img { width: 140px; height: 200px; }
  .jar-hero-copy > p:not(.learning-kicker) { font-size: 15px; }
  .jar-playground { padding: 20px 16px; border-radius: 20px; }
  .jar-playground-top { align-items: flex-start; flex-direction: column; gap: 16px; }
  .jar-modes { align-self: stretch; }
  .jar-modes button { flex: 1; }
  .jar-equation { gap: 10px; margin-top: 24px; font-size: 32px; }
  .jar-equation > span:first-child, .jar-equation > span:nth-child(3) { min-width: 52px; min-height: 58px; border-radius: 15px; }
  .jar-equation [data-result] { min-width: 48px; }
  .jar-legend { gap: 12px; font-size: 11px; }
  .jar-hands { grid-template-columns: 1fr; gap: 28px; }
  .jar-hand-panel svg { max-width: 250px; }
  .jar-number-choices { gap: 6px; }
  .jar-number-choices button { width: 43px; }
  .jar-visual-steps, .jar-learn { grid-template-columns: 1fr; gap: 28px; }
  .jar-step > p:not(.jar-step-equation) { min-height: 0; }
  .jar-learn { margin-top: 40px; }
  .jar-learn h2 { font-size: 30px; }
  .jar-answer input { width: 100%; }
  .jar-answer-controls button { flex: 1 1 auto; }
  .jar-footer { flex-wrap: wrap; padding: 22px 18px; }
}
@media(prefers-reduced-motion:reduce) { .jarimatika-page { scroll-behavior: auto; } .jarimatika-page button { transition: none; } }
