:root{--bg: #fafbfc;--surface: #ffffff;--ink: #111827;--ink-soft: #5b6478;--muted: #6b7280;--border: #e3e8f2;--brand: #4f46e5;--brand-hover: #4338ca;--shadow-soft: 0 16px 36px rgba(15, 23, 42, .09);--shadow-card: 0 10px 24px rgba(15, 23, 42, .08);--font-ui: "Inter", "Nunito", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;--radius: 16px;--radius-sm: 10px}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html{font-family:var(--font-ui);color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{min-height:100dvh}.page{max-width:720px;margin:0 auto;padding:0 16px 32px;display:flex;flex-direction:column;min-height:100dvh}.app-header,.page-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 0 .95rem;gap:1rem;flex-wrap:wrap;border-bottom:1px solid var(--border)}.app-header-left,.page-header-left{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;min-width:0}.app-header-actions,.page-header-actions{display:inline-flex;align-items:center;gap:.75rem;flex-wrap:wrap;justify-content:flex-end}.brand-mark{margin:0;display:inline-flex;align-items:center;gap:.45rem;text-decoration:none;color:#0f172a;font-weight:800;font-size:1.03rem;white-space:nowrap}.brand-logo{width:1.6em;height:1.6em}.app-header-title,.page-title{font-family:"Nunito",var(--font-ui);font-size:clamp(1.1rem,2.4vw,1.45rem);font-weight:800;color:var(--ink);margin:0}.page-main{display:flex;flex:1;flex-direction:column;gap:1rem}.locale-select-wrap{position:relative;display:inline-flex;align-items:center;gap:.5rem}.locale-select-label{font-size:.86rem;color:#1f2937;font-weight:700}.locale-select{font-family:var(--font-ui);font-size:.92rem;font-weight:600;padding:.32rem 2rem .32rem .75rem;border:1px solid #ced6e8;border-radius:.7rem;background:#fff;color:#111827;cursor:pointer;min-height:36px;-moz-appearance:none;appearance:none;-webkit-appearance:none}.locale-select:focus-visible{outline:3px solid rgba(79,70,229,.35);outline-offset:2px}.locale-select-wrap:after{content:"";position:absolute;right:.85rem;top:50%;width:.38rem;height:.38rem;border-right:2px solid var(--brand);border-bottom:2px solid var(--brand);transform:translateY(-58%) rotate(45deg);pointer-events:none}.app-guide{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;margin-bottom:.75rem;background:#4f46e50d;border:1px solid rgba(79,70,229,.1);border-radius:var(--radius-sm);animation:guide-fade-in .3s ease}.app-guide-icon{flex-shrink:0;font-size:.95rem;line-height:1}.app-guide-text{flex:1;font-size:.8rem;line-height:1.45;color:var(--ink-soft);margin:0}.app-guide-close{flex-shrink:0;background:none;border:none;padding:.2rem;cursor:pointer;color:var(--muted);font-size:.75rem;line-height:1;opacity:.6;transition:opacity .15s}.app-guide-close:hover{opacity:1}.app-guide-reopen{position:fixed;bottom:5rem;right:.75rem;width:2rem;height:2rem;border-radius:50%;background:var(--surface);border:1px solid var(--border);box-shadow:0 2px 8px #00000014;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.8rem;font-weight:700;color:var(--brand);z-index:10;transition:transform .15s,box-shadow .15s}.app-guide-reopen:hover{transform:scale(1.1);box-shadow:0 4px 12px #0000001f}@keyframes guide-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.main-content{display:flex;flex:1;flex-direction:column;gap:1rem}.learning-intro-card,.learning-toolbar-card,.learning-workspace-card,.learning-detail-card{padding:1rem 1.1rem;display:grid;gap:.75rem}.learning-intro-card{gap:.4rem}.learning-intro-kicker{margin:0;font-size:.78rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--brand)}.learning-intro-title{margin:0;font-family:"Nunito",var(--font-ui);font-size:clamp(1.2rem,2.7vw,1.7rem);font-weight:800;color:var(--ink)}.learning-intro-copy{margin:0;font-size:.95rem;line-height:1.65;color:var(--ink-soft)}.learning-workspace-card>:first-child,.learning-toolbar-card>:first-child,.learning-detail-card>:first-child{margin-top:0}.learning-workspace-card>:last-child,.learning-toolbar-card>:last-child,.learning-detail-card>:last-child{margin-bottom:0}.learning-split{display:grid;gap:1rem}.learning-split--sidebar{grid-template-columns:minmax(0,1fr)}.learning-section-label{margin:0;font-size:.8rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}.learning-section-title{margin:0;font-family:"Nunito",var(--font-ui);font-size:1.05rem;font-weight:800;color:var(--ink)}.learning-section-copy{margin:0;font-size:.9rem;line-height:1.6;color:var(--ink-soft)}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-soft)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:100;padding:16px}.app-modal{width:100%;max-width:480px;max-height:80vh;overflow-y:auto;padding:24px;animation:pop-in .2s ease}.app-modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.app-modal-header h2{font-size:1.2rem;font-weight:700}.app-modal-close{font-family:var(--font-ui);font-size:.85rem;padding:6px 14px;border:1.5px solid var(--border);border-radius:8px;background:var(--surface);color:var(--muted);cursor:pointer}.app-modal-body{font-size:.95rem;line-height:1.7;color:var(--ink-soft)}.app-modal-body p{margin-bottom:12px}.app-modal-body ol{padding-left:1.5em}.app-modal-body li{margin-bottom:8px}.app-modal-body a{color:var(--brand);text-decoration:underline}.site-footer{margin-top:auto;padding:1.2rem 0 .8rem;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}.site-footer-brand{display:grid;gap:.35rem}.site-footer-copy{margin:0;font-size:.82rem;color:var(--muted)}.site-footer-links{display:inline-flex;align-items:center;gap:.8rem;flex-wrap:wrap}.site-footer-link,.site-footer-button{border:none;background:none;margin:0;padding:.35rem .25rem;min-height:2.75rem;display:inline-flex;align-items:center;font-family:var(--font-ui);font-size:.9rem;font-weight:600;color:#1f2937;text-decoration:none;cursor:pointer;transition:color .2s ease}.site-footer-link:hover,.site-footer-button:hover{color:var(--brand)}@keyframes pop-in{0%{opacity:0;transform:scale(.92)}to{opacity:1;transform:scale(1)}}@media (max-width: 480px){.app-header-actions,.page-header-actions{width:100%;justify-content:space-between}.site-footer{flex-direction:column;align-items:flex-start}}@media (min-width: 720px){.learning-split--sidebar{grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);align-items:start}}.arithmetic-page{max-width:1080px}.arithmetic-main{display:grid;gap:1rem}.arithmetic-control-card,.arithmetic-stage-card{padding:1rem;display:grid;gap:1rem}.arithmetic-control-card{align-content:start}.arithmetic-stage-card{background:radial-gradient(circle at top right,rgba(79,70,229,.08),transparent 32%),linear-gradient(180deg,#fff,#f8fbff)}.arith-section-heading{display:grid;gap:.3rem}.arith-eyebrow{margin:0;font-size:.82rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--brand)}.arith-summary,.arith-stage-copy{margin:0;color:var(--ink-soft);font-size:.98rem}.arith-stage-copy{font-weight:700}.arith-formula-strip{display:grid;grid-template-columns:repeat(5,minmax(0,auto));align-items:center;justify-content:center;gap:.65rem}.arith-formula-slot{min-width:92px;min-height:92px;padding:.75rem;border-radius:1.1rem;border:1px solid #dbe3f0;background:linear-gradient(180deg,#fff,#f8fbff);display:grid;place-items:center;text-align:center}.arith-formula-slot strong{font-family:"Nunito",var(--font-ui);font-size:clamp(1.8rem,5vw,2.7rem);color:#0f172a}.arith-formula-label{display:block;margin-bottom:.25rem;font-size:.8rem;font-weight:700;color:var(--muted)}.arith-formula-symbol{font-family:"Nunito",var(--font-ui);font-size:clamp(1.7rem,4vw,2.3rem);font-weight:800;color:#334155}.arith-formula-slot--result{border-color:#c7d2fe;background:linear-gradient(180deg,#eef2ff,#f8fbff)}.arith-formula-slot--result.is-visible{box-shadow:0 18px 30px #4f46e529}.arith-operand-grid{display:grid;gap:.85rem}.arith-operand-card{border:1px solid #dbe3f0;border-radius:1rem;padding:.9rem;background:#fcfdff;display:grid;gap:.75rem;box-shadow:0 10px 24px #0f172a0d}.arith-operand-header{display:flex;align-items:baseline;justify-content:space-between;gap:1rem}.arith-operand-header p,.arith-operand-header strong{margin:0}.arith-operand-header p{color:var(--ink-soft);font-weight:700}.arith-operand-header strong{font-family:"Nunito",var(--font-ui);font-size:2rem;color:#0f172a}.arith-primary-btn,.arith-secondary-btn,.arith-choice{min-height:3.5rem;border:1px solid transparent;border-radius:.95rem;font-family:var(--font-ui);font-weight:800;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}.arith-primary-btn:hover,.arith-secondary-btn:hover,.arith-choice:hover{transform:translateY(-1px)}.arith-choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(56px,1fr));gap:.45rem}.arith-choice{min-height:3.2rem;padding:.4rem .6rem;border-color:#dbe3f0;background:#fff;color:#334155}.arith-choice.is-active{border-color:#4338ca;background:#eef2ff;color:#312e81;box-shadow:0 10px 18px #4f46e51f}.arith-action-row{display:flex;flex-wrap:wrap;gap:.75rem}.arith-primary-btn{flex:1;background:linear-gradient(135deg,#4f46e5,#2563eb);color:#fff;box-shadow:0 16px 28px #4f46e52e}.arith-primary-btn:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}.arith-secondary-btn{min-width:160px;border-color:#dbe3f0;background:#fff;color:#334155}.arith-stage-grid,.arith-multiply-layout,.arith-division-layout{display:grid;gap:.85rem}.arith-stage-grid,.arith-multiply-layout,.arith-division-layout,.arith-formula-strip{position:relative;z-index:1}.arith-panel{border:1px solid #dbe3f0;border-radius:1rem;padding:.85rem;background:#fff;display:grid;gap:.7rem;box-shadow:0 10px 24px #0f172a0d}.arith-panel--result{background:linear-gradient(180deg,#f8fbff,#eef2ff)}.arith-panel-label{margin:0;font-size:.88rem;font-weight:800;color:#475569}.arith-big-number{font-family:"Nunito",var(--font-ui);font-size:clamp(2.2rem,6vw,3rem);color:#1d4ed8}.arith-token-grid,.arith-array-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(18px,1fr));gap:.45rem}.arith-array-grid{justify-items:center}.arith-token-grid--group{grid-template-columns:repeat(auto-fit,minmax(14px,1fr))}.arith-token{width:18px;height:18px;border-radius:999px;display:inline-block}.arith-token--primary{background:#4f46e5}.arith-token--secondary{background:#f59e0b}.arith-token--accent{background:#10b981}.arith-placeholder{min-height:120px;border:2px dashed rgba(79,70,229,.26);border-radius:1rem;display:grid;place-items:center;padding:1rem;text-align:center;color:#6366f1;font-weight:700;background:#eef2ff8c}.arith-group-list{display:grid;gap:.6rem}.arith-group-card{border-radius:.85rem;padding:.7rem;background:#fffc;border:1px solid rgba(148,163,184,.28)}.arith-group-label{display:inline-block;margin-bottom:.45rem;font-size:.78rem;font-weight:800;color:#64748b}.arithmetic-stage-card.is-animating .arith-panel--result{animation:arithmetic-pop .7s ease}@keyframes arithmetic-pop{0%{transform:scale(.96);box-shadow:0 0 #4f46e500}45%{transform:scale(1.02);box-shadow:0 18px 28px #4f46e52e}to{transform:scale(1);box-shadow:0 0 #4f46e500}}@media (min-width: 900px){.arithmetic-main{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);align-items:start}.arithmetic-control-card{position:sticky;top:.85rem}.arith-operand-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.arith-stage-grid,.arith-multiply-layout{grid-template-columns:repeat(3,minmax(0,1fr))}.arith-division-layout{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)}.arith-panel--wide{grid-column:span 2}}@media (max-width: 640px){.arith-formula-strip{grid-template-columns:repeat(3,minmax(0,1fr))}.arith-formula-symbol{justify-self:center}.arith-primary-btn,.arith-secondary-btn{width:100%}}
