/* Shared portal navigation. Native record layouts and printed sheets stay intact. */
@media screen {
  /* Keep the original artwork inside the sidebar content edge, without negative gutters. */
  #shell > .sidebar > .brand.portal-brand-lockup {
    display: flex; flex-direction: column; align-items: center; flex: 0 0 auto;
    width: 100%; max-width: none; min-width: 0; margin: 0; padding: 0; gap: 0;
  }
  #shell > .sidebar > .portal-brand-lockup .portal-brand-logo {
    display: block; flex: 0 0 auto; width: 100%; max-width: 176px; height: auto;
    aspect-ratio: 2622 / 1009; object-fit: contain; overflow: visible;
  }
  #shell > .sidebar #sidebar-date {
    display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; column-gap: 8px; row-gap: 0;
    width: 100%; min-width: 0; margin: 0; padding: 0; text-align: center; font-size: clamp(11px, calc(12px * var(--portal-text-scale, 1)), 16px);
    line-height: 1.6; font-variant-numeric: tabular-nums;
  }
  :is(#sidebar-date, #portal-mobile-date) > :is(.portal-current-date, .portal-current-time) { white-space: nowrap; }
  #shell > .workspace > .portal-banner .portal-mobile-date { display: none; }
  #shell > .workspace > .topbar.portal-banner,
  #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 8px;
    min-height: 48px; height: auto; padding: 7px 16px; overflow: visible;
  }
  #shell > .workspace > .portal-banner #breadcrumb {
    display: block; flex: 0 1 auto; max-width: 24%; min-width: 64px;
    margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: inherit; font-size: calc(16px * var(--portal-text-scale, 1)); font-weight: 650; line-height: 1.4;
  }
  #shell > .workspace > .portal-banner #banner-apps {
    display: flex; flex: 1 1 0; align-items: center; gap: 4px; min-width: 48px;
    margin: 0; padding: 3px 3px; overflow-x: auto; overflow-y: hidden;
    white-space: nowrap; overscroll-behavior-x: contain; scrollbar-width: thin;
  }
  #shell > .workspace > .portal-banner :is(.portal-mobile-brand, .portal-banner-reading-tools) { display: none; }
  #shell > .workspace > .portal-banner .portal-banner-app-row { display: contents; }
  #shell > .workspace > .portal-banner .portal-banner-app-row[hidden] { display: none; }
  #shell > .workspace > .topbar.portal-banner[hidden] { display: none !important; }
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-desktop-icon {
    display: inline-flex; width: 18px; height: 18px;
  }
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-desktop-icon > svg { display: block; width: 100%; height: 100%; }
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-mobile-icon { display: none; }
  #shell > .workspace > .portal-banner #banner-menu { flex: 0 0 auto; }
  #shell > .workspace > .portal-banner #account-actions { flex: 0 0 auto; width: auto; min-width: 0; }
  #shell > .workspace > .portal-banner .topbar-tools { flex-wrap: nowrap; width: auto; gap: 6px; }
  #shell > .workspace > .portal-banner :is(#banner-apps, #banner-menu)[hidden] { display: none; }
  .portal-banner-shortcut,
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle,
  #portal-banner-apps-menu .portal-banner-menu-head > button {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 32px; width: 32px; height: 32px; min-width: 32px; min-height: 32px;
    margin: 0; padding: 6px; border: 1px solid var(--line, #dec8aa); border-radius: 6px;
    color: var(--ink, #4c2b16); background: var(--paper, #fffaf0); text-decoration: none;
    font: inherit; line-height: 1.3; cursor: pointer;
  }
  .portal-banner-shortcut > .gd-icon,
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle > svg,
  #portal-banner-apps-menu .portal-banner-menu-head > button > svg { display: inline-flex; flex: 0 0 18px; width: 18px; height: 18px; }
  .portal-banner-shortcut > .gd-icon > svg { display: block; width: 18px; height: 18px; }
  .portal-banner-shortcut > .shortcut-label,
  .portal-banner-shortcut > .shortcut-arrow { display: none; }
  .portal-banner-shortcut > .sharing-nav-badge { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 17px; min-height: 17px; margin: 0; padding: 0 4px; border: 2px solid var(--paper, #fffdf7); border-radius: 12px; background: #d9361d; color: #fffdf7; font-size: 10px; font-weight: 700; line-height: 1.3; }
  .portal-banner-shortcut.active { background: var(--cream, #fff0d7); border-color: var(--brown, #8a5731); }
  .portal-banner-shortcut:focus-visible,
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle:focus-visible,
  #portal-banner-apps-menu button:focus-visible { outline: 3px solid var(--brown, #8a5731); outline-offset: 2px; }
  .portal-banner-shortcut.is-menu-dragging { opacity: .45; }
  .portal-banner-shortcut.is-menu-drop-before { box-shadow: -3px 0 var(--brown, #8a5731); }
  .portal-banner-shortcut.is-menu-drop-after { box-shadow: 3px 0 var(--brown, #8a5731); }
  #portal-banner-apps-menu {
    display: none; position: fixed; inset: var(--portal-banner-menu-top, 56px) var(--portal-banner-menu-right, 12px) auto auto;
    width: var(--portal-banner-menu-width, min(420px, calc(100vw - 24px))); max-width: calc(100vw - 24px);
    max-height: var(--portal-banner-menu-height, calc(100dvh - 72px)); margin: 0; padding: 12px;
    overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line, #dec8aa); border-radius: 12px;
    color: var(--ink, #4c2b16); background: var(--paper, #fffaf0); box-shadow: 0 8px 30px #2f1d1b29;
    font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.5;
  }
  #portal-banner-apps-menu:popover-open,
  #portal-banner-apps-menu[data-banner-fallback-open] { display: block; }
  #portal-banner-apps-menu[data-banner-fallback-open] { z-index: 100; }
  #portal-banner-apps-menu .portal-banner-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  #portal-banner-apps-menu .portal-banner-menu-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
  #portal-banner-apps-menu .portal-banner-shortcut { display: flex; justify-content: flex-start; gap: 8px; width: 100%; height: auto; min-height: 44px; padding: 9px; white-space: normal; text-align: left; }
  #portal-banner-apps-menu .portal-banner-shortcut > .shortcut-label { display: block; min-width: 0; overflow-wrap: anywhere; }
  #portal-banner-apps-menu .portal-banner-shortcut > .shortcut-label strong { font: inherit; }
  #portal-banner-apps-menu .portal-banner-shortcut > .sharing-nav-badge { position: static; flex: 0 0 auto; margin-left: auto; }
  #portal-banner-apps-menu .portal-banner-menu-tools { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, #dec8aa); }
  #portal-banner-apps-menu .portal-banner-menu-tools button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 9px; border: 1px solid var(--line, #dec8aa); border-radius: 6px; color: inherit; background: var(--paper, #fffaf0); font: inherit; text-align: left; cursor: pointer; }
  #portal-banner-apps-menu .portal-banner-menu-tools button + button { margin-top: 6px; }
  #portal-banner-apps-menu .portal-banner-menu-tools svg { width: 18px; height: 18px; flex: 0 0 18px; }
  #main:not(.module-main) .portal-page-intro { align-items: center; margin-bottom: 16px; }
  #main:not(.module-main) .portal-page-intro > .lead { flex: 1 1 auto; margin: 0; }
  #main:not(.module-main) .sharing-heading .sharing-title > h1 { display: none; }
  #module-root[data-goodday-module="attendance"] > .workspace > .brand > .appname,
  #module-root[data-goodday-module="transport"] .topbar .brand-name > small,
  #module-root[data-goodday-module="cards"] .topbar .brand > span > small { display: none; }
}
@media screen and (min-width: 761px) and (max-width: 1100px) {
  #shell > .workspace > .topbar.portal-banner { padding-inline: 10px; gap: 4px; }
  #shell > .workspace > .portal-banner #breadcrumb { min-width: 48px; }
  #shell > .workspace > .portal-banner .topbar-tools > :is(.page-help-button, .color-mode-button) { display: none; }
}
/* Desktop navigation stays in the sidebar; the banner contains only page utilities. */
@media screen and (min-width: 761px) {
  #shell > .workspace > .topbar.portal-banner,
  #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) {
    align-items: center; min-height: 48px; padding: 6px 12px; gap: 8px;
  }
  #shell > .workspace > .portal-banner :is(#banner-apps, #banner-menu, #portal-banner-collapse) { display: none !important; }
  #shell > .workspace > .portal-banner #breadcrumb {
    align-self: center; flex: 1 1 auto; max-width: none; min-width: 0;
    font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.4;
  }
  #shell > .workspace > .portal-banner #account-actions { align-self: center; margin-left: auto; }
  #shell > .workspace > .portal-banner .topbar-tools {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 4px; width: auto;
  }
  #shell > .workspace > .portal-banner .topbar-tools > :is(.page-help-button, .color-mode-button) { display: inline-flex; }
  #shell > .workspace > .portal-banner .portal-font-tools { display: flex; align-items: center; gap: 3px; width: auto; }
  #shell > .workspace > .portal-banner :is(.notification-history-bell, .color-mode-button, .page-help-button, .portal-font-tools button) {
    height: 36px; min-height: 36px; margin: 0; padding: 4px 8px; white-space: nowrap;
    font-size: calc(12px * var(--portal-text-scale, 1));
  }
  #shell > .workspace > .portal-banner :is(.notification-history-bell, .color-mode-button) { width: 36px; min-width: 36px; padding: 6px; }
  #shell > .workspace > .portal-banner :is(.notification-history-bell, .color-mode-button) > svg { width: 22px; height: 22px; }
  #shell > .workspace > .portal-banner .portal-font-tools button { min-width: 32px; }
  #shell > .workspace > .portal-banner .portal-font-tools button[data-font-help] { min-width: 76px; }
  #portal-banner-apps-menu .portal-banner-menu-tools > [data-banner-collapse] { display: none; }
}
/* Mobile uses the same account menu and app order, with a separate touch track per group. */
@media screen and (max-width: 760px) {
  #shell > .sidebar,
  html[data-portal-mobile-menu-open="true"] #shell > .sidebar,
  #shell > .sidebar > #mobile-menu-toggle,
  #portal-display-float { display: none !important; }
  #shell > .workspace { min-width: 0; width: 100%; margin-left: 0; }
  #shell > .workspace > .topbar.portal-banner,
  #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) {
    display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px;
    grid-template-rows: 44px minmax(18px, auto) minmax(14px, auto) auto 44px;
    align-items: center; justify-content: stretch; gap: 0 4px;
    min-width: 0; min-height: 0; height: auto; padding: 4px 8px 0;
    background: var(--paper, #fffaf0); border-bottom: 1px solid var(--line, #dec8aa);
  }
  #shell > .workspace > .portal-banner .portal-mobile-brand {
    grid-column: 1; grid-row: 1; display: flex; align-items: center;
    width: 114px; max-width: 100%; min-width: 0; height: 44px; min-height: 44px;
    margin: 0; padding: 0; border: 0; border-radius: 3px; background: #fff;
    text-decoration: none; overflow: visible;
  }
  #shell > .workspace > .portal-banner .portal-mobile-brand > svg {
    display: block; width: 100%; max-width: 114px; height: auto;
    aspect-ratio: 2622 / 1009; object-fit: contain;
  }
  #shell > .workspace > .portal-banner .portal-mobile-date {
    grid-column: 1 / -1; grid-row: 2; display: flex; align-items: baseline; flex-wrap: wrap;
    column-gap: 8px; row-gap: 0; min-width: 0; margin: 0; padding: 0;
    color: var(--muted, #84776c); font-size: clamp(11px, calc(11px * var(--portal-text-scale, 1)), 14px);
    line-height: 1.6; font-variant-numeric: tabular-nums;
  }
  #shell > .workspace > .portal-banner #breadcrumb {
    grid-column: 1 / -1; grid-row: 3; display: block; align-self: start;
    max-width: 100%; min-width: 0; margin: 0; padding: 0 0 2px;
    color: var(--muted, #84776c); font-size: calc(11px * var(--portal-text-scale, 1));
    line-height: 1.25; white-space: nowrap; overflow-wrap: normal;
    overflow: hidden; text-overflow: ellipsis;
  }
  html[data-portal-page="portal"] #shell > .workspace > .portal-banner #breadcrumb { display: none; }
  #shell > .workspace > .portal-banner #account-actions {
    grid-column: 2; grid-row: 1; align-self: start; justify-self: stretch;
    width: 44px; min-width: 0; margin: 0;
  }
  #shell > .workspace > .portal-banner #banner-menu {
    grid-column: 3; grid-row: 1; align-self: start; justify-self: stretch;
    width: 44px; min-width: 0;
  }
  #shell > .workspace > .portal-banner .topbar-tools > :not(#notification-history-control) { display: none; }
  #shell > .workspace > .portal-banner .topbar-tools {
    display: flex; align-items: center; justify-content: center; width: 44px; min-width: 0; gap: 0;
  }
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle,
  #shell > .workspace > .portal-banner .notification-history-bell,
  #portal-banner-apps-menu .portal-banner-menu-head > button {
    flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 6px;
  }
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle > svg,
  #shell > .workspace > .portal-banner .notification-history-bell > svg { width: 26px; height: 26px; }
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-desktop-icon { display: none; }
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-mobile-icon { display: inline-flex; width: 26px; height: 26px; }
  #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-mobile-icon > svg { display: block; width: 100%; height: 100%; }
  #portal-banner-apps-menu .portal-banner-menu-head > button > svg { width: 24px; height: 24px; }
  #shell > .workspace > .portal-banner #banner-apps {
    grid-column: 1 / -1; grid-row: 4; display: grid; grid-template-columns: minmax(0, 1fr);
    align-items: stretch; gap: 2px; width: 100%; max-width: 100%; min-width: 0;
    margin: 2px 0 0; padding: 0; overflow-x: auto; overflow-y: hidden; white-space: normal;
    overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 6px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom;
  }
  #shell > .workspace > .portal-banner #banner-apps[hidden] { display: none; }
  #shell > .workspace > .portal-banner #banner-apps > .portal-banner-app-row {
    display: flex; align-items: stretch; flex-wrap: nowrap; gap: 2px;
    width: max-content; min-width: 100%; max-width: none; min-height: 56px; margin: 0; padding: 1px 6px 1px 0;
    overflow: visible;
  }
  #shell > .workspace > .portal-banner #banner-apps > .portal-banner-app-row[hidden] { display: none; }
  #shell > .workspace > .portal-banner #banner-apps::-webkit-scrollbar { display: none; }
  #shell > .workspace > .portal-banner #banner-apps > .portal-banner-app-row > .portal-banner-shortcut {
    display: flex; flex: 0 0 67px; flex-direction: column; justify-content: center; align-items: center;
    gap: 1px; width: 67px; min-width: 67px; height: 54px; min-height: 54px;
    padding: 1px 1px 2px; border-radius: 6px; scroll-snap-align: start; white-space: nowrap; text-align: center;
    touch-action: pan-x pan-y pinch-zoom; -webkit-user-drag: none;
  }
  #shell > .workspace > .portal-banner #banner-apps > .portal-banner-app-row > .portal-banner-shortcut > .gd-icon,
  #shell > .workspace > .portal-banner #banner-apps > .portal-banner-app-row > .portal-banner-shortcut > .gd-icon > svg {
    display: block; flex: 0 0 28px; width: 28px; height: 28px;
  }
  #shell > .workspace > .portal-banner #banner-apps > .portal-banner-app-row > .portal-banner-shortcut > .shortcut-label {
    display: block; min-width: 0; max-width: 100%; width: 100%; overflow: hidden; text-overflow: ellipsis;
    color: inherit; font-size: calc(10.5px * var(--portal-text-scale, 1)); line-height: 1.2;
    white-space: nowrap; overflow-wrap: normal; word-break: normal;
  }
  #shell > .workspace > .portal-banner #banner-apps .gd-menu-label-text {
    display: block; max-width: 100%; width: auto; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font: inherit; font-weight: 600; transform: none;
  }
  #shell > .workspace > .portal-banner .portal-banner-collapse {
    grid-column: 1 / -1; grid-row: 5; position: static; display: inline-flex;
    align-self: stretch; justify-self: center; align-items: center; justify-content: center;
    width: 70px; min-width: 70px; height: 44px; min-height: 44px; margin: 0;
    padding: 0 10px; transform: none; border: 0; border-radius: 8px;
    background: transparent; color: var(--brown, #6f431f); font: inherit; font-size: 12px; line-height: 1;
    cursor: pointer; touch-action: manipulation;
  }
  #shell > .workspace > .portal-banner .portal-banner-collapse:focus-visible { outline: 3px solid var(--brown, #6f431f); outline-offset: -3px; }
  #shell > .workspace > .portal-banner .portal-banner-collapse[hidden] { display: none; }
  #shell > .workspace > .portal-banner[data-banner-collapsed="true"] { grid-template-rows: 44px minmax(18px, auto) minmax(14px, auto) 0 44px; }
  #shell > .workspace > .portal-banner:has(#portal-banner-collapse[hidden]) { grid-template-rows: 44px minmax(18px, auto) minmax(14px, auto); padding-bottom: 4px; }
  html[data-portal-page="portal"] #shell > .workspace > .topbar.portal-banner,
  html[data-portal-page="portal"] #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) { grid-template-rows: 44px minmax(18px, auto) 0 auto 44px; }
  html[data-portal-page="portal"] #shell > .workspace > .topbar.portal-banner[data-banner-collapsed="true"] { grid-template-rows: 44px minmax(18px, auto) 0 0 44px; }
  html[data-portal-page="portal"] #shell > .workspace > .portal-banner:has(#portal-banner-collapse[hidden]) { grid-template-rows: 44px minmax(18px, auto) 0; }
  #shell > .workspace > .portal-banner .portal-banner-reading-tools {
    position: absolute; right: max(8px, env(safe-area-inset-right)); bottom: 0;
    display: flex; align-items: center; justify-content: flex-end; height: 44px; min-width: 0;
    pointer-events: none;
  }
  #shell > .workspace > .portal-banner .portal-banner-reading-tools[hidden] { display: none; }
  #portal-banner-reading-tools #portal-back-to-top {
    position: static; inset: auto; transform: none; width: auto; min-width: 64px; max-width: 96px;
    height: 44px; min-height: 44px; margin: 0; padding: 4px 6px; border: 0; border-radius: 8px;
    box-shadow: none; background: transparent; color: inherit; font-size: calc(11px * var(--portal-text-scale, 1));
    line-height: 1.25; pointer-events: auto;
  }
  #portal-banner-reading-tools #portal-back-to-top[hidden] { display: none; }
  #portal-banner-apps-menu {
    max-width: calc(100vw - 16px); padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  #portal-banner-apps-menu .portal-banner-menu-head {
    position: sticky; top: -10px; z-index: 2; min-height: 44px; margin: -1px 0 6px; padding: 0 0 6px;
    background: var(--paper, #fffaf0); border-bottom: 1px solid var(--line, #dec8aa);
  }
  #portal-banner-apps-menu .portal-banner-menu-head > strong { min-width: 0; overflow-wrap: anywhere; }
  #portal-banner-apps-menu .portal-banner-menu-list { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  #portal-banner-apps-menu .portal-banner-shortcut { min-height: 44px; padding: 8px; border-color: transparent; }
  #portal-banner-apps-menu .portal-banner-shortcut > .shortcut-label,
  #portal-banner-apps-menu .portal-banner-shortcut > .shortcut-label > .gd-menu-label-text {
    position: static; display: block; width: auto; height: auto; min-width: 0; max-width: 100%;
    overflow: visible; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; font: inherit; transform: none;
  }
  #portal-banner-apps-menu .portal-banner-menu-tools { margin-top: 8px; padding-top: 8px; }
}
@media screen and (max-width: 359px) {
  #portal-banner-apps-menu .portal-banner-menu-list { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  #shell > .workspace > .portal-banner,
  #portal-banner-apps-menu { display: none !important; }
}

