/* MoraPath Web learning stylesheet. Ported from the approved W0/W1 draft
   (docs/product-design/open-design/web-learning-w0-w1-v1/styles.css, approved 2026-10-08). The V5 tokens below must stay
   equal to docs/product-design/open-design/app-wide-visual-v5/theme.css (UI-0011); test/designParity.test.ts checks it.
   Phone layout by default; desktop (sidebar) from 900px. Theme: system by default, data-theme on <html> overrides. */
:root{color-scheme:light;--bg:#F6F6FA;--surface:#FFFFFF;--soft:#EEEEF4;--line:#E3E3EE;--line-strong:#C9C9DA;--ink:#1D1B3A;--muted:#5B5975;--on-ink:#FFFFFF;--scrim:rgba(29,27,58,.42);--bar:rgba(255,255,255,.86);--danger:#C4122F;--danger-bg:#FDE8EC;--warning:#8A5300;--warn-bg:#FFF1D6;--success:#0B7A55;--success-bg:#DFF6EC;--tab:#DA3A12;--materials-fill:#DA3A12;--materials-edge:#A82E10;--materials-tint:#FFE9E2;--materials-text:#C23412;--materials-on-fill:#FFFFFF;--materials-deco:#FF8A6B;--materials-inverse:#C23412;--vocabulary-fill:#5B4BF0;--vocabulary-edge:#3E2FC4;--vocabulary-tint:#ECEAFF;--vocabulary-text:#5040E6;--vocabulary-on-fill:#FFFFFF;--vocabulary-deco:#8F84FF;--vocabulary-inverse:#5040E6;--ai-fill:#0672C7;--ai-edge:#04508C;--ai-tint:#E1F1FF;--ai-text:#0668B5;--ai-on-fill:#FFFFFF;--ai-deco:#4FB3FF;--ai-inverse:#0668B5;--exam-fill:#0B7F58;--exam-edge:#075A3E;--exam-tint:#DDF6EB;--exam-text:#0A7651;--exam-on-fill:#FFFFFF;--exam-deco:#3FD39E;--exam-inverse:#0A7651;--my-fill:#FFC233;--my-edge:#D99A00;--my-tint:#FFF3D1;--my-text:#855C00;--my-on-fill:#1D1B3A;--my-deco:#FFD86B;--my-inverse:#855C00;--tile-0-bg:#0B7F58;--tile-0-fg:#FFFFFF;--tile-1-bg:#0672C7;--tile-1-fg:#FFFFFF;--tile-2-bg:#FFC233;--tile-2-fg:#1D1B3A;--tile-3-bg:#5B4BF0;--tile-3-fg:#FFFFFF;--tile-4-bg:#DA3A12;--tile-4-fg:#FFFFFF;--tile-5-bg:#C21F7A;--tile-5-fg:#FFFFFF}
:root[data-theme=dark]{color-scheme:dark;--bg:#12111E;--surface:#1D1C2E;--soft:#28273D;--line:#33324C;--line-strong:#4C4B68;--ink:#F4F3FF;--muted:#B7B5D3;--on-ink:#12111E;--scrim:rgba(0,0,0,.56);--bar:rgba(29,28,46,.88);--danger:#FF8A98;--danger-bg:#3D1720;--warning:#FFC96B;--warn-bg:#38290F;--success:#5FE0AE;--success-bg:#11342A;--tab:#FF8562;--materials-fill:#DA3A12;--materials-edge:#8F2408;--materials-tint:#3A1D17;--materials-text:#FF9473;--materials-on-fill:#FFFFFF;--materials-deco:#FF8A6B;--materials-inverse:#C23412;--vocabulary-fill:#5B4BF0;--vocabulary-edge:#3324A8;--vocabulary-tint:#25214A;--vocabulary-text:#A79EFF;--vocabulary-on-fill:#FFFFFF;--vocabulary-deco:#8F84FF;--vocabulary-inverse:#5040E6;--ai-fill:#0672C7;--ai-edge:#03406F;--ai-tint:#132B42;--ai-text:#6CC0FF;--ai-on-fill:#FFFFFF;--ai-deco:#4FB3FF;--ai-inverse:#0668B5;--exam-fill:#0B7F58;--exam-edge:#054A33;--exam-tint:#11312A;--exam-text:#5FE0AE;--exam-on-fill:#FFFFFF;--exam-deco:#3FD39E;--exam-inverse:#0A7651;--my-fill:#FFC233;--my-edge:#A87700;--my-tint:#352B12;--my-text:#FFD06B;--my-on-fill:#1D1B3A;--my-deco:#FFD86B;--my-inverse:#855C00;--tile-0-bg:#0B7F58;--tile-0-fg:#FFFFFF;--tile-1-bg:#0672C7;--tile-1-fg:#FFFFFF;--tile-2-bg:#FFC233;--tile-2-fg:#1D1B3A;--tile-3-bg:#5B4BF0;--tile-3-fg:#FFFFFF;--tile-4-bg:#DA3A12;--tile-4-fg:#FFFFFF;--tile-5-bg:#C21F7A;--tile-5-fg:#FFFFFF}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--bg:#12111E;--surface:#1D1C2E;--soft:#28273D;--line:#33324C;--line-strong:#4C4B68;--ink:#F4F3FF;--muted:#B7B5D3;--on-ink:#12111E;--scrim:rgba(0,0,0,.56);--bar:rgba(29,28,46,.88);--danger:#FF8A98;--danger-bg:#3D1720;--warning:#FFC96B;--warn-bg:#38290F;--success:#5FE0AE;--success-bg:#11342A;--tab:#FF8562;--materials-fill:#DA3A12;--materials-edge:#8F2408;--materials-tint:#3A1D17;--materials-text:#FF9473;--materials-on-fill:#FFFFFF;--materials-deco:#FF8A6B;--materials-inverse:#C23412;--vocabulary-fill:#5B4BF0;--vocabulary-edge:#3324A8;--vocabulary-tint:#25214A;--vocabulary-text:#A79EFF;--vocabulary-on-fill:#FFFFFF;--vocabulary-deco:#8F84FF;--vocabulary-inverse:#5040E6;--ai-fill:#0672C7;--ai-edge:#03406F;--ai-tint:#132B42;--ai-text:#6CC0FF;--ai-on-fill:#FFFFFF;--ai-deco:#4FB3FF;--ai-inverse:#0668B5;--exam-fill:#0B7F58;--exam-edge:#054A33;--exam-tint:#11312A;--exam-text:#5FE0AE;--exam-on-fill:#FFFFFF;--exam-deco:#3FD39E;--exam-inverse:#0A7651;--my-fill:#FFC233;--my-edge:#A87700;--my-tint:#352B12;--my-text:#FFD06B;--my-on-fill:#1D1B3A;--my-deco:#FFD86B;--my-inverse:#855C00;--tile-0-bg:#0B7F58;--tile-0-fg:#FFFFFF;--tile-1-bg:#0672C7;--tile-1-fg:#FFFFFF;--tile-2-bg:#FFC233;--tile-2-fg:#1D1B3A;--tile-3-bg:#5B4BF0;--tile-3-fg:#FFFFFF;--tile-4-bg:#DA3A12;--tile-4-fg:#FFFFFF;--tile-5-bg:#C21F7A;--tile-5-fg:#FFFFFF}}
:root{--f-round:"SF Pro Rounded",ui-rounded,-apple-system,BlinkMacSystemFont,"PingFang TC",sans-serif;--f-body:-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC",sans-serif;--f-ja:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","PingFang TC",sans-serif;--m-fill:var(--materials-fill);--m-edge:var(--materials-edge);--m-tint:var(--materials-tint);--m-text:var(--materials-text);--m-on:var(--materials-on-fill)}
body{margin:0;font:16px/1.55 var(--f-body);color:var(--ink);background:var(--bg);text-align:left}
*,*::before,*::after{box-sizing:border-box}
[lang=ja]{font-family:var(--f-ja)}
h1,h2,h3,p{margin:0}
button,input,textarea,select{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--ai-fill);outline-offset:2px;border-radius:12px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.app{min-height:100vh;height:100dvh;display:flex;flex-direction:column}
.scroll{flex:1;min-height:0;overflow:auto}
.page{padding:16px 16px 24px}
.tabs{display:flex;border-top:1px solid var(--line);background:var(--bar);padding:6px 4px 10px;flex-shrink:0}
.tabs a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;min-height:52px;justify-content:center;color:var(--muted);font:700 12px var(--f-body);text-decoration:none;border-radius:12px}
.tabs a[aria-current=page]{color:var(--tab)}
.side{border-right:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;padding:20px 14px;gap:4px}
.brand{display:flex;align-items:center;gap:10px;font:800 19px var(--f-round);margin:0 6px 18px}
.brand i{display:grid;place-items:center;width:36px;height:36px;border-radius:11px;background:var(--materials-fill);color:var(--materials-on-fill);font-style:normal}
.side a{display:flex;align-items:center;gap:12px;min-height:48px;padding:0 12px;border-radius:14px;color:var(--ink);font:750 16px var(--f-body);text-decoration:none}
.side a[aria-current=page]{background:var(--m-tint);color:var(--m-text)}
.side .side-foot{margin-top:auto;font-size:13px;color:var(--muted);padding:0 8px;line-height:1.5}
svg.ic{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.main{min-width:0;display:flex;flex-direction:column}
.title{font:800 28px/1.15 var(--f-round);letter-spacing:-.02em}
.h2{font:800 20px/1.3 var(--f-round)}
.meta{font-size:14px;font-weight:600;color:var(--muted);line-height:1.45}
.lead{font-size:17px;line-height:1.6}
.muted{color:var(--muted)}
.button{--b-bg:var(--m-fill);--b-fg:var(--m-on);--b-edge:var(--m-edge);display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:52px;padding:12px 20px;border:0;border-radius:16px;background:var(--b-bg);color:var(--b-fg);font:800 16px/1.2 var(--f-round);box-shadow:0 4px 0 var(--b-edge);margin-bottom:4px;cursor:pointer;text-decoration:none}
.button.secondary{--b-bg:var(--surface);--b-fg:var(--m-text);--b-edge:var(--line-strong);border:2px solid var(--line)}
.button.subtle{--b-bg:var(--soft);--b-fg:var(--ink);--b-edge:var(--line-strong)}
.button.danger{--b-bg:var(--danger-bg);--b-fg:var(--danger);--b-edge:var(--line-strong)}
.button:disabled{--b-bg:var(--soft);--b-fg:var(--muted);--b-edge:var(--line);cursor:default}
.button.full{width:100%}
.button.small{min-height:44px;font-size:15px;padding:8px 16px}
.text-link{background:none;border:0;color:var(--m-text);font:750 15px var(--f-body);min-height:44px;min-width:44px;padding:0 4px;cursor:pointer}
.icon-btn{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:14px;background:transparent;color:var(--ink);cursor:pointer}
.chunky{display:grid;place-items:center;width:52px;height:52px;border:0;border-radius:16px;background:var(--m-fill);color:var(--m-on);box-shadow:0 4px 0 var(--m-edge);margin-bottom:4px}
.chunky:disabled{background:var(--soft);color:var(--muted);box-shadow:0 4px 0 var(--line);cursor:default}
.search{display:flex;align-items:center;gap:10px;min-height:52px;flex:1;min-width:0;background:var(--surface);border:2px solid var(--line);border-radius:16px;padding:0 4px 0 14px;color:var(--muted);font-size:17px}
.search:focus-within{border-color:var(--m-fill)}
.search input{flex:1;min-width:0;min-height:48px;border:0;background:none;color:var(--ink);font:500 17px var(--f-body);outline:none}
.search input::placeholder{color:var(--muted)}
.seg{display:flex;gap:8px;margin:12px 0 14px;flex-wrap:wrap}
.seg button{min-height:44px;padding:8px 18px;border-radius:14px;background:var(--surface);border:2px solid var(--line);color:var(--muted);font:800 15px var(--f-round)}
.seg button[aria-pressed=true],.seg button[aria-checked=true]{background:var(--ink);color:var(--on-ink);border-color:var(--ink)}
.field{display:grid;gap:6px;font-weight:700;margin-bottom:14px}
.field input{min-height:52px;border:2px solid var(--line);border-radius:14px;background:var(--surface);padding:0 14px;font-size:17px;font-weight:500}
.field.invalid input{border-color:var(--danger)}
.field-error{color:var(--danger);font-size:15px;font-weight:650}
.card{background:var(--surface);border:2px solid var(--line);border-radius:20px;padding:16px;box-shadow:0 3px 0 var(--line)}
.list{display:grid;gap:12px}
.list>*{min-width:0}
.row{position:relative;display:flex;gap:14px;align-items:flex-start;background:var(--surface);border:2px solid var(--line);border-radius:20px;padding:12px;box-shadow:0 3px 0 var(--line);min-height:96px}
.row-link{color:inherit;text-decoration:none}
.row-link::after{content:"";position:absolute;inset:0;border-radius:18px}
.row-link:focus-visible{outline:none}
.row:focus-within{border-color:var(--m-fill)}
.row .icon-btn{position:relative;z-index:1}
.thumb{flex:none;width:96px;height:56px;border-radius:14px;display:grid;place-items:center;color:#fff}
.thumb.t0{background:var(--tile-0-bg)}
.thumb.t1{background:var(--tile-3-bg)}
.thumb.t2{background:var(--tile-5-bg)}
.thumb.audio,.thumb.text{background:var(--m-tint);color:var(--m-text)}
.thumb.local{background:var(--soft);color:var(--muted);border:2px dashed var(--line-strong)}
.row .copy{flex:1;min-width:0}
.row strong{display:block;font:800 17px/1.35 var(--f-round);overflow-wrap:anywhere}
.badge{display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:4px 10px;border-radius:10px;background:var(--m-tint);color:var(--m-text);font:800 13px var(--f-round)}
.badge.neutral{background:var(--soft);color:var(--muted)}
.badge.warn{background:var(--warn-bg);color:var(--warning)}
.continue{color:inherit;text-decoration:none;display:flex;align-items:center;gap:14px;background:var(--surface);border:2px solid var(--line);border-radius:20px;padding:12px 14px;box-shadow:0 3px 0 var(--line);margin-bottom:12px;font:800 17px var(--f-round)}
.continue i{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:var(--m-tint);color:var(--m-text)}
.notice{display:flex;gap:12px;align-items:flex-start;border-radius:18px;padding:14px 16px;margin-bottom:14px;font-weight:600}
.notice.warn{background:var(--warn-bg);color:var(--warning)}
.notice.danger{background:var(--danger-bg);color:var(--danger)}
.notice.info{background:var(--ai-tint);color:var(--ai-text)}
.notice.ok{background:var(--success-bg);color:var(--success)}
.notice p{color:var(--ink);font-weight:500;margin-top:2px}
.empty{text-align:center;padding:48px 16px;display:grid;justify-items:center;gap:10px}
.empty .blob{display:grid;place-items:center;width:84px;height:84px;border-radius:26px;background:var(--m-tint);color:var(--m-text)}
.spinner{display:inline-block;width:20px;height:20px;border-radius:50%;border:3px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.spinner{animation:none;border-right-color:currentColor;opacity:.55}}
.skel{background:var(--soft);border-radius:14px}
.player{display:flex;flex-direction:column;height:100%}
.player-top{display:flex;align-items:center;gap:8px;padding:8px 8px 8px 4px;min-height:56px}
.player-top .ptitle{flex:1;min-width:0;font:750 16px var(--f-body);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stage{position:relative;background:#101018;color:#fff;aspect-ratio:16/9;display:grid;place-items:center;text-align:center;flex-shrink:0}
.stage .stage-title{font:700 17px var(--f-ja)}
.stage.state{background:var(--soft);color:var(--ink);border:2px dashed var(--line-strong);border-radius:0}
.stage-inner{display:grid;justify-items:center;gap:10px;padding:16px;max-width:520px}
.stage-inner .h2{font-size:19px}
.drop{position:absolute;inset:10px;border:3px dashed var(--m-fill);border-radius:18px;background:color-mix(in srgb,var(--m-tint) 85%,transparent);display:grid;place-items:center;color:var(--m-text);font:800 18px var(--f-round)}
.transcript{display:grid;gap:4px;padding:8px 12px}
.line{padding:10px 12px;border-radius:16px}
.line .ja{font:700 20px/1.6 var(--f-ja)}
.line .tr{font-size:15px;font-weight:650;color:var(--muted)}
.line.current{background:var(--m-tint)}
.line rt{font-size:10px;font-weight:600;color:var(--muted)}
.transport{display:flex;align-items:flex-end;justify-content:space-around;gap:2px;padding:8px 6px 10px;border-top:1px solid var(--line);background:var(--bg);flex-shrink:0}
.transport button{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:48px;min-height:52px;border:0;background:none;color:var(--ink);font:700 13px var(--f-body);cursor:pointer;border-radius:12px}
.transport .play{background:var(--m-fill);color:var(--m-on);box-shadow:0 4px 0 var(--m-edge);border-radius:16px;min-width:64px;min-height:60px;justify-content:center;margin-bottom:4px}
.transport button[aria-pressed=true]{color:var(--m-text)}
.transport button:disabled{opacity:.38;cursor:default}
.transport .play:disabled{opacity:1;background:var(--soft);color:var(--muted);box-shadow:0 4px 0 var(--line)}
.repeat-chip{display:inline-flex;align-items:center;gap:8px;margin:6px 12px 0;padding:8px 12px;border-radius:14px;background:var(--m-tint);color:var(--m-text);font:800 14px var(--f-round)}
.timeline{height:6px;border-radius:3px;background:var(--line);margin:10px 12px 0;position:relative}
.timeline b{position:absolute;left:0;top:0;bottom:0;border-radius:3px;background:var(--m-fill)}
.scrim{position:fixed;inset:0;background:var(--scrim);z-index:5}
.sheet{position:fixed;left:0;right:0;bottom:0;background:var(--surface);border-radius:24px 24px 0 0;padding:20px 16px 24px;z-index:6;max-height:86%;overflow:auto}
.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.sheet-head h2{font:800 20px var(--f-round)}
fieldset{border:0;margin:0 0 14px;padding:0}
legend{font:800 15px var(--f-round);color:var(--muted);margin-bottom:8px}
.choices{display:flex;flex-wrap:wrap;gap:8px}
.choice{display:flex;align-items:center;gap:8px;min-height:48px;padding:0 14px;border:2px solid var(--line);border-radius:14px;background:var(--surface);font-weight:700;cursor:pointer}
.choice input{width:20px;height:20px;accent-color:var(--m-fill);margin:0}
.choice.on{border-color:var(--m-fill);background:var(--m-tint);color:var(--m-text)}
.dialog{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(360px,calc(100% - 32px));background:var(--surface);border-radius:24px;padding:22px 20px 16px;z-index:6;text-align:left}
.dialog h2{font:800 20px var(--f-round);margin-bottom:6px}
.dialog .actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
.menu{position:absolute;z-index:6;background:var(--surface);border:2px solid var(--line);border-radius:18px;box-shadow:0 12px 32px rgba(0,0,0,.18);padding:6px;min-width:260px}
.menu button{display:flex;align-items:center;gap:12px;width:100%;min-height:48px;border:0;background:none;padding:0 12px;border-radius:12px;text-align:left;font-weight:700;cursor:pointer}
.menu .menu-note{padding:8px 12px 10px;font-size:14px;color:var(--muted);line-height:1.45}
.banner{display:flex;align-items:center;gap:10px;padding:10px 16px;background:var(--warn-bg);color:var(--warning);font-weight:700;font-size:15px}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-size:15px}
.kv dt{color:var(--muted);font-weight:650}
.kv dd{margin:0;font-weight:700}
.identity{display:flex;align-items:center;gap:14px}
.avatar{display:grid;place-items:center;width:56px;height:56px;border-radius:18px;background:var(--my-fill);color:var(--my-on-fill);font:800 22px var(--f-round)}
.stat{font:800 32px var(--f-round)}
.stack{display:grid;gap:14px}
.center{display:grid;place-items:center;min-height:100%}
.auth{width:100%;max-width:420px;padding:24px 20px}
/* Production layout additions (not in the draft frame): sidebar on desktop, tabs on phone, page scroll. */
.side{display:none}
.main{flex:1;min-height:0}
.tabs{position:sticky;bottom:0}
html,body,#root{height:100%}
/* The canvas behind the page (overscroll, 200% zoom) follows the theme too. */
html{background:var(--bg)}
/* The current tab is marked by more than colour: a bar above it and a heavier label. */
.tabs a{position:relative}
.tabs a[aria-current=page]{font-weight:850}
.tabs a[aria-current=page]::before{content:"";position:absolute;top:0;left:50%;width:24px;margin-left:-12px;border-top:3px solid currentColor;border-radius:2px}
.side a[aria-current=page]{font-weight:850}
/* aria-disabled controls stay focusable (so their reason can be read) but look unavailable. */
.button[aria-disabled=true]{--b-bg:var(--soft);--b-fg:var(--muted);--b-edge:var(--line);cursor:default}
.text-link[aria-disabled=true],.menu button[aria-disabled=true]{color:var(--muted);cursor:default}
/* A focused material card shows the same ring as every other control. */
.row:has(.row-link:focus-visible){outline:3px solid var(--ai-fill);outline-offset:2px}
/* Windows high contrast: keep focus rings and the current tab visible with system colours. */
@media (forced-colors:active){:focus-visible,.row:has(.row-link:focus-visible){outline-color:Highlight}.search:focus-within{outline:3px solid Highlight;outline-offset:2px}.seg button[aria-pressed=true],.seg button[aria-checked=true]{forced-color-adjust:none;background:Highlight;color:HighlightText;border-color:Highlight}.button[aria-disabled=true],.text-link[aria-disabled=true],.menu button[aria-disabled=true]{color:GrayText;border-color:GrayText}.side a[aria-current=page]{outline:2px solid Highlight}.button{border:2px solid ButtonText}}
.auth{width:min(420px,100%)}
@media (min-width:900px){.side{display:flex}.tabs{display:none}.app{display:grid;grid-template-columns:232px 1fr}.page{padding:28px 40px 40px;max-width:1040px}.list.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.thumb{width:116px;height:66px}.stage,.stage.state{border-radius:20px}.player-body{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,1fr);gap:24px;padding:0 32px 0 24px;flex:1;min-height:0}.player-left{display:flex;flex-direction:column;gap:14px;min-height:0;padding-bottom:16px}.transport{border:2px solid var(--line);border-radius:20px;background:var(--surface)}.player-right{overflow:auto;border-left:1px solid var(--line);padding-left:8px}.sheet{left:50%;right:auto;bottom:auto;top:50%;transform:translate(-50%,-50%);width:520px;border-radius:24px}}
