@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
:root{font-family:'DM Sans',system-ui,sans-serif;color:var(--theme-ink);background:var(--theme-page);font-synthesis:none;--ink:#142c32;--muted:#677b7e;--line:#dce3df;--accent:#246d61}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}button,input,select,textarea{border:1px solid var(--line);border-radius:9px}button{background:var(--theme-surface);color:var(--ink);padding:10px 15px;font-weight:600}button:hover{border-color:var(--theme-line);background:var(--theme-hover)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--theme-focus);outline-offset:3px}button.primary{background:var(--theme-primary);color:var(--theme-on-primary);border-color:var(--theme-primary)}button.primary:hover{background:var(--theme-primary-hover)}.quiet{background:transparent}input,select,textarea{background:var(--theme-surface);padding:10px 12px;max-width:100%;color:var(--ink)}label{font-size:13px;font-weight:600;display:grid;gap:7px}input[type=checkbox]{accent-color:var(--accent);width:17px;height:17px}h1,h2,h3,.brand{font-family:Manrope,system-ui,sans-serif}h1{font-size:34px;line-height:1.2;letter-spacing:-1.2px;margin:8px 0 12px}h2{font-size:21px;letter-spacing:-.5px;margin:0}h3{font-size:16px;margin:0 0 12px}p{line-height:1.6}small,.muted{color:var(--muted)}.eyebrow{font-size:11px;letter-spacing:1.8px;font-weight:700;text-transform:uppercase;color:var(--accent)}.brand{font-size:20px;font-weight:800;letter-spacing:-.6px;display:flex;align-items:center;gap:11px}.brandmark{background:var(--ink);color:var(--theme-on-primary);border-radius:10px;padding:5px 10px;font-size:24px}.topbar{height:83px;background:var(--theme-surface);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 max(24px,calc((100vw - 1440px)/2));gap:15px}.topbar-right,.inline,.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.private{font-size:11px;border:1px solid var(--line);padding:5px 9px;border-radius:30px;color:var(--theme-muted)}.avatar{border-radius:50%;background:var(--theme-surface-soft);padding:9px 12px;font-weight:700}.page{max-width:1440px;margin:auto;padding:36px 28px 20px}.intro{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:25px}.intro p{margin:0;color:var(--muted);font-size:14px}.toolbar{display:flex;justify-content:space-between;align-items:end;gap:20px;flex-wrap:wrap;background:var(--theme-surface);border:1px solid var(--line);border-radius:14px;padding:18px 22px;margin-bottom:24px}.reliefs{display:flex;gap:5px}.reliefs button{width:42px;padding:10px 0}.reliefs button.selected{background:var(--theme-primary);border-color:var(--theme-primary);color:var(--theme-on-primary)}.check{display:flex;align-items:center;gap:8px;font-size:12px;max-width:230px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}.panel{background:var(--theme-surface);border:1px solid var(--theme-line);border-radius:14px;overflow:hidden}.panel-head{padding:23px 22px 19px;display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap;border-bottom:1px solid var(--line)}.subhead{font-size:12px;color:var(--muted);margin-top:6px}.segmented{display:flex;padding:4px;background:var(--theme-surface-soft);border-radius:9px;gap:2px}.segmented button{border:0;background:transparent;border-radius:6px;padding:7px 11px;font-size:12px;color:var(--muted)}.segmented .selected{background:var(--theme-surface);color:var(--ink);box-shadow:0 1px 4px #0000000c}.month-nav{display:flex;gap:5px}.month-nav button{padding:6px 12px}.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.weekday{padding:13px 8px;text-align:center;font-size:10px;text-transform:uppercase;letter-spacing:1px;color:var(--muted);background:var(--theme-surface-soft);border-bottom:1px solid var(--line)}.day{min-height:113px;padding:10px;border:0;border-right:1px solid var(--theme-line);border-bottom:1px solid var(--theme-line);border-radius:0;text-align:left;display:flex;flex-direction:column;align-items:start;gap:9px;background:var(--theme-surface);position:relative}.day:nth-child(7n){border-right:0}.day:hover{background:var(--theme-hover)}.day.active{box-shadow:inset 0 0 0 2px var(--theme-focus);background:var(--theme-selected)}.day.outside{background:var(--theme-surface-soft);color:var(--theme-muted)}.day .num{font-size:12px;font-weight:600}.day.today .num{border-radius:50%;background:var(--theme-primary);color:var(--theme-on-primary);padding:3px 6px;margin:-3px -6px}.badge{display:inline-flex;border-radius:5px;padding:5px 7px;font-size:11px;font-weight:700;white-space:nowrap;align-items:center;gap:5px}.early{background:#e2f0df;color:#355c38}.late{background:#fff0c6;color:#806017}.night{background:#e3e8f8;color:#475b96}.rest{background:#edf0ed;color:#7c8880}.leave{background:#fae3e9;color:#97516b}.training{background:#f7dfd4;color:#a45e3c}.other{background:#e8e0f3;color:#715397}.day .time{font-size:10px;color:var(--muted)}.modified{position:absolute;right:9px;top:12px;font-size:9px;color:var(--accent)}.legend{padding:15px 22px;display:flex;gap:15px;flex-wrap:wrap;font-size:11px;color:var(--muted);border-top:1px solid var(--line)}.legend span{display:flex;align-items:center;gap:6px}.dot{width:8px;height:8px;border-radius:50%}.dot.early{background:#91bd82}.dot.late{background:#e3be58}.dot.night{background:#8397d1}.dot.rest{background:#b4bdb5}.side{display:grid;gap:20px}.card{padding:22px}.card-date{font-size:21px;font-weight:800;margin:7px 0 18px;letter-spacing:-.7px}.shift-large{padding:19px;border-radius:10px;margin:0 0 17px}.shift-large h2{margin:10px 0 5px;font-size:25px}.shift-large p{margin:0;font-size:13px}.full{width:100%}.rule{border:0;border-top:1px solid var(--line);margin:20px 0}.cover-row{display:flex;justify-content:space-between;align-items:center;margin:14px 0;gap:10px;font-size:12px}.cover-row p{margin:4px 0 0;font-size:11px;color:var(--muted)}.callout{background:var(--theme-surface-soft);border-radius:10px;padding:15px;font-size:12px;line-height:1.6;color:var(--theme-muted)}.callout strong{color:var(--theme-ink)}.source-note{font-size:11px;line-height:1.7;color:var(--muted);margin:20px 0}.footer{padding:24px 0 5px;display:flex;justify-content:space-between;gap:20px;font-size:11px;color:var(--muted)}.table-scroll{overflow:auto;max-height:630px}.rota{border-collapse:separate;border-spacing:0;width:100%;font-size:12px}.rota th,.rota td{border-right:1px solid var(--theme-line);border-bottom:1px solid var(--line);padding:8px;min-width:91px;text-align:center}.rota th{background:var(--theme-surface-soft);position:sticky;top:0;z-index:2;font-size:11px}.rota .rowhead{position:sticky;left:0;z-index:3;min-width:85px;background:var(--theme-surface)}.rota th.rowhead{z-index:4}.rota .selected-row{background:var(--theme-selected)}.rota td button{border:0;background:none;padding:5px 0;font-size:10px;width:100%}.rota td.chosen{box-shadow:inset 0 0 0 2px var(--accent)}.rota .tabletime{display:block;margin-top:6px;white-space:nowrap}.day-view{padding:24px}.day-view .day-shifts{display:grid;gap:12px}.relief-shift{display:flex;align-items:center;gap:16px;border:1px solid var(--line);border-radius:10px;padding:14px;background:var(--theme-surface);width:100%;text-align:left}.relief-shift .letter{font-weight:800;font-size:21px;background:var(--theme-surface-soft);border-radius:8px;padding:10px 16px}.relief-shift.active{border-color:var(--accent);background:var(--theme-selected)}.relief-shift .detail{flex:1}.relief-shift .detail p{margin:5px 0 0;font-size:12px}.next-note{font-size:11px;margin:10px 0;color:var(--muted)}.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);padding:13px 20px;border-radius:10px;background:var(--theme-primary);color:var(--theme-on-primary);z-index:20;box-shadow:0 6px 20px #0002;max-width:90vw;font-size:13px}.alert{padding:13px 17px;background:var(--theme-warning-surface);color:var(--theme-warning-ink);border:1px solid var(--theme-warning-border);border-radius:10px;font-size:12px;line-height:1.7;margin-bottom:20px}.error{color:var(--theme-danger-ink);font-size:13px;line-height:1.6}.auth{max-width:460px;margin:9vh auto;background:var(--theme-surface);border:1px solid var(--line);border-radius:18px;padding:36px;box-shadow:0 12px 50px #17372e08}.auth h1{font-size:28px;margin-top:28px}.auth p{font-size:13px;color:var(--muted)}.auth form{display:grid;gap:18px;margin:24px 0 15px}.auth .switch{display:flex;justify-content:space-between;gap:8px}.link{padding:6px 0;border:0;background:none;color:var(--accent);font-size:12px;text-decoration:underline}.overlay{position:fixed;inset:0;background:var(--theme-overlay);backdrop-filter:blur(3px);z-index:10;display:flex;align-items:center;justify-content:center;padding:20px}.dialog{max-height:90vh;overflow:auto;background:var(--theme-surface);border:1px solid var(--line);border-radius:16px;width:640px;box-shadow:0 20px 80px #0002}.dialog-head{padding:23px 25px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.dialog-body{padding:25px}.dialog form{display:grid;gap:18px}.formrow{display:grid;grid-template-columns:1fr 1fr;gap:16px}.dialog-foot{padding:18px 25px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px}.choices{display:flex;gap:18px;flex-wrap:wrap}.preview-list{max-height:230px;overflow:auto;border:1px solid var(--line);border-radius:9px;padding:12px;font-size:12px}.preview-list p{margin:6px 0}.history-item{padding:14px 0;border-bottom:1px solid var(--line);font-size:12px;line-height:1.6}.history-item p{margin:5px 0}.member{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;font-size:12px;overflow-wrap:anywhere}.share-link{width:100%;margin:12px 0;font-size:11px}.settings-section{margin:0 0 28px}.screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:1600px){.page{padding-top:44px}.day{min-height:125px}}@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr) 270px}.day{padding:8px;min-height:100px}.day .time{font-size:9px}.page{padding:24px 18px}.card{padding:18px}.toolbar{padding:16px}.topbar{padding:0 20px}.intro h1{font-size:30px}}@media(max-width:850px){.workspace{grid-template-columns:1fr}.side{grid-template-columns:1fr 1fr}.topbar-right .account-email{display:none}.intro{align-items:start}.intro .actions{justify-content:flex-end}.day{min-height:109px}.panel-head{padding:18px}.toolbar{gap:15px}.footer{flex-direction:column;gap:7px}}@media(max-width:550px){.topbar{height:68px;padding:0 16px}.brand{font-size:17px}.private{display:none}.topbar-right{gap:4px}.topbar-right button{padding:7px;font-size:11px}.page{padding:25px 12px}.intro{display:block}.intro h1{font-size:29px}.intro .actions{justify-content:start;margin-top:18px}.intro .actions button{font-size:12px;padding:9px 12px}.toolbar{padding:14px;display:grid;grid-template-columns:1fr 1fr;gap:18px 12px}.toolbar .relief-control{grid-column:1/-1}.reliefs button{width:46px}.toolbar input[type=date]{width:100%;font-size:12px;padding:9px}.toolbar .check{grid-column:1/-1;max-width:none}.side{grid-template-columns:1fr}.panel-head{gap:14px;padding:17px 13px}.panel-head h2{font-size:18px}.segmented button{padding:6px 10px}.day{min-height:94px;padding:8px 3px;gap:8px;align-items:center}.day .time{font-size:8px;letter-spacing:-.4px}.day .badge{font-size:9px;padding:4px 5px}.day .num{font-size:11px}.day .modified{right:3px;top:8px;font-size:7px}.weekday{font-size:9px;padding:11px 1px}.legend{padding:13px;gap:12px;font-size:10px}.auth{margin:5vh 15px;padding:28px}.dialog-body{padding:18px}.dialog-head{padding:18px}.formrow{gap:12px}.overlay{padding:10px}.dialog{max-height:95vh}.day-view{padding:16px}.card{padding:22px}.intro p{font-size:13px}}
@media print{body{background:var(--theme-surface)}.topbar,.intro .actions,.toolbar,.side,.segmented,.month-nav,.footer,.overlay,.toast{display:none!important}.page{max-width:none;padding:0}.workspace{display:block}.panel{border:1px solid var(--theme-line)}.day{min-height:90px;break-inside:avoid}.table-scroll{overflow:visible;max-height:none}.rota th,.rota td{min-width:0;padding:3px;font-size:8px}.rota .badge{font-size:7px;padding:3px}.rota .tabletime{font-size:6px}.rota .rowhead{min-width:35px}.source-note{font-size:9px}*{-webkit-print-color-adjust:exact;print-color-adjust:exact}}
.rota-selector{display:flex;gap:20px;align-items:end;margin:0 0 20px}.rota-selector label{min-width:260px;max-width:100%}.rota-selector .muted{font-size:12px;padding:10px 0}.builder-block{border:1px solid var(--line);border-radius:10px;padding:14px;margin:0 0 15px}.builder-block legend{font-weight:700;font-size:13px;padding:0 6px}.builder-fields{display:grid;grid-template-columns:70px 1fr 100px 100px;gap:12px;margin-bottom:12px}.builder-fields input,.builder-fields select{width:100%;min-width:0}.builder-block .actions button{font-size:11px;padding:6px 10px}.builder-preview{max-height:350px;overflow:auto;border:1px solid var(--line);border-radius:10px}.builder-preview table{width:100%;border-collapse:collapse;font-size:12px}.builder-preview td,.builder-preview th{text-align:left;padding:10px;border-bottom:1px solid var(--line)}.builder-preview th{position:sticky;top:0;background:var(--theme-surface-soft)}#rotation-total{font-size:12px;color:var(--muted)}@media(max-width:550px){.builder-fields{grid-template-columns:1fr 1fr}.rota-selector{display:block}.rota-selector label{min-width:0}.rota-selector .muted{display:block}}
.share-choice{border:1px solid var(--line);border-radius:10px;margin:12px 0;padding:12px}.share-choice legend{padding:0 7px}.share-choice .check{max-width:none}.share-choice .choices{margin:3px 0 4px}.month-nav{display:flex;align-items:center}.month-nav strong{font-size:12px;white-space:nowrap}.day-view .relief-shift{cursor:default}

.import-original{max-width:100%;max-height:600px;object-fit:contain}.import-pdf{width:100%;height:450px;border:1px solid var(--line)}.import-sources{margin:15px 0}.import-table{border-collapse:collapse;width:100%;font-size:12px}.import-table th,.import-table td{padding:8px;border-bottom:1px solid var(--line);text-align:left}.import-table input{max-width:140px}.import-table p{font-size:11px;min-width:100px}.needs-review{background:var(--theme-warning-surface)}.import-table select{min-width:110px}

.note-icon{position:absolute;right:5px;bottom:5px;width:14px;height:14px;color:var(--theme-danger-ink);line-height:0}.note-icon svg{width:100%;height:100%;fill:var(--theme-on-primary);stroke:currentColor;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.rota td button{position:relative}.rota td .note-icon{bottom:0;right:0;width:12px;height:12px}.rota td:has(.note-icon) button{padding-bottom:15px}

/* Keep intrinsic form/table widths inside the viewport; tables scroll locally. */
html,body,#app{width:100%;min-width:0}
.topbar>* ,.intro>* ,.toolbar>* ,.workspace>* ,.side>* ,.panel-head>* ,.formrow>* ,.rota-selector>*{min-width:0}
.table-scroll,.builder-preview,.dialog,.dialog-body{min-width:0;max-width:100%}
@media screen and (max-width:550px){
 html{-webkit-text-size-adjust:100%}
 .page{width:100%;padding-left:12px;padding-right:12px}
 .topbar{height:auto;min-height:68px;padding:12px;gap:8px}
 .topbar .brand{flex:1;min-width:0;font-size:16px;overflow-wrap:anywhere}
 .brandmark{flex-shrink:0}
 .topbar-right{flex-shrink:0;flex-wrap:nowrap}
 .intro h1{overflow-wrap:anywhere}
 .intro .actions{gap:8px}
 .intro .actions button{max-width:100%;white-space:normal}
 .toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .toolbar label,.rota-selector label{width:100%}
 .rota-selector select{width:100%;min-width:0}
 .reliefs{flex-wrap:wrap}
 .toolbar input[type=date]{min-width:0;width:100%;font-size:16px;padding:9px 4px}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px;min-width:0}
 .formrow{grid-template-columns:repeat(2,minmax(0,1fr))}
 .formrow input,.formrow select{width:100%}
 .dialog{width:100%;max-height:calc(100dvh - 20px)}
 .dialog-head h2{min-width:0;overflow-wrap:anywhere}
 .dialog-body{overflow-wrap:anywhere}
 .choices>*{min-width:0;max-width:100%}
 .calendar .day{min-width:0}
 .auth{width:calc(100% - 30px)}
}

/* Calendar-first shell and dismissible navigation. */
.planner-header{height:68px;justify-content:space-between}
.menu-toggle{display:flex;gap:8px;align-items:center;min-height:44px;flex-shrink:0}
.menu-toggle span{font-size:20px}
.planner-page{padding-top:18px}
.planner-page .rota-selector{margin-bottom:12px}
.planner-page .rota-selector label{width:100%;max-width:520px}
.planner-page .toolbar{justify-content:flex-start;margin-bottom:14px;padding:12px 16px;gap:16px}
.planner-menu{position:fixed;inset:0 auto 0 0;margin:0;width:min(340px,calc(100vw - 36px));max-width:none;height:100dvh;max-height:100dvh;padding:0;border:0;border-radius:0 16px 16px 0;background:var(--theme-surface);color:var(--ink);overflow-y:auto;overscroll-behavior:contain;box-shadow:8px 0 35px #112c3226}
.planner-menu::backdrop{background:var(--theme-overlay);backdrop-filter:blur(2px)}
.drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px;border-bottom:1px solid var(--line)}
.drawer-head h2{font-size:18px}
.drawer-head button{min-width:44px;min-height:44px;padding:8px}
.drawer-actions{display:grid;gap:5px;padding:12px}
.drawer-actions button{text-align:left;min-height:46px;border:0;border-radius:8px;background:transparent;padding:12px;font-size:14px}
.drawer-actions button:hover{background:var(--theme-hover)}
.drawer-actions #delete-rota{color:var(--theme-danger-ink)}
.drawer-options,.drawer-account{margin:0 18px;padding:16px 0;border-top:1px solid var(--line)}
.drawer-options .check{max-width:none;align-items:flex-start;line-height:1.5;margin-bottom:12px}
.drawer-options h3{font-size:13px}
.drawer-account p{font-size:12px;overflow-wrap:anywhere;color:var(--muted)}
body:has(.planner-menu[open]){overflow:hidden}
@media screen and (max-width:550px){
 .planner-header{min-height:58px;padding:8px 12px}
 .planner-header .brand{font-size:16px}
 .planner-header .brandmark{font-size:20px;padding:3px 8px}
 .planner-header .private{display:none}
 .planner-page{padding-top:10px}
 .planner-page .rota-selector{margin-bottom:10px}
 .planner-page .rota-selector label{gap:5px;font-size:11px}
 .planner-page .rota-selector select{padding:9px 10px;min-height:42px}
 .planner-page .toolbar{padding:10px 12px;gap:10px 12px;margin-bottom:10px;grid-template-columns:minmax(0,1fr) 80px}
 .planner-page .relief-control{display:flex;align-items:center;justify-content:space-between;gap:10px}
 .planner-page .relief-control>label{width:auto;font-size:11px;flex-shrink:0}
 .planner-page .reliefs{margin-top:0!important;gap:5px;justify-content:flex-end}
 .planner-page .reliefs button{width:40px;min-height:40px;padding:8px 0}
 .planner-page .toolbar>label{font-size:11px;gap:5px}
 .planner-page #today{align-self:end;min-height:42px;padding:9px}
 .planner-page .panel-head{padding:12px;gap:10px}
 .planner-page .panel-head .subhead{font-size:11px}
 .planner-page .segmented{width:100%}
 .planner-page .segmented button{flex:1;min-height:36px}
 .planner-page .workspace{gap:12px}
 .planner-page .day{min-height:82px}
 .planner-page .weekday{padding:9px 1px}
 .planner-page .legend{padding:10px 12px}
 .planner-page .side{grid-template-columns:1fr}
 .planner-menu{padding-bottom:env(safe-area-inset-bottom)}
}
@media screen and (max-width:360px){.planner-page .reliefs button{width:34px}.planner-header .brand{font-size:14px}}
@media print{.menu-toggle,.planner-menu{display:none!important}}

/* Rota and date controls live in the drawer, leaving the calendar first. */
.planner-page{padding-top:12px}
.drawer-planner-controls{padding:16px 18px;border-bottom:1px solid var(--line)}
.drawer-planner-controls .rota-selector{display:block;margin:0 0 16px}
.drawer-planner-controls .rota-selector label,.drawer-planner-controls .toolbar>label{display:grid;gap:6px;min-width:0;width:100%;font-size:13px;font-weight:700}
.drawer-planner-controls select,.drawer-planner-controls input[type=date]{width:100%;min-width:0;min-height:46px;font-size:16px}
.drawer-planner-controls .toolbar{display:grid;grid-template-columns:minmax(0,1fr) 80px;gap:14px 8px;margin:0;padding:0;border:0;box-shadow:none;background:transparent}
.drawer-planner-controls .relief-control{grid-column:1/-1;min-width:0}
.drawer-planner-controls .relief-control>label{font-size:13px;font-weight:700}
.drawer-planner-controls .reliefs{display:flex;gap:5px;margin-top:8px!important}
.drawer-planner-controls .reliefs button{flex:1;min-width:0;min-height:42px;padding:7px 0}
.drawer-planner-controls #today{align-self:end;min-height:46px;padding:8px 4px;font-size:13px}
@media screen and (max-width:550px){.planner-page{padding-top:8px}}
/* Keep note markers alongside the date instead of over the shift time. */
.day .note-icon{left:5px;top:7px;right:auto;bottom:auto;width:13px;height:13px}
.day:has(.note-icon) .num{margin-left:18px}
@media screen and (max-width:550px){
 .day .note-icon{left:2px;top:7px;width:11px;height:11px}
 .day:has(.note-icon) .num{margin-left:4px}
}

/* On phones, day details open from a second tap instead of occupying space below the month. */
@media screen and (max-width:550px){
 .planner-page.view-month .side{display:none}
 .planner-page.view-month .day{touch-action:manipulation}
}

.planner-footer{display:block;padding:8px 0 4px;margin:0;text-align:center;font-size:10px;line-height:1.3;color:var(--muted)}
@media screen and (max-width:550px){.planner-footer{padding:6px 0 2px;font-size:9px}}

@media screen and (max-width:550px){
 .planner-page.view-all .side{display:none}
 .planner-page.view-all .rota td button{touch-action:manipulation}
}

@media screen and (max-width:550px){
 .planner-page .calendar{touch-action:pan-y}
 .planner-page .table-scroll{overscroll-behavior-x:contain}
}

/* Make a successful month swipe visually distinct from ordinary table scrolling. */
@media screen and (max-width:550px){
 .planner-page .workspace{overflow-x:clip}
 .planner-page .month-slide-next{animation:month-enter-next 440ms cubic-bezier(.2,.75,.25,1) both}
 .planner-page .month-slide-prev{animation:month-enter-prev 440ms cubic-bezier(.2,.75,.25,1) both}
 /* The compact Team table needs half the visual travel, not an easier swipe trigger. */
 .planner-page .team-table.month-slide-next{animation-name:team-month-enter-next}
 .planner-page .team-table.month-slide-prev{animation-name:team-month-enter-prev}
}
@keyframes month-enter-next{from{opacity:.35;transform:translateX(54px)}to{opacity:1;transform:translateX(0)}}
@keyframes month-enter-prev{from{opacity:.35;transform:translateX(-54px)}to{opacity:1;transform:translateX(0)}}
@keyframes team-month-enter-next{from{opacity:.35;transform:translateX(27px)}to{opacity:1;transform:translateX(0)}}
@keyframes team-month-enter-prev{from{opacity:.35;transform:translateX(-27px)}to{opacity:1;transform:translateX(0)}}
@media (prefers-reduced-motion:reduce){.planner-page .month-slide-next,.planner-page .month-slide-prev,.planner-page .team-table.month-slide-next,.planner-page .team-table.month-slide-prev{animation:none}}

/* Calendar shortcuts sit beside the month heading on mobile. */
.date-actions{display:flex;align-items:center;gap:7px;margin-left:auto}
.date-actions .jump-date-button,.date-actions #today{width:44px;height:44px;min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--theme-surface);color:var(--ink);display:grid;place-items:center;padding:0;position:relative}
.date-actions #today{font-size:11px;font-weight:700}
.date-actions .jump-date-button:hover{border-color:var(--theme-line);background:var(--theme-hover)}
.date-actions .jump-date-button:focus-within{outline:3px solid var(--theme-focus);outline-offset:3px}
.date-actions #lookup{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;padding:0;margin:0;border:0}
@media screen and (max-width:550px){
 .planner-page .panel-head>.date-actions{gap:5px;margin-left:auto}
 .planner-page .date-actions .jump-date-button,.planner-page .date-actions #today{width:40px;height:40px;min-width:40px;min-height:40px}
}
/* Centre the date shortcuts in the space beside the month, adapting to narrow phones. */
@media screen and (max-width:550px){
 .planner-page .panel-head>.date-actions{flex:1;justify-content:center;align-self:center;margin-left:0;gap:8px}
 .planner-page .date-actions .jump-date-button,.planner-page .date-actions #today{width:48px;height:48px;min-width:48px;min-height:48px}
 .planner-page .date-actions .jump-date-button svg{width:25px;height:25px}
 .planner-page .date-actions #today{font-size:12px}
}
@media screen and (max-width:370px){
 .planner-page .panel-head>.date-actions{flex:0 0 100%;justify-content:center}
}

/* Past dates are muted; adjacent-month dates remain more faded. */
.day.past:not(.outside){background:var(--theme-surface-soft);color:var(--theme-muted)}
.day.past:not(.outside) .badge,.day.past:not(.outside) .time{opacity:.56}
.day.past:not(.outside):hover{background:var(--theme-hover)}
.day.outside.past .badge,.day.outside.past .time{opacity:.42}
.day.outside:not(.past){background:var(--theme-surface-soft);color:var(--theme-muted)}
.day.outside:not(.past) .badge,.day.outside:not(.past) .time{opacity:.82}
.day.past.active:not(.outside) .badge,.day.past.active:not(.outside) .time{opacity:.9}
.rota th.past-date,.rota td.past-date{background:var(--theme-surface-soft)}
.rota th.past-date button{color:var(--theme-muted)}
.rota td.past-date .badge,.rota td.past-date .tabletime{opacity:.55}
.rota td.past-date.chosen .badge,.rota td.past-date.chosen .tabletime{opacity:.9}
@media print{.day.past:not(.outside),.rota th.past-date,.rota td.past-date{background:var(--theme-surface)}.day.past:not(.outside) .badge,.day.past:not(.outside) .time,.rota td.past-date .badge,.rota td.past-date .tabletime{opacity:1}}

.rotation-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:8px;max-height:55vh;overflow:auto;margin:18px 0}.rotation-day{display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;padding:10px;min-height:104px}.rotation-day strong{font-size:13px}.rotation-day small{color:var(--muted)}.rotation-day.occupied{border:2px solid var(--accent);background:var(--theme-selected)}.rotation-day em{font-size:11px;color:var(--accent);font-style:normal;font-weight:700}@media(max-width:550px){.rotation-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.rotation-day{padding:7px;min-height:98px}.rotation-day .badge{font-size:10px;padding:3px 5px}.rotation-day small{font-size:10px}}

