/* Shared studio, register and handset visual primitives. Domain-specific layouts remain intact. */
:root{
 --ui-surface:var(--surface,#fff);--ui-canvas:var(--background,#f6f7f9);--ui-ink:var(--text-primary,#22252c);--ui-muted:var(--text-secondary,#67717e);
 --ui-border:var(--border,#dce0e6);--ui-divider:var(--divider,#e6e7eb);--ui-accent:var(--accent,#b23845);--ui-tint:var(--accent-soft,#fceef0);
 --ui-radius:16px;--ui-field-radius:10px;--ui-space:16px;--ui-field-height:42px;--ui-row-height:52px;
 --ui-dialog-shadow:0 24px 80px #141c342b,0 4px 16px #141c3412;
 --ui-dialog-width:920px;--ui-dialog-inset:24px;
}
[data-ui-size=compact]{--ui-dialog-width:640px}[data-ui-size=standard]{--ui-dialog-width:920px}[data-ui-size=wide]{--ui-dialog-width:1280px}
:root dialog[open][data-ui-dialog]:not(.settings-dialog){width:min(var(--ui-dialog-width),calc(100vw - var(--ui-dialog-inset)*2))!important;max-width:calc(100vw - var(--ui-dialog-inset)*2)!important;max-height:calc(100dvh - var(--ui-dialog-inset)*2)!important;box-sizing:border-box;height:auto!important;padding:20px!important;border:1px solid var(--ui-border)!important;border-radius:var(--ui-radius)!important;background:var(--ui-canvas)!important;color:var(--ui-ink);box-shadow:var(--ui-dialog-shadow)!important}
dialog[data-ui-dialog]::backdrop{background:#151c2d66;backdrop-filter:blur(4px)}
:root dialog[open][data-ui-dialog]:not(.settings-dialog).ui-tabbed-dialog{height:min(860px,calc(100dvh - var(--ui-dialog-inset)*2))!important}
[data-ui-dialog]>header{display:flex;gap:16px;align-items:center;justify-content:space-between;flex:none!important;background:transparent!important;margin:0 0 12px!important;padding:0 0 12px!important;border-bottom:1px solid var(--ui-divider)!important}
[data-ui-dialog]>header :is(h2,h3){font-size:22px!important;line-height:1.25;letter-spacing:-.45px;overflow-wrap:anywhere;margin:0!important;color:var(--ui-ink)}
[data-ui-dialog] :is(label,legend){color:var(--ui-muted);font-size:13px;line-height:1.4}
[data-ui-dialog] :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]),select,textarea){box-sizing:border-box;min-width:0;max-width:100%;border:1px solid var(--ui-border);border-radius:var(--ui-field-radius);background:var(--ui-surface);color:var(--ui-ink);font:inherit;font-size:14px}
[data-ui-dialog] :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]),select:not([multiple])){min-height:var(--ui-field-height);padding:9px 12px}
[data-ui-dialog] textarea{padding:10px 12px;resize:vertical;min-height:64px}
[data-ui-dialog] :is(input[type=checkbox],input[type=radio]){accent-color:var(--ui-accent);flex-shrink:0}
[data-ui-dialog] :is(input,select,textarea):focus-visible{outline:3px solid color-mix(in srgb,var(--ui-accent) 22%,transparent);outline-offset:1px;border-color:var(--ui-accent)}
[data-ui-dialog] :is(.ops-error,.member-error,.employee-error,.agenda-error,[role=alert]):not(:empty){color:var(--error,#b23845);font-size:13px;line-height:1.5;overflow-wrap:anywhere}
[data-ui-dialog] :is(.action,.modal-cancel,.modal-apply){min-height:40px;border-radius:var(--ui-field-radius);font-size:13px;line-height:1.4;white-space:normal}
[data-ui-dialog] :is(footer,.modal-footer){gap:10px;flex-shrink:0;flex-wrap:wrap;border-color:var(--ui-divider);background:var(--ui-canvas);position:relative;z-index:1}
[data-ui-dialog] .ops-form{gap:14px 18px}
[data-ui-dialog] .ops-form label{gap:5px;min-width:0}
[data-ui-dialog] :is(.ops-form,.agenda-form-grid) :is(input:not([type=checkbox]),select:not([multiple])){height:var(--ui-field-height);min-height:var(--ui-field-height)}
:root dialog[data-ui-dialog]>.ui-dialog-form{display:flex!important;flex-direction:column;min-height:0;padding:0!important;margin:0;overflow:hidden!important;border:0;background:transparent}
.ui-dialog-content{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:12px}
:root dialog[data-ui-dialog]>.ui-dialog-form>footer{position:static!important;margin:0!important;padding:12px!important;flex:none!important;min-height:52px}
:root dialog[data-ui-dialog] :is(.member-detail-tabs,.employee-tabs,.contract-mask-tabs,.ops-subscription-tabs){flex-shrink:0;gap:6px;scrollbar-width:thin}
[data-ui-dialog] :is([role=tab],.member-detail-tabs button,.employee-tabs button){border-radius:9px;font-size:13px;min-height:40px;line-height:1.3}
/* Cash popups share the same sizing and fixed header/actions as native dialogs. */
:root .modal-backdrop{padding:var(--ui-dialog-inset);background:#151c2d66;backdrop-filter:blur(4px)}
:root .modal-backdrop>.discount-modal[data-ui-dialog]{display:flex;flex-direction:column;width:min(var(--ui-dialog-width),calc(100vw - var(--ui-dialog-inset)*2))!important;max-width:100%!important;max-height:calc(100dvh - var(--ui-dialog-inset)*2)!important;height:auto;padding:20px!important;border-radius:var(--ui-radius)!important;border:1px solid var(--ui-border)!important;background:var(--ui-canvas)!important;box-shadow:var(--ui-dialog-shadow)!important;overflow:hidden}
[data-ui-dialog]>.modal-header{flex:none!important;padding:0 0 12px!important;margin:0!important;background:transparent!important;border-bottom:1px solid var(--ui-divider)}
[data-ui-dialog]>.modal-header :is(h2,h3){font-size:22px;line-height:1.25;letter-spacing:-.45px;overflow-wrap:anywhere}
:root [data-ui-dialog]>.modal-body{min-height:0;overflow:auto;padding:16px 0;flex:0 1 auto;overscroll-behavior:contain}
:root [data-ui-dialog]>.modal-footer{position:static!important;padding:12px 0 0!important;margin:0!important;flex:none!important;min-height:52px}
[data-ui-dialog] :is(.customer-row,.invoice-row){box-sizing:border-box;border:0;border-bottom:1px solid var(--ui-divider);border-radius:0;box-shadow:none;margin:0;padding:14px 12px;min-height:var(--ui-row-height);background:var(--ui-surface);font-size:13px;text-align:left;overflow-wrap:anywhere}
[data-ui-dialog] :is(.customer-row,.invoice-row):hover{background:var(--hover,#fff4f5)}
[data-ui-dialog] :is(.customer-row,.invoice-row).selected{background:var(--ui-tint);box-shadow:inset 3px 0 var(--ui-accent)}
/* One table rhythm for member, contract, settings, banking, reports and register lists. */
table[data-ui-table]{border-collapse:collapse;border-spacing:0;font-size:13px;color:var(--ui-ink)}
table[data-ui-table] :is(th,td){box-sizing:border-box;padding:12px 14px;line-height:1.45;vertical-align:middle;border-bottom:1px solid var(--ui-divider)}
table[data-ui-table] th{font-size:12px;font-weight:600;text-align:left;color:var(--ui-muted);background:var(--surface-secondary,#eff1f4);white-space:normal}
table[data-ui-table] th button{font:inherit;color:inherit;line-height:inherit;white-space:normal}
table[data-ui-table] tbody tr{min-height:var(--ui-row-height)}
table[data-ui-table] tbody tr:is(:hover,:focus-within)>td{background:var(--hover,#fff4f5)}
table[data-ui-table] tr[role=button]{cursor:pointer}
table[data-ui-table] tr[role=button]:focus-visible{outline:2px solid var(--ui-accent);outline-offset:-2px}
table[data-ui-table] .column-filters :is(th,td){padding:7px;background:var(--ui-surface)}
table[data-ui-table] :is(.empty,.empty-state){padding:28px 16px;text-align:center;color:var(--ui-muted);line-height:1.6}
:is(.panel-meta,.employee-panel-meta){gap:12px;flex-wrap:wrap;min-height:64px;padding:16px 20px;border-color:var(--ui-divider)}
:is(.table-scroll,.employee-table-wrap){overscroll-behavior-x:contain;overscroll-behavior-y:auto;scrollbar-width:thin}
/* Handset dialogs use the same tokens; React retains its own focus and portal lifecycle. */
.live-dialog{border-radius:var(--ui-radius)!important;background:var(--ui-surface)!important;box-shadow:var(--ui-dialog-shadow)!important;gap:12px!important}
.live-dialog [data-slot=dialog-title]{color:var(--ui-ink);font-weight:650;letter-spacing:-.4px}
.live-dialog-body{min-height:0;overscroll-behavior:contain;scrollbar-width:thin}
.live-dialog :is(input.field,select.field){min-height:44px;border-radius:var(--ui-field-radius);border-color:var(--ui-border)}
.live-rows>*,.booking-card{border-color:var(--ui-border);border-radius:12px}
@media(min-width:1100px){[data-ui-size=wide]>.ui-dialog-form .ops-form{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){
 :root{--ui-dialog-inset:10px;--ui-space:12px;--ui-field-height:44px}
 :root dialog[open][data-ui-dialog]:not(.settings-dialog){padding:12px!important;border-radius:14px!important}
 :root .modal-backdrop>.discount-modal[data-ui-dialog]{padding:12px!important;border-radius:14px!important}
 [data-ui-dialog]>header :is(h2,h3),[data-ui-dialog]>.modal-header :is(h2,h3){font-size:20px!important}
 [data-ui-dialog] :is(.ops-form,.agenda-form-grid,.ops-addon-grid,.employee-form-grid){grid-template-columns:minmax(0,1fr)!important}
 [data-ui-dialog] :is(.ops-wide,.agenda-form-grid>label,.ops-addon-grid>.ops-wide){grid-column:1/-1!important}
 [data-ui-dialog] .ops-form :is(input:not([type=checkbox]),select),[data-ui-dialog] .agenda-form-grid :is(input,select){font-size:16px}
 [data-ui-dialog] :is(footer,.modal-footer) .action{flex:0 1 auto}
 .ui-dialog-content{padding:12px}
 table[data-ui-table] :is(th,td){padding:10px 9px;font-size:12px}
 table[data-ui-table] th{font-size:11px}
 :is(.panel-meta,.employee-panel-meta){padding:12px;min-height:56px}
 [data-ui-dialog] :is(.customer-row,.invoice-row){padding:12px 8px;gap:10px}
}
@media(prefers-reduced-motion:reduce){[data-ui-dialog],.live-dialog,table[data-ui-table] *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.auth-page .card{border-color:var(--ui-border);border-radius:20px;box-shadow:0 12px 36px #20232b06}
.auth-page label{color:var(--ui-muted);font-size:13px;line-height:1.4}
.auth-page .card :is(input,select){border:1px solid var(--ui-border);border-radius:var(--ui-field-radius);min-height:46px;background:var(--ui-surface);color:var(--ui-ink)}
.auth-page .card .button{border-radius:var(--ui-field-radius);min-height:44px}
@media(max-width:700px){.ops-subscription-panel{grid-template-columns:minmax(0,1fr)!important}.ops-subscription-panel>.ops-note{grid-column:1/-1}.auth-page .card{padding:20px}.auth-page .registration-grid{grid-template-columns:minmax(0,1fr)}}
/* Employee panels, rather than the complete form, own overflow on short screens. */
:root #employeeDialog #employeeEditor{flex:1;min-height:0;overflow:hidden}
:root #employeeDialog #employeeForm{display:flex;flex-direction:column;height:100%;min-height:0!important;overflow:hidden}
:root #employeeDialog #employeeForm>[role=tabpanel]{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
:root #employeeDialog #employeeForm>:is(.employee-tabs,footer,.employee-error,.employee-conflict){flex-shrink:0}
:root #employeeDialog #employeeForm>footer{position:static!important;margin:0!important;padding:12px!important;background:var(--ui-canvas)}
[data-ui-dialog]:is(.ops-confirm,.employee-confirm)>h2{font-size:21px;line-height:1.3;margin:0 0 12px;letter-spacing:-.4px}
[data-ui-dialog]:is(.ops-confirm,.employee-confirm)>p{line-height:1.6;overflow-wrap:anywhere}
@media(max-width:700px){[data-ui-dialog] .employee-detail-grid{grid-template-columns:minmax(0,1fr)!important}}
html.ui-modal-open{overflow:hidden;overscroll-behavior:none}
@media(min-width:1000px){
 :root #memberDialog .member-detail-body{padding:12px}
 :root #memberDialog .member-form-grid>div{gap:8px}
 :root #memberDialog .member-form-section+.member-form-section{margin-top:12px}
 :root #memberDialog .member-form-section h3{margin-bottom:6px;padding-bottom:6px}
 :root #memberDialog .member-profile-aside .member-photo{max-height:150px;width:150px}
}
:root table[data-ui-table] :is(th,td){padding:14px 16px;font-size:13px;line-height:1.5;border-bottom-color:var(--ui-divider)}
:root table[data-ui-table] th{font-size:12px;font-weight:600;color:var(--ui-muted);background:var(--surface-secondary,#eff1f4)}
:root table[data-ui-table] .column-filters :is(th,td){padding:8px;background:var(--ui-surface)}
:is(.member-status,.employee-access-badge,.list-status,.contract-status){border-radius:8px;font-size:12px;line-height:1.4;white-space:normal}
@media(max-width:700px){:root table[data-ui-table] :is(th,td){padding:10px 8px;font-size:12px}:root table[data-ui-table] th{font-size:11px}:root table[data-ui-table] .column-filters :is(th,td){padding:6px}}
:root [data-ui-dialog]>.cash-audit-body{min-height:0;overflow:auto;flex:0 1 auto;overscroll-behavior:contain}
[data-ui-dialog] :is(footer,.modal-footer)>div{min-width:0;flex-wrap:wrap;gap:10px}
[data-ui-dialog] :is(footer,.modal-footer) button:not(.ui-close){min-height:40px;border-radius:var(--ui-field-radius);font-size:13px;line-height:1.4;white-space:normal}
[data-ui-dialog] .cash-audit-sidebar,[data-ui-dialog] .cash-denomination-section{min-width:0}
:root .modal-backdrop{box-sizing:border-box;align-items:center!important;justify-content:center!important}
:root .modal-backdrop>.discount-modal[data-ui-dialog]{box-sizing:border-box}
[data-ui-dialog] :is(.cash-amount-wrap,.discount-input-wrap)>input{border:0!important;border-radius:0!important;background:transparent!important;outline:0!important;box-shadow:none!important}
[data-ui-dialog] :is(.cash-amount-wrap,.discount-input-wrap):focus-within{border-color:var(--ui-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-accent) 18%,transparent)}
[data-ui-dialog] .payment-choice{min-width:0}
[data-ui-dialog] .payment-choice :is(strong,small){max-width:100%;white-space:normal!important;overflow-wrap:anywhere;hyphens:auto}
[data-ui-dialog] .customer-name :is(strong,span){white-space:normal!important;overflow-wrap:anywhere;text-overflow:clip;max-width:100%}
@media(max-width:700px){[data-ui-dialog] .payment-choice{padding:12px 8px!important}[data-ui-dialog] .payment-choice small{font-size:11px;line-height:1.4}[data-ui-dialog] .customer-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}[data-ui-dialog] .customer-main{grid-column:1/-1}[data-ui-dialog] .customer-check{display:none}}
.live-dialog-actions{flex:none;padding-top:12px;border-top:1px solid var(--ui-divider);background:var(--ui-surface)}.live-dialog-actions:empty{display:none}.live-dialog-actions .btn{min-height:44px;border-radius:var(--ui-field-radius)}
[data-ui-dialog] :is(.employee-error,.employee-conflict,.member-error,.ops-error,.agenda-error,[role=alert]):not(:empty),.live-dialog .api-error{max-height:min(24dvh,160px);overflow:auto;overscroll-behavior:contain}
@media(prefers-reduced-transparency:reduce){dialog[data-ui-dialog]::backdrop,.modal-backdrop{backdrop-filter:none!important}}
[data-ui-size=notice]{--ui-dialog-width:460px}
:is(.date-filter-popover,.shell-account-menu,.phone-menu){border:1px solid var(--ui-border);border-radius:var(--ui-radius);background:var(--popover,var(--ui-surface));box-shadow:var(--ui-dialog-shadow)}
:is(.date-filter-popover,.shell-account-menu,.phone-menu) button{border-radius:var(--ui-field-radius);line-height:1.4}
:is(.phone-stage,.phone-frame,.phone-overlays,.live-dialog){--ui-surface:var(--card,#fff);--ui-ink:var(--foreground,#22252c);--ui-muted:var(--muted-foreground,#67717e);--ui-accent:var(--primary,#b23845);--ui-tint:var(--accent,#fceef0);--ui-border:var(--border,#dce0e6);--ui-divider:var(--border,#e6e7eb)}
/* The register viewport must fit the studio shell; otherwise fixed overlays extend below short windows. */
:root #registerFrame{height:calc(100dvh - 130px)!important;min-height:0!important;max-height:calc(100dvh - 130px)}
@media(max-width:800px){:root #registerFrame{height:calc(100dvh - 170px)!important;max-height:calc(100dvh - 170px)}}

/* One shared record-creation affordance: red square plus, last at the right. */
:root body button.action.ui-list-create{display:inline-flex!important;align-items:center;justify-content:center;width:40px!important;min-width:40px!important;max-width:40px!important;height:40px!important;min-height:40px!important;flex:0 0 40px!important;order:100;padding:0!important;border:1px solid var(--action-primary,#b9384c)!important;border-radius:10px!important;background:var(--action-primary,#b9384c)!important;color:#fff!important;font-size:24px!important;font-weight:400!important;line-height:1!important;box-shadow:none!important;cursor:pointer}
:root body button.action.ui-list-create:hover{background:var(--action-primary-hover,#a52f42)!important;border-color:var(--action-primary-hover,#a52f42)!important}
:root body button.action.ui-list-create:disabled{opacity:.45;cursor:not-allowed}
:root body button.action.ui-list-create:focus-visible{outline:3px solid var(--focus,#d98a99);outline-offset:3px}
.ui-list-actions,.list-create-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-left:auto}
:root .training-plan-list>.panel-meta{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px}
.training-plan-list h2{font-size:21px;letter-spacing:-.5px;margin:0;font-weight:600}
:root .training-plan-list .plan-list-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;width:auto;margin-left:auto}
:root .training-plan-list .plan-list-actions>.action{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:9px 12px;white-space:nowrap;font-size:13px}
:root .training-plan-list .plan-list-actions svg{width:16px;height:16px}
:root .training-plan-list .plan-archive-toggle[aria-pressed=true]{background:var(--accent-soft,#fbf0f3);color:var(--action-primary,#b9384c)}
:root .training-plan-list .training-plan-table{width:100%;min-width:0;table-layout:fixed}
:root .training-plan-list .training-plan-table :is(th,td):last-child{width:auto!important;text-align:left}
:root .training-plan-list .training-plan-table th{font-size:12px;font-weight:400;padding:12px 20px;background:var(--surface,#fff);color:var(--muted,#747e8d)}
:root .training-plan-list .training-plan-table td{font-size:14px;padding:17px 20px;overflow-wrap:anywhere;background:var(--surface,#fff)}
.training-plan-table td small{display:block;margin-top:4px;color:var(--muted,#747e8d);font-size:12px}
.plan-editor-archive{margin-right:auto;color:var(--action-primary,#b9384c)}
@media(max-width:600px){:root .training-plan-list>.panel-meta{padding:14px;gap:14px}:root .training-plan-list .plan-list-actions{margin-left:auto}:root .training-plan-list .plan-list-actions>.action{font-size:12px;padding:9px 10px}}
:root .agenda-month-add{background:var(--action-primary,#b9384c);color:#fff;border-color:var(--action-primary,#b9384c)}
/* Explicit, tenant-scoped delegated support session. */
.platform-support-banner{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap;background:#1b202a;color:#fff;padding:10px 16px;position:relative;z-index:120;font-size:13px}.platform-support-banner button{background:#fff;color:#22252c;border:0;border-radius:8px;padding:7px 12px;font:inherit;cursor:pointer}.studio-brand-frame{display:block;width:100%;height:540px;border:0}
/* Direct assignment keeps each reusable plan's action at the row's right edge. */
:root .training-plan-list .training-plan-table .plan-assignment-column{width:180px!important;text-align:right}
.plan-assignment-column .action{display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap;min-height:40px}
.plan-assignment-column svg{width:16px;height:16px}
@media(max-width:600px){:root .training-plan-list .training-plan-table .plan-assignment-column{width:145px!important;padding:12px 10px}.plan-assignment-column .action{font-size:12px;padding:9px 10px}}

/* Closed native dialogs must never override the browser's hidden state through shared layout classes. */
:root dialog:not([open]){display:none!important}

/* Keep action geometry and focus rings inside every shared popup, including nested dialogs. */
:root dialog[open][data-ui-dialog]:not(.settings-dialog){display:flex;flex-direction:column;min-height:0;overflow:hidden}
:root body [data-ui-dialog][data-ui-size] :is(footer,.modal-footer){box-sizing:border-box;position:static!important;flex:0 0 auto!important;min-width:0;margin:0!important;padding:14px 12px max(12px,env(safe-area-inset-bottom))!important;overflow:visible;gap:10px;flex-wrap:wrap}
:root body [data-ui-dialog][data-ui-size] :is(footer,.modal-footer) :is(button,.action){max-width:100%;min-width:0;height:auto;white-space:normal;overflow-wrap:anywhere;flex-shrink:0}
:root body [data-ui-dialog][data-ui-size] :is(form,.modal-body,.ui-dialog-content){min-width:0;scroll-padding:8px}
:root body [data-ui-dialog][data-ui-size]>.ui-dialog-form{flex:1 1 auto}
:root body [data-ui-dialog][data-ui-size]>.ui-dialog-form>.ui-dialog-content{flex:1 1 auto;min-height:0}
:root body .modal-backdrop>.discount-modal[data-ui-dialog][data-ui-size]{max-height:calc(100dvh - var(--ui-dialog-inset)*2)!important}

/* Member profile: three equal columns and a quiet studio-tinted tab bar. */
:root #memberDialog[open][data-ui-dialog]{--ui-dialog-width:1600px;--ui-canvas:#fff;--ui-surface:#fff;background:#fff!important}
:root #memberDialog[data-ui-dialog] .member-detail-tabs{display:flex;flex-wrap:nowrap;width:100%;max-width:100%;min-width:0;overflow-x:auto;gap:5px;padding:7px;margin:0 0 18px;background:var(--brand-secondary-light,color-mix(in srgb,var(--brand-primary,var(--brand)) 25%,white));border:1px solid var(--border);border-radius:12px;box-sizing:border-box;scroll-padding:7px}
:root #memberDialog[data-ui-dialog] .member-detail-tabs .action{flex:1 0 auto;min-width:0;min-height:64px;padding:12px 10px;white-space:nowrap;border:0;border-radius:10px;background:transparent;color:var(--ink);font-size:16px;font-weight:500;box-shadow:none}
:root #memberDialog[data-ui-dialog] .member-detail-tabs .action.selected{background:#ffffffb3;color:var(--ink);font-weight:600;box-shadow:none}
:root #memberDialog[data-ui-dialog] .member-detail-tabs .action:disabled{opacity:.6}
:root #memberDialog[data-ui-dialog] .member-detail-tabs .action::after,:root #memberDialog[data-ui-dialog] .member-detail-tabs .action::before{display:none}
:root #memberDialog[data-ui-dialog] .member-detail-tabs .action:focus-visible{outline:2px solid var(--brand-accent,var(--accent));outline-offset:-3px}
:root #memberDialog[data-ui-dialog] .member-detail-body{background:#fff;padding:18px;min-width:0}
:root #memberDialog .member-profile{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:start}
:root #memberDialog #memberForm.member-profile-fields{display:grid;grid-column:span 2;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;min-width:0}
:root #memberDialog .member-profile-column{display:grid;align-content:start;gap:14px;min-width:0}
:root #memberDialog .member-profile h3{font-size:16px;font-weight:500;margin:0 0 3px;padding:0 0 11px;border-bottom:1px solid var(--border)}
:root #memberDialog .member-profile-column>label{display:grid;gap:6px;min-width:0;margin:0;font-size:13px;color:var(--muted)}
:root #memberDialog .member-profile-column :is(input,select,textarea){display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;height:58px;min-height:58px;margin:0;padding:12px;font-size:18px}
:root #memberDialog .member-profile-column textarea{height:94px;min-height:94px}
:root #memberDialog .member-profile-aside{display:flex;flex-direction:column;grid-row:auto;gap:12px;max-width:none;min-width:0;width:100%;padding:0;border:0;border-radius:0;background:#fff}
:root #memberDialog .member-profile-aside .member-photo{box-sizing:border-box;width:100%;height:auto;max-height:none;aspect-ratio:1;background:#fff;color:var(--brand-primary,var(--brand));border:1px solid var(--border);border-radius:14px;font-size:52px}
:root #memberDialog .member-profile-aside .action{min-height:48px;width:100%;font-size:14px}
:root #memberDialog .member-profile-aside dl{display:block;width:100%;margin:4px 0 0;padding-top:12px;border-top:1px solid var(--border)}
:root #memberDialog .member-profile-aside dd{margin:3px 0 12px;font-size:14px;line-height:1.4}
:root #memberDialog .member-status-control{display:flex;align-items:flex-start;flex-direction:column;gap:8px;margin:5px 0;padding:0;border:0}
:root #memberDialog .member-status-control label{min-height:32px;display:flex;align-items:center;gap:8px}
:root #memberDialog .member-profile-hint{font-size:12px;color:var(--muted);margin:18px 0 0}
@media(max-width:700px){
 :root #memberDialog .member-profile{grid-template-columns:minmax(0,1fr)}
 :root #memberDialog #memberForm.member-profile-fields{grid-column:auto}
 :root #memberDialog .member-profile-aside{margin-top:12px}
 :root #memberDialog .member-profile-aside .member-photo{width:min(240px,100%);align-self:flex-start}
}
@media(max-width:420px){:root #memberDialog #memberForm.member-profile-fields{grid-template-columns:minmax(0,1fr)}}

/* Bound native Safari date controls to the same grid cell and height as text fields. */
:root #memberDialog .member-profile-column>label{grid-template-columns:minmax(0,1fr)}
:root #memberDialog .member-profile-column input[type=date]{-webkit-appearance:none;appearance:none;box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:100%!important;height:var(--member-control-height,58px)!important;min-height:var(--member-control-height,58px)!important;max-height:var(--member-control-height,58px)!important;overflow:hidden;text-align:left;line-height:normal}
:root #memberDialog .member-profile-column input[type=date]::-webkit-date-and-time-value{min-width:0;text-align:left;margin:0;padding:0}
:root #memberDialog .member-profile-column input[type=date]::-webkit-datetime-edit{min-width:0;padding:0}

/* David 01.12.2026: iPhone/iPad geben Datums- und Zeitfeldern eine eigene Mindestbreite und -höhe; sie ragten über den Rahmen.
   Gilt nur dort, für alle Studios und alle Fenster: Feld bleibt in seiner Spalte, Inhalt links und vertikal mittig. */
@supports(-webkit-touch-callout:none){
 :root body input:is([type=date],[type=month],[type=datetime-local],[type=time]){-webkit-appearance:none;appearance:none;box-sizing:border-box;min-width:0;max-width:100%;text-align:left}
 :root body input:is([type=date],[type=month],[type=datetime-local],[type=time])::-webkit-date-and-time-value{min-width:0;margin:0;text-align:left}
 :root body #contractDialog :is([data-contract-basics],.contract-stamp) input[type=date]{display:flex;align-items:center;width:100%;height:46px;min-height:46px;padding-block:0;padding-right:40px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23686d76' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:20px}
 :root body #contractDialog .contract-stamp :is(input[type=date],.contract-stamp-employee select){height:48px;min-height:48px}
}

/* Desktop-only density; preserve the approved large tablet touch layout. */
@media (hover:hover) and (pointer:fine){
 :root #memberDialog[open][data-ui-dialog]{--ui-dialog-inset:14px;--ui-dialog-width:calc(100vw - 28px);--member-control-height:40px;width:calc(100vw - 28px)!important;max-width:calc(100vw - 28px)!important;height:calc(100dvh - 28px)!important;max-height:calc(100dvh - 28px)!important;padding:16px!important}
 :root #memberDialog[data-ui-dialog] .member-detail-tabs{padding:5px;margin-bottom:10px}
 :root #memberDialog[data-ui-dialog] .member-detail-tabs .action{min-height:44px;padding:8px;font-size:14px}
 :root #memberDialog[data-ui-dialog] .member-detail-body{padding:10px}
 :root #memberDialog .member-profile-column{gap:4px}
 :root #memberDialog .member-profile h3{font-size:14px;padding-bottom:8px;margin-bottom:2px}
 :root #memberDialog .member-profile-column>label{gap:4px;font-size:12px;line-height:1.4}
 :root #memberDialog .member-profile-column :is(input,select,textarea){height:40px;min-height:40px;padding:8px 10px;font-size:15px}
 :root #memberDialog .member-profile-column textarea{height:68px;min-height:68px}
 :root #memberDialog .member-profile-aside{gap:7px}
 :root #memberDialog .member-profile-aside .member-photo{width:min(clamp(140px,calc(100dvh - 600px),360px),100%);aspect-ratio:1;align-self:center;font-size:40px}
 :root #memberDialog .member-profile-aside .action{min-height:36px;font-size:13px;padding:6px 10px}
 :root #memberDialog .member-status-control{gap:4px;margin:0}
 :root #memberDialog .member-status-control label{min-height:24px}
 :root #memberDialog .member-profile-aside dl{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 10px;padding-top:8px;align-items:start}
 :root #memberDialog .member-profile-aside dt{font-size:11px}
 :root #memberDialog .member-profile-aside dd{font-size:13px;margin:0;text-align:right;overflow-wrap:anywhere}
 :root #memberDialog .member-profile-hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;margin:0}
}
/* Handset controls remain touch-sized and use 16px text to avoid iOS focus zoom. */
@media(max-width:600px){
 :root #memberDialog[open][data-ui-dialog]{--member-control-height:48px;padding:12px!important}
 :root #memberDialog[data-ui-dialog] .member-detail-tabs{padding:5px;margin-bottom:12px}
 :root #memberDialog[data-ui-dialog] .member-detail-tabs .action{min-height:48px;font-size:14px;padding:8px 10px}
 :root #memberDialog[data-ui-dialog] .member-detail-body{padding:12px}
 :root #memberDialog .member-profile-column{gap:10px}
 :root #memberDialog .member-profile h3{font-size:14px;padding-bottom:9px}
 :root #memberDialog .member-profile-column>label{font-size:12px;gap:5px}
 :root #memberDialog .member-profile-column :is(input,select,textarea){height:48px;min-height:48px;padding:10px;font-size:16px}
 :root #memberDialog .member-profile-column textarea{height:80px;min-height:80px}
}

/* Contract creation retains its existing two-column layout, with visible actions. */
:root dialog.ops-contract-create[open][data-ui-dialog]{--ui-dialog-width:1800px;--ui-dialog-inset:16px}
:root body dialog.ops-contract-create[data-ui-dialog][data-ui-size]>.ui-dialog-form>footer{background:transparent!important;border-top:0;box-shadow:none}

/* Dialogs never require horizontal scrolling; content must reflow rather than be clipped. */
:root body dialog[open][data-ui-dialog][data-ui-size=wide]:not(.settings-dialog){--ui-dialog-width:1920px;--ui-dialog-inset:16px}
:root body :is(dialog,.discount-modal) :is(.member-detail-tabs,.employee-tabs,.contract-mask-tabs,.ops-subscription-tabs,.ops-tabs,.studio-tabs,[role=tablist],.settings-nav nav){display:flex!important;flex-wrap:wrap!important;min-width:0!important;max-width:100%!important;overflow:visible!important;height:auto;gap:6px}
:root body :is(dialog,.discount-modal) :is(.member-detail-tabs,.employee-tabs,.contract-mask-tabs,.ops-subscription-tabs,.ops-tabs,.studio-tabs,[role=tablist],.settings-nav nav)>:is(button,.action,[role=tab]){flex:1 1 auto!important;min-width:0!important;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere;line-height:1.35}
:root body :is(dialog,.discount-modal) :is(form,section,fieldset,article,nav,header,footer,label,dl,dd,.table-scroll,.ui-dialog-content,.modal-body){min-width:0;box-sizing:border-box;max-width:100%}
:root body :is(dialog,.discount-modal) :is(p,dd,dt,legend,h2,h3,h4,pre,code,th,td){overflow-wrap:anywhere}
:root body :is(dialog,.discount-modal) pre{white-space:pre-wrap}
:root body :is(dialog,.discount-modal) :is(input,select,textarea,video,iframe,img,canvas){box-sizing:border-box;min-width:0;max-width:100%}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow]{display:block!important;table-layout:auto!important;width:100%!important;min-width:0!important;max-width:100%!important}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow] :is(thead,tbody,tfoot){display:block!important;width:100%}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow] colgroup{display:none}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow] tr{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr));gap:10px;max-width:100%;padding:12px 8px;border-bottom:1px solid var(--ui-border)}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow] :is(td,th){display:block!important;box-sizing:border-box;width:auto!important;min-width:0!important;max-width:100%;white-space:normal!important;padding:6px!important;border:0;overflow-wrap:anywhere}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow] td[data-dialog-column]::before{content:attr(data-dialog-column);display:block;margin-bottom:5px;font-size:12px;font-weight:600;color:var(--ui-muted)}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow] td[colspan]{grid-column:1/-1}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow] :is(button,.action){max-width:100%;white-space:normal;overflow-wrap:anywhere}
:root body :is(dialog,.discount-modal) table[data-dialog-reflow] :is(td,th,tr,thead,tbody,tfoot)[hidden]{display:none!important}
@media(max-width:900px){:root body :is(dialog,.discount-modal) :is(.contract-mask-layout,.ops-contract-create-layout,.employee-form-layout){grid-template-columns:minmax(0,1fr)}:root body dialog .employee-permissions{min-width:0!important;width:100%}}

/* Every settings page owns a bounded scroll area, including short touch screens. */
:root body dialog.settings-dialog .settings-layout{display:grid!important;height:100%;min-height:0;min-width:0}
:root body dialog.settings-dialog .settings-content{min-height:0;min-width:0;overflow:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
:root body dialog.settings-dialog .settings-nav{min-height:0;min-width:0;overflow-y:auto;overscroll-behavior-y:contain}
@media(max-width:900px){
 :root body dialog.settings-dialog .settings-layout{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important}
 :root body dialog.settings-dialog .settings-nav{max-height:min(38dvh,260px);position:relative;top:auto}
}
@media(any-pointer:coarse){
 :root body dialog[open][data-ui-dialog][data-ui-size]:not(.settings-dialog){max-height:calc(var(--ui-viewport-height,100dvh) - var(--ui-dialog-inset,12px)*2)!important}
 :root body dialog.settings-dialog[open]{inset:auto 0 auto!important;top:var(--ui-viewport-top,0px)!important;height:var(--ui-viewport-height,100dvh)!important;max-height:var(--ui-viewport-height,100dvh)!important}
 :root body :is(dialog,.discount-modal)[data-ui-dialog] :is(.member-detail-tabs,.employee-tabs,.contract-mask-tabs,.ops-subscription-tabs,.ops-tabs,.studio-tabs,[role=tablist]){flex-shrink:0;max-height:calc(var(--ui-viewport-height,100dvh)*.22);overflow-y:auto!important;overscroll-behavior-y:contain}
 :root body dialog :is(.ui-dialog-content,.member-detail-body,.employee-tab-panel,.contract-detail-body,.agenda-course-content,.entry-form-content){-webkit-overflow-scrolling:touch;scroll-padding-bottom:20px}
}
@media(any-pointer:coarse) and (min-width:601px){
 :root body #memberDialog[open][data-ui-dialog]{top:var(--ui-viewport-top,0px)!important;max-height:var(--ui-viewport-height,100dvh)!important;height:var(--ui-viewport-height,100dvh)!important}
}

@media(any-pointer:coarse){
 :root.ui-viewport-reduced body dialog[open][data-ui-dialog][data-ui-size]:not(.settings-dialog){inset:calc(var(--ui-viewport-top,0px) + var(--ui-viewport-height,100dvh)/2) auto auto 50%!important;margin:0!important;transform:translate(-50%,-50%)!important}
}
@media(any-pointer:coarse) and (min-width:601px){
 :root.ui-viewport-reduced body #memberDialog[open][data-ui-dialog]{inset:var(--ui-viewport-top,0px) auto auto 0!important;transform:none!important}
}
@media(max-width:900px){:root body dialog.settings-dialog .settings-nav{max-height:min(calc(var(--ui-viewport-height,100dvh)*.38),260px)}}
@media(any-pointer:coarse){
 :root.ui-viewport-reduced body [data-ui-dialog]>header{margin-bottom:8px!important;padding-bottom:8px!important}
 :root.ui-viewport-reduced body [data-ui-dialog]>header :is(h2,h3){font-size:20px!important}
 :root.ui-viewport-reduced body [data-ui-dialog][data-ui-size] :is(footer,.modal-footer){padding:8px!important}
}

/* Compact contract detail: one header, generous separation, no sideways navigation. */
:root body #contractDialog{width:calc(100vw - 28px);max-width:2200px}
:root body #contractDialog>header{display:flex;align-items:center;gap:20px;padding:16px 24px}
:root body #contractDialog .contract-header-member{margin-left:0;font-size:18px;font-weight:600;overflow-wrap:anywhere}
:root body #contractDialog .contract-mask-layout{grid-template-columns:minmax(0,.65fr) minmax(0,1.35fr);gap:40px;padding-top:20px}
:root body #contractDialog .contract-mask-fields.compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
:root body #contractDialog .contract-mask-fields.compact .contract-mask-field{padding:8px 0;background:white;border:0;border-bottom:1px solid var(--line);border-radius:0}
:root body #contractDialog .contract-calendar{max-width:350px;margin-top:18px}
:root body #contractDialog .contract-calendar-day{min-height:26px;padding:4px}
:root body #contractDialog .contract-mask-tabs{background:var(--surface,#f1f3f3);border:0;border-radius:12px;padding:6px}
:root body #contractDialog .contract-mask-tabs button{padding:10px 8px;border:0;border-radius:9px}
:root body #contractDialog .contract-mask-tabs button[aria-selected=true]{background:white;color:var(--brand)}
:root body #contractDialog .contract-period-actions{display:flex;gap:10px;margin-bottom:18px}
:root body #contractDialog .contract-period-actions [aria-pressed=true]{background:var(--brand);color:white}
:root body #contractDialog [data-period-content][hidden]{display:none}
@media(min-width:1400px){:root body #contractDialog .contract-mask-tabs{flex-wrap:nowrap!important}:root body #contractDialog .contract-mask-tabs button{white-space:nowrap!important}}
@media(max-width:1000px){:root body #contractDialog .contract-mask-layout{grid-template-columns:minmax(0,1fr);gap:24px}}
@media(max-width:600px){:root body #contractDialog>header{padding:12px;gap:10px}:root body #contractDialog .contract-header-member{font-size:14px}:root body #contractDialog .contract-mask-fields.compact{grid-template-columns:repeat(2,minmax(0,1fr))}}
:root body #contractDialog .contract-mask-general .contract-mask-fields>:nth-child(2){grid-column:auto}
:root body #contractDialog .contract-mask-note:has(p:empty){display:none}
@media(max-width:1200px){:root body #contractDialog .contract-mask-layout{grid-template-columns:minmax(0,1fr);gap:24px}}

/* Contract billing follows the detail summary: two columns, dates last. */
:root body .ops-contract-create .ops-contract-create-billing-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:540px){:root body .ops-contract-create .ops-contract-create-billing-grid{grid-template-columns:minmax(0,1fr)}}

.member-reports-dialog{width:min(96vw,1200px);max-width:calc(100vw - 24px)}.report-profile-photo{display:block;width:64px;height:64px;object-fit:cover;border-radius:8px;margin-top:8px}.member-reports-dialog .member-detail-body{min-height:0;overflow:auto}.member-reports-dialog .members-table{min-width:680px}

/* Active navigation/filter/choice surfaces share one tenant-derived selection token.
   Deliberate allowlist: no semantic status badges, health levels, chart series,
   booked/cancelled courses or individually assigned staff/course colours. */
:root body :is(
 #sidebar.sidebar .nav button.active,
 .sidebar .nav button.active,
 .shell-bottom-nav button.active,
 .side button.selected,
 .settings-dialog .settings-nav nav button.active,
 .settings-nav nav button.active,
 .view-tabs .view-tab.active,
 button.pill:is(.active,[aria-pressed=true],:has(input:checked)),
 .column-search.is-filtered,
 .member-filter-toggle[aria-pressed=true],
 #memberReset[aria-pressed=true],
 #contractArchive[aria-pressed=true],
 #view-customers .member-notice-action[aria-pressed=true],
 #memberDialog .member-detail-tabs .action.selected,
 #contractDialog .contract-mask-tabs button[aria-selected=true],
 #contractDialog .contract-period-actions [aria-pressed=true],
 .settings-dialog .studio-tabs .action:is(.selected,[aria-pressed=true]),
 .employee-tabs button[aria-selected=true],
 .employee-status button[aria-pressed=true],
 .customer-tabs button[aria-selected=true],
 .ops-tabs :is(button.active,button.selected,button[aria-selected=true]),
 .ops-subscription-tabs .action[aria-selected=true],
 .training-mode-tabs button[aria-pressed=true],
 .exercise-equipment-grid .exercise-equipment-choice[aria-pressed=true],
 .shift-week-header button.selected,
 .ops-checkbox-grid .ops-check:has(input:checked),
 .ops-customer-results [role=option][aria-selected=true],
 .training-plan-list .plan-archive-toggle[aria-pressed=true],
 .agenda-view-switch button.active,
 .agenda-settings-tabs button.active,
 .agenda-registers button.active,
 .agenda-mini-grid button.selected,
 .agenda-legend button.selected,
 .agenda-staff-list button.selected,
 .course-venue-card.selected,
 .date-filter-mode [aria-pressed=true],
 .date-filter-days button.selected,
 .contract-calendar-day.selected,
 .payroll-tabs button[aria-selected=true],
 .operator-payroll-tabs [aria-selected=true],
 .topbar .tab.active,
 .filter-option.active,
 .discount-type.active,
 .payment-choice:is(.active,.selected),
 .purchases-subtab.active,
 .action[aria-expanded=true],
 [data-ui-dialog] :is(.customer-row,.invoice-row).selected,
 .phone-frame .bottom-nav>button.active,
 .phone-frame .app-header .shop-link.active,
 .phone-frame .app-tile.selected,
 .phone-frame :is(.page-tabs,.appointment-tabs,.measurement-tabs,.ts-period-tabs) :is(button.active,[data-state=active],[aria-selected=true]),
 .phone-frame .week-strip button.selected,
 .phone-frame .filter-chip.active,
 .phone-frame .service-option.selected,
 .phone-frame .slot-grid button.selected,
 .phone-frame .appointment-calendar button.selected,
 .phone-frame .calendar-box button[data-selected-single=true],
 .phone-frame .admin-tabs button.active,
 .phone-frame .ts-source button[aria-pressed=true]
){background:var(--selection-active-bg,#5b5b5b)!important;color:var(--selection-active-fg,#fff)!important;border-color:var(--selection-active-border,var(--selection-active-bg,#5b5b5b))!important;box-shadow:none!important}
:root body :is(.nav button.active,.settings-nav button.active,.view-tab.active,.pill.active,.action.selected,[role=tab][aria-selected=true],.date-filter-days button.selected,.agenda-mini-grid button.selected):not(:disabled):not([aria-disabled=true]){opacity:1}
/* Icons and labels with their own older accent rules must follow the selected surface. */
:root body button.pill:is(.active,[aria-pressed=true])>span:not(.member-notice-badge){background:transparent;color:inherit}
:root body :is(.sidebar .nav button.active,.settings-nav nav button.active,.view-tabs .view-tab.active,button.pill.active) svg{color:var(--selection-active-fg,#fff);opacity:1}
:root body .column-search.is-filtered :is(input,select,button,svg){color:var(--selection-active-fg,#fff)}
/* Native select popups use the normal surface palette, independent of the selected field. */
:root body .column-search.is-filtered select :is(option,optgroup){background:var(--surface,#fff);color:var(--ink,#242424)}
:root body .phone-frame .app-tile.selected :is(.tile-icon,.tile-arrow,strong),
:root body .phone-frame .service-option.selected :is(strong,span,small),
:root body .phone-frame .week-strip button.selected :is(strong,span){color:var(--selection-active-fg,#fff)}
:root body .phone-frame .app-tile.selected .tile-icon{background:transparent}
@media(forced-colors:active){:root body :is(.nav button,.action,.pill,[role=tab],[role=option]):is(.active,.selected,[aria-selected=true],[aria-pressed=true]){outline:2px solid Highlight;outline-offset:-2px}}

/* Nutzerauftrag 15.11.2026 06:30: In allen Pop-ups steht der Kundenname links direkt nach dem Titel; Schliessen bleibt rechts. */
:root body dialog>header:has(>.dialog-header-subject){display:flex;justify-content:flex-start;align-items:center;gap:16px}
:root body dialog>header>.dialog-header-subject{margin-left:0;font-size:18px;font-weight:600;color:var(--text,inherit);overflow-wrap:anywhere;min-width:0}
:root body dialog>header>.dialog-header-subject:empty{display:none}
:root body dialog>header:has(>.dialog-header-subject)>.ui-close{margin-left:auto;flex:none}
:root body #dialogTitle .dialog-header-subject{margin-left:16px;font-size:18px;font-weight:600;color:var(--text,inherit)}
@media(max-width:600px){:root body dialog>header>.dialog-header-subject,:root body #dialogTitle .dialog-header-subject{font-size:14px}}
/* Nutzerauftrag 16.11.2026: Standort-Postfächer unter Mein Studio › E-Mail */
.studio-mailbox-locations{display:grid;gap:12px;margin-top:8px}.studio-mailbox-locations h3{margin:8px 0 0;font-size:16px}
.studio-mailbox-location{display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) auto auto;gap:10px;align-items:end;padding:12px 0;border-top:1px solid var(--border)}
.studio-mailbox-location .studio-mailbox-location-state{grid-column:1/-1;margin:0;font-size:13px;color:var(--muted)}
@media(max-width:800px){.studio-mailbox-location{grid-template-columns:1fr}}
/* Nutzerauftrag 19.11.2026 11:42: Kundenname im Vertragskopf gleich gross und gleich gewichtet wie der Vertragstitel (h2) – auf allen Breiten. */
:root body #contractDialog>header>h2+.contract-header-member{font-size:26px;font-weight:650;letter-spacing:-.65px;line-height:1.3}
:root body #contractDialog>header:has(>.contract-header-member){flex-wrap:wrap;row-gap:2px}
:root body #contractDialog>header:has(>.contract-header-member)>.ui-close{margin-left:auto}
/* Nutzerauftrag 19.11.2026 11:51/11:52: Register «Unterschrift & PDF» rot bei fehlender, grün bei vorhandener Kundenunterschrift – auch im ausgewählten Zustand. */
:root body #contractDialog .contract-mask-tabs button[role=tab][data-signature-state=open]{color:#b42318;font-weight:600}
:root body #contractDialog .contract-mask-tabs button[role=tab][data-signature-state=signed]{color:#1f7a3a;font-weight:600}
:root body #contractDialog .contract-mask-tabs button[role=tab][aria-selected=true][data-signature-state=open]{color:#b42318!important}
:root body #contractDialog .contract-mask-tabs button[role=tab][aria-selected=true][data-signature-state=signed]{color:#1f7a3a!important}
/* Nutzerauftrag 19.11.2026 11:54/11:55: Vertragsrechnungen – Inhalt beginnt exakt unter dem ersten Buchstaben der Überschrift (gleicher linker Innenabstand für Kopf und Zeilen, auch bei abweichenden Dialog-Tabellenregeln). */
@media(min-width:601px){
 :root body dialog .contract-invoice-list th{padding:0!important;text-align:left!important}
 :root body dialog .contract-invoice-list th>button{padding:12px 16px!important;margin:0!important;justify-content:flex-start!important;text-align:left!important;text-indent:0}
 :root body dialog .contract-invoice-list td{padding:12px 16px!important;text-align:left!important;text-indent:0}
 :root body dialog .contract-invoice-list td>:is(button,a,span):first-child{margin-left:0!important;padding-left:0!important;text-align:left!important}
}
/* Feste Nutzerregel 19.11.2026 12:20 (David): jede Ladeanimation ist derselbe Ring – immer exakt in der Bildschirmmitte,
   128 px Durchmesser, 12 px Ringbreite, Studiofarbe, kein Text. Studio-Seiten laden loading.css nicht, daher hier die Studio-Fassung. */
:root{--msa-loader-size:76px;--msa-loader-stroke:12px}
@keyframes msa-loader-turn{to{transform:rotate(360deg)}}
:root body .ui-loading-ring{display:block;position:fixed;left:50%;top:50%;margin:calc(var(--msa-loader-size) / -2) 0 0 calc(var(--msa-loader-size) / -2);z-index:2147482800;pointer-events:none;box-sizing:border-box;width:var(--msa-loader-size);height:var(--msa-loader-size);border:var(--msa-loader-stroke) solid color-mix(in srgb,var(--brand-primary,var(--primary,var(--brand,#a8996b))) 18%,transparent);border-top-color:var(--brand-primary,var(--primary,var(--brand,#a8996b)));border-radius:50%;animation:msa-loader-turn 1s linear infinite}
:root body .initial-loader-spinner{position:fixed;left:50%;top:50%;margin:calc(var(--msa-loader-size) / -2) 0 0 calc(var(--msa-loader-size) / -2)!important;box-sizing:border-box;width:var(--msa-loader-size)!important;height:var(--msa-loader-size)!important;border-width:var(--msa-loader-stroke)!important}
:root body .initial-loader-card{position:static;transform:none!important;margin-top:calc(var(--msa-loader-size) + 56px)}
@media(prefers-reduced-motion:reduce){:root body .ui-loading-ring{animation:none;border-style:dotted;border-top-style:solid}}

/* Nutzerentscheid David 19.11.2026 14:22: überall genau der iOS-Ladekreis – weisses abgerundetes Kästchen (76 px) mit
   Strahlenkranz in Studiofarbe (8 Schritte), immer exakt in der Bildschirmmitte. Ersetzt den grossen Ring vom 12:20. */
:root body :is(.ui-loading-ring,.initial-loader-spinner,.native-boot-ring,.shop-handoff-ring,.entry-loading-ring){position:fixed!important;left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;margin:-38px 0 0 -38px!important;width:76px!important;height:76px!important;box-sizing:border-box!important;border:0!important;border-radius:18px!important;background:#fff!important;box-shadow:0 6px 24px rgba(31,32,35,.14)!important;animation:none!important;transform:none!important;z-index:2147482800;pointer-events:none}
:root body :is(.ui-loading-ring,.initial-loader-spinner,.native-boot-ring,.shop-handoff-ring,.entry-loading-ring)::before{content:'';position:absolute;left:50%;top:50%;width:40px;height:40px;margin:-20px 0 0 -20px;background:var(--brand-primary,var(--primary,var(--accent,#a3966b)));-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%221.0%22%20transform%3D%22rotate%280%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.89%22%20transform%3D%22rotate%28-45%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.78%22%20transform%3D%22rotate%28-90%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.67%22%20transform%3D%22rotate%28-135%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.56%22%20transform%3D%22rotate%28-180%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.45%22%20transform%3D%22rotate%28-225%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.34%22%20transform%3D%22rotate%28-270%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.23%22%20transform%3D%22rotate%28-315%2050%2050%29%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%221.0%22%20transform%3D%22rotate%280%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.89%22%20transform%3D%22rotate%28-45%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.78%22%20transform%3D%22rotate%28-90%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.67%22%20transform%3D%22rotate%28-135%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.56%22%20transform%3D%22rotate%28-180%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.45%22%20transform%3D%22rotate%28-225%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.34%22%20transform%3D%22rotate%28-270%2050%2050%29%22%2F%3E%3Cline%20x1%3D%2250%22%20y1%3D%229%22%20x2%3D%2250%22%20y2%3D%2229%22%20stroke%3D%22%23000%22%20stroke-width%3D%229%22%20stroke-linecap%3D%22round%22%20stroke-opacity%3D%220.23%22%20transform%3D%22rotate%28-315%2050%2050%29%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;animation:msa-spokes .8s steps(8) infinite}
@keyframes msa-spokes{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){:root body :is(.ui-loading-ring,.initial-loader-spinner,.native-boot-ring,.shop-handoff-ring,.entry-loading-ring)::before{animation:none}}
/* David 19.11.2026 17:02: zuletzt geöffneter Listeneintrag bleibt in der Kundenfarbe umrahmt (nicht eingefärbt). */
:root body tr[data-last-opened]>td,:root body tr[data-last-opened]>th{box-shadow:inset 0 2px 0 var(--brand-primary,var(--brand)),inset 0 -2px 0 var(--brand-primary,var(--brand))}
:root body tr[data-last-opened]>:first-child{box-shadow:inset 2px 0 0 var(--brand-primary,var(--brand)),inset 0 2px 0 var(--brand-primary,var(--brand)),inset 0 -2px 0 var(--brand-primary,var(--brand))}
:root body tr[data-last-opened]>:last-child{box-shadow:inset -2px 0 0 var(--brand-primary,var(--brand)),inset 0 2px 0 var(--brand-primary,var(--brand)),inset 0 -2px 0 var(--brand-primary,var(--brand))}
/* Einheitliches Pulldown, Standard A (David 20.11.2026): Haken links beim gewählten Eintrag, keine Farbfläche. */
.ui-select-list{position:fixed;inset:auto;margin:0;z-index:2147483000;box-sizing:border-box;padding:5px;border:1px solid var(--ui-border,var(--border,#dce1e8));border-radius:12px;background:var(--ui-surface,var(--surface,#fff));color:var(--ui-ink,var(--ink,#1c2330));box-shadow:0 10px 30px rgba(20,24,32,.16);overflow-y:auto;overscroll-behavior:contain;font:inherit;font-size:14px;line-height:1.4;text-align:left}
.ui-select-option{display:flex;align-items:flex-start;gap:8px;min-height:40px;box-sizing:border-box;padding:10px 12px 10px 8px;border-radius:8px;cursor:pointer;font-weight:400;overflow-wrap:anywhere}
.ui-select-option.is-active{background:var(--hover,rgba(20,24,32,.06))}
.ui-select-option[aria-selected=true]{font-weight:600}
.ui-select-option[aria-disabled=true]{color:var(--ui-muted,var(--muted,#737d8c));cursor:default}
.ui-select-check{flex:none;width:18px;height:20px;position:relative}
.ui-select-option[aria-selected=true]>.ui-select-check::before,.course-choice-option[aria-selected=true]::before,.phone-location-option[aria-selected=true]::before{content:'';position:absolute;left:5px;top:3px;width:5px;height:10px;border:solid var(--brand-accent,var(--ui-accent,currentColor));border-width:0 2px 2px 0;transform:rotate(45deg)}
.ui-select-text{min-width:0;flex:1}.ui-select-text small{display:block;font-size:12px;font-weight:400;color:var(--ui-muted,var(--muted,#737d8c))}
.ui-select-group{padding:8px 12px 4px 34px;font-size:12px;color:var(--ui-muted,var(--muted,#737d8c))}
@media (pointer:coarse){.ui-select-option{min-height:44px;font-size:16px}}
/* David 22.11.2026, Mockup C: Pulldown am Handy als Liste von unten. */
.ui-select-option[hidden],.ui-select-group[hidden],.ui-select-sheet-empty[hidden]{display:none}
.ui-select-sheet{position:fixed;inset:0 0 auto;z-index:2147483000;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;overflow:hidden;display:flex;align-items:flex-end;background:rgba(40,43,50,.42);color:var(--ui-ink,var(--ink,#1c2330));font:inherit;text-align:left}
.ui-select-sheet-panel{box-sizing:border-box;width:100%;max-height:min(82%,620px);display:flex;flex-direction:column;gap:10px;padding:9px 14px calc(14px + env(safe-area-inset-bottom,0px));border-radius:22px 22px 0 0;background:var(--ui-surface,var(--surface,#fff));box-shadow:0 -10px 34px rgba(0,0,0,.2)}
.ui-select-sheet-grab{flex:none;width:42px;height:5px;margin:0 auto 2px;border-radius:9px;background:#cfcdc7}
.ui-select-sheet h3{flex:none;margin:0;font-size:20px;line-height:1.2;letter-spacing:-.02em;overflow-wrap:anywhere}
.ui-select-sheet-search{flex:none;box-sizing:border-box;width:100%;min-height:44px;padding:0 13px;border:1px solid var(--ui-border,var(--border,#dce1e8));border-radius:11px;background:#fff;color:inherit;font:inherit;font-size:16px}
.ui-select-list.is-sheet{position:static;flex:1 1 auto;min-height:0;max-height:none;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent;font-size:16px;-webkit-overflow-scrolling:touch}
.ui-select-list.is-sheet .ui-select-option{min-height:50px;align-items:center;padding:12px 10px 12px 8px;border-radius:0;border-bottom:1px solid #efede8;font-size:16px}
.ui-select-list.is-sheet .ui-select-option.is-active{background:transparent}
.ui-select-sheet-empty{flex:none;margin:0;padding:14px 8px;color:var(--ui-muted,var(--muted,#737d8c))}
.ui-select-sheet-cancel{flex:none;width:100%;min-height:46px}
/* Mit Tastatur zählt jede Zeile: Titel und Abbrechen weichen der Trefferliste, die iOS-Leiste überdeckt nichts. */
.ui-select-sheet.has-keyboard .ui-select-sheet-panel{max-height:calc(100% - 12px);padding-bottom:58px}
.ui-select-sheet.has-keyboard h3,.ui-select-sheet.has-keyboard .ui-select-sheet-cancel{display:none}
/* Bestehende Auswahlmenüs im selben Standard */
:root body .shared-location-option{flex-direction:row-reverse;justify-content:flex-end;gap:8px;padding-left:8px}
:root body .shared-location-option[aria-checked=true]{background:transparent;font-weight:600}
:root body .shared-location-option:hover{background:var(--hover)}
:root body .shared-location-check{width:18px;text-align:center}
:root body .shared-location-check[hidden]{display:block;visibility:hidden}
:root body .phone-location-option{position:relative;padding-left:34px}
:root body .phone-location-option[aria-selected=true]{background:transparent;font-weight:600}
:root body .phone-location-option[aria-selected=true]::before{left:14px;top:14px}
:root body dialog :has(>.course-choice-menu){position:relative}
:root body dialog .course-choice-menu{position:absolute;left:0;right:0;top:100%;z-index:5;margin-top:4px;gap:0;border-radius:12px;box-shadow:0 10px 30px rgba(20,24,32,.16);max-height:min(300px,45dvh)}
:root body dialog .course-choice-option{position:relative;padding:10px 12px 10px 34px;background:transparent}
:root body dialog .course-choice-option[aria-selected=true]{background:transparent}
:root body dialog .course-choice-option:is(:hover,:focus-visible){background:var(--hover,rgba(20,24,32,.06))}
:root body dialog .course-choice-option[aria-selected=true]::before{left:13px;top:13px}
:root body dialog .course-choice-toggle{position:relative;padding-right:38px}
:root body dialog .course-choice-toggle::after{content:'';position:absolute;right:16px;top:50%;width:7px;height:7px;margin-top:-6px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);opacity:.6}
/* David 23.11.2026: Am Handy gibt es keinen CSV-Export. Computer und Tablet behalten ihn; CSV-Importe bleiben unberührt. */
@media(max-width:760px){:root body :is(.csv-export,.measurement-csv-export,[data-csv],[data-account-csv],[data-member-contract-csv],#accountingCsvButton,#dashCsv,#reportExport,#csv){display:none!important}}

/* David 25.11.2026: Ladeanimation auf dem Knopf, wenn eine Aktion länger als 1 s dauert (shared/delayed-busy.mjs). */
button[data-busy-visible]{position:relative;color:transparent!important;pointer-events:none}
button[data-busy-visible]>*{visibility:hidden}
button[data-busy-visible]::after{content:"";position:absolute;top:50%;left:50%;width:18px;height:18px;margin:-9px 0 0 -9px;box-sizing:border-box;border:2px solid transparent;border-color:color-mix(in srgb,var(--primary,#315e53) 20%,transparent);border-top-color:var(--busy-ring,var(--primary,#315e53));border-radius:50%;animation:ui-busy-turn .9s linear infinite}
button.primary[data-busy-visible]::after,button.action.primary[data-busy-visible]::after{border-color:rgba(255,255,255,.35);border-top-color:#fff}
@keyframes ui-busy-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){button[data-busy-visible]::after{animation-duration:2.4s}}
