/* All styles are scoped to the new section; existing learning screens opt out. */
#memory{--mm-ink:#18355e;--mm-muted:#67758c;--mm-top:80px;color:var(--mm-ink)}
#memory button{cursor:pointer;touch-action:manipulation;font:inherit}
#memory button:focus-visible,#memory input:focus-visible,#memory summary:focus-visible,#memory a:focus-visible{outline:3px solid #3f7ed1;outline-offset:3px}
#memory .mm-art{display:block;background-image:url('assets/memory-tips/illustrations-v1.png');background-size:400% 200%;background-repeat:no-repeat;width:104px;aspect-ratio:1;flex-shrink:0}
#memory .mm-art-0{background-position:0 0}#memory .mm-art-1{background-position:33.333333% 0}#memory .mm-art-2{background-position:66.666667% 0}#memory .mm-art-3{background-position:100% 0}
#memory .mm-art-4{background-position:0 100%}#memory .mm-art-5{background-position:33.333333% 100%}#memory .mm-art-6{background-position:66.666667% 100%}#memory .mm-art-7{background-position:100% 100%}
#memory .mm-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 4px 12px;position:relative}
#memory .mm-hero h1{font-size:30px;line-height:1.3;margin:0 0 5px;font-weight:800;color:#17355e}
#memory .mm-hero h1>span{color:#df6093}
#memory .mm-hero p{margin:0;color:#81635b;font-size:15px;font-weight:650;line-height:1.6}
#memory .mm-hero .mm-art{width:83px}
#memory .mm-layout{display:grid;grid-template-columns:282px minmax(0,1fr);gap:18px;align-items:start}
#memory .mm-directory{position:sticky;top:var(--mm-top);max-height:calc(100dvh - var(--mm-top) - 16px);display:flex;flex-direction:column;min-width:0;background:#ffffffed;border:1px solid #e6e1e5;border-radius:18px;padding:15px 12px;box-shadow:0 6px 22px #28385708}
#memory .mm-directory h2{font-size:19px;margin:0 4px 10px}
#memory .mm-directory-body{min-height:0;display:flex;flex-direction:column}
#memory .mm-search{min-width:0;width:100%;border:1px solid #dadfe9;border-radius:9px;padding:10px 11px;color:#26486e;background:#fff;font:inherit;font-size:13px}
#memory .mm-count{font-size:11px;color:#7a879b;margin:7px 4px}
#memory .mm-topic-list{min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#cbd6e5 transparent;padding:2px}
#memory .mm-topic{border:1px solid transparent;width:100%;border-radius:12px;background:linear-gradient(95deg,#fff2f7,#f8f8fc);color:#304667;display:flex;align-items:center;gap:9px;text-align:left;padding:10px 8px;margin-bottom:7px;min-height:58px}
#memory .mm-topic:nth-child(3n+2){background:linear-gradient(95deg,#f1ebfd,#fcfaf8)}
#memory .mm-topic:nth-child(3n){background:linear-gradient(95deg,#e8f7ee,#fcfaf8)}
#memory .mm-topic.is-active{border-color:#9fc3f6;background:linear-gradient(100deg,#e3efff,#eff6ff);color:#154778;box-shadow:inset 3px 0 #397bd0}
#memory .mm-topic:hover{border-color:#bfd0e6}
#memory .mm-topic-icon{height:32px;width:32px;flex:0 0 32px;border-radius:50%;background:#dfebfd;display:grid;place-items:center;font-size:19px;font-weight:700;color:#376fae}
#memory .mm-topic:nth-child(3n+2) .mm-topic-icon{background:#e9dcfa;color:#8657b8}
#memory .mm-topic:nth-child(3n) .mm-topic-icon{background:#d9f1e4;color:#328164}
#memory .mm-topic>span:nth-child(2){display:flex;align-items:center;gap:7px;min-width:0;flex:1}
#memory .mm-topic small{font-size:10px;color:#7c8da7;font-weight:700}
#memory .mm-topic b{font-size:13px;line-height:1.45;overflow-wrap:anywhere}
#memory .mm-topic i{font-style:normal;font-size:20px;color:#7b8caa}
#memory .mm-directory-note{font-size:12px;line-height:1.7;margin:7px 4px 0;color:#8390a2}
#memory .mm-mobile-toggle{display:none}
#memory-content{min-width:0;outline:none;scroll-margin-top:var(--mm-top)}
#memory .mm-panel{background:#fffefa;border:1px solid #e8e1e4;border-radius:19px;overflow:hidden;box-shadow:0 6px 24px #27395408}
#memory .mm-sheet-heading{position:relative;min-height:132px;padding:20px 125px 18px;text-align:center;background:radial-gradient(ellipse at 0 0,#fff0f5,transparent 60%),linear-gradient(110deg,#fffef9,#fff9f9);border-bottom:1px solid #f2e7e6}
#memory .mm-sheet-heading>.mm-art{position:absolute;right:16px;top:16px;width:104px}
#memory .mm-eyebrow{font-size:10px;font-weight:800;color:#ad7082;letter-spacing:.12em}
#memory .mm-sheet-heading h2{display:table;font-size:27px;line-height:1.3;margin:6px auto;color:#19375e;letter-spacing:-.02em;background:linear-gradient(90deg,#ffe8f000,#ffe8f0a8,#ffe8f000);padding:3px 12px;border-radius:28% / 22%}
#memory .mm-sheet-heading p{font-size:14px;line-height:1.6;color:#84635a;margin:0}
#memory .mm-sheet-body{padding:18px 21px 20px}
#memory .mm-tone-0{--mm-tone:#dc5087;--mm-wash:#fff0f6}
#memory .mm-tone-1{--mm-tone:#9253c3;--mm-wash:#f4edfc}
#memory .mm-tone-2{--mm-tone:#c7792c;--mm-wash:#fff4e5}
#memory .mm-tone-3{--mm-tone:#328665;--mm-wash:#eafaef}
#memory .mm-tone-4{--mm-tone:#c25384;--mm-wash:#fff0f5}
#memory .mm-tone-5{--mm-tone:#347bb9;--mm-wash:#edf7ff}
#memory .mm-tone-6{--mm-tone:#7953bb;--mm-wash:#f4edff}
#memory .mm-tone-7{--mm-tone:#d45370;--mm-wash:#fff0f1}
#memory .mm-tone-8{--mm-tone:#218c80;--mm-wash:#e5f9ef}
#memory .mm-tone-9{--mm-tone:#9c6c4d;--mm-wash:#fff3e4}
#memory .mm-particle-list{display:grid;gap:7px}
#memory .mm-particle{border-radius:13px;background:linear-gradient(95deg,var(--mm-wash),#ffffffa8);border:1px solid transparent;overflow:hidden}
#memory .mm-particle[open]{border-color:#e2d7e0}
#memory .mm-particle summary{list-style:none;display:grid;grid-template-columns:30px minmax(0,1.15fr) 106px minmax(0,1fr) 13px;gap:11px;align-items:center;padding:9px 12px;min-height:61px;cursor:pointer}
#memory .mm-particle summary::-webkit-details-marker{display:none}
#memory .mm-number{width:28px;height:28px;display:grid;place-items:center;border-radius:50%;color:white;background:var(--mm-tone);font-size:13px;font-weight:700}
#memory .mm-cue{font-size:15px;line-height:1.45}
#memory .mm-particle-term{display:flex;align-items:center;justify-content:center;gap:9px;color:var(--mm-tone)}
#memory .mm-particle-term b{font-size:34px;line-height:1.2;font-family:'Yu Gothic','Noto Sans JP',sans-serif}
#memory .mm-particle-term small{font-weight:700;font-size:13px;min-width:22px}
#memory .mm-role{font-size:13px;font-weight:650;line-height:1.4}
#memory .mm-chevron{font-size:14px;color:#9e8c9b;transition:transform .15s}
#memory details[open]>summary>.mm-chevron{transform:rotate(180deg)}
#memory .mm-particle-body{padding:0 14px 13px 53px}
#memory .mm-particle-body>p{font-size:13px;line-height:1.7;color:#6a6476;margin:0 0 7px}
#memory .mm-example{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:9px 10px;background:#ffffffbc;border:1px solid #e8e7ee;border-radius:10px;min-width:0}
#memory .mm-example>div{min-width:0}
#memory .mm-jp{font-family:'Yu Gothic','Noto Sans JP',sans-serif;font-weight:700;font-size:19px;line-height:1.65;overflow-wrap:anywhere;color:#23446c}
#memory .mm-romaji{font-size:12px;font-weight:600;color:#486181;line-height:1.6;overflow-wrap:anywhere}
#memory .mm-meaning{font-size:12px;color:#6c7487;line-height:1.6}
#memory .mm-sound{flex:0 0 32px;min-width:32px;min-height:36px;padding:5px;border:1px solid #d7e3f2;background:#f3f8ff;border-radius:50%;display:grid;place-items:center;color:#315d94}
#memory .mm-sound svg{height:19px;width:19px}
#memory .mm-concept-grid,#memory .mm-flow-grid,#memory .mm-endings-grid,#memory .mm-comparison-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#memory .mm-concept-grid.mm-three{grid-template-columns:repeat(3,minmax(0,1fr))}
#memory .mm-concept{padding:16px;border-radius:15px;border:1px solid #eadfe6;background:linear-gradient(125deg,var(--mm-wash),#fffefb);min-width:0;position:relative;overflow:hidden}
#memory .mm-concept>.mm-art{height:auto;width:92px;float:right;margin:0 -2px 5px 4px}
#memory .mm-concept .mm-example{clear:both;margin-top:12px}
#memory .mm-term{font-size:29px;font-family:'Yu Gothic','Noto Sans JP',sans-serif;color:var(--mm-tone,#285a88);line-height:1.5;overflow-wrap:anywhere;margin:0 0 1px}
#memory .mm-term small{font-family:Inter,'Segoe UI',sans-serif;font-size:13px}
#memory .mm-concept-meaning{font-size:15px;font-weight:750;line-height:1.65;color:#344769;margin:6px 0}
#memory .mm-concept-hint{font-size:12px;line-height:1.7;color:#6d7081;margin:5px 0}
#memory .mm-concept-grid.mm-three .mm-concept>.mm-art{float:none;width:108px;margin:0 auto 9px}
#memory .mm-tense-tags{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin-bottom:7px;font-size:10px}
#memory .mm-tense-tags span,#memory .mm-kind{font-size:10px;color:#7b7383;line-height:1.5}
#memory .mm-tense-tags b{background:#ffffffb0;color:var(--mm-tone);border-radius:5px;padding:3px 6px}
#memory .mm-tense .mm-term{font-size:26px}
#memory .mm-stem-steps{display:flex;align-items:center;gap:9px;margin-top:14px;padding:12px;border:1px dashed #d4d9e7;border-radius:12px;background:#fff}
#memory .mm-stem-steps>div{flex:1;min-width:0;text-align:center}
#memory .mm-stem-steps b{display:block;font-size:20px;overflow-wrap:anywhere}
#memory .mm-stem-steps small,#memory .mm-stem-steps .mm-meaning{display:block;font-size:11px}
#memory .mm-step-arrow{font-size:22px;color:#b78fa0}
#memory .mm-gift-diagram{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;align-items:center;text-align:center;margin:15px 0}
#memory .mm-gift-diagram>div{display:grid;gap:5px}
#memory .mm-gift-diagram>div>b{font-size:24px;color:#3974c3}
#memory .mm-gift-diagram>div:last-child>b{color:#895cc3}
#memory .mm-gift-arrow{display:flex;flex-direction:column;align-items:center;font-size:42px;color:var(--mm-tone)}
#memory .mm-gift-arrow small{font-size:24px}
#memory .mm-formula{display:flex;flex-wrap:wrap;gap:5px;line-height:1.6;font-weight:700;padding:10px 0;border-top:1px solid #e7dfe6;font-size:15px}
#memory .mm-ink-blue{color:#3475c6}#memory .mm-ink-purple{color:#8554b3}#memory .mm-ink-pink{color:#d65383}#memory .mm-ink-green{color:#268066}#memory .mm-ink-orange{color:#ad712b}
#memory .mm-demonstrative-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#memory .mm-counter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#memory .mm-counter-values{display:grid;gap:6px;margin-top:10px}
#memory .mm-value{display:flex;align-items:center;justify-content:space-between;gap:6px;border:1px solid #e6e5ed;background:#fffefb;border-radius:9px;padding:8px 9px;min-width:0}
#memory .mm-value>div{min-width:0}
#memory .mm-value b{font-size:18px;color:#385c87}
#memory .mm-value .mm-romaji,#memory .mm-value .mm-meaning{display:block;font-size:11px}
#memory .mm-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
#memory .mm-week .mm-value{padding:8px 4px;flex-direction:column;text-align:center}
#memory .mm-week .mm-value b{font-size:16px}
#memory .mm-subtitle{font-size:15px;line-height:1.6;margin:13px 0 8px;color:#42608a}
#memory .mm-time-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#memory .mm-time-grid .mm-value{margin-bottom:6px}
#memory .mm-frequency{display:grid;gap:9px}
#memory .mm-frequency-row{display:grid;grid-template-columns:145px minmax(0,1fr) auto;gap:10px;align-items:center;border-radius:12px;background:var(--mm-wash);padding:12px}
#memory .mm-frequency-label b{font-size:21px;color:var(--mm-tone)}
#memory .mm-frequency-label small,#memory .mm-frequency-label .mm-meaning{display:block;font-size:11px}
#memory .mm-frequency-meter{height:10px;background:#ffffffba;border-radius:20px;overflow:hidden;border:1px solid #e2e6ed}
#memory .mm-frequency-meter>span{display:block;height:100%;background:var(--mm-tone);border-radius:20px}
#memory .mm-frequency-row>strong{font-size:14px;color:var(--mm-tone)}
#memory .mm-frequency-row .mm-example{grid-column:1/-1}
#memory .mm-caption{font-size:11px;color:#8b8492;margin:6px 0}
#memory .mm-comparison-grid{margin-top:12px}
#memory .mm-memo{border-radius:12px;background:linear-gradient(90deg,#fff1bd,#fff9e8);padding:12px 14px;line-height:1.7;font-size:14px;font-weight:700;color:#82612e;display:flex;gap:9px;align-items:center;margin:16px 0 9px}
#memory .mm-memo>span{font-size:24px;color:#d5a02a}
#memory .mm-note{background:#f1faf7;border:1px solid #dbeee5;border-radius:11px;padding:11px 13px;margin:0;line-height:1.8;font-size:12px;color:#5a7c73}
#memory .mm-actions{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}
#memory .mm-secondary,#memory .mm-pager button{min-height:37px;border:1px solid #d4deec;border-radius:9px;background:#fff;color:#3d628e;padding:8px 10px;font-size:12px;font-weight:650}
#memory .mm-secondary:hover{background:#f5f8ff}
#memory .mm-hide-meaning .mm-meaning{visibility:hidden}
#memory .mm-quiz{border:1px solid #e8d9c8;background:#fffaf0;border-radius:13px;padding:13px 15px;margin-top:15px}
#memory .mm-quiz-head{display:flex;align-items:center;justify-content:space-between;gap:9px}
#memory .mm-quiz-head h3{font-size:15px;margin:0;color:#88602c}
#memory .mm-quiz>p{font-size:13px;line-height:1.7;margin:9px 0}
#memory .mm-text-button{border:0;background:transparent;padding:4px;color:#755e85;font-size:12px;text-decoration:underline}
#memory .mm-quiz-options{display:flex;flex-wrap:wrap;gap:7px}
#memory .mm-quiz-options button{border:1px solid #ddcfbc;border-radius:9px;background:#fff;padding:8px 16px;min-height:39px;color:#604c6a;font-size:19px;font-weight:700}
#memory .mm-quiz-options .is-correct{border-color:#459b7e;background:#eaf7f0;color:#1b7959}
#memory .mm-quiz-options .is-wrong{border-color:#d87684;background:#fff0f2;color:#b3455b}
#memory .mm-quiz-result{font-size:12px!important;color:#6c756e;min-height:0}
#memory .mm-quiz-result:empty{display:none}
#memory .mm-lesson-links{border-top:1px solid #ece7e9;margin-top:15px;padding-top:10px;font-size:12px;color:#6f7e96}
#memory .mm-lesson-links summary{cursor:pointer;line-height:1.8;font-weight:650}
#memory .mm-lesson-links>div{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
#memory .mm-lesson-links button{border:1px solid #d9e4f2;border-radius:8px;background:#f7faff;color:#3d648f;padding:7px 10px;font-size:12px}
#memory .mm-lesson-links p{line-height:1.7}
#memory .mm-pager{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:12px;font-size:12px;color:#7c89a1}
#memory .mm-pager button:disabled{opacity:.4;cursor:default}
#memory .mm-empty{padding:25px;font-size:14px;line-height:1.8;color:#77839a}
#memory .mm-poster-dialog{width:min(1120px,96vw);max-width:96vw;max-height:94dvh;padding:0;border:1px solid #e2dce4;border-radius:15px;color:#2b466b;background:#fffcf9}
#memory .mm-poster-dialog::backdrop{background:#152a47b5;backdrop-filter:blur(3px)}
#memory .mm-poster-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid #eee2e8;flex-wrap:wrap}
#memory .mm-poster-bar h2{font-size:15px;margin:0;line-height:1.5}
#memory .mm-poster-controls{display:flex;align-items:center;gap:6px}
#memory .mm-poster-controls button{border:1px solid #d8deea;border-radius:7px;background:#fff;color:#435d86;padding:6px 10px;min-height:34px;font-size:13px}
#memory .mm-poster-controls button:disabled{opacity:.4}
#memory .mm-poster-controls span{font-size:12px;width:38px;text-align:center}
#memory .mm-poster-viewport{max-height:calc(90dvh - 130px);min-height:200px;overflow:auto;background:#ede9e4;overscroll-behavior:contain}
#memory .mm-poster-viewport img{display:block;width:100%;max-width:none;height:auto;margin:0 auto}
#memory .mm-poster-footer{display:flex;gap:10px;justify-content:space-between;align-items:center;padding:10px 12px;font-size:12px;color:#718095}
#memory .mm-poster-footer a{color:#315d96;white-space:nowrap}
@media(min-width:901px) and (max-width:1150px){
 #memory .mm-layout{grid-template-columns:245px minmax(0,1fr);gap:12px}
 #memory .mm-concept-grid.mm-three,#memory .mm-counter-grid,#memory .mm-demonstrative-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #memory .mm-week{grid-template-columns:repeat(4,minmax(0,1fr))}
 #memory .mm-particle summary{grid-template-columns:26px minmax(0,1.2fr) 87px minmax(0,1fr) 10px;gap:6px;padding:9px 8px}
 #memory .mm-cue{font-size:13px}#memory .mm-role{font-size:12px}
 #memory .mm-sheet-body{padding:15px}#memory .mm-flow-grid{grid-template-columns:1fr}
}
@media(max-width:900px){
 #memory .mm-layout{grid-template-columns:minmax(0,1fr);gap:12px}
 #memory .mm-directory{position:static;max-height:none;padding:10px 12px}
 #memory .mm-directory h2{display:none}
 #memory .mm-mobile-toggle{width:100%;border:0;background:transparent;display:flex;justify-content:space-between;align-items:center;min-height:34px;padding:2px;color:#36567f;font-weight:750;text-align:left}
 #memory .mm-mobile-toggle:after{content:'⌃';font-size:19px}
 #memory .mm-collapsed .mm-mobile-toggle:after{content:'⌄'}
 #memory .mm-collapsed .mm-directory-body{display:none}
 #memory .mm-directory-body{padding-top:8px}
 #memory .mm-topic-list{max-height:330px}
 #memory .mm-topic{min-height:47px}
}
@media(max-width:650px){
 #memory .mm-hero h1{font-size:24px}#memory .mm-hero p{font-size:12px}#memory .mm-hero .mm-art{width:64px}
#memory .mm-sheet-heading{padding:17px 87px 16px 16px;min-height:123px;text-align:left}
 #memory .mm-sheet-heading h2{font-size:23px}#memory .mm-sheet-heading p{font-size:12px}
 #memory .mm-sheet-heading>.mm-art{width:70px;right:8px;top:17px}
 #memory .mm-sheet-body{padding:13px}
 #memory .mm-particle summary{grid-template-columns:24px minmax(0,1fr) 77px 9px;gap:5px 8px;padding:9px 8px}
 #memory .mm-number{grid-row:1/3;width:24px;height:24px;font-size:11px}
 #memory .mm-cue{grid-column:2;grid-row:1;font-size:12px}
 #memory .mm-role{grid-column:2;grid-row:2;font-size:10px}
 #memory .mm-particle-term{grid-column:3;grid-row:1/3;gap:5px}
 #memory .mm-particle-term b{font-size:30px}#memory .mm-particle-term small{font-size:11px;min-width:17px}
 #memory .mm-chevron{grid-column:4;grid-row:1/3}
 #memory .mm-particle-body{padding:2px 9px 10px}#memory .mm-particle-body>p{font-size:12px}
 #memory .mm-concept-grid,#memory .mm-concept-grid.mm-three,#memory .mm-flow-grid,#memory .mm-endings-grid,#memory .mm-comparison-grid,#memory .mm-counter-grid{grid-template-columns:1fr}
 #memory .mm-concept-grid.mm-three .mm-concept>.mm-art{float:right;width:89px;margin:0 0 7px 4px}
 #memory .mm-demonstrative-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #memory .mm-demonstrative-grid .mm-concept{padding:12px 9px}#memory .mm-demonstrative-grid .mm-term{font-size:25px}#memory .mm-demonstrative-grid .mm-jp{font-size:17px}
 #memory .mm-term{font-size:27px}#memory .mm-jp{font-size:18px}
 #memory .mm-week{grid-template-columns:repeat(3,minmax(0,1fr))}
 #memory .mm-time-grid{gap:8px}
 #memory .mm-frequency-row{grid-template-columns:110px minmax(0,1fr) auto;gap:6px;padding:9px}
 #memory .mm-frequency-label b{font-size:18px}#memory .mm-frequency-row>strong{font-size:12px}
 #memory .mm-stem-steps{gap:5px;padding:10px 6px}#memory .mm-stem-steps b{font-size:17px}
 #memory .mm-stem-steps .mm-meaning{font-size:10px}
 #memory .mm-memo{font-size:12px;padding:10px;align-items:flex-start}#memory .mm-note{font-size:11px}
 #memory .mm-actions{display:grid;grid-template-columns:1fr}#memory .mm-actions button{width:100%}
 #memory .mm-quiz{padding:12px}#memory .mm-quiz-options button{font-size:18px;padding:7px 12px}
 #memory .mm-poster-footer{align-items:flex-start;flex-wrap:wrap}#memory .mm-poster-bar h2{max-width:100%}
}
@media(prefers-reduced-motion:reduce){#memory *{transition:none!important;scroll-behavior:auto!important}}