/* Retain the display-menu caller for focus restoration while a native app modal is open. */
@media screen {
  body:has(#module-root :is([role="dialog"], [role="alertdialog"])[data-state="open"]) #portal-display-float {
    visibility: hidden; pointer-events: none;
  }
}

/* Native popover activation always lands on its button, including icon taps. */
.portal-banner-menu-toggle *,
#portal-banner-apps-menu button[popovertarget] * { pointer-events: none; }

/* Give the shared inbox a visible name without hiding its unread count. */
#shell > .workspace > .portal-banner .notification-history-control .notification-history-bell{width:auto;min-width:94px;height:auto;min-height:40px;padding:7px 10px;gap:6px;background:#fff0de;border-color:#d98558;color:#6d301c;font:inherit;font-size:calc(13px * var(--portal-text-scale,1));font-weight:700;line-height:1.35}
#shell > .workspace > .portal-banner .notification-history-bell>svg{width:21px;height:21px}
#shell > .workspace > .portal-banner .notification-history-bell[data-has-unread="true"]{background:#ffdfc7;border-color:#c74525;box-shadow:inset 3px 0 0 #c74525}
#main:not(.module-main) .native-event .native-event-time,#main:not(.module-main) .native-event.compact .native-event-time{color:#4f3928;font-size:.88em;font-weight:700;opacity:1;font-variant-numeric:tabular-nums;line-height:1.5;white-space:normal;overflow-wrap:anywhere;max-width:100%}
@media screen and (max-width:760px){
 #shell > .workspace > .topbar.portal-banner,
 #shell > .workspace > .topbar.portal-banner:has(.topbar-tools){grid-template-columns:minmax(0,1fr) max-content 44px}
 #shell > .workspace > .portal-banner #account-actions,
 #shell > .workspace > .portal-banner .topbar-tools{width:auto}
 #shell > .workspace > .portal-banner .notification-history-control .notification-history-bell{flex:0 0 auto;min-width:90px;min-height:44px;padding:7px 9px;font-size:calc(12px * var(--portal-text-scale,1))}
}