.planner-page .date-actions #add-shift-card{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:10px;font-size:24px;line-height:1;color:var(--accent)}.staged-reliefs{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:10px 0}.staged-reliefs strong{width:100%;font-size:13px}.staged-reliefs button{padding:7px 9px;font-size:12px;background:var(--theme-surface-soft);border-color:var(--theme-line)}@media(max-width:550px){.planner-page .date-actions #add-shift-card{width:40px;height:40px;min-width:40px;min-height:40px}}

.shift-picker-controls{position:sticky;top:-25px;z-index:2;background:var(--theme-surface);border:1px solid var(--line);border-radius:10px;padding:10px;margin:12px 0;display:flex;align-items:center;flex-wrap:wrap;gap:7px;box-shadow:0 4px 12px #142c3212}.shift-picker-controls strong{width:100%;font-size:13px}.shift-picker-controls button,.existing-reliefs button{font-size:12px;padding:7px 9px}.shift-picker-controls #review-add-reliefs{margin-left:auto}.existing-reliefs{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.existing-reliefs strong{width:100%;font-size:13px}.existing-reliefs .marked-remove{background:var(--theme-danger-surface);color:var(--theme-danger-ink)}.rotation-grid{max-height:42vh}
/* Shift identity is independent of the underlying rotation key. */
.relief-chip{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-width:2.1em;padding:.32em .65em;border-radius:999px;background:var(--relief-color);color:var(--relief-ink);font-size:.9em;font-weight:700;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
.planner-page .panel-head .subhead{display:flex;align-items:center;gap:8px;min-height:30px}
.planner-page .panel-head .subhead .relief-chip{font-size:13px;max-width:min(38vw,200px)}
.drawer-planner-controls .appearance-menu-link{display:block;width:100%;min-height:48px;margin-top:12px;text-align:left;border:1px solid var(--theme-line);border-radius:12px;background:var(--theme-surface-soft);color:var(--theme-ink);padding:10px 14px;font-size:14px;font-weight:700;cursor:pointer}
.drawer-planner-controls .reliefs button{width:auto;padding:5px;min-width:42px;flex:0 1 auto}
.drawer-planner-controls .reliefs button .relief-chip{font-size:12px;max-width:110px}
.rota .rowhead .relief-chip{max-width:100px;font-size:12px}
.appearance-list{display:grid;gap:10px;margin:16px 0 20px}.appearance-row{display:grid;grid-template-columns:28px minmax(0,1fr) 72px;gap:10px;align-items:end}.appearance-row label{font-size:12px}.appearance-row input[type=color]{height:44px;padding:3px;width:100%;cursor:pointer}.appearance-key{align-self:center;font-weight:700}

/* A full-width row keeps both short and long shift names centred on the card. */
.planner-page .panel-head>.shift-identity{flex:0 0 100%;width:100%;justify-content:center;text-align:center;margin:0}
.planner-page .panel-head>.shift-identity .relief-chip{max-width:min(80vw,360px)}

/* Position the identity under the month text itself, independent of arrows and shortcuts. */
.planner-page .panel-head .month-heading{display:grid;justify-items:center;min-width:0}
.planner-page .panel-head .month-heading .shift-identity{width:100%;justify-content:center;text-align:center;margin-top:7px}
.planner-page .panel-head .month-heading .shift-identity .relief-chip{max-width:100%}
.planner-page .panel-head .inline{align-items:start}
/* In the installed phone app, keep the viewport still. Shorter screens can still scroll the planner itself. */
@media screen and (display-mode:standalone) and (max-width:550px){
 html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior-y:none}
 #app{position:fixed;inset:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:none;-webkit-overflow-scrolling:touch}
 .planner-menu,.overlay{overscroll-behavior-y:contain}
}

/* Read-only links use the same compact calendar as the personal planner. */
.shared-page .workspace{grid-template-columns:minmax(0,1fr)}
.shared-page .viewer-update-banner{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 12px;background:var(--theme-danger-surface);color:var(--theme-danger-ink);font-size:12px;border-bottom:1px solid var(--theme-danger-border)}
.viewer-update-banner button{min-height:36px;padding:5px 10px;color:var(--theme-danger-ink);border-color:var(--theme-danger-border);background:var(--theme-surface)}
.shared-page .day.update-highlight,.shared-page .rota td.update-highlight{background:var(--theme-danger-surface);box-shadow:inset 0 0 0 2px var(--theme-danger-border)}
.shared-page .day.update-highlight.active{box-shadow:inset 0 0 0 3px var(--theme-danger-border)}
.shared-page .day.update-highlight .num{color:var(--theme-danger-ink)}
.shared-page .day.today.update-highlight .num{background:var(--theme-danger-solid);color:var(--theme-on-status-solid)}
.shared-page .day.update-highlight .badge,.shared-page .day.update-highlight .time{opacity:1}
.update-dot{background:var(--theme-danger-solid)}.viewer-update-note{color:var(--theme-danger-ink);font-size:12px}.viewer-note{white-space:pre-wrap;overflow-wrap:anywhere}
.viewer-relief-label{margin-top:16px}#viewer-menu #viewer-push button{width:100%;min-height:46px;font-size:14px}#viewer-menu #viewer-push p{font-size:12px}
.shared-page .date-actions button,.shared-page .date-actions .jump-date-button{min-width:44px;min-height:44px}

.team-page .workspace{grid-template-columns:minmax(0,1fr)}.team-caption{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 2px 10px;font-size:13px}.team-caption span{font-size:11px;color:var(--muted);white-space:nowrap}.team-empty{padding:24px}.team-empty p,.team-help{font-size:12px;line-height:1.6}.team-person-selector{flex:1 0 100%;display:flex;align-items:center;gap:12px;font-size:12px}.team-person-selector select{flex:1;min-width:0;min-height:44px;font-size:16px}.team-table .rowhead{max-width:180px;min-width:130px}.team-table .rowhead .relief-chip{display:inline-block;font-size:10px;margin-top:5px}.team-person-link{display:block;width:100%;border:0;background:transparent;padding:6px;text-align:left;white-space:normal;overflow-wrap:anywhere;font-size:12px}.team-person-choices{border:1px solid var(--line);border-radius:10px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px;max-height:180px;overflow:auto}.team-person-choices legend{font-size:13px;font-weight:700;padding:0 5px}.team-person-choices .check{max-width:none;overflow-wrap:anywhere}.team-access-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:14px 0;border-bottom:1px solid var(--line);font-size:12px}.team-access-row strong{grid-column:1/-1;overflow-wrap:anywhere}.team-danger{color:var(--theme-danger-ink);margin-top:10px}.team-history-json{font-size:11px;white-space:pre-wrap;overflow-wrap:anywhere}.dot.leave{background:#cf869b}.dot.training{background:#c78c69}#person-names{width:100%}
@media(max-width:550px){.team-caption{font-size:12px}.team-page .panel-head{padding:12px}.team-table .rowhead{min-width:110px}.team-caption strong{overflow-wrap:anywhere}.team-person-choices{grid-template-columns:1fr}.team-page .date-actions{flex:1;justify-content:center}}

#team-times[hidden]{display:none}
.team-day-entries{display:grid;gap:10px}.team-day-entry{display:flex;flex-wrap:wrap;align-items:center;gap:10px;width:100%;text-align:left;padding:14px;touch-action:manipulation}.team-day-entry strong{flex:1;min-width:120px}.team-day-entry .viewer-note{flex-basis:100%;white-space:pre-wrap;font-weight:400}.team-day-entry.chosen{outline:2px solid var(--accent,var(--theme-focus));outline-offset:-2px}.team-default-summary{padding-bottom:18px;border-bottom:1px solid var(--theme-line)}.team-default-selector{min-width:0}.team-default-selector select{max-width:100%}.team-linked-caption{font-size:13px;color:var(--theme-muted);margin:8px 0 0}
#default-times[hidden]{display:none}
.team-page .team-default-selector{flex:1 0 100%;display:flex;align-items:center;gap:12px;font-size:12px}.team-default-selector select{flex:1;min-width:0;min-height:44px;font-size:16px}
@media(max-width:550px){.team-page .day .time{white-space:nowrap;font-size:clamp(6px,1.8vw,8px);letter-spacing:-.4px}}
.team-day-group{display:grid;gap:8px}.team-group-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:16px}.team-group-heading h3{margin:0}.team-group-heading button{min-height:44px;font-size:12px}.team-roster-group{margin:22px 0 4px;padding-top:12px;border-top:1px solid var(--line)}.team-table-group th{background:var(--theme-surface-soft);text-align:left;font-size:12px;padding:12px}#manual-people[hidden],#replace-duty-option[hidden]{display:none}

