:root{
  --bg:#eef3f5;--surface:#fff;--surface-2:#f6f9fa;--surface-3:#edf3f5;--ink:#142027;--muted:#65757e;
  --line:#d5e0e4;--line-strong:#a9bac2;--brand:#08717a;--brand-strong:#05565e;--brand-soft:#e4f5f5;
  --focus:#0da7b5;--good:#13734c;--good-soft:#e9f7ef;--bad:#a83333;--bad-soft:#fff0f0;
  --shadow:0 14px 38px rgba(18,38,45,.09);--radius:18px;--structure-bg:#f8fbfc;
}
html[data-mm-theme="dark"]{
  --bg:#0c1318;--surface:#131d23;--surface-2:#10181d;--surface-3:#172229;--ink:#edf4f7;--muted:#9bacb4;
  --line:#2b3a42;--line-strong:#53666f;--brand:#27b9bf;--brand-strong:#8ce4e6;--brand-soft:#14383c;
  --focus:#56d5dc;--good:#63d49a;--good-soft:#113529;--bad:#ff8b8b;--bad-soft:#371b1d;
  --shadow:0 16px 42px rgba(0,0,0,.32);--structure-bg:#091116;
}
*{box-sizing:border-box}html{scroll-behavior:smooth;color-scheme:light}html[data-mm-theme="dark"]{color-scheme:dark}
body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP",Meiryo,sans-serif;line-height:1.55}
button,input{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,a:focus-visible{outline:3px solid color-mix(in srgb,var(--focus) 30%,transparent);outline-offset:2px}
[hidden]{display:none!important}.skip{position:fixed;left:12px;top:-80px;z-index:100;background:var(--ink);color:var(--surface);padding:10px 14px;border-radius:8px}.skip:focus{top:12px}
.sitebar{position:sticky;top:0;z-index:40;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(12px)}
.sitebar__inner{max-width:1180px;height:64px;margin:auto;padding:0 20px;display:flex;align-items:center;gap:12px}.back{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);text-decoration:none;font-size:24px;line-height:1}.brand{display:flex;align-items:center;gap:9px;min-width:0;color:var(--ink);text-decoration:none}.brand img{width:34px;height:34px}.brand__name{font-size:17px;font-weight:850;letter-spacing:.055em}.brand__sep{color:var(--line-strong)}.brand__page{font-size:14px;font-weight:760;white-space:nowrap}.sitebar__spacer{flex:1}.header-actions{display:flex;align-items:center;gap:7px}.icon-button{height:38px;min-width:38px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font-weight:800}.header-link{color:var(--muted);font-size:12px;font-weight:750;text-decoration:none;padding:8px}.header-link:hover{color:var(--ink)}
main{max-width:1120px;margin:0 auto;padding:20px 20px 80px}.conditions{margin-bottom:15px}.conditions__label{display:flex;align-items:center;gap:8px;margin:0 0 8px 3px;color:var(--muted);font-size:12px;font-weight:850;letter-spacing:.04em}.conditions__label::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--brand);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 15%,transparent)}
.controls{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap;padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 5px 18px rgba(18,38,45,.05)}.chips{display:flex;flex:1 1 720px;flex-wrap:wrap;gap:7px}.chip{--c:var(--brand);appearance:none;border:1px solid var(--line);background:var(--surface-3);color:var(--muted);border-radius:999px;padding:7px 11px;font-size:12px;font-weight:780;line-height:1;display:inline-flex;align-items:center;gap:7px;white-space:nowrap;transition:.14s}.chip::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--c);box-shadow:0 0 6px color-mix(in srgb,var(--c) 58%,transparent)}.chip:hover{border-color:var(--line-strong);color:var(--ink);transform:translateY(-1px)}.chip[aria-pressed="true"]{color:var(--ink);border-color:var(--c);background:color-mix(in srgb,var(--c) 11%,var(--surface));box-shadow:inset 0 0 0 1px var(--c),0 0 14px color-mix(in srgb,var(--c) 18%,transparent)}
.segments{margin-left:auto;display:flex;gap:8px;flex:0 0 auto}.segment{display:flex;gap:2px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--surface-3)}.segment button{border:0;border-radius:6px;background:transparent;color:var(--muted);padding:7px 11px;font-size:11px;font-weight:820;white-space:nowrap}.segment button:hover{color:var(--ink)}.segment button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:inset 0 0 0 1px var(--line-strong),0 2px 7px rgba(18,38,45,.08)}.segment--level button[aria-pressed="true"]{background:linear-gradient(135deg,#25c6bd,#38bdf8);color:#073432;box-shadow:none}
.problem{overflow:hidden;border:1px solid var(--line);border-radius:22px;background:var(--surface);box-shadow:var(--shadow)}.problem__top{display:flex;align-items:center;gap:8px;padding:16px 20px 0}.tag{display:inline-flex;border-radius:999px;background:var(--brand-soft);color:var(--brand-strong);padding:4px 9px;font-size:11px;font-weight:820}.level-tag{color:var(--muted);font-size:11px;font-weight:750}.mode-label{margin-left:auto;color:var(--muted);font-size:12px;font-weight:780}.data-warning{margin:0 20px 8px;color:var(--muted);font-size:11px}.structure{position:relative;margin:8px 20px 0;min-height:330px;border:1px solid var(--line);border-radius:16px;background:var(--structure-bg);display:grid;place-items:center;overflow:hidden}.structure img{display:block;width:100%;height:330px;object-fit:contain;padding:16px 22px}.structure__fallback{font-size:26px;font-weight:800;color:var(--muted)}

.stereo-markers{position:absolute;inset:0;z-index:4;pointer-events:none;overflow:hidden}.stereo-marker{position:absolute;width:30px;height:30px;transform:translate(-50%,-50%);border:2px solid color-mix(in srgb,var(--line-strong) 82%,transparent);border-radius:50%;background:color-mix(in srgb,var(--surface) 8%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--surface) 58%,transparent),0 2px 8px rgba(0,0,0,.12);transition:width .15s,height .15s,background .15s,border-color .15s}.stereo-marker::after{content:attr(data-marker);position:absolute;right:-11px;top:-12px;display:grid;place-items:center;width:22px;height:22px;border:2px solid var(--line-strong);border-radius:50%;background:var(--surface);color:var(--muted);font-size:11px;font-weight:900;line-height:1;box-shadow:0 2px 8px rgba(0,0,0,.16)}.stereo-marker.is-current{width:42px;height:42px;border:4px solid var(--focus);background:color-mix(in srgb,var(--focus) 6%,transparent);box-shadow:0 0 0 5px color-mix(in srgb,var(--focus) 20%,transparent),0 5px 16px rgba(0,0,0,.18)}.stereo-marker.is-current::after{border-color:var(--focus);background:var(--brand);color:#fff}.stereo-marker.is-complete:not(.is-current){border-color:var(--good);background:color-mix(in srgb,var(--good) 6%,transparent)}.stereo-marker.is-complete:not(.is-current)::after{border-color:var(--good);background:var(--good-soft);color:var(--good)}
.stereo-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}.stereo-choice{height:54px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface-2);color:var(--ink);font-size:21px;font-weight:900}.stereo-choice:hover{border-color:var(--brand);background:var(--brand-soft);color:var(--brand-strong)}.problem.is-stereo .answer-row input{text-align:center;text-transform:uppercase;font-size:22px;font-weight:900;letter-spacing:.12em}.problem.is-stereo .question-note{font-size:13px;font-weight:800;color:var(--brand-strong)}
.stepper-wrap{padding:14px 20px 0}.stepper{display:grid;grid-template-columns:repeat(9,minmax(74px,1fr));gap:5px}.step{min-height:48px;padding:6px 5px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);text-align:center;color:var(--muted);font-size:10px;font-weight:720;line-height:1.24}.step b{display:block;margin-bottom:2px;font-size:11px}.step.is-done{background:var(--good-soft);border-color:color-mix(in srgb,var(--good) 38%,var(--line));color:var(--good)}.step.is-current{background:var(--brand-soft);border-color:var(--brand);color:var(--brand-strong);box-shadow:inset 0 0 0 1px var(--brand)}
.answer-area{padding:18px 20px 22px}.question{margin:0 0 9px;font-size:17px;font-weight:830}.question-note{margin:-2px 0 10px;color:var(--muted);font-size:11px}.answer-row{display:flex;gap:9px}.answer-row input{flex:1;min-width:0;height:50px;border:1px solid var(--line-strong);border-radius:11px;background:var(--surface);color:var(--ink);padding:0 14px;font-size:16px}.primary{min-width:132px;border:1px solid var(--brand);border-radius:11px;background:var(--brand);color:white;font-weight:830;padding:0 18px}.primary:hover{background:var(--brand-strong)}.feedback{margin-top:11px;border-radius:10px;padding:11px 12px;font-size:13px;font-weight:650}.feedback.is-correct{background:var(--good-soft);color:var(--good);border:1px solid color-mix(in srgb,var(--good) 38%,var(--line))}.feedback.is-wrong{background:var(--bad-soft);color:var(--bad);border:1px solid color-mix(in srgb,var(--bad) 38%,var(--line))}.accepted{display:block;margin-top:4px;color:var(--ink);font-weight:800}.explanation{margin-top:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);padding:12px 14px}.explanation summary{cursor:pointer;font-weight:800}.explanation ol{margin:10px 0 0;padding-left:22px}.explanation li+li{margin-top:7px}.guided-notes{margin-top:10px;border-top:1px solid var(--line);padding-top:10px}.guided-notes dt{font-size:11px;color:var(--muted);font-weight:800}.guided-notes dd{margin:2px 0 8px;font-size:13px}.autoplay-notice{display:none;margin:0 20px 10px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);font-size:11px;color:var(--muted)}.autoplay-notice.show{display:block}
.audio-settings{position:relative}.audio-panel{position:absolute;right:0;top:46px;width:min(370px,calc(100vw - 24px));padding:15px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 18px 48px rgba(0,0,0,.22);z-index:70}.audio-panel h2{margin:0 0 11px;font-size:15px}.audio-group{padding:10px 0}.audio-group+.audio-group{border-top:1px solid var(--line)}.audio-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;color:var(--muted);font-size:12px;font-weight:850}.preview-button{border:1px solid var(--line);border-radius:8px;background:var(--surface-2);color:var(--ink);padding:5px 8px;font-size:11px;font-weight:750}.audio-row{display:flex;align-items:center;gap:9px;margin:8px 0;font-size:13px;font-weight:720}.audio-row input[type="checkbox"]{width:18px;height:18px;accent-color:var(--brand)}.volume-row{display:grid;grid-template-columns:auto 1fr 42px;gap:8px;align-items:center;font-size:12px}.volume-row input{width:100%;accent-color:var(--brand)}.volume-value{text-align:right;color:var(--muted);font-variant-numeric:tabular-nums}.audio-status,.music-credit{font-size:11px;color:var(--muted);line-height:1.55}.music-credit{border-top:1px solid var(--line);padding-top:10px;margin-top:8px}.music-credit a{color:var(--brand-strong)}
.page-credit{max-width:1120px;margin:-55px auto 24px;padding:0 20px;text-align:right;font-size:11px;color:var(--muted)}.page-credit a{color:inherit}.mobile-action{display:none}.celebration{position:fixed;inset:0;z-index:100;pointer-events:none;display:none}.celebration.active{display:block}.loading{padding:60px 20px;text-align:center;color:var(--muted)}
@media(max-width:940px){.segments{width:100%;margin-left:0;justify-content:flex-end}.stepper{overflow:auto;grid-template-columns:repeat(9,94px);padding-bottom:4px}}
@media(max-width:600px){
 .sitebar__inner{height:58px;padding:0 11px;gap:7px}.back{width:36px;height:36px}.brand img{width:30px;height:30px}.brand__name{font-size:15px}.brand__page{font-size:12px}.header-link{display:none}.icon-button__label{display:none}.icon-button{padding:0;width:38px}main{padding:10px 10px 92px}.conditions__label{margin-top:1px}.controls{padding:9px;border-radius:12px}.chips{gap:6px}.chip{font-size:11px;padding:7px 9px}.segments{display:grid;grid-template-columns:1fr 1fr;gap:7px}.segment{width:100%}.segment button{flex:1;padding:8px 4px;font-size:10px}.problem{border-radius:17px}.problem__top{padding:13px 13px 0}.data-warning{margin:0 13px 6px}.structure{margin:7px 12px 0;min-height:250px}.structure img{height:250px}.stereo-marker{width:28px;height:28px}.stereo-marker.is-current{width:38px;height:38px}.stereo-marker::after{right:-10px;top:-11px;width:20px;height:20px;font-size:10px}.stereo-choices{gap:8px}.stereo-choice{height:52px}.stepper-wrap{padding:12px 12px 0}.answer-area{padding:14px 12px 22px}.question{font-size:16px}.answer-row input{height:50px}.answer-row .primary{display:none}.mobile-action{position:fixed;z-index:45;left:0;right:0;bottom:0;display:block;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:color-mix(in srgb,var(--surface) 95%,transparent);backdrop-filter:blur(10px)}.mobile-action button{width:100%;height:50px}.page-credit{margin:10px auto 88px;text-align:center}.audio-panel{position:fixed;top:64px;right:10px;left:10px;width:auto;max-height:calc(100vh - 84px);overflow:auto}.mode-label{font-size:11px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}.chip:hover{transform:none}}