.portal-banner-menu-label, #portal-mobile-menu-float { display:none; }
@media screen and (max-width:760px) {
 #shell > .workspace > .topbar.portal-banner,
 #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) { grid-template-columns:96px minmax(0,1fr) max-content; position:relative; top:auto; }
 #shell > .workspace > .portal-banner #banner-menu { grid-column:1; width:96px; }
 #shell > .workspace > .portal-banner .portal-mobile-brand { grid-column:2; justify-self:center; }
 #shell > .workspace > .portal-banner #account-actions { grid-column:3; }
 #shell > .workspace > .portal-banner .portal-banner-menu-toggle { width:96px; min-width:96px; gap:4px; padding:6px; font-size:clamp(12px,calc(12px * var(--portal-text-scale,1)),14px); }
 #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-mobile-icon { flex:0 0 20px; width:20px; height:20px; }
 #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-mobile-icon > svg { width:20px; height:20px; }
 #shell > .workspace > .portal-banner .portal-banner-menu-label { display:inline; white-space:nowrap; }
 #portal-mobile-menu-float:not([hidden]) { position:fixed; z-index:45; left:max(12px,env(safe-area-inset-left)); bottom:max(var(--mobile-menu-float-bottom,12px),calc(12px + env(safe-area-inset-bottom))); display:inline-flex; align-items:center; justify-content:center; gap:6px; width:auto; min-width:100px; max-width:calc(100vw - 24px); min-height:44px; padding:8px 10px; border:1px solid #c5b9a6; border-radius:12px; background:rgb(255 253 247 / 90%); color:#493723; box-shadow:0 2px 8px #47352220; font:inherit; font-weight:650; font-size:clamp(13px,calc(13px * var(--portal-text-scale,1)),16px); line-height:1.3; touch-action:manipulation; }
 #portal-mobile-menu-float svg { flex:0 0 20px; width:20px; height:20px; }
 #portal-mobile-menu-float:focus-visible { outline:3px solid #5b7857; outline-offset:2px; }
 html[data-mobile-drawer-open="true"],html[data-mobile-drawer-open="true"] body { overflow:hidden; }
 #portal-banner-apps-menu[open] { display:block; position:fixed; inset:var(--portal-banner-menu-top,0px) auto auto var(--portal-banner-menu-left,0px); width:var(--portal-banner-menu-width,86vw); max-width:calc(100vw - 24px); height:var(--portal-banner-menu-height,100dvh); max-height:var(--portal-banner-menu-height,100dvh); box-sizing:border-box; margin:0; padding:12px; padding-top:max(12px,env(safe-area-inset-top)); padding-bottom:max(12px,env(safe-area-inset-bottom)); border:0; border-right:1px solid var(--line,#dec8aa); border-radius:0 14px 14px 0; overflow:auto; overscroll-behavior:contain; box-shadow:4px 0 18px #24170d25; }
 #portal-banner-apps-menu[open]::backdrop { background:rgb(25 20 15 / 32%); backdrop-filter:none; -webkit-backdrop-filter:none; }
 #portal-banner-apps-menu[open] .portal-banner-menu-head { top:calc(-1 * max(12px,env(safe-area-inset-top))); padding-top:4px; }
}
@media print { #portal-mobile-menu-float { display:none!important; } }

@media screen {
 #portal-banner-apps-menu .portal-banner-menu-account { margin: 0 0 8px; color: var(--muted, #84776c); font-size: .85em; overflow-wrap: anywhere; }
 #portal-banner-apps-menu .portal-banner-menu-privacy { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-top: 6px; color: inherit; }
 #portal-banner-apps-menu .portal-banner-menu-privacy svg { width: 16px; height: 16px; }
}
@media screen and (max-width: 760px) {
 html[data-portal-editing="true"] #main:not(.module-main) .portal-home-head { display: flex; height: auto; margin: 0 0 8px; }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-home-actions > [data-appearance-edit] { position: static; inset: auto; box-shadow: none; }
}

@media screen and (max-width: 760px) {
 /* Let a vertical swipe continue to the page at a widget's scroll boundary. */
 #main:not(.module-main) .portal-widget-body { overscroll-behavior-y: auto; }
}


/* Mobile header: one menu location; the current page remains visible while reading. */
@media screen and (max-width:760px) {
  #shell > .workspace > .topbar.portal-banner,
  #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) {
    position:sticky !important; top:0 !important;
    grid-template-columns:96px minmax(0,1fr) max-content;
    grid-template-rows:44px minmax(20px,auto) !important;
    gap:2px 4px; padding:4px 8px; min-width:0;
  }
  #shell > .workspace > .portal-banner :is(#banner-apps,#portal-banner-collapse,#portal-mobile-date,.portal-banner-reading-tools),
  #portal-mobile-menu-float,
  #portal-banner-apps-menu [data-banner-collapse] { display:none !important; }
  #module-root[data-goodday-module="transport"] .topbar .current-clock { display:none !important; }
  #shell > .workspace > .portal-banner .portal-mobile-brand { grid-column:2; grid-row:1; }
  #shell > .workspace > .portal-banner #banner-menu { grid-column:1; grid-row:1; }
  #shell > .workspace > .portal-banner #account-actions { grid-column:3; grid-row:1; }
  #shell > .workspace > .portal-banner #breadcrumb {
    display:block !important; grid-column:1 / -1; grid-row:2; align-self:center;
    min-width:0; max-width:100%; margin:0; padding:0;
    font-size:clamp(13px,calc(14px * var(--portal-text-scale,1)),18px);
    font-weight:650; line-height:1.4; color:var(--ink,#4c2b16);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  html[data-mobile-apps-collapsed="true"] #shell > .workspace > .topbar.portal-banner,
  html[data-mobile-apps-collapsed="true"] #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) {
    grid-template-columns:44px minmax(0,1fr) 44px;
    grid-template-rows:44px !important;
  }
  html[data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner :is(.portal-mobile-brand,.portal-banner-menu-label,.notification-history-label) { display:none !important; }
  html[data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner #breadcrumb { grid-column:2; grid-row:1; padding-inline:4px; }
  html[data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner :is(#banner-menu,#account-actions,.topbar-tools) { width:44px; min-width:0; }
  html[data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner :is(.portal-banner-menu-toggle,.notification-history-control .notification-history-bell) {
    width:44px; min-width:44px; height:44px; min-height:44px; padding:8px; gap:0;
  }
}

/* Mobile header r3: no title row before reading; compact reading controls stay together. */
@media screen and (max-width:760px) {
  #shell > .workspace > .topbar.portal-banner,
  #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) {
    grid-template-rows:44px !important; row-gap:0;
  }
  html:not([data-mobile-apps-collapsed="true"]) #shell > .workspace > .portal-banner #breadcrumb {
    display:none !important;
  }
  #shell > .workspace > #main:not(:has(.auth-card)) {
    padding-top:6px !important;
  }
}

/* Mobile main r4: meet the module toolbar without extra starting space. */
@media screen and (max-width:760px) {
  #shell > .workspace > #main:not(:has(.auth-card)) {
    padding-top:0 !important;
  }
}

/* Wide phones keep the touch shell while rotated. Business page grids remain
 * free to use the horizontal space; tablets, desktop and print stay unchanged. */
@media screen {
 html[data-portal-phone-landscape="true"] #shell > .sidebar,
 html[data-portal-phone-landscape="true"][data-portal-mobile-menu-open="true"] #shell > .sidebar,
 html[data-portal-phone-landscape="true"] #shell > .sidebar > #mobile-menu-toggle { display:none !important; }
 html[data-portal-phone-landscape="true"] #shell > .workspace { min-width:0; width:100%; margin-left:0; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .topbar.portal-banner,
 html[data-portal-phone-landscape="true"] #shell > .workspace > .topbar.portal-banner:has(.topbar-tools) {
  display:grid; position:sticky !important; top:0 !important;
  grid-template-columns:96px minmax(0,1fr) max-content; grid-template-rows:44px !important;
  align-items:center; justify-content:stretch; gap:0 4px; min-width:0; min-height:0; height:auto;
  padding:2px max(8px,env(safe-area-inset-right)) 2px max(8px,env(safe-area-inset-left));
 }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner :is(#banner-apps,#portal-banner-collapse,#portal-mobile-date,.portal-banner-reading-tools),
 html[data-portal-phone-landscape="true"] #portal-mobile-menu-float,
 html[data-portal-phone-landscape="true"] #portal-banner-apps-menu [data-banner-collapse],
 html[data-portal-phone-landscape="true"] #portal-display-float,
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="transport"] .topbar .current-clock { display:none !important; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .portal-mobile-brand {
  display:flex; grid-column:2; grid-row:1; justify-self:center; align-items:center;
  width:114px; max-width:100%; min-width:0; height:44px; min-height:44px; margin:0; padding:0;
  border:0; background:#fff; overflow:visible;
 }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .portal-mobile-brand > svg { display:block; width:100%; height:auto; max-width:114px; aspect-ratio:2622/1009; object-fit:contain; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner #banner-menu { display:block !important; grid-column:1; grid-row:1; width:96px; min-width:0; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner #banner-menu[hidden] { display:none !important; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner #account-actions { grid-column:3; grid-row:1; width:auto; min-width:0; margin:0; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .topbar-tools { display:flex; align-items:center; width:auto; gap:0; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .topbar-tools > :not(#notification-history-control) { display:none !important; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .portal-banner-menu-toggle { flex:0 0 96px; width:96px; min-width:96px; height:44px; min-height:44px; gap:4px; padding:6px; font-size:clamp(12px,calc(12px * var(--portal-text-scale,1)),14px); }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .portal-banner-menu-label { display:inline; white-space:nowrap; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-desktop-icon { display:none; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .portal-banner-menu-toggle .portal-banner-menu-mobile-icon { display:inline-flex; flex:0 0 20px; width:20px; height:20px; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .portal-banner-menu-mobile-icon > svg { display:block; width:100%; height:100%; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner .notification-history-control .notification-history-bell { width:auto; min-width:90px; height:44px; min-height:44px; padding:7px 9px; font-size:clamp(12px,calc(12px * var(--portal-text-scale,1)),16px); }
 html[data-portal-phone-landscape="true"] #shell > .workspace > .portal-banner #breadcrumb { display:none !important; min-width:0; max-width:100%; margin:0; padding:0; }
 html[data-portal-phone-landscape="true"][data-mobile-apps-collapsed="true"] #shell > .workspace > .topbar.portal-banner { grid-template-columns:44px minmax(0,1fr) 44px; }
 html[data-portal-phone-landscape="true"][data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner :is(.portal-mobile-brand,.portal-banner-menu-label,.notification-history-label) { display:none !important; }
 html[data-portal-phone-landscape="true"][data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner #breadcrumb { display:block !important; grid-column:2; grid-row:1; padding-inline:4px; font-size:clamp(13px,calc(14px * var(--portal-text-scale,1)),18px); font-weight:650; line-height:1.4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 html[data-portal-phone-landscape="true"][data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner :is(#banner-menu,#account-actions,.topbar-tools) { width:44px; min-width:0; }
 html[data-portal-phone-landscape="true"][data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner :is(.portal-banner-menu-toggle,.notification-history-control .notification-history-bell) { width:44px; min-width:44px; height:44px; min-height:44px; padding:8px; gap:0; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > #main:not(:has(.auth-card)) { padding-top:0 !important; }
 html[data-portal-phone-landscape="true"] #shell > .workspace > #main:not(.module-main) { padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right)); }
 /* The same mobile widget profile survives rotation; controls use its editor. */
 html[data-portal-phone-landscape="true"] #shell > .workspace [data-appearance-edit],
 html[data-portal-phone-landscape="true"] #shell > .workspace #main:not(.module-main) :is(.portal-drag-handle,.portal-edit-help) { display:none; }
 html[data-portal-phone-landscape="true"][data-mobile-drawer-open="true"],
 html[data-portal-phone-landscape="true"][data-mobile-drawer-open="true"] body { overflow:hidden; }
 html[data-portal-phone-landscape="true"] #portal-banner-apps-menu[open] {
  display:block; position:fixed; inset:var(--portal-banner-menu-top,0px) auto auto var(--portal-banner-menu-left,0px);
  width:var(--portal-banner-menu-width,360px); max-width:calc(100vw - 24px); height:var(--portal-banner-menu-height,100dvh); max-height:var(--portal-banner-menu-height,100dvh);
  box-sizing:border-box; margin:0; padding:8px max(12px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-bottom)); border:0; border-right:1px solid var(--line,#dec8aa); border-radius:0 14px 14px 0;
  overflow:auto; overscroll-behavior:contain; box-shadow:4px 0 18px #24170d25;
 }
 html[data-portal-phone-landscape="true"] #portal-banner-apps-menu[open]::backdrop { background:rgb(25 20 15 / 32%); backdrop-filter:none; -webkit-backdrop-filter:none; }
 html[data-portal-phone-landscape="true"] #portal-banner-apps-menu .portal-banner-menu-head { position:sticky; top:-8px; z-index:2; min-height:44px; padding:0 0 4px; margin:0 0 4px; background:var(--paper,#fffaf0); }
 html[data-portal-phone-landscape="true"] #portal-banner-apps-menu .portal-banner-menu-head > button { width:44px; min-width:44px; height:44px; min-height:44px; }
 html[data-portal-phone-landscape="true"] #portal-banner-apps-menu .portal-banner-menu-list { grid-template-columns:minmax(0,1fr); gap:3px; }
 html[data-portal-phone-landscape="true"] #portal-banner-apps-menu .portal-banner-shortcut { min-height:44px; padding:8px; }
 html[data-portal-phone-landscape="true"] #portal-banner-apps-menu .portal-banner-shortcut :is(.shortcut-label,.gd-menu-label-text) { display:block; width:auto; min-width:0; max-width:100%; overflow:visible; white-space:normal; overflow-wrap:anywhere; font:inherit; transform:none; }
 /* Only the three shell-owned dialogs are sized here. Native app dialogs keep
  * their own scroll and dirty-input/focus behavior. */
 html[data-portal-phone-landscape="true"] :is(#detail-dialog,#notification-choice-dialog,#appearance-dialog.appearance-dialog) {
  position:fixed; top:calc(var(--portal-phone-viewport-top,0px) + max(8px,env(safe-area-inset-top))); bottom:auto;
  max-width:calc(100vw - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)));
  max-height:calc(var(--portal-phone-viewport-height,100dvh) - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)));
  margin-block:0; border-radius:14px; overscroll-behavior:contain;
 }
 html[data-portal-phone-landscape="true"] :is(#detail-dialog,#notification-choice-dialog) { left:max(8px,env(safe-area-inset-left)); right:max(8px,env(safe-area-inset-right)); margin-inline:auto; overflow-y:auto; }
 html[data-portal-phone-landscape="true"] :is(#detail-dialog,#notification-choice-dialog) .dialog-head { position:sticky; top:0; z-index:2; align-items:center; padding:6px 14px; background:var(--paper,#fffefa); }
 html[data-portal-phone-landscape="true"] :is(#detail-dialog,#notification-choice-dialog) .dialog-body { padding:8px 14px 12px; }
 html[data-portal-phone-landscape="true"] #detail-dialog :is(.dialog-footer,.home-compose-footer) { position:sticky; bottom:0; z-index:2; padding:8px 14px; background:var(--paper,#fffefa); }
 html[data-portal-phone-landscape="true"] #appearance-dialog.appearance-dialog { right:max(8px,env(safe-area-inset-right)); left:auto; width:min(500px,calc(100vw - 16px)); overflow:hidden; }
 html[data-portal-phone-landscape="true"] #appearance-dialog .appearance-head { padding:6px 14px; }
 html[data-portal-phone-landscape="true"] #appearance-dialog .appearance-body { padding-inline:14px; }
 html[data-portal-phone-landscape="true"] #appearance-dialog .appearance-actions { padding:8px 14px; }
 html[data-portal-phone-landscape="true"] #appearance-dialog .appearance-body > .appearance-actions { margin-inline:-14px; }
 html[data-portal-phone-landscape="true"] :is(#detail-dialog,#notification-choice-dialog,#appearance-dialog) :is(button.close,.appearance-head > button) { width:44px; min-width:44px; height:44px; min-height:44px; }
 html[data-portal-phone-landscape="true"] :is(#main:not(.module-main),#detail-dialog,#notification-choice-dialog,#appearance-dialog) :is(.button,summary) { min-height:44px; }
 html[data-portal-phone-landscape="true"] :is(#main:not(.module-main),#detail-dialog,#notification-choice-dialog,#appearance-dialog) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea) { font-size:max(16px,calc(16px * var(--portal-text-scale,1))); }
 /* Existing module forms retain their own columns and scroll bodies. Override
  * the old desktop sidebar/header deduction only for handset modal geometry. */
 html[data-portal-phone-landscape="true"] #module-root:is([data-goodday-module="attendance"],[data-goodday-module="transport"]) :is(.error-popup,[data-slot="dialog-content"]:not(.transport-menu):not(.route-adviser-dialog),[data-slot="alert-dialog-content"]) {
  top:calc(var(--portal-phone-viewport-top,0px) + var(--portal-phone-viewport-height,100dvh) / 2) !important;
  left:calc((100vw + max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right))) / 2) !important;
  width:calc(100vw - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right))) !important;
  max-height:calc(var(--portal-phone-viewport-height,100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
 }
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="attendance"] .bulk-plan-dialog .bulk-plan-header { padding:6px 14px; gap:10px; }
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="attendance"] .bulk-plan-dialog .bulk-plan-header [data-slot="dialog-title"] { font-size:18px; }
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="attendance"] .bulk-plan-dialog .bulk-plan-footer { padding:6px 14px; gap:10px; }
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="attendance"] .bulk-plan-dialog .bulk-plan-header .iconbutton { min-width:44px; min-height:44px; margin:0; }
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="attendance"] .bulk-plan-dialog .bulk-plan-body { min-height:0; overflow:auto; }
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="cards"] .modal-backdrop {
  top:var(--portal-phone-viewport-top,0px) !important; bottom:auto; height:var(--portal-phone-viewport-height,100dvh);
  padding:8px max(8px,env(safe-area-inset-right)) 8px max(8px,env(safe-area-inset-left));
 }
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="cards"] .modal-backdrop .scan-modal {
  max-height:calc(var(--portal-phone-viewport-height,100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  overflow-y:auto; overscroll-behavior:contain; padding:14px 18px;
 }
 html[data-portal-phone-landscape="true"] .notification-history-dialog,
 html[data-portal-phone-landscape="true"] .notification-history-dialog.is-preview {
  top:calc(var(--portal-phone-viewport-top,0px) + max(8px,env(safe-area-inset-top))); bottom:auto;
  right:max(8px,env(safe-area-inset-right)); left:auto;
  width:min(520px,calc(100vw - 16px)); max-width:calc(100vw - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)));
  max-height:calc(var(--portal-phone-viewport-height,100dvh) - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom))); overflow-y:auto;
 }
 html[data-portal-phone-landscape="true"] .notification-history-dialog .notification-history-head { padding:6px 12px; align-items:center; gap:8px; }
 html[data-portal-phone-landscape="true"] .notification-history-dialog .notification-history-close { width:44px; min-width:44px; height:44px; }
 html[data-portal-phone-landscape="true"] .notification-history-dialog .notification-history-tabs { padding-inline:8px; }
 html[data-portal-phone-landscape="true"] .notification-history-dialog .notification-history-tabs button { min-height:44px; padding-block:5px; }
 html[data-portal-phone-landscape="true"] .notification-history-dialog .notification-history-toolbar { padding:4px 10px; }
 html[data-portal-phone-landscape="true"] .notification-history-dialog .notification-history-toolbar button { min-height:44px; }
 html[data-portal-phone-landscape="true"] .notification-history-dialog .notification-history-scroll { min-height:72px; }
 html[data-portal-phone-landscape="true"] .notification-history-dialog .notification-history-foot { padding:5px 12px; }
}
/* Cards already becomes a nonmodal right drawer below 900px. Keep its existing
 * visible/transform behavior, but do not spend a second app header on a phone. */
@media screen and (max-width:900px) {
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="cards"] .detail {
  top:calc(var(--portal-phone-viewport-top,0px) + var(--portal-banner-height,48px) + 8px) !important;
  bottom:auto; right:max(8px,env(safe-area-inset-right)); z-index:35;
  max-width:calc(100vw - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)));
  height:calc(var(--portal-phone-viewport-height,100dvh) - var(--portal-banner-height,48px) - 16px);
  max-height:calc(var(--portal-phone-viewport-height,100dvh) - var(--portal-banner-height,48px) - 16px);
  overflow-y:auto; overscroll-behavior:contain;
 }
 html[data-portal-phone-landscape="true"] #module-root[data-goodday-module="cards"] .detail .detail-close { min-width:44px; min-height:44px; }
}