/* Related drawer actions share a heading, while keeping comfortable phone tap targets. */
.drawer-actions{gap:0;padding:0 18px}
.drawer-action-group{display:grid;gap:2px;padding:14px 0;border-bottom:1px solid var(--line);min-width:0}
.drawer-action-group:last-child{border-bottom:0}
.drawer-action-group h3,.drawer-account h3{font-size:12px;line-height:1.5;color:var(--muted);font-weight:700;margin:0 0 6px}
.drawer-action-group button{width:100%;padding:11px 6px;min-height:46px;line-height:1.45;overflow-wrap:anywhere}
.drawer-account h3{margin-bottom:8px}.drawer-account p{margin:0 0 12px}
.drawer-danger{margin:0 18px;padding:8px 0;border-top:1px solid var(--line)}

/* Linked workplace records have their own multi-interval presentation. */
.wp-calendar .day{min-height:100px;height:auto;justify-content:flex-start}.wp-time{display:block;margin:3px 0;padding:3px;background:#e8f3ee;color:#234d43;font-size:11px;border-radius:4px;white-space:normal}.wp-cancelled{color:var(--theme-danger-ink);background:var(--theme-danger-surface)}.wp-cancelled>strong{text-decoration:line-through}.wp-interval{border-bottom:1px solid var(--line);padding:12px 0}.wp-interval p{font-size:13px;line-height:1.6}.wp-note{white-space:pre-wrap}.wp-empty{color:var(--theme-muted)}@media(max-width:550px){.wp-calendar .day{min-height:90px;padding:4px}.wp-time{font-size:9px}}

.product-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin:24px 0}.product-cards a{color:inherit;text-decoration:none}.product-home{display:block;margin:20px;padding:12px;color:inherit}.drawer-action-group[hidden]{display:none}