/* Guided mode redesign v10 */
.guided-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}.problem.is-guided .guided-layout{grid-template-columns:minmax(0,1fr) 300px;align-items:start}.guided-main{min-width:0}.guided-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:2px 0 11px}.guided-choice{min-height:50px;border:1px solid var(--line-strong);border-radius:11px;background:var(--surface-2);color:var(--ink);padding:10px 12px;text-align:left;font-size:13px;font-weight:760;line-height:1.35;transition:border-color .14s ease,background .14s ease,transform .14s ease}.guided-choice:hover:not(:disabled){border-color:var(--brand);transform:translateY(-1px)}.guided-choice.is-selected{border-color:var(--brand);background:var(--brand-soft);box-shadow:inset 0 0 0 1px var(--brand)}.guided-choice.is-correct{border-color:var(--good);background:var(--good-soft);color:var(--good)}.guided-choice.is-wrong{border-color:var(--bad);background:var(--bad-soft);color:var(--bad)}.guided-choice:disabled{cursor:default}.answer-row.is-choice input{display:none}.answer-row.is-choice .primary{min-height:50px;margin-left:auto}.guided-summary{border:1px solid var(--line);border-radius:14px;background:var(--surface-2);padding:13px;position:sticky;top:80px}.guided-summary h2{margin:0 0 9px;font-size:13px}.guided-summary dl{display:grid;gap:6px;margin:0}.guided-summary__item{border:1px solid var(--line);border-radius:9px;background:var(--surface);padding:7px 9px}.guided-summary__item dt{font-size:10px;font-weight:820;color:var(--muted)}.guided-summary__item dd{margin:2px 0 0;font-size:12px;font-weight:720;overflow-wrap:anywhere}.guided-summary__item.is-current{border-color:var(--brand);background:var(--brand-soft)}.guided-summary__item.is-confirmed{border-color:color-mix(in srgb,var(--good) 38%,var(--line))}.guided-summary__item.is-confirmed dd{color:var(--good)}.name-builder{margin:0 0 11px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);padding:12px}.name-builder h2{margin:0;font-size:14px}.name-builder p{margin:4px 0 9px;color:var(--muted);font-size:11px}.name-parts{display:flex;flex-wrap:wrap;gap:7px}.name-part{border:1px solid var(--line-strong);border-radius:999px;background:var(--surface);color:var(--ink);padding:7px 10px;font-size:12px;font-weight:780}.name-part:hover:not(:disabled){border-color:var(--brand);background:var(--brand-soft)}.name-part:disabled{opacity:.65;cursor:default}.problem.is-guided .question{font-size:18px}.problem.is-guided .question-note{font-size:12px}.problem.is-guided .feedback{margin-top:12px}
@media(max-width:940px){.problem.is-guided .guided-layout{grid-template-columns:1fr}.guided-summary{position:static}.guided-summary dl{grid-template-columns:repeat(3,minmax(0,1fr))}.guided-summary__item{min-width:0}}
@media(max-width:560px){.guided-choices{grid-template-columns:1fr}.problem.is-guided .guided-summary dl{grid-template-columns:1fr 1fr}.guided-summary{padding:10px}.guided-summary__item{padding:7px}.answer-row.is-choice .primary{display:none}.name-builder{padding:10px}.name-part{font-size:11px}}

