/* V5 shared layout. Keep lesson data, article colours and original behaviour. */
html[data-ai-book="a1-1"]{--m5-book:#9f2941;--m5-book-soft:#f8ecf0}
html[data-ai-book="a1-2"]{--m5-book:#557819;--m5-book-soft:#eef3e1}
html[data-ai-book="a2-1"]{--m5-book:#a62e42;--m5-book-soft:#faedf0}
html[data-ai-book="a2-2"]{--m5-book:#176a9c;--m5-book-soft:#e9f3f9}
html[data-ai-book="b1-1"]{--m5-book:#a95b0c;--m5-book-soft:#fff2df}
html[data-ai-book="b1-2"]{--m5-book:#217c71;--m5-book-soft:#e7f4f1}
html[data-theme=dark][data-ai-book="a1-1"],html[data-theme=dark][data-ai-book="a2-1"]{--m5-book:#ffadc0}
html[data-theme=dark][data-ai-book="a1-2"]{--m5-book:#c0df86}
html[data-theme=dark][data-ai-book="a2-2"]{--m5-book:#98d5fa}
html[data-theme=dark][data-ai-book="b1-1"]{--m5-book:#ffc080}
html[data-theme=dark][data-ai-book="b1-2"]{--m5-book:#91ded1}
html[data-theme=dark][data-ai-book]{--m5-book-soft:var(--theme-subtle,#272c34)}
body.mr-study{--mr-accent:var(--m5-book);--mr-accent-soft:var(--m5-book-soft);line-height:1.7}
body.mr-study #menschen-workspace .mw-inner{max-width:1200px}
body.mr-study #menschen-workspace .mw-top{padding-block:8px 6px}
body.mr-study #menschen-workspace .mw-sub{min-height:40px;gap:1px}
body.mr-study #menschen-workspace .mw-groups button{font-weight:650}
body.mr-study :is(main,.main,.a11-main,.b11-main){min-width:0;box-sizing:border-box}
/* The three existing picture dictionaries share one compact visual grammar. */
html body.mr-study :is(#bilder.m-bild-grid,#bilder.grid,#b12Main .b12-bild-cards){display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;direction:ltr;text-align:left;align-items:stretch;min-width:0}
html body.mr-study :is(#bilder .m-bild-card,#bilder .picture-card,#b12Main .b12-bild-card){display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;min-width:0!important;min-height:0!important;height:auto!important;padding:10px 12px 11px!important;gap:3px!important;border:1px solid var(--mr-border)!important;border-radius:8px!important;background:var(--mr-surface)!important;color:var(--mr-ink)!important;box-shadow:none!important;direction:ltr;text-align:left}
html body.mr-study :is(#bilder .m-bild-image,#bilder .a11-bild-crop,#bilder .b11-bild-crop,#b12Main .b12-bild-card>img){height:114px!important;max-height:114px!important;width:100%!important;max-width:100%!important;object-fit:contain!important;display:block!important;margin:0 0 6px!important;background:transparent!important;border:0!important;border-radius:3px!important;overflow:hidden!important}
html body.mr-study .m5-picture-card .m5-missing-visual{display:none!important}
html body.mr-study .m5-media-note{display:flex;align-items:center;justify-content:center;min-height:66px;padding:8px;text-align:center;font-size:11px;color:var(--mr-muted);background:var(--mr-bg);border:1px dashed var(--mr-border);border-radius:5px;margin-bottom:5px;line-height:1.6;font-weight:400}
html body.mr-study .m5-word-line{display:grid!important;grid-template-columns:34px minmax(0,1fr);align-items:start;gap:4px;min-width:0;direction:ltr;text-align:left}
html body.mr-study .m5-word-line h3{margin:4px 0 2px!important;padding:0!important;font:650 16px/1.5 var(--mr-latin)!important;color:var(--mr-ink);width:auto!important;text-align:left!important;overflow-wrap:anywhere}
html body.mr-study .m5-word-audio{width:34px!important;min-width:34px!important;max-width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;margin:0!important;border:0!important;background:transparent!important;color:var(--m5-book)!important;font-size:0!important;box-shadow:none!important;display:inline-grid!important;place-items:center!important;cursor:pointer}
html body.mr-study .m5-word-audio::before{content:"";width:19px;height:19px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4zM15 9a4 4 0 0 1 0 6M18 5.5a9 9 0 0 1 0 13'/%3E%3C/svg%3E") center/contain no-repeat}
html body.mr-study .m5-word-audio:hover{background:var(--m5-book-soft)!important;border-radius:5px!important}
html body.mr-study .m5-word-audio:is([aria-pressed=true],.reading-playing28)::before{mask:none;width:11px;height:11px;border-radius:2px}
html body.mr-study .m5-picture-card :is(.fa,.m-bild-fa){font:500 14px/1.8 var(--mr-font)!important;color:var(--mr-ink)!important;text-align:right!important;direction:rtl!important;min-height:0!important;margin:0!important;padding:0!important;background:none!important;border:0!important}
html body.mr-study .m5-picture-card :is(.en,.m-bild-en,[lang=en]){font:400 13px/1.45 var(--mr-latin)!important;color:var(--mr-muted)!important;min-height:0!important;margin:0!important;text-align:left!important;overflow-wrap:anywhere}
html body.mr-study .m5-picture-card .b12-bild-card-body{gap:3px!important;flex:1}
html body.mr-study .m5-picture-card .b12-bild-actions{margin-top:6px!important;display:flex!important;flex-wrap:wrap;gap:4px!important}
html body.mr-study .m5-picture-card .b12-bild-actions:empty{display:none!important}
html body.mr-study .m5-picture-card .b12-bild-actions button{font-size:11px!important;min-height:32px!important;padding:4px 8px!important}
html body.mr-study .m5-picture-card .b12-draft-note{font-size:10px!important;color:var(--mr-muted)!important}
html body.mr-study .m5-picture-card .bild-icon{font-size:34px!important;min-height:54px!important;height:auto!important;margin:0!important;align-self:center}
/* Reduce visual nesting without changing learning cues. */
html body.mr-study :is(.reading-segment26,.grammar-example26){border-radius:5px!important;margin-block:7px!important;padding:8px 10px!important;box-shadow:none!important;min-width:0!important}
html body.mr-study :is(.reading-german26,.example-de26){line-height:1.65!important;overflow-wrap:anywhere}
html body.mr-study :is(.reading-translation26,.example-fa26){line-height:1.8!important;font-weight:500!important;padding-block:4px!important;overflow-wrap:anywhere}
html body.mr-study :is(.mw-ai-inline){padding:5px 9px!important;margin:5px 0 9px!important;border-radius:5px!important;background:transparent!important}
html body.mr-study :is(.mw-ai-action){min-height:34px!important}
html body.mr-study :is(.top,.mw-top,.mw-sub){box-sizing:border-box;max-width:100%}
@media(max-width:1000px){html body.mr-study :is(#bilder.m-bild-grid,#bilder.grid,#b12Main .b12-bild-cards){grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:9px!important}}
@media(max-width:700px){html body.mr-study :is(#bilder.m-bild-grid,#bilder.grid,#b12Main .b12-bild-cards){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}html body.mr-study :is(#bilder .m-bild-card,#bilder .picture-card,#b12Main .b12-bild-card){padding:8px!important}html body.mr-study :is(#bilder .m-bild-image,#bilder .a11-bild-crop,#bilder .b11-bild-crop,#b12Main .b12-bild-card>img){height:96px!important;max-height:96px!important}html body.mr-study .m5-word-line{grid-template-columns:30px minmax(0,1fr);gap:2px}html body.mr-study .m5-word-line h3{font-size:14px!important}html body.mr-study .m5-word-audio{min-width:30px!important;width:30px!important;max-width:30px!important}html body.mr-study .m5-picture-card :is(.fa,.m-bild-fa){font-size:13px!important}html body.mr-study .m5-picture-card :is(.en,.m-bild-en,[lang=en]){font-size:12px!important}html body.mr-study .top{flex-wrap:wrap;gap:6px!important}html body.mr-study .top .lesson-label{min-width:0;max-width:100%}html body.mr-study .top .lesson-label select{max-width:100%!important;min-width:0!important}html body.mr-study :is(.reading-segment26,.grammar-example26){padding:6px!important}}
@media(max-width:340px){html body.mr-study :is(#bilder.m-bild-grid,#bilder.grid,#b12Main .b12-bild-cards){grid-template-columns:1fr!important}}
/* Final visual regression corrections (specificity intentionally exceeds legacy rules). */
html body.mr-study :is(#bilder .m-bild-card,#bilder .picture-card,#b12Main .b12-bild-card)>.m5-missing-visual{display:none!important;height:0!important;min-height:0!important;max-height:0!important;margin:0!important;padding:0!important}
html body.mr-study #menschen-workspace .mw-groups button:not([aria-current=true]),html body.mr-study #menschen-workspace .mw-sub button:not([aria-current=true]){background:transparent!important;border-color:transparent!important;box-shadow:none!important}
html body.mr-study #menschen-workspace .mw-sub button[aria-current=true]{background:transparent!important;border-top-color:transparent!important;border-left-color:transparent!important;border-right-color:transparent!important}
html body.mr-study .top{height:auto!important;min-height:0!important;padding:8px 16px!important}
html body.mr-study .book-access-bar[data-notice=promotion]{max-width:1200px;margin:12px auto 0!important;padding:9px 13px!important;min-height:0!important;gap:8px!important;border-color:var(--mr-border)!important;background:var(--mr-surface)!important;color:var(--mr-ink)!important}
html body.mr-study .book-access-bar[data-notice=promotion] .book-access-badge{font-size:10px!important;padding:1px 6px!important}
html body.mr-study .book-access-bar[data-notice=promotion] p{font-size:12px!important;margin:2px 0!important;line-height:1.7!important}
html body.mr-study .book-access-bar[data-notice=promotion] small{font-size:11px!important;line-height:1.7!important;color:var(--mr-muted)!important}
html body.mr-study .book-access-bar[data-notice=promotion] .book-access-bar-actions{gap:5px!important}
html body.mr-study .book-access-bar[data-notice=promotion] .book-access-primary{min-height:34px!important;padding:6px 10px!important;font-size:12px!important;background:var(--m5-book-soft)!important;border:1px solid var(--m5-book)!important;color:var(--m5-book)!important}
html body.mr-study .book-access-bar[data-notice=promotion] .book-notice-close{background:transparent!important;min-height:34px!important;min-width:30px!important;flex:0 0 auto!important;padding:2px 8px!important}
@media(max-width:1230px){html body.mr-study .book-access-bar[data-notice=promotion]{margin-inline:12px!important}}
@media(max-width:700px){
 html body.mr-study .top{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-start!important;gap:5px!important;padding:8px 10px!important;position:relative!important}
 html body.mr-study .top h1{font-size:15px!important;flex:1 1 100%;margin:0!important;line-height:1.5!important}
 html body.mr-study .top .lesson-label{flex:1 1 100%;display:flex!important;direction:ltr!important;gap:6px!important;min-width:0!important;max-width:100%!important;margin:0!important}
 html body.mr-study .top .lesson-label select{flex:1;min-width:0!important;width:auto!important;max-width:100%!important}
 html body.mr-study .top :is(button,select,.library-back,.book-return,.top-settings>summary){min-height:34px!important;font-size:11px!important;padding:5px 8px!important;line-height:1.5!important}
 html body.mr-study .top #themeModeButton{margin-inline-start:auto!important;max-width:100px!important}
 html body.mr-study .book-access-bar[data-notice=promotion]{margin:7px 10px 0!important;padding:8px 10px!important;gap:6px!important}
 html body.mr-study .book-access-bar[data-notice=promotion] .book-access-bar-actions{width:auto!important;flex:1 1 auto!important;justify-content:flex-start!important}
 html body.mr-study .book-access-bar[data-notice=promotion] .book-access-bar-actions>.book-access-primary{flex:0 1 auto!important;min-height:32px!important}
 html body.mr-study .book-access-bar[data-notice=promotion] .book-access-bar-actions>.book-notice-close{margin-inline-start:auto!important}
 html body.mr-study .m5-media-note{min-height:52px;padding:5px;font-size:10px}
}
