/* Distinct compositions for the three revised layouts. Layout 1 has no matching rules.
   Grid areas change presentation of the original sections, not records or form ownership. */

/* Dashboard columns flow independently. Fixed cross-column row spans created empty tracks. */
@media(min-width:1101px){
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body:not(.layout-edit-mode) #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order){display:grid!important;align-items:start;gap:.8rem!important;grid-template-columns:minmax(0,1fr) 18rem!important;grid-template-areas:"welcome welcome" "attention attention" "numbers numbers" "main aside"}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body:not(.layout-edit-mode) #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-header{grid-area:welcome!important;order:0!important}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body:not(.layout-edit-mode) #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.role-summary{grid-area:attention!important;order:0!important;margin:0}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body:not(.layout-edit-mode) #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-stats{grid-area:numbers!important;order:0!important;margin:0;height:auto;align-self:start;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:.7rem}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body:not(.layout-edit-mode) #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-main{display:grid!important;grid-area:main!important;grid-template-columns:1fr!important;gap:.8rem;min-width:0;align-content:start}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body:not(.layout-edit-mode) #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-aside{display:grid!important;grid-area:aside!important;grid-template-columns:1fr!important;gap:.8rem;min-width:0;align-content:start}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body:not(.layout-edit-mode) #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>:is(.staff-dashboard-main,.staff-dashboard-aside)>*{grid-area:auto!important;grid-column:auto!important;min-width:0}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .role-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-tournaments-panel{border:0;background:transparent;box-shadow:none;padding:0 0 0 1rem}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-tournaments-panel .staff-event-list{border-left:2px solid var(--club-border);padding-left:1rem;margin-left:-1rem;gap:.7rem}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-tournaments-panel .staff-event-card{position:relative;grid-template-columns:minmax(0,1fr) 11rem!important;padding:.85rem;border-left-width:1px;background:var(--surface,#fff)}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-tournaments-panel .staff-event-card::before{content:"";position:absolute;left:-1.45rem;top:1.3rem;width:.65rem;height:.65rem;border:2px solid var(--club-control-border);border-radius:50%;background:var(--surface,#fff)}
 html[data-app-layout="focus"] body:not(.layout-edit-mode) #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-tournaments-panel .staff-event-list{grid-template-columns:1fr!important}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-event-card{grid-template-columns:minmax(0,1fr) 11rem!important;gap:.8rem}
}

/* Members: large two-column cards, horizontal rows, small profile modules. */
@media(min-width:761px){
 html[data-app-layout="compact"] #app-screen #view-members[data-lv-page] .grid:has(>.member-card){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:1.2rem!important}
 html[data-app-layout="compact"] #view-members[data-lv-page] .member-card{padding:1.4rem!important}
 html[data-app-layout="compact"] #view-members[data-lv-page] .member-card-avatar{width:4rem;height:4rem;flex-basis:4rem;border-radius:1rem}
 html[data-app-layout="compact"] #view-members[data-lv-page] .member-card-identity h3{font-size:1.1rem}
 html[data-app-layout="cards"] #app-screen #view-members[data-lv-page] .grid:has(>.member-card){grid-template-columns:1fr!important}
 html[data-app-layout="focus"] #view-members[data-lv-page] .member-card{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:.7rem}
 html[data-app-layout="focus"] #view-members[data-lv-page] .member-card-top{display:contents!important}
 html[data-app-layout="focus"] #view-members[data-lv-page] .member-card-avatar{grid-column:1;grid-row:1;width:3rem;height:3rem;flex-basis:3rem}
 html[data-app-layout="focus"] #view-members[data-lv-page] .member-card-points{grid-column:2;grid-row:1}
 html[data-app-layout="focus"] #view-members[data-lv-page] :is(.member-card-identity,.member-card-info,.member-card-diary){grid-column:1/-1;min-width:0}
}

