/* Shared name/status columns for an absence and its replacement. */
.roster-people{display:grid;grid-template-columns:minmax(0,1fr) fit-content(7.5em);column-gap:6px;row-gap:3px;align-items:baseline;min-width:0}
.roster-people>.roster-person-entry{display:contents}
.roster-people .roster-person-name{grid-column:1;min-width:0;overflow-wrap:anywhere}
.roster-people .roster-person-status{grid-column:2;justify-self:start;min-width:0}
.roster-person-status{display:inline-flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.roster-people .roster-person-status .badge{white-space:normal;overflow-wrap:anywhere}
.roster-person-entry>.roster-person-name.shift-absence{color:var(--muted);font-weight:500}
.roster-person-entry>.roster-person-name.shift-replacement{display:inline;position:static}
/* On narrow phones the pair uses the full row so long names stay readable. */
@media(max-width:450px){
 .shift-line:has(.roster-people)>.shift-role{grid-column:1/3;grid-row:1}
 .shift-line:has(.roster-people)>.shift-person{grid-column:1/-1;grid-row:2}
 .roster-people{grid-template-columns:minmax(0,1fr) minmax(58px,max-content);column-gap:10px;row-gap:5px}
}

/* A datum, name, position, shift, time or status is one unbroken unit.
   Layouts may move complete units; letters and position numbers never split. */
:root[data-theme] :is(.person-name,.name-unit,.shift-role,.shift-hours,.schedule-event-role,.schedule-event-time,
 .request-position,.request-date,.request-time,.request-slot>strong,.opening-role,.opening-shift-label,
 .opening-ratio,.opening-choice-time,.fixed-day-area,.fixed-day-shift,.fixed-day-time,
 .roster-person-name,.roster-person-status,.badge,.instant-notice-name,.change-history-actor,
 .hours-person-value,.plan-status-date,.replacement-reply-count,
 .planner-request-person-name,.signal-person>b,.planner-extra-heading>strong,.planning-area-head>strong,time){
 white-space:nowrap;overflow-wrap:normal;word-break:normal;
}
.person-name{min-width:0}
:root[data-theme] :is(button,a.button,summary.button){white-space:nowrap;overflow-wrap:normal;word-break:normal;flex-shrink:0}
.name-unit{display:inline-block;max-width:100%;overflow-x:auto;vertical-align:bottom;scrollbar-width:thin}
.request-position,.fixed-day-area{overflow-x:auto;scrollbar-width:thin}
.shift-line>.shift-person:not(:has(.roster-people)),
.schedule-event-person>strong{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.roster-person-status{flex-wrap:nowrap}
.roster-people{grid-template-columns:minmax(0,1fr) max-content}
.roster-people .roster-person-name,.shift-role{overflow-x:auto;scrollbar-width:thin}
.shift-line>.shift-person,.schedule-event-person>strong{overflow-x:auto;scrollbar-width:thin}
.shift-person>.roster-person-entry{display:grid;grid-template-columns:minmax(0,1fr);row-gap:3px}
.shift-person>.roster-person-entry>.roster-person-name{min-width:0;white-space:nowrap}
.shift-person>.roster-person-entry>.roster-person-status{justify-self:start}
.shift-line,.site-plan-shift,.schedule-event-person{grid-template-columns:var(--roster-role) minmax(0,1fr) var(--roster-time)}
.home-page .instant-notice-name{display:block}
.instant-notice-name>span{display:inline;max-width:none;overflow:visible;text-overflow:clip}
.instant-notice-name>span+span::before{content:' '}

/* Compact actions use one shared size at each phone breakpoint. */
@media(max-width:650px){
 :root[data-theme]{--phone-action-font:.76rem;--phone-action-height:34px;--phone-action-padding:7px 9px}
 :root[data-theme] .person-name{font-size:var(--roster-font)}
 :root[data-theme] :is(button,a.button,summary.button){
  font-size:var(--phone-action-font)!important;line-height:1.25!important;
  min-height:var(--phone-action-height)!important;min-width:0!important;
  padding:var(--phone-action-padding)!important;white-space:nowrap;
  overflow-wrap:normal;word-break:normal;box-sizing:border-box;flex-shrink:0;
 }
 :root[data-theme] .request-entry>.record-actions:not(:has(>form))>.badge{
  font-size:var(--phone-action-font);min-height:var(--phone-action-height);
  white-space:nowrap;
 }
 :root[data-theme] .request-entry>.record-actions:has(>form)>.badge{white-space:nowrap}
 .record-actions,.form-actions,.inline-actions{flex-wrap:wrap}
 .shift-line,.schedule-event-person{grid-template-columns:minmax(0,1fr) max-content;column-gap:8px;row-gap:4px}
 .shift-line>.shift-role,.shift-line:has(.roster-people)>.shift-role,
 .schedule-event-person>.schedule-event-role{grid-area:1/1/2/2}
 .shift-line>.shift-hours,.schedule-event-person>.schedule-event-time{grid-area:1/2/2/3}
 .shift-line>.shift-person,.shift-line:has(.roster-people)>.shift-person,
 .schedule-event-person>strong{grid-area:2/1/3/3;min-width:0;align-self:center}
 .shift-line:has(>.shift-actions)>.shift-person,
 .schedule-event-person:has(>.shift-actions)>strong{grid-area:2/1/3/2}
 .shift-line>.shift-actions,.schedule-event-person>.shift-actions{
  grid-area:2/2/3/3;align-self:center;margin:0;gap:0;min-width:0;
 }
 .shift-actions>:is(button,.button){width:auto}
 .shift-line>.shift-status,.shift-line>.shift-replacement-action,
 .shift-line>.shift-warning,.shift-line>.shift-note-inline,
 .schedule-event-person>small{grid-column:1/-1;grid-row:auto}
 .roster-people{grid-template-columns:minmax(0,1fr) max-content;column-gap:10px;min-width:0;width:100%}
 .shift-person,.schedule-event-person>strong{overflow-x:auto;scrollbar-width:thin}
 .hours-person-row{grid-template-columns:minmax(0,1fr) max-content;gap:4px 10px;align-items:center}
 .hours-person-row>div:first-child{display:contents}
 .hours-person-row>div:first-child>strong{grid-column:1/-1;grid-row:1;white-space:nowrap}
 .hours-person-row>div:first-child>p{grid-column:1;grid-row:2;margin:0}
 .hours-person-row>.hours-person-value{grid-column:2;grid-row:2}
 .hours-person-row>div:first-child>.badge{grid-column:1/-1;grid-row:auto;justify-self:start}
 .fixed-day-entry .fixed-day-person{grid-column:1/-1;grid-row:1;padding:0;align-self:center}
 .fixed-day-entry{grid-template-columns:minmax(0,1fr) max-content max-content}
 .fixed-day-entry .fixed-day-area{grid-column:1;grid-row:2;padding-top:8px}
 .fixed-day-entry .fixed-day-shift{grid-column:2}
 .fixed-day-entry .fixed-day-slot-1{grid-row:2}
 .fixed-day-entry .fixed-day-slot-2{grid-row:3}
 .fixed-day-entry .fixed-day-actions{grid-column:1/-1;grid-row:3;justify-self:end}
 .fixed-day-entry.fixed-day-double .fixed-day-actions{grid-row:4}
 .fixed-day-entry .fixed-day-actions form{flex-wrap:wrap;justify-content:flex-end}
 .home-page .instant-notice-row.request-entry{grid-template-columns:74px minmax(78px,1fr) max-content}
 .home-page .instant-notice-row>.instant-notice-name{grid-column:1/-1;grid-row:2;align-self:center;overflow-x:auto;scrollbar-width:thin}
 .home-page .instant-notice-row>.instant-notice-name::before{display:none}
 .home-page .instant-notice-row>.instant-notice-action{grid-column:3;grid-row:1;align-self:center}
 .instant-notice-action button{width:auto}
 .home-page .replacement-management-row>.record-actions{
  grid-column:3;grid-row:1;flex-direction:column;justify-content:center;gap:4px;min-height:0;
 }
 .home-page .replacement-management-row .replacement-reply-count{font-size:.65rem}
 .change-history-actor{grid-column:1/-1;grid-row:2}
 .change-history-date{grid-column:2;grid-row:1;align-self:center}
 .change-history-actor::before{display:none}
 .workspace-page .card:has(>.record-row){padding-inline:14px}
 .privacy-deadline-notice .record-actions{min-width:max-content}
 .section-head:has(>h2){flex-wrap:wrap;row-gap:8px}
 .section-head>h2{flex-shrink:0}
 .section-head>a{margin-left:auto;white-space:nowrap}
 .more-link-copy>strong{font-size:var(--phone-action-font);white-space:nowrap}
 .two-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 .two-fields>label{min-width:0}
 input,select{min-width:0;max-width:100%}
}
@media(max-width:380px){
 :root[data-theme]{--phone-action-font:.70rem;--phone-action-height:32px;--phone-action-padding:6px 7px}
 .schedule-day-accordion>.accordion-body{padding-inline:10px}
 .schedule-block{padding-inline:8px}
 .hours-page .hours-total{min-width:0}
 :root[data-theme] .hours-page .hours-summary-card{padding-inline:8px}
 .site-admin-card{padding-inline:8px}
 .site-admin-people{padding-right:0}
 .home-page .home-instant-notices>.accordion-body{padding-inline:12px}
}


/* Shared compact calendar headings and balanced empty days. */
:root[data-theme] time.calendar-day-date{color:var(--blue);font-size:.94rem;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
:root[data-theme=dark] :is(time.calendar-day-date,.wish-row time.wish-day-date){color:#7bcdf8}
.schedule-day-title{display:block}
.schedule-day-accordion>.accordion-body:has(>.schedule-day-empty){padding-block:0}
.schedule-day-empty{display:flex;align-items:center;justify-content:flex-start;min-height:52px;margin:0;padding-block:14px;text-align:left;line-height:1.4}
.wish-list.card{padding-block:0}
.wish-list>.wish-row,.wish-list>.wish-row:first-child{padding-block:0;border-bottom:0}
.wish-list>.wish-row>summary{box-sizing:border-box;min-height:58px;border-bottom:1px solid var(--line);margin:0}
.wish-list>.wish-row:last-child>summary{border-bottom-color:transparent}


/* Team-week offers occupy the same row, immediately before the time. */
.team-week-list .team-day{container-type:inline-size}
.team-week-list .shift-line:has(>.team-replacement-action){grid-template-columns:var(--roster-role) minmax(0,1fr) max-content var(--roster-time);align-items:center}
.team-week-list .shift-line:has(>.team-replacement-action)>.shift-role{grid-area:1/1/2/2}
.team-week-list .shift-line:has(>.team-replacement-action)>.shift-person{grid-area:1/2/2/3;align-self:center;overflow:visible}
.team-week-list .shift-line:has(>.team-replacement-action)>.shift-hours{grid-area:1/4/2/5}
.team-week-list .shift-line>.team-replacement-action{grid-area:1/3/2/4;justify-self:end;align-self:center;margin:0;line-height:1}
.team-week-list .team-request-button{min-height:26px!important;height:auto!important;padding:4px 8px!important;font-size:.75rem!important;line-height:1.1!important;border-radius:8px;white-space:nowrap}
.team-week-list .replacement-searching:not(.shift-filled-replacement) .roster-people{display:flex;flex-direction:column;align-items:stretch;gap:3px}
.team-week-list .replacement-searching:not(.shift-filled-replacement) .roster-person-entry{display:flex;align-items:center;gap:6px;min-width:0;max-width:100%}
.team-week-list .replacement-searching:not(.shift-filled-replacement) .roster-person-name{flex:0 1 auto;min-width:0;overflow-x:auto;white-space:nowrap}
.team-week-list .replacement-searching:not(.shift-filled-replacement) .roster-person-status{flex:none}
@container (max-width:460px){
 .team-week-list .shift-line:has(>.team-replacement-action){grid-template-columns:minmax(0,1fr) max-content;row-gap:4px;column-gap:8px}
 .team-week-list .shift-line:has(>.team-replacement-action)>.shift-role{grid-area:1/1/2/2}
 .team-week-list .shift-line:has(>.team-replacement-action)>.shift-hours{grid-area:1/2/2/3}
 .team-week-list .shift-line:has(>.team-replacement-action)>.shift-person{grid-area:2/1/3/2}
 .team-week-list .shift-line>.team-replacement-action{grid-area:2/2/3/3}
}


/* One quiet footer, shared by the normal app pages. */
/* Arrival notices use existing card, button and pending-status colours. */
.lateness-board{padding:16px 20px}
.lateness-board h2{margin:0 0 8px;font-size:1rem}
.lateness-notice-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid var(--line)}
.lateness-board-confirmation .lateness-notice-row{padding:0;border-top:0}
.lateness-notice-row:has(>.lateness-notice-actions){display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
.lateness-notice-copy{display:grid;gap:3px;min-width:0;font-size:.88rem}
.lateness-notice-copy .person-name{overflow-x:auto;white-space:nowrap}
.lateness-notice-time{font-size:.8rem;color:var(--muted)}
.lateness-notice-row>.button{flex:none}
.lateness-notice-question{font-size:.85rem;font-weight:650}
.lateness-notice-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px;flex:none}
.lateness-notice-actions>form{margin:0}
.lateness-confirmation-title{margin-bottom:6px;font-size:1rem}
.lateness-page{max-width:650px;margin-inline:auto}
.lateness-facts{display:grid;grid-template-columns:74px minmax(0,1fr);align-items:center;gap:12px;margin-bottom:20px;line-height:1.4}
.lateness-facts>.request-day-position,.lateness-facts>.request-slot{grid-row:1;display:grid;gap:4px;min-width:0}
.lateness-facts>.request-slot{position:relative;padding-left:12px;border-left:1px solid var(--line)}
.lateness-facts .request-date{font-weight:650;color:var(--blue);font-size:.88rem}
.lateness-facts .request-position,.lateness-facts .request-time{font-weight:650;font-size:.8rem}
.lateness-facts .request-position{color:var(--muted);overflow-x:auto}
.lateness-facts .request-slot>strong{font-size:.88rem}
.lateness-arrival{display:grid;gap:4px;margin-block:16px 20px}
.lateness-arrival>span{color:var(--muted);font-size:.88rem}
.lateness-person{max-width:100%;overflow-x:auto;white-space:nowrap}
.lateness-select-label{margin-bottom:0}
.lateness-recipients{margin-top:14px}
.lateness-resolution{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}
.schedule-roster-name{display:contents}
.schedule-roster-name>.roster-person-entry{display:grid;grid-template-columns:minmax(0,1fr);row-gap:3px}
.late-team-marker:empty{display:none}
.shift-person:has(>.late-team-marker:not(:empty)),.schedule-event-person>strong:has(>.late-team-marker:not(:empty)){display:flex;align-items:center;gap:6px;min-width:0;overflow:visible}
.shift-person:has(>.late-team-marker:not(:empty))>.schedule-roster-name{display:block;flex:1;min-width:0;overflow-x:auto;white-space:nowrap}
.schedule-event-person>strong:has(>.late-team-marker:not(:empty))>.name-unit{flex:1;min-width:0;overflow-x:auto}
.late-team-marker{flex:none}
.late-team-marker:not(:empty){display:inline-flex;align-items:center;line-height:1}
:root[data-theme] .late-inline-badge{display:inline-grid;justify-items:center;gap:1px;padding:3px 5px;font-size:.65rem;line-height:1.15;white-space:nowrap}
.late-inline-badge small{color:inherit;font-size:inherit;white-space:nowrap}
.roster-name-parts{white-space:nowrap}
@media(max-width:650px){
 .team-week-list :is(.shift-person,.schedule-event-person>strong):has(>.late-team-marker:not(:empty)) .roster-name-parts{display:grid;gap:2px;min-width:0;max-width:100%;line-height:1.4}
 .team-week-list :is(.shift-person,.schedule-event-person>strong):has(>.late-team-marker:not(:empty)) .roster-name-parts>span{display:block;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:thin}
 .team-week-list .shift-person:has(>.late-team-marker:not(:empty))>.schedule-roster-name,.team-week-list .schedule-event-person>strong:has(>.late-team-marker:not(:empty))>.name-unit{overflow-y:hidden}
}
@media(max-width:400px){.lateness-board{padding:12px 14px}.lateness-notice-row{gap:8px}.lateness-notice-time{font-size:.74rem}}
@media(max-width:650px){
 .shift-actions:has(>a[href^="/lateness/"]){display:flex;flex-direction:column;align-items:stretch;gap:4px}
}
@media(max-width:650px){
 .home-page .next-shift.request-entry:has(>.next-shift-footer>a[href^="/lateness/"]){grid-template-columns:72px minmax(72px,1fr) 86px;column-gap:4px}
 .home-page .next-shift-footer:has(>a[href^="/lateness/"]){display:flex;flex-direction:column;align-items:stretch;justify-self:stretch;width:100%;min-width:0;gap:4px}
 .home-page .next-shift-footer:has(>a[href^="/lateness/"])>.button{width:100%}
}

@media screen{
 body{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
 body>.container{flex:1;width:100%;margin:0 auto;padding-bottom:8px}
 .app-footer{flex:none;padding:6px 20px 20px;text-align:center;color:var(--muted);font-size:.75rem;line-height:1.5}
 .app-footer-version,.app-footer-copyright{margin:0;white-space:nowrap}
 .app-footer-version{font-weight:600}
 .app-footer-copyright{margin-top:3px;font-size:.72rem}
}
@media screen and (max-width:900px){
 body:not(.signed-out)>.app-footer{padding-bottom:calc(104px + env(safe-area-inset-bottom,0px))}
}