.feedback .accepted{display:block;margin-top:5px;font-weight:850}.feedback-reason{display:block;margin-top:4px;font-weight:650}.problem.is-stereo .structure{min-height:420px}.problem.is-stereo .stereo-marker{transform:translate(-50%,-50%) scale(.92)}
@media(max-width:560px){.problem.is-stereo .structure{min-height:310px}.problem.is-stereo .stereo-marker{transform:translate(-50%,-50%) scale(.78)}}


/* hotfix5: large stereo structures */
.structure{display:block;min-height:0;padding:0;overflow:hidden}
.structure-scroll{position:relative;width:100%;height:330px;overflow:auto;display:grid;place-items:center;overscroll-behavior:contain;scrollbar-gutter:stable both-edges;background:var(--structure-bg)}
.structure-stage{position:relative;display:grid;place-items:center;width:100%;height:330px;min-width:100%;flex:none}
.structure-stage img{display:block;width:100%;height:100%;max-width:none;object-fit:contain;padding:10px 14px}
.structure-stage .stereo-markers{position:absolute;inset:0;z-index:4;pointer-events:none;overflow:visible}
.structure-stage .structure__fallback{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center}
.structure-expand{position:absolute;z-index:8;top:10px;right:10px;display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 11px;border:1px solid var(--line-strong);border-radius:10px;background:color-mix(in srgb,var(--surface) 92%,transparent);color:var(--ink);font-size:12px;font-weight:820;box-shadow:0 3px 12px rgba(0,0,0,.12);backdrop-filter:blur(8px)}
.structure-expand:hover{border-color:var(--brand);color:var(--brand-strong)}
.structure-expand__icon{font-size:17px;line-height:1}
.structure-scroll-hint{position:absolute;z-index:7;left:50%;bottom:10px;transform:translateX(-50%);padding:5px 10px;border:1px solid var(--line);border-radius:999px;background:color-mix(in srgb,var(--surface) 90%,transparent);color:var(--muted);font-size:11px;font-weight:760;pointer-events:none;backdrop-filter:blur(8px)}
.problem.is-stereo .structure-scroll{height:clamp(500px,64vh,720px)}
.problem.is-stereo .structure-stage{height:100%}
.problem.is-stereo-advanced .structure-scroll{height:clamp(600px,72vh,840px)}
.problem.is-stereo-advanced .structure-stage img{padding:6px 8px}
.problem.is-wide-stereo .structure-scroll{place-items:center start}
.structure:fullscreen{width:100vw;height:100vh;margin:0;border:0;border-radius:0;background:var(--structure-bg)}
.structure:fullscreen .structure-scroll{width:100vw;height:100vh}
.structure:fullscreen .structure-expand{top:16px;right:16px}
.structure:fullscreen .structure-scroll-hint{bottom:18px}
@media(max-width:560px){
  .structure-scroll{height:250px}.structure-stage{height:250px}.structure-stage img{padding:7px 8px}
  .problem.is-stereo .structure-scroll{height:clamp(360px,58vh,470px)}
  .problem.is-stereo-advanced .structure-scroll{height:clamp(430px,64vh,540px)}
  .structure-expand{top:7px;right:7px;width:38px;padding:0;justify-content:center}.structure-expand__label{display:none}
  .structure-scroll-hint{bottom:7px;font-size:10px}
}