/* Attendance: card roster / single rows with trainer rail / portrait tiles. */
@media(min-width:1001px){
 html[data-app-layout="compact"] #view-attendance[data-lv-page] .attendance-member-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 html[data-app-layout="cards"] #view-attendance[data-lv-page]{display:grid;grid-template-columns:minmax(0,1fr) 18rem;gap:1rem;align-items:start}
 html[data-app-layout="cards"] #view-attendance[data-lv-page]>.page-hero,html[data-app-layout="cards"] #view-attendance[data-lv-page]>.attendance-date-panel{grid-column:1/-1}
 html[data-app-layout="cards"] #view-attendance[data-lv-page]>.attendance-availability-panel{grid-column:2;grid-row:3/6;position:sticky;top:1rem;margin:0}
 html[data-app-layout="cards"] #view-attendance[data-lv-page] .availability-summary-list{grid-template-columns:1fr}
 html[data-app-layout="cards"] #view-attendance[data-lv-page]>.attendance-roster-controls{grid-column:1;margin:0}
 html[data-app-layout="cards"] #view-attendance[data-lv-page]>.attendance-member-grid{grid-column:1;grid-template-columns:1fr!important;gap:.35rem}
 html[data-app-layout="cards"] #view-attendance[data-lv-page] .attendance-row--simple{border-radius:.6rem;padding:.7rem 1rem;min-height:4.5rem}
 html[data-app-layout="cards"] #view-attendance[data-lv-page]>.attendance-save-dock{grid-column:1/-1}
 html[data-app-layout="focus"] #view-attendance[data-lv-page] .attendance-member-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
html[data-app-layout="focus"] #view-attendance[data-lv-page] .attendance-row--simple{display:flex!important;flex-direction:column;align-items:center;text-align:center;padding:1.3rem;min-height:10rem;position:relative;gap:.7rem}
html[data-app-layout="focus"] #view-attendance[data-lv-page] .attendance-row--simple>.avatar{width:3.6rem;height:3.6rem;flex-basis:3.6rem}
html[data-app-layout="focus"] #view-attendance[data-lv-page] .attendance-mark{position:absolute;right:.65rem;top:.65rem}

/* Training: seven-day planner / vertical agenda / modular week and templates. */
@media(min-width:761px){
 html[data-app-layout="compact"] #view-training[data-lv-page] .training-week-board{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:.6rem}
 html[data-app-layout="compact"] #view-training[data-lv-page] .training-week-day{min-height:10rem;padding:.7rem}
 html[data-app-layout="cards"] #view-training[data-lv-page] .training-week-board{display:grid!important;grid-template-columns:1fr!important;gap:.5rem}
 html[data-app-layout="cards"] #view-training[data-lv-page] .training-week-day{display:grid;grid-template-columns:11rem minmax(0,1fr);align-items:start;min-height:5rem;padding:1rem;border-top-width:1px;border-left:3px solid var(--club-control-border)}
 html[data-app-layout="cards"] #view-training[data-lv-page] .training-week-units{margin-top:0}
 html[data-app-layout="focus"] #view-training[data-lv-page] .training-week-board{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:1rem}
 html[data-app-layout="focus"] #view-training[data-lv-page] .training-week-day{min-height:10rem;padding:1.1rem;border-radius:1.1rem}
}

/* Diary: horizontal member selector / left navigation with journal / modular personal dashboard. */
@media(min-width:1001px){
 html[data-app-layout="compact"] #view-training_diary[data-lv-page] .td-layout{grid-template-columns:1fr!important}
 html[data-app-layout="compact"] #view-training_diary[data-lv-page] .td-sidebar{position:static;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
 html[data-app-layout="compact"] #view-training_diary[data-lv-page] .td-week-layout{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr)!important}
 html[data-app-layout="cards"] #view-training_diary[data-lv-page] .td-layout{grid-template-columns:14rem minmax(0,1fr)!important}
 html[data-app-layout="cards"] #view-training_diary[data-lv-page] .td-sidebar{position:sticky;top:1rem;grid-template-columns:1fr}
 html[data-app-layout="cards"] #view-training_diary[data-lv-page] .td-week-layout{grid-template-columns:1fr!important}
 html[data-app-layout="focus"] #view-training_diary[data-lv-page] .td-layout{grid-template-columns:1fr!important}
 html[data-app-layout="focus"] #view-training_diary[data-lv-page] .td-sidebar{position:static;grid-template-columns:repeat(3,minmax(0,1fr))}
 html[data-app-layout="focus"] #view-training_diary[data-lv-page] .td-journal{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.1rem;align-items:start}
 html[data-app-layout="focus"] #view-training_diary[data-lv-page] .td-journal>.td-content-head{grid-column:1/-1}
 html[data-app-layout="focus"] #view-training_diary[data-lv-page] .td-week-layout{grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* Calendar agenda: standard vertical program / timeline / cards by day.
   Month and Program remain explicit user choices, with no automatic filter changes. */
html[data-app-layout="cards"] #view-calendar[data-lv-page] .calendar-agenda-view{padding-left:1.5rem;border-left:2px solid var(--club-border);margin-left:.7rem}
html[data-app-layout="cards"] #view-calendar[data-lv-page] .calendar-program-day-head{position:relative;background:transparent;border:0;border-radius:0;padding-left:0}
html[data-app-layout="cards"] #view-calendar[data-lv-page] .calendar-program-day-head::before{content:"";position:absolute;left:-1.95rem;top:1rem;width:.7rem;height:.7rem;border:2px solid var(--club-control-border);border-radius:50%;background:var(--surface,#fff)}
@media(min-width:1001px){
 html[data-app-layout="focus"] #view-calendar[data-lv-page] .calendar-agenda-view{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem 1.2rem;align-items:start}
 html[data-app-layout="focus"] #view-calendar[data-lv-page] .calendar-program-stats{grid-column:1/-1}
 html[data-app-layout="focus"] #view-calendar[data-lv-page] .calendar-agenda-list{border:1px solid var(--club-border);border-radius:1rem;padding:1rem}
 html[data-app-layout="focus"] #view-calendar[data-lv-page] .calendar-program-day-head{grid-column:1/-1}
}

/* Product lists, communication, tournaments and events also change their working composition. */
@media(min-width:1001px){
 html[data-app-layout="compact"] #view-tournaments[data-lv-page] .grid:has(>.tournament-card){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html[data-app-layout="cards"] #view-tournaments[data-lv-page]{display:grid;grid-template-columns:minmax(0,1fr) 19rem;gap:1rem;align-items:start}
 html[data-app-layout="cards"] #view-tournaments[data-lv-page]>.page-hero{grid-column:1/-1}
 html[data-app-layout="cards"] #view-tournaments[data-lv-page]>.schedule-catalog{grid-column:2;grid-row:2/5;position:sticky;top:1rem;margin:0}
 html[data-app-layout="cards"] #view-tournaments[data-lv-page]>:not(.page-hero,.schedule-catalog){grid-column:1}
 html[data-app-layout="focus"] #view-tournaments[data-lv-page] .grid:has(>.tournament-card){grid-template-columns:repeat(3,minmax(0,1fr))!important}
 html[data-app-layout="focus"] #view-communication[data-lv-page]>.grid:has(>.communication-priority-card){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:1.1rem}
 html[data-app-layout="cards"] #view-communication[data-lv-page]{display:grid;grid-template-columns:minmax(0,1fr) 18rem;gap:1rem;align-items:start}
 html[data-app-layout="cards"] #view-communication[data-lv-page]>.page-hero{grid-column:1/-1}
 html[data-app-layout="cards"] #view-communication[data-lv-page]>section.panel{grid-column:2;grid-row:2/5;position:sticky;top:1rem;margin:0}
 html[data-app-layout="cards"] #view-communication[data-lv-page]>section.panel .grid{grid-template-columns:1fr!important}
 html[data-app-layout="cards"] #view-communication[data-lv-page]>:not(.page-hero,section.panel){grid-column:1}
 html[data-app-layout="focus"] #view-actions[data-lv-page] .grid:has(>.club-event-card){grid-template-columns:repeat(3,minmax(0,1fr))!important}
 html[data-app-layout="focus"] #view-clubwear[data-lv-page] .grid:has(>.merch-product-card){grid-template-columns:repeat(3,minmax(0,1fr))!important}
 html[data-app-layout="cards"] #view-clubwear[data-lv-page] .grid:has(>.merch-product-card){grid-template-columns:1fr!important}
}

/* Forms: centered classic dialog / side drawer with steps / full workspace with cards. */
html[data-app-layout="compact"] #modal-root .modal-backdrop:has(>[data-lv-modal]){place-items:center;padding:1.5rem}
html[data-app-layout="compact"] #modal-root [data-lv-modal]{width:min(62rem,calc(100vw - 3rem))!important;max-height:calc(100dvh - 3rem);border-radius:1.2rem}
html[data-app-layout="cards"] #modal-root .modal-backdrop:has(>[data-lv-modal]){place-items:stretch end;padding:0}
html[data-app-layout="cards"] #modal-root [data-lv-modal]{width:min(75rem,92vw)!important;max-width:100vw;max-height:100dvh;height:100dvh;border-radius:1.25rem 0 0 1.25rem;display:flex;flex-direction:column}
html[data-app-layout="cards"] #modal-root [data-lv-modal]>.modal-head{flex:none;position:relative}
html[data-app-layout="cards"] #modal-root [data-lv-modal]>.modal-body{flex:1;overflow:auto;align-content:start}
html[data-app-layout="cards"] #modal-root [data-lv-stepper] [data-lv-step-current="false"]{display:none!important}
html[data-app-layout="cards"] #modal-root [data-lv-stepper] [data-lv-step-current="true"]{min-height:14rem}
html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) .lv-step-controls{display:none}
html[data-app-layout="cards"] .lv-step-controls{display:flex;align-items:center;justify-content:space-between;gap:.7rem;padding:1rem 0;border-top:1px solid var(--club-border);margin-top:1rem}
html[data-app-layout="cards"] .lv-step-controls>span{font-size:.7rem;color:var(--muted);text-align:center}
html[data-app-layout="cards"] #modal-root .lv-form-navigation [aria-current="step"]{background:var(--club-selected-gradient);border-color:var(--club-control-border);color:var(--club-text);font-weight:750}
html[data-app-layout="focus"] #modal-root .modal-backdrop:has(>[data-lv-modal]){place-items:start center;padding:1rem;background:var(--surface-soft,#f5f7fa)}
html[data-app-layout="focus"] #modal-root [data-lv-modal]{width:calc(100vw - 2rem)!important;max-width:none;max-height:calc(100dvh - 2rem);border-radius:1rem;background:var(--surface-soft,#f5f7fa)}
html[data-app-layout="focus"] #modal-root [data-lv-modal]>.modal-head{background:var(--surface,#fff)}
html[data-app-layout="focus"] #modal-root [data-lv-form]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.2rem;align-items:start}
html[data-app-layout="focus"] #modal-root [data-lv-form]>:is(.modal-actions,.lv-step-controls,p,[role="alert"],.training-editor-summary,.training-config-intro,.training-structure,.member-editor-overview,.member-editor-tabs,.member-editor-panels){grid-column:1/-1}
html[data-app-layout="focus"] #modal-root [data-lv-form]>[data-lv-part]{margin:0;min-width:0}
html[data-app-layout="focus"] #modal-root [data-lv-form]>fieldset{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;min-width:0}
html[data-app-layout="focus"] #modal-root [data-lv-form]>fieldset>.form-grid{grid-column:1/-1}
html[data-app-layout="focus"] #modal-root [data-lv-modal="members"] .member-editor-panels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.2rem}
html[data-app-layout="focus"] #modal-root [data-lv-modal="members"] .member-editor-panel{padding:1rem;border:1px solid var(--club-border);border-radius:1rem;background:var(--surface,#fff);animation:none;scroll-margin-top:1rem}
html[data-app-layout="focus"] #modal-root [data-lv-modal="members"] .member-editor-panel[data-member-editor-panel="profile"]{grid-column:1/-1}
html[data-app-layout="focus"] #modal-root [data-lv-modal="members"] .member-form-section{box-shadow:none}
html[data-app-layout="focus"] #modal-root [data-lv-modal="members"] .member-editor-tabs{position:static;margin:0;border-radius:1rem;background:var(--surface,#fff)}

@media(max-width:1100px) and (min-width:761px){
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard>:is(.staff-dashboard-header,.role-summary,.staff-stats){grid-column:1/-1}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] :is(.staff-dashboard-main,.staff-dashboard-aside){display:grid;grid-template-columns:1fr;min-width:0}
 html[data-app-layout="compact"] #view-training[data-lv-page] .training-week-board{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media(max-width:1000px){
 html[data-app-layout="focus"] #modal-root [data-lv-form]{grid-template-columns:1fr}
 html[data-app-layout="focus"] #modal-root [data-lv-form]>fieldset{grid-template-columns:1fr}
 html[data-app-layout="focus"] #modal-root [data-lv-modal="members"] .member-editor-panels{grid-template-columns:1fr}
}
@media(max-width:760px){
 html[data-app-layout="compact"] #view-dashboard[data-lv-page] .staff-dashboard{display:flex!important;flex-direction:column}
 html[data-app-layout="compact"] #view-dashboard[data-lv-page] .staff-dashboard>*{width:100%}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-event-card{grid-template-columns:1fr}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard{display:flex!important;flex-direction:column}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard>*{width:100%}
 html[data-app-layout="focus"] #view-attendance[data-lv-page] .attendance-member-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html[data-app-layout="focus"] #view-attendance[data-lv-page] .attendance-row--simple{padding:1rem .6rem;min-height:9rem}
 html[data-app-layout="cards"] #view-training[data-lv-page] .training-week-board{grid-template-columns:1fr!important}
 html[data-app-layout="cards"] #modal-root [data-lv-modal]{width:100vw!important;border-radius:0}
 html[data-app-layout="focus"] #modal-root .modal-backdrop:has(>[data-lv-modal]){padding:.4rem}
 html[data-app-layout="focus"] #modal-root [data-lv-modal]{width:calc(100vw - .8rem)!important;max-height:calc(100dvh - .8rem)}
 html[data-app-layout="focus"] #modal-root [data-lv-form]{gap:.8rem}
 html[data-app-layout="cards"] .lv-step-controls{flex-wrap:wrap}
 html[data-app-layout="cards"] .lv-step-controls>span{order:-1;width:100%}
}

