/* Compact study layout. Only the Bài 15 grammar tab opts into these styles. */
#lessons.lesson15-compact .hero{padding:14px 18px;border-radius:17px;margin-bottom:10px;box-shadow:none}
#lessons.lesson15-compact .hero h1{font-size:24px;margin-bottom:4px}
#lessons.lesson15-compact .hero p{font-size:14px}
#lessons.lesson15-compact .lesson-tabs{margin:7px 0 10px}
#lessons.lesson15-compact .subtab{padding:7px 11px;font-size:14px}
#lessons.lesson15-compact .lesson-content-search{padding:9px 12px;min-height:40px;margin-bottom:5px}
#lessons.lesson15-compact .lesson-search-count{font-size:12px;margin-bottom:8px}
#lesson-grammar-grid.lesson15-study{display:block;max-width:1100px;margin:0 auto;color:#10234a;font-family:Inter,"Segoe UI",Arial,sans-serif}
.lesson15-study{--l15-navy:#10234a;--l15-muted:#5b6d8b;--l15-line:#d9e5f4}
.lesson15-study .l15-tone-slot1,.lesson15-study .l15-ink-slot1{--tone:#0755df;--wash:#e8f2ff;color:var(--tone)}
.lesson15-study .l15-tone-slot2,.lesson15-study .l15-ink-slot2{--tone:#7442bc;--wash:#f1eafd;color:var(--tone)}
.lesson15-study .l15-tone-slot3,.lesson15-study .l15-ink-slot3{--tone:#a45b08;--wash:#fff2dc;color:var(--tone)}
.lesson15-study .l15-tone-particle,.lesson15-study .l15-ink-particle{--tone:#d52343;--wash:#ffe9ed;color:var(--tone)}
.lesson15-study .l15-tone-fixed,.lesson15-study .l15-ink-fixed{--tone:#076b43;--wash:#e7f7ed;color:var(--tone)}
.lesson15-study .l15-tone-neutral,.lesson15-study .l15-ink-neutral{--tone:#10234a;--wash:#f0f4fa;color:var(--tone)}
.lesson15-study button{cursor:pointer;touch-action:manipulation}
.lesson15-study button:focus-visible,.lesson15-study summary:focus-visible{outline:3px solid #3379e9;outline-offset:3px}
.lesson15-study .l15-pattern-nav{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 10px}
.lesson15-study .l15-pattern-nav button{border:1px solid #d9e3f0;background:#fff;color:#516381;padding:7px 12px;border-radius:9px;font-size:13px;font-weight:700;display:flex;align-items:center;gap:7px;min-height:35px}
.lesson15-study .l15-pattern-nav button span{font-size:11px;opacity:.7}
.lesson15-study .l15-pattern-nav .is-active{border-color:#173e7f;background:#173e7f;color:white}
.lesson15-study .l15-study-card{padding:16px 18px;background:#fff;border-radius:17px;border:1px solid #e2e8f1;box-shadow:0 5px 22px #1d35500a;overflow:hidden}
.lesson15-study .l15-card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:10px;margin-bottom:11px;border-bottom:2px solid #abe6d6}
.lesson15-study .l15-card-header h2{font-size:23px;line-height:1.3;letter-spacing:-.02em;font-weight:750;margin:0;color:#10234a}
.lesson15-study .l15-progress{color:#70819b;font-size:12px;white-space:nowrap}
.lesson15-study .l15-section-title{display:flex;align-items:center;gap:7px;color:#17335e;font-size:16px;font-weight:750;line-height:1.4;margin:0 0 9px}
.lesson15-study .l15-section-title>span{background:#d5f3e9;width:23px;height:23px;border-radius:50%;display:grid;place-items:center;flex:0 0 23px;font-size:15px;color:#085b45}
.lesson15-study .l15-structure{margin-bottom:13px;padding-bottom:10px;border-bottom:1px solid #e7edf4}
.lesson15-study .l15-formula{display:grid;gap:7px;align-items:start;margin:0 auto 6px}
.lesson15-study .l15-formula-simple{grid-template-columns:1fr .5fr 1.7fr;max-width:620px}
.lesson15-study .l15-formula-long{grid-template-columns:1fr .5fr 1fr .8fr 1fr .5fr 1.65fr;gap:6px}
.lesson15-study .l15-formula-past{grid-template-columns:.7fr 1.2fr .25fr .7fr 1.9fr;max-width:760px}
.lesson15-study .l15-formula-cell{text-align:center;min-width:0}
.lesson15-study .l15-formula-token{border-radius:8px;background:var(--wash);color:var(--tone);padding:4px 6px;font-family:"Yu Gothic","Noto Sans JP",sans-serif;font-size:29px;font-weight:750;line-height:1.4;white-space:nowrap;min-height:45px;display:flex;justify-content:center;align-items:center}
.lesson15-study .l15-formula-cell strong{display:inline-block;margin-top:3px;color:var(--tone);font-size:12px;font-weight:700;line-height:1.4}
.lesson15-study .l15-formula-cell small{display:block;color:var(--l15-muted);font-size:11px;line-height:1.4;margin-top:1px}
.lesson15-study .l15-formula-long .l15-formula-token{font-size:24px;min-height:42px;padding:4px 3px}
.lesson15-study [data-l15-card="receive"] .l15-formula-cell:nth-child(4) .l15-formula-token{font-size:20px;white-space:normal;word-break:keep-all;display:block;align-content:center}
.lesson15-study .l15-formula-past .l15-formula-token{font-size:25px}
.lesson15-study .l15-formula-reading{font-weight:650;font-size:14px;text-align:center;line-height:1.5;color:#24446f;margin-top:4px}
.lesson15-study .l15-slot-hint{font-size:12px;line-height:1.5;color:var(--l15-muted);text-align:center;margin:3px 0 0}
.lesson15-study .l15-study-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;margin-bottom:12px;align-items:start}
.lesson15-study .l15-substitution,.lesson15-study .l15-qa{min-width:0}
.lesson15-study .l15-qa{border-left:1px solid #e7edf4;padding-left:18px}
.lesson15-study .l15-example{margin:0 0 9px;padding:9px;background:#f8fbff;border-radius:10px}
.lesson15-study .l15-example-line{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:4px}
.lesson15-study .l15-example-parts{display:flex;align-items:center;flex-wrap:wrap;gap:3px;min-width:0;line-height:1.5}
.lesson15-study .l15-example-token{color:var(--tone);background:var(--wash);font-family:"Yu Gothic","Noto Sans JP",sans-serif;font-size:23px;font-weight:750;border-radius:6px;padding:2px 5px;overflow-wrap:anywhere}
.lesson15-study .l15-study-card:not([data-l15-card="want"]) .l15-example-token{font-size:21px}
.lesson15-study .l15-reading{color:#24446f;font-weight:600;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.lesson15-study .l15-meaning{color:#536482;font-size:14px;line-height:1.5;margin-top:1px}
.lesson15-study .l15-audio{border:0;background:transparent;color:#164483;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:2px;flex:0 0 40px;min-height:44px;font-size:10px}
.lesson15-study .l15-audio svg{border:1px solid #d3e1f2;background:#f1f7ff;border-radius:50%;padding:6px;width:30px;height:30px}
.lesson15-study .l15-audio:hover svg{background:#e5efff;border-color:#91b8f2}
.lesson15-study .l15-word-groups{display:grid;gap:8px;margin:0}
.lesson15-study .l15-multi-groups{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.lesson15-study .l15-multi-groups .l15-word-option{flex-basis:80px}
.lesson15-study .l15-word-group{border:0;padding:0;margin:0;min-width:0}
.lesson15-study .l15-word-group legend{font-size:12px;margin-bottom:4px;color:#415774;font-weight:650;padding:0}
.lesson15-study .l15-word-options{display:flex;flex-wrap:wrap;gap:5px}
.lesson15-study .l15-word-option{flex:1 1 90px;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border:1px solid #d6e2f1;background:#fff;color:var(--l15-navy);border-radius:8px;padding:5px 6px;min-height:47px}
.lesson15-study .l15-word-option strong{font-family:"Yu Gothic","Noto Sans JP",sans-serif;font-size:18px;line-height:1.4;font-weight:700}
.lesson15-study .l15-word-option span{font-size:12px;line-height:1.4;color:#596e92;overflow-wrap:anywhere;text-align:center}
.lesson15-study .l15-word-option.is-selected{background:var(--wash);border:1px solid var(--tone);box-shadow:0 0 0 1px var(--tone)}
.lesson15-study .l15-word-option.is-selected strong{color:var(--tone)}
.lesson15-study .l15-dialogue-line{display:grid;grid-template-columns:34px minmax(0,1fr) 36px;gap:5px;align-items:start;margin:0 0 8px}
.lesson15-study .l15-dialogue-line:last-child{margin-bottom:0}
.lesson15-study .l15-dialogue-label{font-size:11px;font-weight:750;padding:4px 3px;text-align:center;border-radius:6px;margin-top:6px}
.lesson15-study .l15-question-label{background:#eaf3ff;color:#0755df}
.lesson15-study .l15-answer-label{background:#ffecef;color:#cc2340}
.lesson15-study .l15-dialogue-copy{background:#f6f9fd;border-radius:8px;padding:7px 9px;min-width:0}
.lesson15-study .l15-jp{font-family:"Yu Gothic","Noto Sans JP",sans-serif;font-weight:700;font-size:21px;line-height:1.5;overflow-wrap:anywhere}
.lesson15-study .l15-jp>span{display:inline-block}
.lesson15-study .l15-dialogue-line>.l15-audio{margin-top:4px}
.lesson15-study .l15-reference-sections{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.lesson15-study .l15-details{border:1px solid #dae5f2;border-radius:8px;background:#fff;overflow:hidden;min-width:0}
.lesson15-study .l15-details[open]{grid-column:1/-1}
.lesson15-study .l15-details summary{cursor:pointer;list-style:none;display:flex;gap:5px;align-items:center;padding:7px 9px;line-height:1.5;font-weight:650;font-size:12px;min-height:35px}
.lesson15-study .l15-details summary::-webkit-details-marker{display:none}
.lesson15-study .l15-details summary:after{content:'⌄';color:#7085aa;font-size:17px;margin-left:auto;line-height:1;transition:transform .15s}
.lesson15-study .l15-details[open] summary:after{transform:rotate(180deg)}
.lesson15-study .l15-details summary>span:not(.l15-note-icon){font-size:11px;font-weight:500;color:var(--l15-muted);white-space:nowrap}
.lesson15-study .l15-details-body{padding:0 10px 10px}
.lesson15-study .l15-notes{background:#f5f8fc}
.lesson15-study .l15-note-icon{font-size:17px;color:#31527f}
.lesson15-study .l15-note-copy{font-size:14px;color:#4c5e7a;line-height:1.8}
.lesson15-study .l15-source-pair+.l15-source-pair{border-top:1px solid #e3eaf3;padding-top:8px;margin-top:8px}
.lesson15-study .l15-source-example{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 0;border-bottom:1px dashed #dde6f1}
.lesson15-study .l15-source-example:last-child{border-bottom:0}
.lesson15-study .l15-source-example>div{min-width:0}
.lesson15-study .l15-card-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:7px;margin-top:10px}
.lesson15-study .l15-card-actions button{display:flex;justify-content:center;align-items:center;gap:7px;font-weight:650;line-height:1.4;min-height:37px;padding:7px 12px;border-radius:8px;font-size:13px}
.lesson15-study .l15-card-actions svg{height:18px;width:18px;flex:0 0 18px}
.lesson15-study .l15-hide-button{border:1px solid #bccce2;color:#24446f;background:#fff}
.lesson15-study .l15-practice-button{border:1px solid #173e7f;color:#fff;background:#173e7f}
.lesson15-study .l15-hide-meaning .l15-meaning{visibility:hidden}
.lesson15-study .l15-practice-status{font-size:12px;line-height:1.5;color:var(--l15-muted);margin:7px 0 0}
.lesson15-study .l15-practice-status:empty{display:none}
@media(max-width:1199px) and (min-width:901px){
 .lesson15-study .l15-study-columns{gap:12px}.lesson15-study .l15-qa{padding-left:12px}
 .lesson15-study .l15-formula-long .l15-formula-token{font-size:21px}
 .lesson15-study .l15-formula-cell strong{font-size:11px}
 .lesson15-study .l15-reference-sections{grid-template-columns:1fr}
}
@media(max-width:700px){
 #lessons.lesson15-compact .hero h1{font-size:21px}
 .lesson15-study .l15-study-card{padding:13px;border-radius:13px}
 .lesson15-study .l15-card-header h2{font-size:20px}
 .lesson15-study .l15-card-header{padding-bottom:8px;margin-bottom:10px}
 .lesson15-study .l15-study-columns{grid-template-columns:1fr;gap:13px}
 .lesson15-study .l15-qa{padding:12px 0 0;border-left:0;border-top:1px solid #e7edf4}
 .lesson15-study .l15-formula-simple{grid-template-columns:.9fr .45fr 1.65fr;gap:5px}
 .lesson15-study .l15-formula-token{font-size:25px;padding:4px;min-height:42px}
 .lesson15-study .l15-formula-long{grid-template-columns:1fr .55fr 1fr .85fr;gap:7px 5px}
 .lesson15-study .l15-formula-long .l15-formula-cell:last-child{grid-column:3/5}
 .lesson15-study .l15-formula-long .l15-formula-token{font-size:23px}
 .lesson15-study .l15-formula-past{grid-template-columns:.65fr 2fr}
 .lesson15-study .l15-formula-past .l15-formula-cell:nth-child(3){display:none}
 .lesson15-study .l15-formula-past .l15-formula-token{font-size:23px}
 .lesson15-study .l15-formula-reading{font-size:13px}
 .lesson15-study .l15-slot-hint{font-size:12px}
 .lesson15-study .l15-example-token{font-size:21px}
 .lesson15-study .l15-word-option{flex-basis:85px;min-height:48px}
 .lesson15-study .l15-multi-groups{grid-template-columns:1fr}
 .lesson15-study .l15-study-card:not([data-l15-card="want"]) .l15-word-option{flex-basis:110px}
 .lesson15-study .l15-word-option strong{font-size:18px}
 .lesson15-study .l15-reference-sections{grid-template-columns:1fr}
 .lesson15-study .l15-details summary{font-size:13px;min-height:39px}
 .lesson15-study .l15-pattern-nav{gap:5px}
 .lesson15-study .l15-pattern-nav button{flex:1 1 110px;padding:8px;min-height:40px;font-size:12px;justify-content:center}
 .lesson15-study .l15-card-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 .lesson15-study .l15-card-actions button{min-height:42px;padding:7px;font-size:12px;gap:5px}
}
@media(prefers-reduced-motion:reduce){.lesson15-study *{transition:none!important;scroll-behavior:auto!important}}
