
:root { --ink:#243431; --muted:#6f7c78; --paper:#f5f3eb; --surface:#fffdf8; --line:#d6d8d0; --teal:#4c8580; --teal-soft:#dcece8; --amber:#bd8d53; --success:#4f8b69; }
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:"Hiragino Sans","Yu Gothic","Noto Sans JP",sans-serif; }
button,input { font:inherit; }
.site-shell { width:min(100%,760px); margin:0 auto; padding:42px 18px 30px; }
.hero { padding:0 8px 24px; }
.chapter-kicker { margin:0 0 7px; color:var(--teal); font-size:.76rem; font-weight:900; letter-spacing:.14em; }
.chapter-title { margin:0 0 15px; color:var(--ink); font-size:clamp(1.45rem,4.2vw,2rem); font-weight:900; letter-spacing:.02em; line-height:1.3; }
h1 { margin:0; max-width:none; white-space:nowrap; font-size:clamp(1.35rem,3.5vw,1.7rem); line-height:1.25; letter-spacing:-.025em; }
.intro { max-width:610px; margin:18px 0 0; color:var(--muted); line-height:1.9; }
.table-of-contents { margin:0 0 40px; border:1px solid rgba(36,52,49,.09); border-radius:26px; background:var(--surface); box-shadow:0 16px 45px rgba(49,65,60,.07); padding:24px; }
.toc-heading { display:flex; align-items:baseline; gap:12px; margin-bottom:15px; }
.toc-heading span { color:var(--amber); font-size:.7rem; font-weight:800; letter-spacing:.16em; }
.toc-heading h2 { margin:0; font-size:1.45rem; letter-spacing:.04em; }
.toc-list { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.toc-list a { display:grid; grid-template-columns:38px 1fr auto; align-items:center; gap:10px; min-height:58px; border:1px solid var(--line); border-radius:15px; color:var(--ink); padding:10px 13px; text-decoration:none; transition:border-color .18s ease,background .18s ease,transform .18s ease; }
.toc-list a:hover { border-color:var(--teal); background:rgba(220,236,232,.34); transform:translateY(-1px); }
.toc-list a:focus-visible { outline:3px solid var(--teal-soft); outline-offset:2px; }
.toc-list b { color:var(--teal); font-size:.88rem; letter-spacing:.08em; }
.toc-list span { font-size:.84rem; font-weight:700; line-height:1.45; }
.toc-list i { color:var(--amber); font-size:.9rem; font-style:normal; }
.lesson { overflow:hidden; border:1px solid rgba(36,52,49,.09); border-radius:30px; background:var(--surface); box-shadow:0 22px 60px rgba(49,65,60,.09); padding:clamp(18px,5vw,34px); }
.controls { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.controls label { display:grid; gap:7px; color:var(--muted); font-size:.78rem; font-weight:700; letter-spacing:.04em; }
.input-wrap { display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:14px; background:#fff; padding:2px 12px; }
.input-wrap input { min-width:0; width:100%; border:0; outline:0; background:transparent; color:var(--ink); padding:10px 0; font-weight:700; }
.input-wrap:focus-within { border-color:var(--teal); box-shadow:0 0 0 3px var(--teal-soft); }
.input-wrap b { color:var(--muted); font-size:.8rem; }
.message { min-height:2.8em; margin:18px 0 2px; text-align:center; color:var(--muted); font-size:.9rem; }
.question-card { display:flex; align-items:center; gap:12px; margin:8px auto 2px; max-width:520px; border:1px solid rgba(189,141,83,.25); border-radius:16px; background:rgba(246,232,209,.48); padding:13px 16px; }
.question-card span { flex:none; border-radius:999px; background:var(--amber); color:white; padding:5px 10px; font-size:.72rem; font-weight:800; letter-spacing:.08em; }
.question-card b { font-size:.9rem; line-height:1.6; }
.practice-support { margin:10px auto 18px; max-width:520px; border:1px solid rgba(76,133,128,.18); border-radius:20px; background:rgba(220,236,232,.25); padding:17px; }
.practice-title { display:flex; align-items:center; gap:9px; margin:0 0 13px; }
.practice-title span { border-radius:999px; background:var(--teal); color:#fff; padding:4px 9px; font-size:.65rem; font-weight:900; letter-spacing:.1em; }
.practice-title b { font-size:.94rem; }
.answer-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px; }
.answer-fields label { display:grid; gap:6px; color:var(--muted); font-size:.76rem; font-weight:700; }
.answer-input-wrap { display:flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:13px; background:#fff; padding:0 11px; }
.answer-input-wrap:focus-within { border-color:var(--teal); box-shadow:0 0 0 3px var(--teal-soft); }
.answer-input-wrap input { min-width:0; width:100%; border:0; outline:0; background:transparent; color:var(--ink); padding:10px 0; font-weight:800; }
.answer-input-wrap b { color:var(--muted); font-size:.78rem; white-space:nowrap; }
.practice-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.practice-actions button { border:1px solid var(--line); border-radius:999px; padding:9px 15px; font-size:.8rem; font-weight:800; cursor:pointer; }
.practice-actions .check-answer { border-color:var(--teal); background:var(--teal); color:white; }
.practice-actions .show-hint { background:var(--surface); color:#94642e; border-color:rgba(189,141,83,.45); }
.practice-actions button:disabled { cursor:default; opacity:.55; }
.answer-feedback { margin:12px 0 0; border-radius:12px; padding:10px 12px; font-size:.82rem; font-weight:800; line-height:1.55; }
.answer-feedback.correct { background:rgba(79,139,105,.12); color:#397052; }
.answer-feedback.retry { background:rgba(189,141,83,.12); color:#8b602e; }
.progressive-hints { display:grid; gap:8px; margin:12px 0 0; padding:0; list-style:none; counter-reset:none; }
.progressive-hints li { display:grid; grid-template-columns:auto 1fr; align-items:start; gap:9px; border-top:1px dashed rgba(111,124,120,.25); padding-top:9px; color:var(--muted); font-size:.8rem; line-height:1.6; }
.progressive-hints b { color:var(--amber); white-space:nowrap; }
.geometry { display:block; width:100%; touch-action:none; user-select:none; }
.upper-zone { fill:rgba(76,133,128,.055); }
.lower-zone { fill:rgba(189,141,83,.05); }
.frame { fill:none; stroke:var(--line); stroke-width:2; }
.midline { stroke:var(--teal); stroke-width:3; }
.piece { stroke-width:2.5; }
.piece-a { fill:rgba(76,133,128,.27); stroke:var(--teal); }
.piece-b { fill:rgba(189,141,83,.27); stroke:var(--amber); }
.fixed-base { stroke:var(--muted); stroke-width:3; }
.handle { fill:var(--surface); stroke-width:3; cursor:grab; }
.handle:active { cursor:grabbing; }
.handle-a { stroke:var(--teal); }
.handle-b { stroke:var(--amber); }
.touch-target { fill:transparent!important; stroke:transparent!important; cursor:grab; pointer-events:all; }
.snap-halo { fill:rgba(79,139,105,.10); stroke:var(--success); stroke-width:3; }
.measure,.dimension-label,.formula { fill:var(--muted); font-size:13px; }
.dimension { stroke:var(--muted); stroke-width:1.5; }
.answer rect { fill:var(--ink); }
.answer text { fill:var(--surface); font-size:14px; font-weight:700; }
.actions { display:flex; justify-content:center; flex-wrap:wrap; gap:10px; margin-top:2px; }
.actions button { border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--ink); padding:11px 18px; font-weight:700; cursor:pointer; }
.actions button.primary { border-color:var(--ink); background:var(--ink); color:var(--surface); }
.actions button.answer-toggle { border-color:var(--amber); color:#94642e; background:#fffaf1; }
.actions button:focus-visible { outline:3px solid var(--teal-soft); outline-offset:2px; }
footer { padding:24px 8px 0; text-align:center; color:var(--muted); font-size:.82rem; }
.problem-divider { padding:58px 8px 22px; scroll-margin-top:18px; }
.first-problem-title { padding-top:10px; }
.problem-divider span { color:var(--amber); font-size:1rem; font-weight:900; letter-spacing:.13em; }
.problem-divider h2 { margin:8px 0 8px; font-size:clamp(1.3rem,4vw,1.9rem); letter-spacing:-.02em; }
.problem-divider p { margin:0; color:var(--muted); line-height:1.7; }
.given { display:flex; justify-content:center; flex-wrap:wrap; gap:10px; }
.given span { border:1px solid var(--line); border-radius:999px; padding:8px 14px; color:var(--muted); font-size:.82rem; }
.given b { color:var(--ink); margin-left:5px; }
.second-frame { fill:rgba(255,253,248,.7); stroke:var(--line); stroke-width:2; stroke-dasharray:6 5; }
.guide { stroke:var(--line); stroke-width:1.5; stroke-dasharray:5 5; }
.sum-piece { stroke:var(--amber); stroke-width:3; fill:rgba(210,172,85,.34); }
.bottom-piece { fill:rgba(189,141,83,.25); }
.shared-base { stroke:var(--ink); stroke-width:4; }
.line-drag circle,.edge-handle { fill:var(--surface); stroke:var(--teal); stroke-width:4; cursor:grab; }
.edge-handle { stroke:var(--amber); }
.base-five,.height-eight { fill:var(--muted); font-size:15px; font-weight:700; }
.height-eight { dominant-baseline:middle; }
.second-formula { font-size:17px; font-weight:700; }
.reason { display:grid; gap:6px; margin:4px auto 20px; max-width:440px; border-radius:18px; background:var(--teal-soft); padding:16px 18px; color:var(--muted); font-size:.86rem; text-align:center; }
.reason b { color:var(--teal); font-size:.94rem; }
.parallel-line { stroke:var(--muted); stroke-width:2; }
.third-piece { stroke-width:2.5; }
.third-a { fill:rgba(76,133,128,.25); stroke:var(--teal); }
.third-i { fill:rgba(189,141,83,.27); stroke:var(--amber); }
.cross-line { stroke:var(--ink); stroke-width:2.2; }
.bc-line { stroke:var(--muted); stroke-width:3; }
.third-handle { fill:var(--surface); stroke:var(--teal); stroke-width:4; cursor:grab; }
.third-point { fill:var(--surface); stroke:var(--amber); stroke-width:3; }
.third-e { fill:var(--surface); stroke:var(--success); stroke-width:3; }
.point-label { fill:var(--ink); font-size:14px; font-weight:800; }
.area-letter { fill:var(--ink); font-size:20px; font-weight:800; }
.e-height { stroke:var(--muted); stroke-width:1.5; stroke-dasharray:4 4; }
.third-formula { font-size:15px; }
.third-height-label { fill:var(--muted); font-size:13px; font-weight:700; writing-mode:vertical-rl; }
.hint-card { display:grid; gap:7px; margin:4px auto 14px; max-width:520px; border:1px solid rgba(189,141,83,.28); border-radius:18px; background:rgba(246,232,209,.58); padding:16px 18px; color:var(--muted); font-size:.84rem; line-height:1.65; }
.hint-card b { color:#9b6b34; font-size:.95rem; text-align:center; }
.third-controls { grid-template-columns:repeat(3,1fr); }
.square-shape { fill:rgba(76,133,128,.04); stroke:var(--teal); stroke-width:2.5; }
.extension-line { stroke:var(--muted); stroke-width:2; }
.acf-piece { fill:rgba(76,133,128,.25); stroke:var(--teal); stroke-width:2.5; }
.def-piece { fill:rgba(189,141,83,.28); stroke:var(--amber); stroke-width:2.5; }
.construction-line { stroke:var(--ink); stroke-width:2.2; }
.construction-line.secondary { stroke:var(--amber); }
.fourth-handle { fill:var(--surface); stroke:var(--success); stroke-width:4; cursor:grab; }
.fourth-formula { font-size:14px; }
@media (max-width:460px) { .site-shell{padding-top:26px}.hero{padding-bottom:18px}.hero h1{white-space:normal}.table-of-contents{padding:19px;margin-bottom:30px}.toc-list{grid-template-columns:1fr}.toc-list a{min-height:54px}.lesson{border-radius:24px}.controls,.third-controls{grid-template-columns:1fr}.message{font-size:.8rem} }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after{scroll-behavior:auto!important} }

  

.chapter01-home-nav{
  position:sticky;top:10px;z-index:99999;
  display:flex;justify-content:center;
  padding:10px 12px 0;
  pointer-events:none;
}
.chapter01-home-btn{
  pointer-events:auto;
  display:inline-flex;align-items:center;justify-content:center;
  min-width:180px;min-height:50px;padding:12px 28px;
  border-radius:999px;text-decoration:none;
  background:#e7f4f0;border:1px solid #c9e2db;
  color:#3f756b;font:800 15px/1 "Yu Gothic","Hiragino Kaku Gothic ProN",sans-serif;
  letter-spacing:.05em;box-shadow:0 8px 22px rgba(62,96,88,.10);
}
.chapter01-home-btn:hover{background:#dcefe9;transform:translateY(-1px)}
@media(max-width:700px){
  .chapter01-home-btn{min-width:160px;min-height:46px;font-size:14px;padding:10px 23px}
}


.ch1-site-nav{
 display:flex;justify-content:center;gap:8px;
 max-width:760px;margin:10px auto 8px;padding:0 10px;box-sizing:border-box;
}
.ch1-site-nav a{
 display:inline-flex;align-items:center;justify-content:center;
 min-height:38px;padding:7px 14px;border:1px solid #d8e6e3;border-radius:999px;
 background:#fff;color:#497d74;text-decoration:none;font-weight:800;font-size:13px;
}
@media(max-width:700px){
 .ch1-site-nav{margin:6px auto}
 .ch1-site-nav a{min-height:34px;padding:5px 11px;font-size:12px}
}


.site-nav-v25{display:flex;justify-content:center;gap:8px;max-width:760px;margin:8px auto 8px;padding:0 10px;box-sizing:border-box}
.site-nav-v25 a{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:6px 13px;border:1px solid #d8e6e3;border-radius:999px;background:#fff;color:#497d74;text-decoration:none;font-weight:800;font-size:12px}
@media(max-width:560px){.site-nav-v25{margin:5px auto}.site-nav-v25 a{min-height:32px;padding:5px 10px;font-size:11px}}


:root{
 --site-green:#497d74;
 --site-green-soft:#edf7f4;
 --site-border:#dce9e5;
 --site-muted:#7d918c;
}
.site-section-label{
 font-size:10px;font-weight:900;letter-spacing:.15em;color:var(--site-green);
 text-transform:uppercase;
}
.site-soft-card{
 border:1px solid var(--site-border);border-radius:20px;background:#fff;
 box-shadow:0 8px 24px rgba(60,90,82,.055);
}
@media(max-width:560px){
 .site-soft-card{border-radius:17px}
}


:root{--learn-green:#497d74;--learn-soft:#f8fbfa;--learn-border:#dce9e5}
.learning-page-frame{
  max-width:760px;margin:0 auto;padding:0 10px;box-sizing:border-box
}
@media(max-width:700px){
  .site-nav-v15,.site-nav-v25{margin-bottom:5px!important}
}


.site-copyright-v33{
  max-width:900px;margin:26px auto 12px;padding:12px 16px;
  text-align:center;font-size:11px;line-height:1.7;color:#7d918c;
  border-top:1px solid #e4eeeb;box-sizing:border-box
}
@media(max-width:560px){.site-copyright-v33{margin-top:18px;font-size:10px;padding:10px 12px}}