/* Password visibility: large touch target, the entered value stays in its input. */
.auth .password-field{position:relative;display:block;width:100%}
.auth .password-field>input{padding-right:54px;width:100%;margin-bottom:0}
.auth .password-visibility-toggle{position:absolute;right:3px;top:50%;transform:translateY(-50%);width:44px;height:44px;min-width:44px;padding:10px;margin:0;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:var(--muted);line-height:1}
.auth .password-visibility-toggle:hover{background:var(--theme-hover);color:var(--ink)}
.auth .password-visibility-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

.day-notes-editor{border:0;padding:0;margin:8px 0 18px;min-width:0}
.day-notes-editor legend{font-weight:700;font-size:13px;margin-bottom:6px}
.day-notes-editor>.muted{font-size:12px;line-height:1.5;margin:0 0 12px}
.day-note-row{padding:12px;border:1px solid var(--line);border-radius:10px;margin-bottom:10px;background:var(--theme-surface-soft)}
.day-note-row label{margin-bottom:8px}.day-note-row textarea{min-height:70px;resize:vertical}
.day-note-row [data-delete-day-note]{font-size:12px;padding:7px 10px;color:var(--theme-danger-ink);background:var(--theme-surface)}
#day-notes-count{margin-top:8px}

.share-welcome{width:min(520px,calc(100vw - 28px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid var(--line);border-radius:18px;color:var(--ink);background:var(--theme-surface);box-shadow:0 18px 70px #142c3240}.share-welcome::backdrop{background:var(--theme-overlay)}.share-welcome-head{display:flex;align-items:start;gap:16px;justify-content:space-between}.share-welcome-head h2{font-size:24px;line-height:1.25}.share-welcome button{min-height:44px}.share-welcome section{border-top:1px solid var(--line);padding-top:18px;margin-top:18px}.share-welcome p{font-size:15px;line-height:1.6}.share-welcome h3{font-size:17px}.share-welcome .muted{font-size:13px}.share-welcome [hidden]{display:none!important}@media(max-width:550px){.share-welcome{padding:20px}.share-welcome-head h2{font-size:22px}}

.share-welcome .share-setup-icon{width:1.5em;height:1.5em;vertical-align:middle;flex-shrink:0}.share-welcome [data-install-icons]{font-weight:600;line-height:2}

.share-welcome .share-reminder-choice{display:flex;align-items:center;gap:12px;min-height:44px;margin:16px 0;font-size:15px;font-weight:500;cursor:pointer}.share-welcome .share-reminder-choice input{width:22px;height:22px;flex:0 0 22px;margin:0;accent-color:var(--accent)}.share-welcome .share-notification-requirement{font-weight:700}

/* Keep share setup readable while using the available phone viewport. */
.share-welcome{width:min(520px,calc(100vw - 16px));max-height:calc(100dvh - 16px);padding:12px 14px}
.share-welcome-head{gap:8px;align-items:center}.share-welcome-head h2{margin:0}.share-welcome-head [data-close]{flex:0 0 44px;width:44px;padding:6px}
.share-welcome p{margin:6px 0;line-height:1.3}.share-welcome section{padding-top:8px;margin-top:8px}.share-welcome h3{margin:0 0 5px;line-height:1.25}
.share-welcome [data-install-icons]{margin:5px 0;line-height:1.3}.share-welcome .share-reminder-choice{margin:4px 0;gap:10px}.share-welcome .actions{gap:6px;margin:0}
@media(max-width:550px){.share-welcome{padding:12px}}
.share-welcome[open]{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px}.share-welcome>:not(.share-reminder-choice):not(.actions){grid-column:1/-1}.share-welcome .share-reminder-choice,.share-welcome .actions{align-self:center}.share-welcome .share-reminder-choice{min-width:0}.share-welcome .actions button{white-space:nowrap}

/* Size grid rows to their content; notification setup opens as a bottom sheet. */
.share-welcome{height:fit-content;min-height:0;align-content:start;grid-auto-rows:max-content}
.share-welcome[data-setup-stage="installed"]{inset:auto 0 max(8px,env(safe-area-inset-bottom)) 0;margin:0 auto;max-height:min(70dvh,calc(100dvh - 24px));border-radius:18px;padding-bottom:max(12px,env(safe-area-inset-bottom));}
.share-welcome[data-setup-stage="installed"][open]{animation:share-notification-rise .25s ease-out}
@keyframes share-notification-rise{from{transform:translateY(calc(100% + 24px));opacity:0}to{transform:translateY(0);opacity:1}}
@media(prefers-reduced-motion:reduce){.share-welcome[data-setup-stage="installed"][open]{animation:none}}


.auth-choices{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:20px 0}.auth-choices [aria-pressed="true"]{background:var(--theme-primary);color:var(--theme-on-primary)}.account-settings{margin:12px 0}.account-settings summary{cursor:pointer;padding:12px 0;font-weight:600}.account-settings a{display:block;padding:12px;min-height:44px}.account-page{max-width:680px;margin:0 auto}.account-page dd{margin:4px 0 16px;overflow-wrap:anywhere}.account-page dt{font-weight:600}.account-page h1{margin-top:8px}

#leave-options[hidden],#leave-duration[hidden]{display:none}.leave-editor{margin:16px 0;padding:16px;background:var(--theme-surface-soft);border-radius:12px}.leave-help{font-size:13px;line-height:1.5}.leave-record-row{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr) minmax(0,1fr);gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px}.leave-record-list{margin:16px 0}.leave-record-row span:last-child{text-align:right}@media(max-width:420px){.leave-record-row{font-size:12px;gap:6px}}

.training-part-dialog{width:min(380px,calc(100vw - 40px));max-height:80dvh;overflow:auto;border:1px solid var(--theme-line);border-radius:16px;padding:20px;box-shadow:0 20px 60px #0003}.training-part-dialog::backdrop{background:var(--theme-overlay)}.training-part-dialog h3{margin-top:0}

.activity-row{border:1px solid var(--theme-line);border-radius:10px;padding:12px;margin:14px 0;min-width:0}.activity-row legend{font-weight:650;padding:0 6px}.activity-row .formrow{grid-template-columns:1fr 1fr}.activity-details p{border-bottom:1px solid var(--theme-line);padding-bottom:8px}.badge.mixed{background:#e8ddf5;color:#50336b}.shift-large.mixed{background:#f3edf8}#activities-form>button,#open-activities,#open-team-activities{margin:8px 0}

/* Relief membership is fixed for the displayed month, not the viewport date. */
.team-table-help{margin:0;padding:10px 14px;font-size:11px;color:var(--theme-muted);background:var(--theme-surface-soft);border-bottom:1px solid var(--line)}
.team-table .team-other-relief{background:repeating-linear-gradient(135deg,var(--theme-page),var(--theme-page) 6px,var(--theme-surface-soft) 6px,var(--theme-surface-soft) 7px);color:var(--theme-muted);font-size:11px;line-height:1.4}
.team-table .team-other-relief span{display:block;max-width:110px;margin:auto;overflow-wrap:anywhere}
.team-membership{display:block;font-size:10px;font-weight:500;line-height:1.4;margin-top:5px;color:var(--theme-muted);white-space:normal}
.team-page .team-table-empty{text-align:left;margin:0;padding:20px;color:var(--theme-muted);font-size:12px}

/* Only the Team roster scrolls; date headers and controls stay in the viewport. */
@media screen{
 html.team-roster-open,html.team-roster-open body{height:100%;overflow:hidden;overscroll-behavior:none}
 #app.team-roster-shell{position:fixed;inset:0;height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden;overscroll-behavior:none}
 .team-roster-shell>.planner-header{flex:0 0 auto}
 .team-roster-shell>.team-page{flex:1;min-height:0;display:flex;flex-direction:column;width:100%;margin:0 auto;overflow:hidden;padding-bottom:max(8px,env(safe-area-inset-bottom))}
 .team-roster-shell .team-caption,.team-roster-shell .panel-head,.team-roster-shell .team-table-help,.team-roster-shell .legend,.team-roster-shell .planner-footer{flex:0 0 auto}
 .team-roster-shell .workspace{flex:1;min-height:0;display:flex;flex-direction:column;align-items:stretch}
 .team-roster-shell .panel{flex:1;min-height:0;display:flex;flex-direction:column;min-width:0}
 .team-roster-shell .team-table{flex:1;min-height:0;max-height:none;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
 .team-table thead th{position:sticky;top:0;z-index:4}
 .team-table thead th.rowhead{left:0;z-index:5}
 .team-table tbody th.rowhead{position:sticky;left:0;top:auto;z-index:2}
 .team-table tbody .team-table-group th{position:static;z-index:auto}
 .team-page [data-person-day]{touch-action:manipulation}
 .team-page .calendar{touch-action:pan-y pinch-zoom}
 .team-roster-shell .panel-head{max-height:45vh;max-height:45dvh;overflow:auto;overscroll-behavior:contain}
 .team-roster-shell .team-table-help,.team-roster-shell .legend{max-height:7em;overflow:auto;overscroll-behavior:contain}
 .team-roster-shell .team-table-empty{overflow:auto;overscroll-behavior:contain}
}
@media screen and (max-height:600px){
 .team-roster-shell .panel-head{max-height:35vh;max-height:35dvh}
 .team-roster-shell .team-table-help,.team-roster-shell .legend{max-height:5em}
 .team-roster-shell .planner-footer{display:none}
}

/* Modal pages scroll vertically. Do not let iOS drag their contents sideways. */
.dialog{overflow-x:hidden;overflow-y:auto;overscroll-behavior-x:none}
.dialog form{grid-template-columns:minmax(0,1fr)}
.dialog form>*,.dialog fieldset,.dialog legend{min-width:0;max-width:100%}
.dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea){min-width:0;max-width:100%}
