/* Phone overrides are screen-only: desktop and printed rotas keep their layouts. */
.mobile-date-control { display:contents; }
/* A compact identity header and one clear form column on phones. */
@media screen and (max-width:600px) {
  #authScreen { min-height:100dvh;box-sizing:border-box;padding:max(22px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));align-content:center; }
  #authScreen::before { transform:none;background-position:68% center;background-size:auto 110%; }
  #authScreen::after { background:color-mix(in srgb,var(--panel-solid,#fff) 8%,transparent); }
  #authScreen .auth-shell { display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:12px;align-items:center;width:min(380px,100%);box-sizing:border-box;padding:22px;border-radius:20px;border:1px solid var(--line);background:color-mix(in srgb,var(--panel-solid,#fff) 94%,transparent);color:var(--ink);box-shadow:0 16px 48px rgb(0 0 0 / .12),inset 0 1px 0 rgb(255 255 255 / .3);backdrop-filter:blur(20px); }
  #authScreen .auth-shell > :not(.auth-logo):not(.auth-heading) { grid-column:1 / -1;min-width:0; }
  #authScreen .auth-shell { overflow:hidden;background:color-mix(in srgb,var(--panel-solid,#fff) 86%,transparent);border-color:color-mix(in srgb,var(--accent) 18%,var(--line));box-shadow:0 22px 60px rgb(0 0 0 / .16),inset 0 1px 0 rgb(255 255 255 / .5); }
  #authScreen .auth-shell::before { content:'';position:absolute;inset:0 0 auto;height:3px;background:linear-gradient(90deg,var(--accent),#bba8e9,#58c7c5);pointer-events:none; }
  #authScreen .auth-logo { outline:1px solid color-mix(in srgb,var(--accent) 18%,transparent);outline-offset:4px; }
  #authScreen .auth-heading .eyebrow { color:var(--ink);font-size:11px; }
  #authScreen .auth-submit { box-shadow:0 5px 14px color-mix(in srgb,var(--accent) 20%,transparent); }
  #authScreen .auth-logo { width:44px;height:44px;border-radius:10px;box-shadow:0 4px 12px rgb(0 0 0 / .08); }
  #authScreen .auth-heading { margin:0;min-width:0; }
  #authScreen .auth-heading .eyebrow { font-size:10px;line-height:1.4;font-weight:600;color:var(--muted);margin:0 0 2px; }
  #authScreen .auth-heading h1 { font-size:23px;line-height:1.25;margin:0;font-weight:650; }
  #authScreen .auth-heading > p:last-child { font-size:12px;line-height:1.5;color:var(--muted);margin:4px 0 0; }
  #authScreen .auth-modes { margin-top:18px;padding:3px;gap:3px;border:1px solid var(--line);border-radius:8px;background:var(--soft);backdrop-filter:none;box-shadow:none; }
  #authScreen .auth-modes button { height:40px;min-height:40px;font-size:13px;font-weight:600;border-radius:5px;color:var(--muted); }
  #authScreen .auth-modes button.active { color:var(--ink);background:var(--panel-solid);box-shadow:0 1px 4px rgb(0 0 0 / .08); }
  #authScreen .auth-form { display:grid;gap:12px;margin-top:18px; }
  #authScreen .auth-form label { display:grid;gap:6px;margin:0;font-size:12px;font-weight:500;line-height:1.4;color:var(--ink); }
  #authScreen .auth-form :is(input,select) { box-sizing:border-box;width:100%;min-width:0;height:46px;min-height:46px;padding:10px 12px;font-size:16px;line-height:1.4;border:1px solid var(--line);border-radius:8px;background:var(--panel-solid);color:var(--ink);box-shadow:none;backdrop-filter:none; }
  #authScreen .auth-form :is(input,select):focus { outline:2px solid var(--accent);outline-offset:2px; }
  #authScreen .auth-submit { height:46px;min-height:46px;margin-top:4px;border-radius:8px;font-size:14px;font-weight:600; }
  #authScreen .auth-recovery-link { min-height:36px;font-size:12px;line-height:1.5;margin:6px auto 0;padding:7px 8px;color:var(--accent-dark,var(--ink)); }
  #authScreen .auth-divider { margin:12px 0;font-size:11px;color:var(--muted); }
  #authScreen .auth-divider::before,#authScreen .auth-divider::after { background:var(--line); }
  #authScreen .provider-buttons { grid-template-columns:repeat(3,minmax(0,1fr));gap:7px; }
  #authScreen .provider-button { min-height:44px;padding:8px 4px;border-radius:8px;border:1px solid var(--line);font-size:11px;font-weight:500;color:var(--ink);background:var(--panel-solid);box-shadow:none;backdrop-filter:none;white-space:nowrap; }
  #authScreen .provider-button b { margin-right:3px;font-size:13px; }
  #authScreen .auth-message { margin:12px 0 0;font-size:12px;line-height:1.6;overflow-wrap:anywhere; }
  #authScreen .auth-message:empty { display:none; }
  #authScreen .auth-invitation { margin-top:14px;padding-block:10px; }
}
.mobile-pull-refresh { position:absolute;inset-inline:0;z-index:70;display:flex;align-items:center;justify-content:center;gap:10px;min-height:58px;padding:4px 16px;box-sizing:border-box;pointer-events:none;color:var(--ink);font-size:12px; }
.mobile-pull-refresh[hidden] { display:none; }
.mobile-refresh-ring { flex:0 0 22px;width:22px;height:22px;box-sizing:border-box;border:2.5px solid color-mix(in srgb,var(--accent) 20%,var(--panel-solid));border-top-color:var(--accent);border-right-color:var(--accent);border-radius:50%;transform:rotate(var(--ring-turn,0deg)); }
.mobile-pull-refresh[data-phase="pulling"] { opacity:var(--pull-progress,1); }
.mobile-pull-refresh[data-phase="refreshing"] .mobile-refresh-ring { animation:mobile-refresh-spin .75s linear infinite; }
.mobile-pull-refresh[data-phase="complete"] .mobile-refresh-ring { border-color:var(--accent);transform:scale(.85);transition:transform .2s ease,border-color .2s ease; }
body.mobile-shell .main.mobile-pull-offset { transform:translate3d(0,var(--pull-offset,0px),0); }
body.mobile-shell .main.mobile-pull-settle { transition:transform 460ms cubic-bezier(.2,1.45,.4,1); }
@keyframes mobile-refresh-spin { to { transform:rotate(calc(var(--ring-turn,0deg) + 360deg)); } }
@media (prefers-reduced-motion:reduce) {
  body.mobile-shell .main.mobile-pull-offset { transform:none; }
  .mobile-pull-refresh { position:relative; }
  .mobile-pull-refresh[data-phase="refreshing"] .mobile-refresh-ring { animation:none; }
}
.mobile-header,.mobile-dock,.mobile-nav-backdrop,.mobile-drawer-close,.mobile-planner-days,.mobile-view-switch,.mobile-period-picker,.mobile-settings-picker,.mobile-daily-picker,.mobile-page-title { display:none; }
@media screen and (max-width:900px) {
  body.mobile-shell .topbar { position:relative;z-index:75;isolation:isolate; }
  body.mobile-shell #plannerView .notice-row { position:relative;z-index:0; }
  body.mobile-shell > :is(#sharePanel,#editPanel) { position:fixed;inset:auto 12px calc(var(--mobile-dock-height,66px) + env(safe-area-inset-bottom) + 12px);z-index:110;width:auto;box-sizing:border-box;max-height:min(65dvh,540px);overflow:auto;pointer-events:auto; }
  body.mobile-shell > :is(#sharePanel,#editPanel) button { min-height:44px;height:auto;white-space:normal; }
  /* Clip the page, not its scrollable week grids or day strips. Unlike hidden,
     clip does not create a second scrolling container around the sticky UI. */
  html:has(body.mobile-shell) { overflow-x:clip;overscroll-behavior-x:none; }
  body.mobile-shell { width:100%;min-width:0;max-width:100%;overflow-x:clip;overscroll-behavior-x:none; }
  body.mobile-shell #appShell,body.mobile-shell .main > .view { min-width:0;max-width:100%;box-sizing:border-box; }
  body.mobile-shell #rotaGrid.mobile-day-planner .rota-row > * { min-width:0;overflow-wrap:anywhere; }
  body.mobile-shell { --mobile-dock-height:66px; -webkit-tap-highlight-color:transparent; }
  body.mobile-shell #appShell { display:block;min-height:100dvh;padding:0 0 calc(var(--mobile-dock-height) + env(safe-area-inset-bottom) + 12px); }
  body.mobile-shell .main { min-width:0;width:100%;box-sizing:border-box;padding:18px max(14px,env(safe-area-inset-right)) 16px max(14px,env(safe-area-inset-left)); }
  body.mobile-shell .mobile-header { display:flex;align-items:center;gap:10px;position:relative;z-index:90;padding:calc(8px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));border-bottom:1px solid var(--line);background:var(--panel-solid); }
  .mobile-menu-button,.mobile-home-button { display:flex;align-items:center;justify-content:center;min-height:44px;border:0;background:none;color:var(--ink);box-shadow:none; }
  .mobile-menu-button { flex:0 0 44px;width:44px;padding:0;font-size:22px; }
  .mobile-home-button { flex:1;gap:8px;padding:4px 0;min-width:0;font-weight:650;font-size:15px;white-space:normal;text-align:left;justify-content:flex-start; }
  .mobile-home-button img { width:30px;height:30px;flex:0 0 30px;object-fit:contain; }
  .mobile-brand-copy { display:flex;flex-direction:column;gap:3px;min-width:0; }
  .mobile-brand-name { font-size:12px;font-weight:500;color:var(--muted);line-height:1.3; }
  .mobile-workspace-name { font-size:14px;font-weight:600;line-height:1.35;white-space:normal;overflow-wrap:anywhere; }
  .mobile-account-slot { margin-left:auto;flex:0 0 44px;min-width:0; }
  body.mobile-shell .mobile-account-slot .profile-menu { width:44px; }
  body.mobile-shell .mobile-account-slot .account-profile-button { width:44px;height:44px;min-height:44px;max-width:44px;padding:4px;justify-content:center;background:transparent;border:0;box-shadow:none; }
  .mobile-account-slot #accountProfileName,.mobile-account-slot .profile-chevron { display:none; }
  body.mobile-shell .mobile-account-slot .account-avatar { width:34px;height:34px;flex:0 0 34px; }
  body.mobile-shell .mobile-account-slot #accountProfilePanel { position:fixed;top:var(--account-menu-top,calc(env(safe-area-inset-top) + 64px));left:12px;right:12px;width:auto;max-width:none;max-height:var(--account-menu-height,calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 150px));overflow-x:hidden;overflow-y:auto; }
  body.mobile-shell #accountProfilePanel :is(button,select,summary) { min-height:44px;font-size:14px;line-height:1.45;white-space:normal;overflow-wrap:break-word; }
  body.mobile-shell #accountProfilePanel select { width:100%;font-size:16px; }
  body.mobile-shell .mobile-dock { position:fixed;z-index:65;inset:auto 0 0;display:grid;grid-template-columns:repeat(var(--mobile-tab-count,5),minmax(0,1fr));gap:2px;padding:5px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));background:var(--panel-solid);border-top:1px solid var(--line);box-shadow:0 -3px 18px #00000006; }
  .mobile-dock button { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:54px;min-width:0;padding:4px 2px;border:0;border-radius:8px;background:transparent;color:var(--muted);box-shadow:none;font-size:10px;font-weight:500;line-height:1.2; }
  .mobile-dock button[aria-current="page"] { color:var(--ink);background:color-mix(in srgb,var(--accent) 16%,transparent); }
  .mobile-dock-icon { display:grid;place-items:center;height:22px;font-size:21px;line-height:1; }
  body.mobile-shell #appShell>.sidebar { position:fixed;z-index:102;inset:0 auto 0 0;display:block;width:min(330px,calc(100vw - 40px));height:100dvh;box-sizing:border-box;padding:calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;background:var(--panel-solid);border:0;border-right:1px solid var(--line);transform:translateX(-105%);visibility:hidden;transition:transform 160ms ease,visibility 160ms; }
  body.mobile-shell #appShell>.sidebar :is(.brand,.native-sidebar-search,.nav-tabs) { display:flex; }
  body.mobile-shell #appShell>.sidebar .brand { gap:10px;padding:0 30px 16px 0;margin:0;justify-content:flex-start; }
  body.mobile-shell #appShell>.sidebar .brand-copy { display:block; }
  body.mobile-shell #appShell>.sidebar .brand-copy h1 { font-size:17px; }
  body.mobile-shell #appShell>.sidebar .brand-copy p { font-size:11px; }
  body.mobile-shell #appShell>.sidebar .nav-tabs { flex-direction:column;gap:4px; }
  body.mobile-shell #appShell>.sidebar .nav-button { flex-direction:row;justify-content:flex-start;gap:12px;min-height:46px;padding:10px 12px;width:100%;font-size:14px;text-align:left; }
  body.mobile-shell #appShell>.sidebar .nav-button .nav-label { display:inline; }
  body.mobile-shell #appShell>.sidebar .nav-button .icon { width:22px;font-size:18px; }
  body.mobile-shell #appShell>.sidebar :is(.sidebar-top,.summary-panel,.ongoing-panel) { display:none; }
  body.mobile-shell #appShell>.sidebar #nativeSearchControl { margin:6px 0 20px; }
  body.mobile-shell #appShell>.sidebar .native-sidebar-search { flex-direction:column;align-items:stretch; }
  body.mobile-shell #appShell>.sidebar .native-search-field { display:flex;width:100%; }
  body.mobile-shell #appShell>.sidebar #nativeSearchCompact { display:none; }
  body.mobile-shell #appShell>.sidebar .mobile-drawer-close { display:grid;place-items:center;position:absolute;right:12px;top:calc(20px + env(safe-area-inset-top));height:44px;width:44px;padding:0;border:0;background:transparent;color:var(--ink);box-shadow:none;font-size:25px; }
  .mobile-nav-backdrop { position:fixed;inset:0;z-index:101;border:0;border-radius:0;background:#0006; }
  body.mobile-navigation-open { overflow:hidden; }
  body.mobile-navigation-open #appShell>.sidebar { transform:translateX(0);visibility:visible; }
  body.mobile-navigation-open .mobile-nav-backdrop { display:block; }
  body.mobile-shell .topbar { display:block;margin-bottom:18px; }
  body.mobile-shell .topbar>.toolbar { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:14px; }
  body.mobile-shell .topbar .week-stepper { grid-column:1 / 3;display:grid;grid-template-columns:1fr 1fr;gap:8px; }
  body.mobile-shell .topbar #weekPicker { grid-column:3 / 5;min-width:0;width:100%; }
  body.mobile-shell .topbar .location-control { grid-column:1 / 3;min-width:0;width:100%; }
  body.mobile-shell .topbar .location-control select { min-width:0;width:100%; }
  body.mobile-shell .toolbar :is(button,input,select) { min-height:44px; }
  body.mobile-shell .toolbar .share-menu { width:auto;min-width:0; }
  body.mobile-shell .toolbar .share-menu>button { width:100%; }
  body.mobile-shell .toolbar .share-panel { position:fixed;inset:auto 12px calc(var(--mobile-dock-height) + env(safe-area-inset-bottom) + 8px);width:auto;max-height:65dvh;overflow:auto;z-index:90; }
  body.mobile-shell .toolbar .share-panel>button { min-height:44px; }
  body.mobile-shell[data-workflow-view="true"] .topbar { margin-bottom:8px; }
  body.mobile-shell[data-workflow-view="true"] .topbar>.toolbar { display:none; }
  body.mobile-shell #weekTitle,body.mobile-shell[data-theme] #weekTitle { font-size:22px;line-height:1.25; }
  body.mobile-shell .topbar .eyebrow { font-size:10px; }
  body.mobile-shell #myworkView .workflow-heading { margin-top:8px; }
  body.mobile-shell #myworkView .workflow-heading h2 { font-size:24px; }
  body.mobile-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),body.mobile-shell select,body.mobile-shell textarea { font-size:16px; }
  body.mobile-shell :is(.settings-tab,.manage-tab,.task-tab,.workflow-actions button,.home-actions button,.home-week-nav button) { min-height:44px; }
  body.mobile-shell :is(.settings-tabs,.manage-tabs) { display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;scrollbar-width:none; }
  body.mobile-shell :is(.settings-tabs,.manage-tabs)>button { flex:0 0 auto;width:auto; }
  body.mobile-shell dialog { box-sizing:border-box;width:calc(100vw - 16px);max-width:none;max-height:calc(100dvh - env(safe-area-inset-top) - 20px);margin:auto;padding:0; }
  body.mobile-shell dialog .dialog-body { padding:18px;min-width:0; }
  body.mobile-shell dialog.workspace-lifecycle-dialog { padding:18px; }
  body.mobile-shell dialog .dialog-body>header,body.mobile-shell dialog .dialog-body>footer { background:var(--panel-solid); }
  body.mobile-shell dialog :is(button,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select) { min-height:44px; }
  body.mobile-shell #shiftDialog .shift-editor-pair { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.mobile-shell #shiftDialog .shift-editor-pair>label { grid-template-rows:1fr 44px; }
  body.mobile-shell #shiftDialog .dialog-body :is(input,select),body.mobile-shell #shiftDialog footer button { height:44px;min-height:44px; }
  body.mobile-shell #shiftDialog .shift-editor-times { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.mobile-shell #shiftDialog .shift-editor-times>label:last-child { grid-column:1 / -1; }
  body.mobile-shell #shiftDialog footer { position:static; }
  body.mobile-shell .mobile-planner-days { display:grid;grid-template-columns:repeat(7,minmax(44px,1fr));gap:4px;margin:14px 0 10px;overflow-x:auto;scrollbar-width:none; }
  .mobile-planner-days button { display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;min-width:0;min-height:56px;padding:5px 1px;border:1px solid var(--line);border-radius:8px;background:var(--panel-solid);color:var(--muted);box-shadow:none; }
  .mobile-planner-days button span { font-size:10px; }
  .mobile-planner-days button strong { font-size:16px;line-height:1; }
  .mobile-planner-days button[aria-pressed="true"] { color:var(--ink);border-color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,var(--panel-solid)); }
  body.mobile-shell #rotaGrid,body.mobile-shell #tasksView .department-task-grid { max-height:65dvh;overscroll-behavior-x:contain;scrollbar-width:thin; }
  body.mobile-shell #rotaGrid { grid-template-columns:126px repeat(7,minmax(184px,1fr));max-height:none;overflow-x:auto;overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch;scroll-behavior:auto; }
  body.mobile-shell :is(#rotaGrid,.mobile-planner-days,.home-week-scroll) { -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scroll-snap-type:none;touch-action:pan-x pan-y; }
  body.mobile-shell #rotaGrid :is(.shift-card,.day-planner-shift) { -webkit-user-drag:none;touch-action:pan-x pan-y; }
  body.mobile-shell #rotaGrid,body.mobile-shell #rotaGrid :is(.shift-cell,.shift-card,.day-planner-cell,.day-planner-shift) { backdrop-filter:none; }
  body.mobile-shell #rotaGrid.day-column-planner { grid-template-columns:112px repeat(7,minmax(200px,1fr)); }
  body.mobile-shell #rotaGrid :is(.person-row-label,.day-planner-department) { background:var(--panel-solid); }
  body.mobile-shell #rotaGrid .person-name { font-size:14px;line-height:1.4; }
  body.mobile-shell #rotaGrid .day-planner-person strong { white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;font-size:12px;line-height:1.4; }
  body.mobile-shell #rotaGrid .person-row-label { padding:10px; }
  body.mobile-shell #rotaGrid .day-planner-add { min-height:40px; }
  body.mobile-shell #tasksView .task-cell-add { min-height:40px;opacity:1; }
  body.mobile-shell .workflow-toast { bottom:calc(var(--mobile-dock-height) + env(safe-area-inset-bottom) + 12px); }
  body.mobile-shell .workflow-sync-banner { bottom:calc(var(--mobile-dock-height) + env(safe-area-inset-bottom) + 12px); }
  body.mobile-keyboard-open .mobile-dock { display:none; }
  @media(prefers-reduced-motion:reduce) { body.mobile-shell #appShell>.sidebar { transition:none; } }
}
@media print { .mobile-header,.mobile-dock,.mobile-nav-backdrop,.mobile-drawer-close,.mobile-planner-days { display:none!important; } }

/* Phone-first content, not a scaled-down desktop canvas. The original nodes
 * and handlers stay intact; period filtering never affects printed output. */
@media screen and (max-width:900px) {
  body.mobile-shell .main { padding-top:14px; }
  body.mobile-shell .topbar,body.mobile-shell[data-theme] .topbar { padding:0 0 14px;min-height:0;margin:0 0 14px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;box-shadow:none;backdrop-filter:none; }
  body.mobile-shell .topbar>.toolbar { margin-top:10px;grid-template-columns:44px 44px minmax(0,1fr) 58px 58px;gap:8px; }
  body.mobile-shell .topbar .week-stepper { grid-column:1 / 3;gap:8px; }
  body.mobile-shell .topbar .mobile-date-control { display:block;grid-column:3 / 6;position:relative;min-width:0;width:100%;height:44px;box-sizing:border-box;overflow:hidden;border:1px solid var(--line);border-radius:var(--radius,8px);background:var(--control-3,var(--panel-solid)); }
  body.mobile-shell[data-context-toolbar="workspace"] .topbar .mobile-date-control { display:none; }
  body.mobile-shell .topbar #weekPicker { position:absolute;inset:0;display:block;appearance:none;-webkit-appearance:none;box-sizing:border-box;min-inline-size:0;inline-size:100%;max-inline-size:100%;height:100%;margin:0;padding:8px;border:0;border-radius:inherit;font-size:16px;text-align:left;box-shadow:none; }
  body.mobile-shell #weekPicker::-webkit-date-and-time-value { min-width:0;text-align:left; }
  body.mobile-shell #weekPicker::-webkit-datetime-edit { min-width:0;padding:0; }
  body.mobile-shell #weekTitle .week-range { white-space:normal;overflow:visible;overflow-wrap:anywhere; }
  body.mobile-shell .topbar .location-control { grid-column:1 / 4; }
  body.mobile-shell .topbar .share-menu:has(#editBtn) { grid-column:4; }
  body.mobile-shell .topbar .share-menu:has(#shareBtn) { grid-column:5;grid-row:2; }
  body.mobile-shell .topbar .location-control { grid-row:2;align-self:stretch;display:flex;align-items:center; }
  body.mobile-shell .topbar .location-control select { min-height:44px;height:44px; }
  body.mobile-shell .topbar>.eyebrow,body.mobile-shell .topbar>div>.eyebrow { display:none; }
  body.mobile-shell #weekTitle .week-workplace { font-size:14px;font-weight:600; }
  body.mobile-shell #weekTitle .week-workplace { display:none; }
  body.mobile-shell[data-mobile-view="planner"] .mobile-page-title { display:block;font-size:23px;line-height:1.3;margin:0; }
  body.mobile-shell:is([data-mobile-view="mywork"],[data-mobile-view="manage"],[data-mobile-view="settings"],[data-mobile-view="inbox"],[data-mobile-view="activity"]) .topbar { display:none; }
  body.mobile-shell #weekTitle .week-range { display:block;margin-top:3px;font-size:12px;line-height:1.5;color:var(--muted); }
  body.mobile-shell[data-workflow-view="true"] .topbar { padding:0 0 10px;margin-bottom:10px; }
  body.mobile-shell[data-workflow-view="true"] #weekTitle .week-range { display:none; }
  body.mobile-shell #appShell .main .view>.section-heading { display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0 0 14px; }
  body.mobile-shell #appShell .main .view>.section-heading h3 { font-size:22px;line-height:1.3;margin:0; }
  body.mobile-shell #appShell .main .view>.section-heading .eyebrow { display:none; }
  body.mobile-shell #appShell .main .cash-toolbar { width:auto;margin-left:auto;display:flex;gap:8px; }
  body.mobile-shell #appShell .main :is(.section-heading,.notice-row,.open-shift-panel) button { min-height:44px;height:44px;padding-inline:12px; }
  body.mobile-shell #plannerView .notice-row { margin:0 0 8px; }
  body.mobile-shell #plannerView .planner-save-actions { display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px; }
  body.mobile-shell #plannerView .planner-save-actions button { font-size:12px;padding-inline:10px;flex:none; }
  body.mobile-shell #plannerView .planner-save-actions #saveState { flex:1;min-width:0;text-align:left; }
  body.mobile-shell #plannerView #saveState { font-size:11px; }
  body.mobile-shell #plannerView #openShiftPanel { padding:8px 0;margin:0;border:0;border-radius:0;background:none;box-shadow:none; }
  body.mobile-shell #plannerView #openShiftList:not(:has(.open-shift-card)) { display:none; }
  body.mobile-shell #plannerView #openShiftPanel:not(:has(.open-shift-card)) { display:none; }
  body.mobile-shell .mobile-view-switch { display:flex;gap:3px;width:fit-content;padding:3px;background:var(--soft);border:1px solid var(--line);border-radius:8px;margin:10px 0; }
  .mobile-view-switch button { min-height:38px;min-width:76px;border:0;border-radius:6px;background:transparent;color:var(--muted);box-shadow:none;font-size:13px; }
  .mobile-view-switch button[aria-pressed="true"] { background:var(--panel-solid);color:var(--ink);box-shadow:0 1px 3px #0001; }
  body.mobile-shell .mobile-planner-days { margin:10px 0 14px; }
  body.mobile-shell #rotaGrid.mobile-day-planner { display:flex!important;flex-direction:column;gap:10px;min-height:0;max-height:none;overflow:visible;padding:0;border:0;border-radius:0;background:none;box-shadow:none; }
  body.mobile-shell #rotaGrid.mobile-day-planner :is(.mobile-period-excluded,.person-head,.day-planner-corner,.rota-header-row) { display:none!important; }
  body.mobile-shell #rotaGrid.mobile-day-planner .rota-row:not(.rota-header-row) { display:grid;grid-template-columns:minmax(100px,.85fr) minmax(0,1.4fr);align-items:stretch;gap:12px;padding:12px 0;border-bottom:1px solid var(--line); }
  body.mobile-shell #rotaGrid.mobile-day-planner .person-row-label { grid-column:1;grid-row:1;position:static;min-height:0;padding:6px 0;border:0;border-radius:0;background:none;box-shadow:none; }
  body.mobile-shell #rotaGrid.mobile-day-planner .rota-row > .shift-cell { grid-column:2;grid-row:1; }
  /* Root-level selection survives replaced cells, before any redraw callbacks. */
  body.mobile-shell #rotaGrid.mobile-day-planner[data-planner-day="0"] [data-day-index]:not([data-day-index="0"]),
  body.mobile-shell #rotaGrid.mobile-day-planner[data-planner-day="1"] [data-day-index]:not([data-day-index="1"]),
  body.mobile-shell #rotaGrid.mobile-day-planner[data-planner-day="2"] [data-day-index]:not([data-day-index="2"]),
  body.mobile-shell #rotaGrid.mobile-day-planner[data-planner-day="3"] [data-day-index]:not([data-day-index="3"]),
  body.mobile-shell #rotaGrid.mobile-day-planner[data-planner-day="4"] [data-day-index]:not([data-day-index="4"]),
  body.mobile-shell #rotaGrid.mobile-day-planner[data-planner-day="5"] [data-day-index]:not([data-day-index="5"]),
  body.mobile-shell #rotaGrid.mobile-day-planner[data-planner-day="6"] [data-day-index]:not([data-day-index="6"]) { display:none!important; }
  body.mobile-shell #rotaGrid.mobile-day-planner .shift-cell { min-height:74px;padding:0;border:0;border-radius:8px;background:transparent; }
  body.mobile-shell #rotaGrid.mobile-day-planner .shift-card { width:100%;min-height:74px;height:auto;box-sizing:border-box;padding:12px;border-radius:8px;font-size:13px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-date-head { position:static;min-height:0;padding:2px 0 10px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;box-shadow:none;text-align:left; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-date-head strong { font-size:18px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-date-head strong::after { display:none; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-department { position:static;align-items:center;min-height:0;padding:12px 0 0;border:0;border-radius:0;background:none;box-shadow:none; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-department strong { font-size:15px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-department span { font-size:11px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-department [data-weekly-budget]::before { content:"Week · "; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-cell { padding:0;min-height:0;border:0;border-radius:0;background:none;box-shadow:none;gap:8px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-shift { min-height:86px;padding:14px;gap:6px;border-radius:8px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-person strong { font-size:14px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-time { font-size:18px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-meta { font-size:11px; }
  body.mobile-shell #rotaGrid.mobile-day-planner .day-planner-empty { padding:10px 0;font-size:12px; }
  body.mobile-shell :is(.mobile-period-picker,.mobile-settings-picker,.mobile-daily-picker) { display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin:12px 0 16px;color:var(--muted);font-size:12px; }
  body.mobile-shell :is(.mobile-period-picker,.mobile-settings-picker,.mobile-daily-picker) select { width:100%;min-width:0;min-height:46px; }
  body.mobile-shell #settingsView>.settings-tabs { display:none!important; }
  body.mobile-shell #settingsView.active { gap:4px; }
  body.mobile-shell #settingsView .settings-page-heading { padding-bottom:10px; }
  body.mobile-shell #tasksView .task-controls { padding:0;border:0;border-radius:0;background:none;box-shadow:none; }
  body.mobile-shell #tasksView #taskTabs { display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;border:0;background:transparent; }
  body.mobile-shell #tasksView #taskTabs button { width:auto;flex:0 0 auto;min-width:60px;min-height:44px;padding:8px 10px;font-size:12px;white-space:nowrap;border:1px solid var(--line);border-radius:6px;background:var(--panel-solid); }
  body.mobile-shell #tasksView #taskTabs button.active { background:color-mix(in srgb,var(--accent) 14%,var(--panel-solid));border-color:var(--accent); }
  body.mobile-shell #tasksView #taskList.mobile-task-list { display:flex!important;flex-direction:column;max-height:none;min-height:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible;gap:16px; }
  body.mobile-shell #tasksView .mobile-task-list .rota-header-row,body.mobile-shell #tasksView .mobile-task-list .mobile-period-excluded { display:none!important; }
  body.mobile-shell #tasksView .mobile-task-list .rota-row:not(.rota-header-row) { display:flex;flex-direction:column;gap:10px; }
  body.mobile-shell #tasksView .mobile-task-list .person-row-label { position:static;padding:6px 0;min-height:0;border:0;border-radius:0;background:none;box-shadow:none; }
  body.mobile-shell #tasksView .mobile-task-list .person-name { font-size:15px; }
  body.mobile-shell #tasksView .mobile-task-list .department-task-cell { padding:0;min-height:0;border:0;border-radius:0;background:none;gap:8px; }
  body.mobile-shell #tasksView .mobile-task-list .department-task-card { padding:12px;min-height:90px;border:1px solid var(--line);border-left:3px solid var(--task-department-color,var(--accent));border-radius:8px;background:var(--panel-solid); }
  body.mobile-shell #tasksView .mobile-task-list .department-task-title { font-size:14px;line-height:1.5; }
  body.mobile-shell #tasksView .mobile-task-list .department-task-person,body.mobile-shell #tasksView .mobile-task-list .department-task-status { font-size:12px; }
  body.mobile-shell #tasksView .mobile-task-list .department-task-status { min-height:44px; }
  body.mobile-shell #tasksView .mobile-task-list .department-task-status input { min-width:22px;min-height:22px;width:22px;height:22px; }
  body.mobile-shell #tasksView .mobile-task-list .task-cell-add { min-height:44px;height:44px;background:var(--soft);border:1px dashed var(--line); }
  body.mobile-shell #dashboardGrid .mobile-daily-excluded { display:none!important; }
  body.mobile-shell #appShell #dashboardGrid { display:flex;flex-direction:column;gap:12px; }
  body.mobile-shell #appShell #dashboardGrid .dashboard-card { border-radius:8px; }
  body.mobile-shell #cashView .cash-summary-grid { grid-template-columns:minmax(0,1fr); }
  body.mobile-shell #cashView :is(.cash-sheet-grid,.cash-sheet-form-list,.cash-count-grid,.cash-tills-grid) { grid-template-columns:minmax(0,1fr); }
  body.mobile-shell #cashView .cash-sheet-form { grid-template-columns:minmax(0,1fr); }
  body.mobile-shell #cashView .cash-count-section { width:100%;max-width:none;box-sizing:border-box; }
  body.mobile-shell #reportsView .report-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
  body.mobile-shell #reportsView .report-summary-card { padding:12px;border-radius:8px;min-height:96px; }
  body.mobile-shell #reportsView .report-summary-card strong { font-size:23px; }
  body.mobile-shell #reportsView .report-panel { padding:14px;border-radius:8px;min-width:0; }
  body.mobile-shell #myworkView .workflow-heading { align-items:flex-start;gap:10px; }
  body.mobile-shell #myworkView .workflow-heading h2 { font-size:23px;line-height:1.35; }
  body.mobile-shell #myworkView .workflow-heading>button { min-height:44px;flex:none; }
  body.mobile-shell #myworkView .my-work-next { padding:18px;border-radius:8px; }
  body.mobile-shell #myworkView .home-day { min-width:64px; }
  body.mobile-shell #myworkView .home-week-days { grid-template-columns:repeat(7,minmax(72px,1fr)); }
  body.mobile-shell #appShell #myworkView .home-day { height:94px;padding:8px 4px; }
  body.mobile-shell .mobile-nav-backdrop { touch-action:none; }
}