/* hotfix6: marker coordinates and molecule drawing use the same rendered image box. */
.structure-stage img{padding:0!important}
.stereo-marker::before{content:"";position:absolute;left:50%;top:50%;width:6px;height:6px;transform:translate(-50%,-50%);border-radius:50%;background:currentColor;box-shadow:0 0 0 2px color-mix(in srgb,var(--surface) 85%,transparent)}
.stereo-marker.is-current::before{background:var(--focus)}
.stereo-marker.is-complete:not(.is-current)::before{background:var(--good)}


/* hotfix7: enable horizontal scrolling only when the molecule would become unreadably small. */
.structure-scroll{overflow:hidden;scrollbar-gutter:auto}
.structure-scroll.is-scrollable{overflow-x:auto;overflow-y:hidden;scrollbar-gutter:stable both-edges}
.problem.is-wide-stereo .structure-scroll{place-items:center}
.problem.is-wide-stereo .structure-scroll.is-scrollable{place-items:center start}
.structure-scroll:not(.is-scrollable){touch-action:pan-y}
.structure-scroll.is-scrollable{touch-action:pan-x pan-y}


/* hotfix8: prevent inaccessible negative overflow and stale scroll positions. */
.structure-stage{box-sizing:border-box;padding:var(--structure-stage-pad-y,18px) var(--structure-stage-pad-x,24px)}
.structure-stage img{width:100%;height:100%;min-width:0;min-height:0}
.structure-scroll.is-scrollable{place-items:center start!important}
.structure-scroll.is-scrollable .structure-stage{justify-self:start;margin-inline:0}