/* Explicitly saved content order and the drag editor take precedence over default board areas. */
@media(min-width:1101px){
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #view-dashboard[data-lv-page] .staff-dashboard.layout-has-order,
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body.layout-edit-mode #view-dashboard[data-lv-page] .staff-dashboard{grid-template-areas:none!important;grid-template-columns:minmax(0,1fr)!important}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #view-dashboard[data-lv-page] .staff-dashboard.layout-has-order>*,
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body.layout-edit-mode #view-dashboard[data-lv-page] .staff-dashboard>*{grid-area:auto!important;grid-column:1!important}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #view-dashboard[data-lv-page] .staff-dashboard.layout-has-order>:is(.staff-dashboard-main,.staff-dashboard-aside),
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body.layout-edit-mode #view-dashboard[data-lv-page] :is(.staff-dashboard-main,.staff-dashboard-aside){display:grid!important;grid-template-columns:1fr!important}
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #view-dashboard[data-lv-page] .staff-dashboard.layout-has-order .staff-panel,
 html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) body.layout-edit-mode #view-dashboard[data-lv-page] .staff-panel{grid-area:auto!important}
}

/* The mobile variants keep different priorities instead of collapsing to the same ordering. */
@media(max-width:760px){
 html[data-app-layout="compact"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-header{order:0!important}
 html[data-app-layout="compact"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.role-summary{order:1!important}
 html[data-app-layout="compact"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-stats{order:2!important}
 html[data-app-layout="compact"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-main{order:3!important}
 html[data-app-layout="compact"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-aside{order:4!important}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-dashboard{display:flex!important;flex-direction:column}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-dashboard>*{width:100%}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-header{order:0!important}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-main{order:1!important}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-aside{order:2!important}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.role-summary{order:3!important}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-stats{order:4!important}
 html[data-app-layout="cards"] #view-dashboard[data-lv-page] .staff-tournaments-panel .staff-event-list{padding-left:.8rem;border-left:2px solid var(--club-border)}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-header{order:0!important}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-stats{order:1!important}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.role-summary{order:2!important}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-main{order:3!important}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard:not(.layout-has-order)>.staff-dashboard-aside{order:4!important}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.6rem}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-dashboard-aside{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;align-items:start}
 html[data-app-layout="focus"] #view-dashboard[data-lv-page] .staff-birthdays-panel{grid-column:1/-1}
}

/* Layout 3 product photographs fill the image column instead of retaining the small card thumbnail. */
html[data-app-layout="cards"] #view-clubwear.view-section[data-lv-page]:not(.is-hidden) .merch-product-card>.product-image{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:0;min-height:0;width:calc(100% - 2rem);max-width:none;height:clamp(12rem,25vw,20rem);margin:1rem;padding:.75rem;align-self:start;background:var(--club-subtle-gradient)}
html[data-app-layout="cards"] #view-clubwear.view-section[data-lv-page]:not(.is-hidden) .merch-product-card>.product-image>img{display:block;min-width:0;min-height:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center}
@media(max-width:760px){
 html[data-app-layout="cards"] #view-clubwear.view-section[data-lv-page]:not(.is-hidden) .merch-product-card>.product-image{width:calc(100% - 2rem);max-width:22rem;height:16rem;margin:1rem auto}
}

/* Member detail: preserve every original fact, result row and permitted action. */
html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-member-detail]{max-width:calc(100vw - 2rem)}
html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-member-detail-body]{min-width:0;gap:1rem}
html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area]{min-width:0;margin:0!important}
html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-member-detail-body] .stat-highlight :is(strong,span){min-width:0;overflow-wrap:anywhere}
html:is([data-app-layout="compact"],[data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="results"] .table-wrap{max-width:100%;overflow:auto}
html[data-app-layout="compact"] #modal-root [data-lv-member-detail]{width:min(70rem,calc(100vw - 3rem));max-height:calc(100dvh - 3rem)}
html[data-app-layout="compact"] #modal-root [data-lv-member-detail-body]{display:grid;grid-template-columns:1fr;padding:1.5rem}
html[data-app-layout="compact"] #modal-root [data-lv-detail-area="numbers"]{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:1rem}
html[data-app-layout="compact"] #modal-root [data-lv-detail-facts]{grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
html[data-app-layout="compact"] #modal-root [data-lv-detail-area="profile"] .avatar{width:5rem;height:5rem;flex-basis:5rem}
html[data-app-layout="cards"] #modal-root .modal-backdrop:has(>[data-lv-member-detail]){place-items:stretch end;padding:0}
html[data-app-layout="cards"] #modal-root [data-lv-member-detail]{width:min(76rem,94vw);max-width:100vw;height:100dvh;max-height:100dvh;border-radius:1.2rem 0 0 1.2rem;display:flex;flex-direction:column}
html[data-app-layout="cards"] #modal-root [data-lv-member-detail]>.modal-head{flex:none}
html[data-app-layout="cards"] #modal-root [data-lv-member-detail-body]{display:grid;grid-template-columns:17rem minmax(0,1fr);grid-template-areas:"profile numbers" "contact personal" "contact points" "contact results" "actions actions";align-content:start;align-items:start;overflow:auto;padding:1.2rem}
html[data-app-layout="cards"] #modal-root [data-lv-detail-facts],html[data-app-layout="focus"] #modal-root [data-lv-detail-facts]{display:contents}
html[data-app-layout="cards"] #modal-root [data-lv-detail-area="profile"]{display:flex;flex-direction:column;align-items:start;padding:1.2rem;border:1px solid var(--club-border);border-radius:1rem;background:var(--club-subtle-gradient)}
html[data-app-layout="cards"] #modal-root [data-lv-detail-area="profile"] .member-head{display:flex;flex-direction:column;align-items:start;gap:1rem}
html[data-app-layout="cards"] #modal-root [data-lv-detail-area="profile"] .avatar{width:6rem;height:6rem;flex-basis:6rem}
html[data-app-layout="cards"] #modal-root [data-lv-detail-area="contact"]>.grid{grid-template-columns:1fr}
html[data-app-layout="cards"] #modal-root [data-lv-detail-area="contact"] .stat-highlight{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:.7rem;align-items:start;padding:.7rem .4rem;border:0;border-bottom:1px solid var(--club-border);border-radius:0;background:transparent}
html[data-app-layout="cards"] #modal-root [data-lv-detail-area="numbers"]{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.7rem}
html[data-app-layout="focus"] #modal-root .modal-backdrop:has(>[data-lv-member-detail]){place-items:start center;padding:1rem;background:var(--surface-soft,#f5f7fa)}
html[data-app-layout="focus"] #modal-root [data-lv-member-detail]{width:calc(100vw - 2rem);max-width:none;max-height:calc(100dvh - 2rem);border-radius:1rem;background:var(--surface-soft,#f5f7fa)}
html[data-app-layout="focus"] #modal-root [data-lv-member-detail]>.modal-head{background:var(--surface,#fff)}
html[data-app-layout="focus"] #modal-root [data-lv-member-detail-body]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:"profile profile numbers" "personal contact numbers" "points results results" "actions actions actions";align-items:start;padding:1.2rem;gap:1.2rem}
html[data-app-layout="focus"] #modal-root [data-lv-detail-area="profile"]{padding:1.3rem;border:1px solid var(--club-border);border-radius:1rem;background:var(--surface,#fff)}
html[data-app-layout="focus"] #modal-root [data-lv-detail-area="profile"] .avatar{width:6rem;height:6rem;flex-basis:6rem}
html[data-app-layout="focus"] #modal-root [data-lv-detail-area="numbers"]{grid-template-columns:1fr!important;gap:.8rem}
html[data-app-layout="focus"] #modal-root [data-lv-detail-area="numbers"] .stat-card{min-height:6rem;background:var(--club-subtle-gradient)}
html[data-app-layout="focus"] #modal-root [data-lv-detail-area="points"]>.grid{grid-template-columns:1fr}
html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="profile"]{grid-area:profile}
html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="numbers"]{grid-area:numbers}
html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="personal"]{grid-area:personal}
html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="contact"]{grid-area:contact}
html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="points"]{grid-area:points}
html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="results"]{grid-area:results}
html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="actions"]{grid-area:actions}
@media(max-width:1100px){
 html[data-app-layout="focus"] #modal-root [data-lv-member-detail-body]{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"profile profile" "numbers numbers" "personal contact" "points points" "results results" "actions actions"}
 html[data-app-layout="focus"] #modal-root [data-lv-detail-area="numbers"]{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 html[data-app-layout="focus"] #modal-root [data-lv-detail-area="points"]>.grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 html[data-app-layout="cards"] #modal-root [data-lv-member-detail-body]{grid-template-columns:14rem minmax(0,1fr)}
 html[data-app-layout="cards"] #modal-root [data-lv-detail-area="numbers"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
 html[data-app-layout="compact"] #modal-root [data-lv-member-detail]{width:calc(100vw - 1rem);max-width:none;max-height:calc(100dvh - 1rem)}
 html[data-app-layout="compact"] #modal-root [data-lv-member-detail-body]{padding:.8rem}
 html[data-app-layout="compact"] #modal-root [data-lv-detail-facts]{grid-template-columns:1fr}
 html[data-app-layout="compact"] #modal-root [data-lv-detail-area="numbers"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html[data-app-layout="cards"] #modal-root [data-lv-member-detail]{width:100vw;border-radius:0}
 html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-member-detail-body]{grid-template-columns:1fr;grid-template-areas:"profile" "numbers" "personal" "contact" "points" "results" "actions";padding:.8rem}
 html:is([data-app-layout="cards"],[data-app-layout="focus"]) #modal-root [data-lv-detail-area="numbers"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html[data-app-layout="cards"] #modal-root [data-lv-detail-area="profile"] .member-head{flex-direction:row;align-items:center}
 html[data-app-layout="cards"] #modal-root [data-lv-detail-area="profile"] .avatar{width:4rem;height:4rem;flex-basis:4rem}
 html[data-app-layout="focus"] #modal-root [data-lv-detail-area="profile"] .avatar{width:4rem;height:4rem;flex-basis:4rem}
 html[data-app-layout="focus"] #modal-root [data-lv-detail-area="points"]>.grid{grid-template-columns:1fr}
}
