/* Portal appearance only. Native business modules keep their own layout. */
:root {
  --portal-sidebar-width: 224px;
  --portal-sidebar-font: 15px;
  --portal-content-font: 16px;
  --portal-calendar-font: 15px;
  --portal-calendar-cell-height: 155px;
  --portal-ui-scale: 1;
  --portal-text-scale: 1;
  --portal-home-scale: clamp(.85, var(--portal-ui-scale), 1.15);
}

#shell > .sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--portal-sidebar-width);
  height: 100dvh;
  min-height: 0;
  padding: calc(24px * var(--portal-ui-scale)) calc(16px * var(--portal-ui-scale));
  display: flex;
  flex-direction: column;
  gap: calc(14px * var(--portal-ui-scale));
  overflow: visible;
  background: var(--paper, #fffefa);
  border-right: 1px solid var(--line, #e7e0d5);
  font-size: var(--portal-sidebar-font);
}

#shell > .sidebar > .brand {
  flex: 0 0 auto;
  gap: calc(10px * var(--portal-ui-scale));
  min-width: 0;
  font-size: 1.18em;
  letter-spacing: .025em;
}

#shell > .sidebar > .brand > :last-child { min-width: 0; }
#shell > .sidebar > .brand small { font-size: .65em; }
#shell > .sidebar > .mobile-menu-toggle { display: none; }
#shell > .sidebar > .mobile-menu-toggle[hidden] { display: none; }

#shell > .sidebar #sidebar-date {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 calc(4px * var(--portal-ui-scale));
  color: var(--muted, #887d70);
  font-size: .86em;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

#shell > .sidebar #navigation {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  margin: 0 calc(-4px * var(--portal-ui-scale));
  padding: 0 calc(4px * var(--portal-ui-scale));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d5d9cd transparent;
}

#shell > .sidebar .nav-button {
  width: 100%;
  min-width: 0;
  min-height: calc(46px * var(--portal-ui-scale));
  margin: 0 0 calc(4px * var(--portal-ui-scale));
  padding: calc(10px * var(--portal-ui-scale)) calc(11px * var(--portal-ui-scale));
  display: flex;
  align-items: center;
  gap: calc(11px * var(--portal-ui-scale));
  border: 1px solid transparent;
  border-radius: calc(10px * var(--portal-ui-scale));
  background: transparent;
  color: #655c50;
  font-size: 1em;
  font-weight: 550;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
}

#shell > .sidebar .nav-button:hover {
  background: #f1f4eb;
  color: #3e664b;
}

#shell > .sidebar .nav-button.active {
  background: #edf3e7;
  border-color: #dce6d1;
  color: #395e43;
  font-weight: 650;
}

#shell > .sidebar .nav-label-text { min-width: 0; overflow-wrap: anywhere; }

#shell > .sidebar #navigation .menu-section-label { display: block; padding: 3px 7px; color: var(--muted, #715a46); font-size: .72em; font-weight: 650; line-height: 1.5; }
#shell > .sidebar #navigation .menu-favorites-label { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line, #e7e0d5); }
#shell > .sidebar #navigation .menu-empty-note { padding: 5px 7px; color: var(--muted, #715a46); font-size: .75em; line-height: 1.7; }

#shell > .sidebar .gd-icon,
#main:not(.module-main) .gd-icon,
#appearance-dialog .gd-icon {
  width: calc(23px * var(--portal-ui-scale));
  height: calc(23px * var(--portal-ui-scale));
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  vertical-align: middle;
}

#shell > .sidebar .gd-icon svg,
#main:not(.module-main) .gd-icon svg,
#appearance-dialog .gd-icon svg,
#shell > .sidebar svg.gd-icon,
#main:not(.module-main) svg.gd-icon,
#appearance-dialog svg.gd-icon {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#shell > .sidebar .nav-icon.gd-icon {
  width: 22px;
  height: 22px;
  color: #587451;
}

html[data-portal-sidebar-style="icons"] #shell > .sidebar .nav-button { justify-content: center; }
html[data-portal-sidebar-style="icons"] #shell > .sidebar .nav-label-text,
html[data-portal-home-style="icons"] #main:not(.module-main) .portal-shortcut .shortcut-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#shell > .sidebar .sidebar-bottom {
  flex: 0 0 auto;
  min-width: 0;
  display: grid;
  gap: calc(11px * var(--portal-ui-scale));
  padding-top: calc(14px * var(--portal-ui-scale));
  border-top: 1px solid var(--line, #e7e0d5);
}

#shell > .sidebar #sidebar-account {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-inline: calc(5px * var(--portal-ui-scale));
  color: var(--brown, #6f4d2f);
  font-size: .94em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#shell > .sidebar #sidebar-account .account-name { font-size: 1em; font-weight: 650; }
#shell > .sidebar #sidebar-account :is(.account-role, small) { color: var(--muted, #887d70); font-size: .8em; }
#shell > .sidebar #sidebar-tools { display: grid; gap: calc(5px * var(--portal-ui-scale)); }

#shell > .sidebar #sidebar-tools :is(button, a) {
  width: 100%;
  min-width: 0;
  min-height: calc(38px * var(--portal-ui-scale));
  padding: calc(7px * var(--portal-ui-scale)) calc(9px * var(--portal-ui-scale));
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: calc(9px * var(--portal-ui-scale));
  border: 1px solid #e5e5d9;
  border-radius: 8px;
  background: #fafaf5;
  color: #655c50;
  font: inherit;
  font-size: .83em;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
  white-space: normal;
}

#shell > .sidebar #sidebar-tools :is(button, a):hover { background: #eff3e8; border-color: #d5dec9; }
#shell > .sidebar #sidebar-tools .gd-icon { width: 18px; height: 18px; }
#shell > .sidebar .sidebar-privacy { margin: 0; padding-inline: 5px; font-size: .72em; line-height: 1.6; }
#shell > .sidebar .sidebar-privacy,
#shell > .sidebar .sidebar-privacy a { color: #817565; text-underline-offset: 3px; overflow-wrap: anywhere; }

#shell > .workspace {
  margin-left: var(--portal-sidebar-width);
  width: calc(100% - var(--portal-sidebar-width));
  min-width: 0;
}

#shell > .workspace > .topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  min-height: 48px;
  height: auto;
  padding: 5px 14px;
  gap: 8px;
  background: #fffefa;
}

#shell > .workspace > .topbar .breadcrumb { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
#shell > .workspace > .topbar .portal-font-tools { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; }
#shell > .workspace > .topbar .portal-font-tools button { min-width: 36px; min-height: 36px; margin: 0; padding: 5px 9px; border: 1px solid #dce4d2; border-radius: 7px; background: #fafcf6; color: #526b43; font-size: 13px; line-height: 1.4; }
#shell > .workspace > .topbar .portal-font-tools button[data-font-help] { min-width: 78px; }
#shell > .workspace > .topbar .portal-font-tools button:hover { background: #edf3e5; border-color: #bacda6; }
#shell > .workspace > .topbar .portal-font-tools button:focus-visible { outline: 3px solid #8ba86e; outline-offset: 2px; }

/* Auth cards and native modules retain their original typography and sizing. */
#main:not(.module-main):not(:has(.auth-card)) {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding: calc(26px * var(--portal-ui-scale)) calc(28px * var(--portal-ui-scale)) calc(40px * var(--portal-ui-scale));
  font-size: var(--portal-content-font);
  line-height: 1.7;
}

html[data-portal-content-width="balanced"] #main:not(.module-main):not(:has(.auth-card)) { max-width: 1600px; }

#main:not(.module-main):not(:has(.auth-card)) :where(p, li, td, label, .description, .lead, .panel-copy, .rich-text, .field, .app-link strong) { font-size: 1em; }
#main:not(.module-main):not(:has(.auth-card)) :where(.button, input, textarea, select) { font-size: .9em; }
#main:not(.module-main):not(:has(.auth-card)) :where(.check-help, .form-help, .source, .meta, .app-link small, .panel-head small, small) { font-size: .82em; }
#main:not(.module-main):not(:has(.auth-card)) h1 { font-size: 1.6em; }
#main:not(.module-main):not(:has(.auth-card)) h2 { font-size: 1.22em; }
#main:not(.module-main):not(:has(.auth-card)) h3 { font-size: 1.05em; }
#main:not(.module-main):not(:has(.auth-card)) .button { min-height: calc(38px * var(--portal-ui-scale)); padding: calc(8px * var(--portal-ui-scale)) calc(13px * var(--portal-ui-scale)); }

#main:not(.module-main) .portal-home .page-heading {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
#main:not(.module-main) .portal-home .page-heading::before { display: none; }

#main:not(.module-main) .portal-home-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

#main:not(.module-main) .portal-home-head h1 { margin: 0; font-size: 1.3em; color: var(--brown, #6f4d2f); }
#main:not(.module-main) .portal-home-head :is(.button-row, .portal-home-actions) { display: flex; flex-wrap: wrap; gap: calc(8px * var(--portal-ui-scale)); }

#main:not(.module-main) .portal-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 80px), 1fr));
  align-items: stretch;
  gap: 8px;
  margin: 0 0 14px;
}

#main:not(.module-main) .portal-shortcuts .portal-shortcut {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 64px;
  justify-self: start;
  padding: 4px 6px;
  border: 1px solid #e1e5d9;
  border-radius: 9px;
  background: #fffefa;
  color: #495e42;
  box-shadow: 0 1px 2px #31452b06;
  font-size: 1em;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

#main:not(.module-main) .portal-shortcuts .portal-shortcut:hover { background: #f2f6ed; border-color: #b8cba6; box-shadow: 0 3px 10px #31452b0a; }
#main:not(.module-main) .portal-shortcuts .portal-shortcut:focus-visible { outline: 3px solid #789b58; outline-offset: 3px; }
#main:not(.module-main) .portal-shortcuts .portal-shortcut > .gd-icon { width: 24px; height: 24px; padding: 0; border-radius: 0; background: none; color: #59734d; }
#main:not(.module-main) .portal-shortcut .shortcut-label { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
#main:not(.module-main) .portal-shortcut .shortcut-label strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: calc(11.5px * var(--portal-text-scale, 1)); font-weight: 600; line-height: 1.2; text-wrap: balance; }
#main:not(.module-main) .portal-shortcut .shortcut-arrow { display: none; }
#main:not(.module-main) .portal-menu-group + .portal-menu-group { margin-top: 15px; }
#main:not(.module-main) .portal-menu-group > .menu-section-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; margin: 0 0 8px; font-size: 13px; line-height: 1.6; color: var(--ink, #49301b); }
#main:not(.module-main) .portal-menu-group > .menu-section-label small { color: var(--muted, #715a46); font-size: 11px; font-weight: 400; }
html[data-portal-editing="true"] :is(#navigation, .portal-shortcuts) [data-menu-drag] { cursor: grab; outline: 1px dashed var(--muted, #715a46); outline-offset: -3px; }
:is(#navigation, .portal-shortcuts) .is-menu-dragging { opacity: .5; }
#navigation .is-menu-drop-before { box-shadow: inset 0 4px 0 var(--ink, #49301b); }
#navigation .is-menu-drop-after { box-shadow: inset 0 -4px 0 var(--ink, #49301b); }
.portal-shortcuts .is-menu-drop-before { box-shadow: inset 4px 0 0 var(--ink, #49301b); }
.portal-shortcuts .is-menu-drop-after { box-shadow: inset -4px 0 0 var(--ink, #49301b); }

html[data-portal-home-style="icons"] #main:not(.module-main) .portal-shortcuts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 64px), 1fr)); }
html[data-portal-home-style="icons"] #main:not(.module-main) .portal-shortcuts .portal-shortcut { min-height: max(44px, calc(50px * var(--portal-home-scale))); }
html[data-portal-home-style="compact"] #main:not(.module-main) .portal-shortcuts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
html[data-portal-home-style="compact"] #main:not(.module-main) .portal-shortcuts .portal-shortcut { flex-direction: row; justify-content: flex-start; min-height: max(44px, calc(46px * var(--portal-home-scale))); padding: calc(8px * var(--portal-home-scale)) calc(10px * var(--portal-home-scale)); gap: 8px; text-align: left; }
html[data-portal-home-style="compact"] #main:not(.module-main) .portal-shortcut .shortcut-label { flex: 1; }
html[data-portal-home-style="compact"] #main:not(.module-main) .portal-shortcut .shortcut-arrow { display: block; margin-left: auto; color: #8a967f; }

/* Home widgets follow DOM order, with preset sizes and scrollable content. */
#main:not(.module-main) .portal-widget-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  min-width: 0;
}

#main:not(.module-main) .portal-widget {
  --portal-widget-height: 380px;
  position: relative;
  box-sizing: border-box;
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: var(--portal-widget-height);
  overflow: hidden;
  border: 1px solid #dfdfd2;
  border-radius: 11px;
  background: #fffefa;
  box-shadow: 0 1px 3px #624b2d06;
}

#main:not(.module-main) .portal-widget[hidden] { display: none; }
#main:not(.module-main) .portal-widget[data-widget-size="small"] { --portal-widget-height: 260px; grid-column: span 3; }
#main:not(.module-main) .portal-widget[data-widget-size="medium"] { --portal-widget-height: 380px; grid-column: span 6; }
#main:not(.module-main) .portal-widget[data-widget-size="large"] { --portal-widget-height: 600px; grid-column: span 12; }
#main:not(.module-main) .portal-widget.is-dragging { opacity: .45; }
#main:not(.module-main) .portal-widget:is(.is-drop-target, [data-drag-over="true"]) { outline: 2px dashed #8aa875; outline-offset: 3px; background: #f7faf2; }

#main:not(.module-main) .portal-widget-head {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  min-height: 38px;
  padding: 4px 10px;
  border-bottom: 1px solid #e5e5d9;
  background: #f8f8f0;
}

#main:not(.module-main) .portal-widget-head h2 { flex: 1 1 90px; min-width: 0; margin: 0; color: #6d5135; font-size: calc(15px * var(--portal-text-scale, 1)); font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
#main:not(.module-main) .portal-widget-head > .gd-icon { width: 18px; height: 18px; color: #647b52; }
#main:not(.module-main) .portal-widget-head h2 .gd-icon { width: 18px; height: 18px; margin-right: 5px; color: #647b52; }
#main:not(.module-main) .portal-widget-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 4px; }
#main:not(.module-main) .portal-widget-actions:empty { display: none; }
#main:not(.module-main) .portal-widget-actions .widget-create-button { flex: 0 0 auto; width: 28px; min-width: 28px; height: 28px; padding: 0; }
#detail-dialog:has(.home-compose-form, .home-compose-permission, .home-compose-receipt) { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
#detail-dialog .home-compose-form { min-width: 0; }
#detail-dialog .home-compose-form > .check-help:first-child { margin-bottom: 14px; }
#detail-dialog .home-compose-form .field { font-size: 14px; }
#detail-dialog .home-compose-form :is(input, select, textarea) { min-width: 0; max-width: 100%; font-size: 16px; }
#detail-dialog .home-compose-form .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#detail-dialog .home-compose-form .field-grid > * { min-width: 0; }
#detail-dialog .home-compose-form textarea { min-height: 80px; }
#detail-dialog .home-compose-form .inline-check { align-items: center; min-height: 40px; margin-block: 6px; }
#detail-dialog .home-compose-form .inline-check input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
#detail-dialog .home-compose-form [hidden] { display: none; }
#detail-dialog .home-compose-more { margin: 0 0 16px; }
#detail-dialog .home-compose-more > summary { min-height: 40px; padding-block: 8px; cursor: pointer; font-weight: 600; }
#detail-dialog .home-compose-labels { max-height: 220px; overflow-y: auto; padding: 6px 2px; }
#detail-dialog .home-compose-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
#detail-dialog .home-compose-footer .button { min-height: 44px; white-space: normal; }
#detail-dialog .home-compose-permission p { margin-bottom: 16px; }
#detail-dialog .home-compose-receipt { overflow-wrap: anywhere; }
#detail-dialog .home-compose-receipt > :is(strong, p) { display: block; margin-top: 12px; }
#detail-dialog .home-compose-success { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 10px; border-radius: 50%; background: var(--green-bg); color: var(--green); font-size: 22px; }
@media (max-width: 760px) {
 #main:not(.module-main) .portal-widget-actions .widget-create-button { width: 38px; min-width: 38px; height: 38px; }
 #detail-dialog:has(.home-compose-form, .home-compose-permission, .home-compose-receipt) { max-height: calc(100dvh - 16px); width: calc(100vw - 16px); }
 #detail-dialog:has(.home-compose-form, .home-compose-permission, .home-compose-receipt) .dialog-head { position: sticky; top: 0; z-index: 1; align-items: center; background: var(--paper); }
 #detail-dialog:has(.home-compose-form, .home-compose-permission, .home-compose-receipt) .close { min-width: 44px; width: 44px; height: 44px; }
 #detail-dialog .home-compose-form .field-grid { grid-template-columns: minmax(0, 1fr); }
 #detail-dialog .home-compose-form .inline-check { min-height: 44px; }
 #detail-dialog .home-compose-form .home-compose-footer { position: sticky; bottom: 0; z-index: 1; padding-block: 12px; background: var(--paper); }
}
#main:not(.module-main) .portal-widget-tools { display: none; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; margin-left: auto; }
html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-tools { display: flex; }
#main:not(.module-main) .portal-widget-head :is(.button, button, a) { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 28px; min-height: 28px; margin: 0; padding: 3px 6px; border: 1px solid #dedfcf; border-radius: 6px; background: #fffefa; color: #63754e; font: inherit; font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.35; text-decoration: none; white-space: nowrap; cursor: pointer; }
#main:not(.module-main) .portal-widget-head > .portal-widget-actions :is(.button, button, a) { min-height: 28px; }
#main:not(.module-main) .portal-widget-head > .portal-widget-actions :is(.button, button, a):focus-visible { outline-offset: -1px; }
#main:not(.module-main) .portal-widget-head :is(.button, button, a):hover { background: #edf3e5; border-color: #b9cba5; }
#main:not(.module-main) .portal-widget-head :is(.button, button, a):focus-visible { outline: 3px solid #8ba86e; outline-offset: 2px; }
#main:not(.module-main) .portal-widget-head :is(.button, button, a)[aria-pressed="true"] { background: #e5efdc; border-color: #9cb885; color: #3f6135; font-weight: 650; }
#main:not(.module-main) .portal-widget-head :is(.button, button, a) .gd-icon { width: 16px; height: 16px; }
#main:not(.module-main) .portal-widget-actions > :is(button, a) > svg.gd-ui-icon { width: 16px; height: 16px; }
#main:not(.module-main) .portal-widget-head .widget-drag-handle,
#main:not(.module-main) .portal-widget-head .widget-size-options { display: none; }
html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-drag-handle { display: inline-flex; cursor: grab; }
html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-drag-handle:active { cursor: grabbing; }
html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-size-options { display: inline-flex; align-items: center; gap: 2px; }

#main:not(.module-main) .portal-widget .widget-resize-handle { display: none; }

@media (min-width: 761px) {
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget { padding-bottom: 40px; }
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget .widget-resize-handle {
    position: absolute;
    right: 6px;
    bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    margin: 0;
    padding: 0;
    border: 1px solid #cad7bd;
    border-radius: 6px;
    background: #f0f5e9;
    color: #65814e;
    font-size: 21px;
    line-height: 1;
    cursor: nwse-resize;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget .widget-resize-handle:hover { border-color: #99b380; background: #e7efdd; }
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget .widget-resize-handle:focus-visible { outline: 3px solid #829f66; outline-offset: 0; }
}

#main:not(.module-main) .portal-widget-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d1d7c7 transparent;
  font-size: .9em;
  line-height: 1.6;
}

#main:not(.module-main) .portal-widget-body > :first-child { margin-top: 0; }
#main:not(.module-main) .portal-widget-body > :last-child { margin-bottom: 0; }
#main:not(.module-main) .portal-widget-body :is(.calendar-panel, .native-calendar) { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
#main:not(.module-main) .portal-widget-body .native-calendar-top { gap: 10px; padding-bottom: 12px; }
#main:not(.module-main) .widget-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
#main:not(.module-main) .portal-widget:is([data-widget-size="medium"], [data-widget-size="large"]) .widget-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#main:not(.module-main) .widget-kpi { min-width: 0; padding: 10px; border: 1px solid #e2e6d6; border-radius: 8px; background: #f4f7ed; }
#main:not(.module-main) .widget-kpi:only-child { grid-column: 1 / -1; }
#main:not(.module-main) .widget-kpi strong { display: block; margin: 0 0 3px; color: #4d6944; font-size: calc(26px * var(--portal-text-scale, 1)); line-height: 1.2; overflow-wrap: anywhere; }
#main:not(.module-main) .widget-kpi :is(span, small) { color: #7e7769; font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.45; }
#main:not(.module-main) .widget-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
#main:not(.module-main) .widget-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 5px 10px; width: 100%; min-width: 0; margin: 0; padding: 10px 0; border: 0; border-bottom: 1px solid #ecebdf; border-radius: 0; background: transparent; color: inherit; font: inherit; line-height: 1.5; text-align: left; text-decoration: none; overflow-wrap: anywhere; }
#main:not(.module-main) .widget-row > :first-child { flex: 1 1 9em; min-width: 0; }
#main:not(.module-main) .widget-row > :last-child:not(:first-child) { flex: 0 1 auto; max-width: 100%; }
#main:not(.module-main) .widget-row:last-child { border-bottom: 0; }
#main:not(.module-main) .widget-row :is(strong, b) { font-weight: 600; }
#main:not(.module-main) .widget-row small { color: #857b6c; font-size: .86em; }
#main:not(.module-main) .widget-row:is(a, button):hover { color: #476b3e; background: #f7f9f0; }
#main:not(.module-main) .widget-row:is(a, button):focus-visible { outline: 2px solid #8ba86e; outline-offset: 2px; }
#main:not(.module-main) .portal-widget[data-widget-id="attendance"] { height: auto; max-height: var(--portal-widget-height); }
#main:not(.module-main) .portal-widget[data-widget-id="attendance"] .portal-widget-body { padding: 10px 12px; }
#main:not(.module-main) .attendance-summary { min-width: 0; }
#main:not(.module-main) .attendance-current { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
#main:not(.module-main) .attendance-current small { color: var(--muted, #837a6c); font-size: .85em; }
#main:not(.module-main) .attendance-state { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--line, #dec8aa); border-radius: 6px; background: var(--cream, #fff4dc); color: var(--ink, #4c2b16); font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main) .attendance-details { display: grid; gap: 0; margin: 0; }
#main:not(.module-main) .attendance-details > div { display: grid; grid-template-columns: minmax(5.5em, auto) minmax(0, 1fr); align-items: baseline; gap: 5px 10px; padding: 6px 0; }
#main:not(.module-main) .attendance-details dt { color: var(--muted, #837a6c); font-size: .86em; font-weight: 500; }
#main:not(.module-main) .attendance-details dd { min-width: 0; margin: 0; text-align: right; overflow-wrap: anywhere; line-height: 1.5; }
#main:not(.module-main) .attendance-details dd strong { font-size: calc(15px * var(--portal-text-scale, 1)); font-weight: 650; }
#main:not(.module-main) .attendance-details dd small { display: block; color: var(--muted, #837a6c); font-size: .83em; }
#main:not(.module-main) .attendance-next { border-top: 1px solid var(--line, #dec8aa); }
#main:not(.module-main) .portal-widget-actions .widget-attendance-settings { width: 28px; min-width: 28px; height: 28px; padding: 0; }
#appearance-dialog .attendance-widget-settings { margin-top: 14px; border-top: 1px solid var(--line, #dec8aa); padding-top: 12px; }
#appearance-dialog .attendance-widget-settings > summary { cursor: pointer; font-weight: 600; line-height: 1.6; }
#appearance-dialog .attendance-widget-options { display: grid; gap: 4px; }
#appearance-dialog .attendance-widget-options label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 4px; cursor: pointer; }
#appearance-dialog .attendance-widget-options input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--brown, #4c2b16); }
@media (max-width: 760px) {
  #main:not(.module-main) .portal-widget-actions .widget-attendance-settings { width: 38px; min-width: 38px; height: 38px; }
}
#main:not(.module-main) :is(.widget-empty, .widget-note) { color: #837a6c; font-size: .92em; line-height: 1.7; overflow-wrap: anywhere; }
#main:not(.module-main) .widget-empty { display: grid; place-content: center; min-height: 110px; padding: 12px; text-align: center; }
#main:not(.module-main) .portal-widget-body > .widget-list > .widget-empty:only-child { display: block; min-height: 0; margin: 8px 0 0; padding: 8px 0; text-align: left; }
#main:not(.module-main) .portal-widget[data-widget-id="transport"] .widget-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#main:not(.module-main) .portal-widget[data-widget-id="transport-overview"] { height: auto; max-height: var(--portal-widget-height); }
#main:not(.module-main) .transport-overview-summary { margin-bottom: 10px; }
#main:not(.module-main) .transport-overview-summary .transport-overview-date { margin: 0 0 6px; font-size: .82em; }
#main:not(.module-main) .transport-overview-counts { display: flex; flex-wrap: wrap; gap: 5px 6px; min-width: 0; }
#main:not(.module-main) .transport-overview-counts > span { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; padding: 3px 6px; border: 1px solid var(--line, #dec8aa); border-radius: 6px; color: var(--ink, #4c2b16); background: var(--cream, #fff4dc); font-size: .82em; line-height: 1.5; }
#main:not(.module-main) .transport-overview-counts strong { font-size: 1.08em; font-weight: 650; font-variant-numeric: tabular-nums; }
#main:not(.module-main) :is(.transport-schedule-heading, .transport-schedule-row) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 5px 8px; min-width: 0; }
#main:not(.module-main) .transport-schedule-heading { padding: 0 0 5px; color: var(--muted, #837a6c); font-size: .75em; }
#main:not(.module-main) .transport-schedule-heading > :last-child { text-align: right; }
#main:not(.module-main) .transport-schedule-list { margin: 0; padding: 0; list-style: none; }
#main:not(.module-main) .transport-schedule-row { align-items: center; padding: 2px 0; border-top: 1px solid var(--line, #dec8aa); font-size: calc(15px * var(--portal-text-scale, 1)); line-height: 1.5; }
#main:not(.module-main) .transport-schedule-child { min-width: 0; overflow-wrap: anywhere; }
#main:not(.module-main) .transport-schedule-kind { display: inline-flex; align-items: center; justify-self: end; gap: 5px; text-align: right; white-space: nowrap; }
#main:not(.module-main) .transport-schedule-kind small { display: inline; color: var(--muted, #837a6c); font-size: .78em; line-height: 1.4; }
#main:not(.module-main) .transport-schedule-open { display: inline; min-width: 0; min-height: 0; max-width: 100%; margin: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; color: inherit; font: inherit; line-height: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#main:not(.module-main) .transport-schedule-open:hover { background: var(--cream, #fff4dc); }
#main:not(.module-main) .transport-schedule-open:focus-visible { outline: 3px solid var(--green, #26994b); outline-offset: 2px; }
#main:not(.module-main) :is(.transport-schedule-note, .transport-schedule-empty) { margin: 8px 0 0; color: var(--muted, #837a6c); font-size: .82em; line-height: 1.6; overflow-wrap: anywhere; }
#main:not(.module-main) .portal-widget-grid > .widget-empty { grid-column: 1 / -1; }

/* Additional widgets use the same small/medium/large grid and theme tokens. */
#main:not(.module-main) .widget-section-heading { flex-wrap: wrap; gap: 12px; }
#main:not(.module-main) .widget-add-actions { margin-left: auto; }
#main:not(.module-main) .widget-link-row { display: grid; grid-template-columns: minmax(0,1fr) 14px; gap: 10px; align-items: center; width: 100%; min-height: 48px; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--line,#e7dcc8); border-radius: 0; background: transparent; color: inherit; font: inherit; line-height: 1.6; text-align: left; overflow-wrap: anywhere; }
#main:not(.module-main) .widget-link-row:last-child { border-bottom: 0; }
#main:not(.module-main) .widget-link-row strong { display: block; font-size: 1em; font-weight: 650; }
#main:not(.module-main) .widget-link-row small { display: block; margin-top: 4px; color: var(--muted,#837a6c); font-size: .88em; line-height: 1.7; }
#main:not(.module-main) .widget-link-row:hover { background: var(--green-bg,#fff3df); }
#main:not(.module-main) .widget-link-row:focus-visible { outline: 3px solid var(--brown,#6f431f); outline-offset: -3px; }
#main:not(.module-main) .widget-agenda-list { display: grid; gap: 8px; margin-bottom: 12px; }
#main:not(.module-main) .widget-clock { display: grid; align-content: center; justify-items: center; min-height: 170px; gap: 10px; text-align: center; }
#main:not(.module-main) .widget-clock-date { color: var(--muted,#837a6c); font-size: calc(15px * var(--portal-text-scale,1)); line-height: 1.6; }
#main:not(.module-main) .widget-clock-time { color: var(--ink,#4c2b16); font-size: calc(44px * var(--portal-text-scale,1)); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.2; }
#main:not(.module-main) .portal-widget[data-widget-size="medium"] .widget-clock-time { font-size: calc(64px * var(--portal-text-scale,1)); }
#main:not(.module-main) .portal-widget[data-widget-size="large"] .widget-clock-time { font-size: calc(80px * var(--portal-text-scale,1)); }
#main:not(.module-main) .widget-clock small { color: var(--muted,#837a6c); font-size: .88em; }
#main:not(.module-main) .portal-widget:is([data-widget-id="agenda"],[data-widget-id="clock"]) { --widget-brand-accent: var(--goodday-yellow,#ffc000); }
#main:not(.module-main) .portal-widget[data-widget-id="transport-overview"] { --widget-brand-accent: var(--goodday-orange,#fe4528); }
#main:not(.module-main) .portal-widget[data-widget-id="shifts"] { --widget-brand-accent: var(--goodday-green,#20c74c); }
#main:not(.module-main) .portal-widget:is([data-widget-id="documents"],[data-widget-id="faq"]) { --widget-brand-accent: var(--goodday-blue,#00a7eb); }
#appearance-dialog .appearance-item.widget-choice { display: block; padding: 8px; }
#appearance-dialog .widget-choice .widget-choice-label { display: grid; grid-template-columns: 20px 24px minmax(0,1fr); align-items: start; gap: 10px; width: 100%; min-height: 48px; padding: 4px 0; }
#appearance-dialog .widget-choice-label input { width: 18px; height: 18px; margin: 4px 0 0; }
#appearance-dialog .widget-choice-label .gd-icon { margin-top: 1px; }
#appearance-dialog .widget-choice-copy { min-width: 0; overflow-wrap: anywhere; }
#appearance-dialog .widget-choice-copy strong { display: block; font-size: 14px; line-height: 1.6; }
#appearance-dialog .widget-choice-copy small { display: block; margin-top: 3px; color: var(--muted,#715a46); font-size: 12px; line-height: 1.7; }
#appearance-dialog #appearance-widgets { scroll-margin-top: 18px; }
@media(max-width:760px) {
 #main:not(.module-main) .widget-add-actions { flex-wrap: wrap; margin-left: 0; }
 #main:not(.module-main) .widget-add-actions .button { min-height: 44px; }
 #main:not(.module-main) .portal-widget:is([data-widget-size="medium"],[data-widget-size="large"]) .widget-clock-time { font-size: calc(48px * var(--portal-text-scale,1)); }
 #appearance-dialog .widget-choice-copy strong { font-size: 15px; }
 #appearance-dialog .widget-choice-copy small { font-size: 13px; }
}

/* Native Todoist content stays within the widget's existing scroll area. */
#main:not(.module-main) .portal-widget-body .todoist-widget-status { margin: 0 0 12px; padding: 9px 11px; border: 1px solid #e3e4d5; border-radius: 8px; background: #f5f6ed; color: #7d715f; font-size: .95em; line-height: 1.65; overflow-wrap: anywhere; }
#main:not(.module-main) .portal-widget-body .todoist-view-control { display: grid; gap: 5px; width: 100%; min-width: 0; margin: 0 0 12px; color: #786c5b; font: inherit; }
#main:not(.module-main) .portal-widget-body .todoist-view-control select { display: block; box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #d7ddca; border-radius: 8px; background: #fffefa; color: #5d6f4c; font: inherit; line-height: 1.4; }
#main:not(.module-main) .portal-widget-body .todoist-view-control select:focus-visible { outline: 3px solid #91aa79; outline-offset: 2px; }
#main:not(.module-main) .portal-widget-body .todoist-groups { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; margin: 12px 0 0; }
#main:not(.module-main) .portal-widget:is([data-widget-size="medium"], [data-widget-size="large"]) .todoist-groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
#main:not(.module-main) .portal-widget-body .todoist-task-group { min-width: 0; }
#main:not(.module-main) .portal-widget-body .todoist-task-group h3 { margin: 0 0 4px; padding-bottom: 6px; border-bottom: 1px solid #e3e5d7; color: #79613f; font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.5; }
#main:not(.module-main) .portal-widget-body .todoist-task-list { display: grid; gap: 0; min-width: 0; margin: 10px 0; padding: 0; list-style: none; }
#main:not(.module-main) .portal-widget-body .todoist-task-item { --todoist-priority-color: #a0aa96; position: relative; min-width: 0; margin: 0; padding: 10px 0 10px 14px; border-bottom: 1px solid #ecebdf; list-style: none; }
#main:not(.module-main) .portal-widget-body .todoist-task-marker { position: absolute; top: 18px; left: 0; display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--todoist-priority-color); }
#main:not(.module-main) .portal-widget-body .todoist-task-item > div { min-width: 0; }
#main:not(.module-main) .portal-widget-body .todoist-task-item[data-priority="2"] { --todoist-priority-color: #81976a; }
#main:not(.module-main) .portal-widget-body .todoist-task-item[data-priority="3"] { --todoist-priority-color: #b18c60; }
#main:not(.module-main) .portal-widget-body .todoist-task-item[data-priority="4"] { --todoist-priority-color: #af6d60; }
#main:not(.module-main) .portal-widget-body .todoist-task-item:last-child { border-bottom: 0; }
#main:not(.module-main) .portal-widget-body .todoist-task-link { display: block; min-width: 0; color: #526d44; font-weight: 600; line-height: 1.55; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
#main:not(.module-main) .portal-widget-body .todoist-task-link:hover { color: #385b2e; text-decoration: underline; text-underline-offset: 3px; }
#main:not(.module-main) .portal-widget-body .todoist-task-link:focus-visible { outline: 3px solid #91aa79; outline-offset: 2px; }
#main:not(.module-main) .portal-widget-body .todoist-task-meta { display: block; margin-top: 4px; color: #877a68; font-size: .85em; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
#main:not(.module-main) .portal-widget-body .todoist-task-item.is-overdue .todoist-task-meta,
#main:not(.module-main) .portal-widget-body .todoist-task-meta.is-overdue { color: #a55748; }
#main:not(.module-main) .portal-widget-body .todoist-summary { margin: 10px 0 0; color: #857a68; font-size: .88em; line-height: 1.6; overflow-wrap: anywhere; }
#main:not(.module-main) .portal-widget-body .todoist-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; margin: 12px 0 0; }
#main:not(.module-main) .portal-widget-body .todoist-actions :is(.button, button, a) { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; max-width: 100%; min-width: 0; min-height: 34px; padding: 6px 10px; border: 1px solid #dce0ce; border-radius: 7px; background: #fbfcf5; color: #60744c; font: inherit; font-size: .88em; line-height: 1.5; text-align: center; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
#main:not(.module-main) .portal-widget-body .todoist-actions :is(button, a):focus-visible { outline: 3px solid #91aa79; outline-offset: 2px; }

@media (max-width: 1400px) {
  #main:not(.module-main) .portal-widget[data-widget-size="small"] { grid-column: span 6; }
}

/* Page guidance shares the portal toolbar without changing native toolbars. */
.portal-mobile-label { display: none; }
.portal-mobile-mascot { display: none !important; }
#shell > .workspace > .topbar .portal-display-menu-button { display: none; }
#detail-dialog .portal-display-actions { display: grid; gap: 10px; }
#detail-dialog .portal-display-actions .button { min-height: 48px; padding: 11px 14px; text-align: left; font-size: var(--portal-content-font, 16px); white-space: normal; }
#detail-dialog .portal-display-font h3 { margin: 0 0 8px; font-size: .9em; }
#detail-dialog .portal-display-font .portal-font-tools { display: flex; align-items: stretch; gap: 6px; margin-bottom: 6px; }
#detail-dialog .portal-display-font .portal-font-tools button { min-width: 48px; min-height: 44px; padding: 8px; margin: 0; border: 1px solid var(--line, #dec8aa); border-radius: 8px; background: var(--paper, #fffaf0); color: inherit; font: inherit; font-size: .9em; }
#detail-dialog .portal-display-font [data-font-help] { flex: 1 1 auto; }
#detail-dialog .portal-display-font button:focus-visible { outline: 3px solid var(--brown, #4c2b16); outline-offset: 2px; }
#portal-display-float { display: none; }
#portal-back-to-top { position: fixed; z-index: 40; right: max(14px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 64px; min-height: 44px; margin: 0; padding: 9px 12px; border: 1px solid var(--line, #dec8aa); border-radius: 22px; background: var(--paper, #fffaf0); color: var(--brown, #4c2b16); box-shadow: 0 3px 13px #4c2b1624; font: inherit; font-size: 12px; line-height: 1.5; cursor: pointer; }
#portal-back-to-top[hidden] { display: none; }
#portal-back-to-top:focus-visible { outline: 3px solid var(--brown, #4c2b16); outline-offset: 3px; }
@media (min-width: 761px), print { #portal-back-to-top, #portal-display-float { display: none !important; } }
@media print { :root { --portal-floating-clearance: 0px !important; } .portal-home-actions > [data-appearance-edit] { display: none !important; } }

/* Shared feedback must remain above native dialogs and clear floating controls. */
#toast { bottom: var(--portal-toast-bottom, 28px); overflow-wrap: anywhere; }
#toast[popover] {
  inset: auto auto var(--portal-toast-bottom, 28px) 50%;
  margin: 0;
  border: 0;
  width: max-content;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
}
#toast[popover]::backdrop { background: transparent; pointer-events: none; }

#shell > .workspace > .topbar .topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

#shell > .workspace > .topbar .topbar-tools .portal-font-tools { margin-left: 0; }
#shell > .workspace > .topbar .page-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  max-width: 100%;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid #dce4d2;
  border-radius: 7px;
  background: #f1f5eb;
  color: #526b43;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

#shell > .workspace > .topbar .page-help-button:hover { border-color: #bacda6; background: #e8f0df; }
#shell > .workspace > .topbar .page-help-button:focus-visible { outline: 3px solid #8ba86e; outline-offset: 2px; }

#detail-dialog .page-help-summary {
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid #e1e5d7;
  border-radius: 10px;
  background: #f5f7ef;
  color: #5c674f;
  font-size: var(--portal-content-font, 16px);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

#detail-dialog .page-help-tips {
  margin: 0 0 19px;
  padding-left: 24px;
  color: #685d50;
  font-size: calc(var(--portal-content-font, 16px) * .94);
  line-height: 1.8;
}

#detail-dialog .page-help-tips li { margin: 8px 0; padding-left: 3px; overflow-wrap: anywhere; }
#detail-dialog .page-help-tips li::marker { color: #718759; font-weight: 600; }
#detail-dialog .page-help-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; padding-top: 15px; border-top: 1px solid #e6e5d9; }
#detail-dialog .page-help-links :is(a, button) { max-width: 100%; min-height: 38px; font-size: calc(var(--portal-content-font, 16px) * .88); line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }

#main:not(.module-main) .browser-helper-card {
  min-width: 0;
  margin-top: 18px;
  padding: 19px 21px;
  border: 1px solid #dfe3d4;
  border-radius: 12px;
  background: #f7f8f1;
  color: #685d50;
  overflow-wrap: anywhere;
}

#main:not(.module-main) .browser-helper-card :is(h2, h3) { margin: 0 0 9px; color: #596b49; }
#main:not(.module-main) .browser-helper-card > p { margin: 8px 0 12px; line-height: 1.75; }
#main:not(.module-main) .browser-helper-card > .check-help { display: block; margin-top: 8px; }
#main:not(.module-main) .browser-helper-steps { margin: 13px 0 0; padding: 13px 0 0; border-top: 1px solid #e1e5d7; line-height: 1.8; }
#main:not(.module-main) .browser-helper-steps > summary { color: #596b49; font-weight: 600; cursor: pointer; }
#main:not(.module-main) .browser-helper-steps > ol { margin: 11px 0 13px; padding-left: 24px; }
#main:not(.module-main) .browser-helper-steps li { margin: 7px 0; padding-left: 3px; }
#main:not(.module-main) .browser-helper-steps li::marker { color: #718759; font-weight: 600; }
#main:not(.module-main) .browser-helper-steps > summary:focus-visible { outline: 3px solid #a8bf92; outline-offset: 3px; }
#main:not(.module-main) .browser-helper-card .browser-helper-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid #6e8957;
  border-radius: 8px;
  background: #6e8957;
  color: #fff;
  font: inherit;
  font-size: .9em;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

#main:not(.module-main) .browser-helper-card .browser-helper-download:hover { border-color: #5f784b; background: #5f784b; }
#main:not(.module-main) .browser-helper-card .browser-helper-download:focus-visible { outline: 3px solid #a8bf92; outline-offset: 3px; }

@media (max-width: 760px) {
  #shell > .workspace > .topbar .topbar-tools { gap: 4px; }
  #shell > .workspace > .topbar .page-help-button { min-height: 44px; padding: 5px 8px; border: 0; font-size: 12px; }
  #shell > .workspace > .topbar:has(.topbar-tools) .breadcrumb { display: none; }
  #detail-dialog .page-help-summary { padding: 11px 12px; }
  #detail-dialog .page-help-links { align-items: stretch; }
  #detail-dialog .page-help-links :is(a, button) { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  #main:not(.module-main) .browser-helper-card { padding: 16px; }
  #main:not(.module-main) .browser-helper-steps > summary { min-height: 44px; padding-block: 8px; }
  #main:not(.module-main) .browser-helper-card .browser-helper-download { min-height: 44px; }
}

@media (max-width: 340px) {
  #shell > .workspace > .topbar:has(.topbar-tools) .breadcrumb { display: none; }
  #shell > .workspace > .topbar:has(.topbar-tools) { justify-content: flex-end; }
}

@media (max-width: 760px) {
  #main:not(.module-main) .portal-widget-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #main:not(.module-main) .portal-widget,
  #main:not(.module-main) .portal-widget[data-widget-size] { grid-column: 1; height: auto; max-height: 520px; }
  #main:not(.module-main) .portal-widget-head { min-height: 46px; padding: 3px 8px; }
  #main:not(.module-main) .portal-widget-head :is(.button, button, a) { min-width: 38px; min-height: 38px; padding: 4px 6px; }
  #main:not(.module-main) .portal-widget-head > .portal-widget-actions :is(.button, button, a) { min-height: 38px; }
  #main:not(.module-main) .portal-widget-actions { gap: 6px; }
  #main:not(.module-main) .portal-widget-body { max-height: 440px; padding: 10px; }
  #main:not(.module-main) .sharing-widget-footer button { min-width: 44px; min-height: 44px; }
  #main:not(.module-main) .portal-widget-body .todoist-view-control select { min-height: 44px; font-size: max(16px, 1em); }
  #main:not(.module-main) .portal-widget[data-widget-id="todoist"] .todoist-groups { grid-template-columns: minmax(0, 1fr); }
  #main:not(.module-main) .portal-widget-body .todoist-actions :is(.button, button, a) { min-height: 44px; }
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-size-options { display: none; }
}

/* The work guide uses a fixed category map, independent of home widgets. */
#main:not(.module-main) .guide-home { min-width: 0; }
#main:not(.module-main) .guide-home .page-heading { margin-bottom: 18px; gap: 12px; }
#main:not(.module-main) .guide-home .page-heading .eyebrow { margin: 0 0 4px; font-size: calc(10px * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main) .guide-home .page-heading h1 { margin: 0; font-size: calc(28px * var(--portal-text-scale, 1)); line-height: 1.35; }
#main:not(.module-main) .guide-home .page-heading .lead { margin: 6px 0 0; font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.6; }
#main:not(.module-main) .guide-home .lookup { max-width: 960px; min-width: 0; margin: 0 0 10px; padding: 0; }
#main:not(.module-main) .guide-home .lookup-label { margin: 0 0 6px; font-size: calc(13px * var(--portal-text-scale, 1)); line-height: 1.5; }
#main:not(.module-main) .guide-home .lookup-input { min-width: 0; min-height: 46px; gap: 8px; padding: 0 10px; border-radius: 10px; box-shadow: none; }
#main:not(.module-main) .guide-home .lookup-input > span { flex: 0 0 auto; font-size: 22px; line-height: 1; }
#main:not(.module-main) .guide-home .lookup-input input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 8px 0; font: inherit; font-size: max(16px, calc(15px * var(--portal-text-scale, 1))); line-height: 1.4; }
#main:not(.module-main) .guide-home .lookup-clear { flex: 0 0 44px; width: 44px; min-height: 44px; margin: 0; padding: 0; }
#main:not(.module-main) .guide-home .lookup-clear[hidden] { display: none; }
#main:not(.module-main) .guide-home .lookup-categories { gap: 6px; margin: 8px 0 0; }
#main:not(.module-main) .guide-home .lookup-categories .filter { min-height: 32px; margin: 0; padding: 5px 10px; font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main) .guide-home .guide-map-top { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; padding: 0; border: 0; }
#main:not(.module-main) .guide-home .guide-map-top .button { min-height: 32px; margin: 0; padding: 6px 10px; font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main) .guide-home .guide-map-top :is(h1, h2) { margin: 0 0 6px; color: #704f31; font-size: calc(28px * var(--portal-text-scale, 1)); font-weight: 700; line-height: 1.35; letter-spacing: .025em; overflow-wrap: anywhere; }
#main:not(.module-main) .guide-home .guide-map-top p { max-width: 64ch; margin: 0; color: #827563; font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.7; }
#main:not(.module-main) .guide-home .guide-map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 12px; min-width: 0; margin: 0; }

#main:not(.module-main) .guide-home .guide-map-card {
  --guide-map-surface: #f8f4e5;
  --guide-map-border: #e6ddbf;
  --guide-map-accent: #8d7c45;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 222px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--guide-map-border);
  border-top: 3px solid var(--guide-map-border);
  border-radius: 12px;
  background: var(--guide-map-surface);
  color: #6d5035;
  box-shadow: 0 1px 3px #6f4d2f05;
  font: inherit;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .15s, box-shadow .15s;
}

#main:not(.module-main) .guide-home .guide-map-card[data-guide-tone="sage"] { --guide-map-surface: #edf3e8; --guide-map-border: #d5e1cd; --guide-map-accent: #58754d; }
#main:not(.module-main) .guide-home .guide-map-card[data-guide-tone="apricot"] { --guide-map-surface: #fbefe2; --guide-map-border: #ebd8be; --guide-map-accent: #a37344; }
#main:not(.module-main) .guide-home .guide-map-card[data-guide-tone="cream"] { --guide-map-surface: #f8f4e5; --guide-map-border: #e6ddbf; --guide-map-accent: #8d7c45; }
#main:not(.module-main) .guide-home .guide-map-card[data-guide-tone="rose"] { --guide-map-surface: #f8eeeb; --guide-map-border: #ead5cd; --guide-map-accent: #9c7267; }
#main:not(.module-main) .guide-home .guide-map-card:hover { border-color: #baa98c; box-shadow: 0 4px 12px #6f4d2f10; }
#main:not(.module-main) .guide-home .guide-map-card:focus-visible { outline: 3px solid #8ba66e; outline-offset: 3px; }
#main:not(.module-main) .guide-home .guide-map-icon { display: inline-flex; flex: 0 0 40px; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--guide-map-accent); }
#main:not(.module-main) .guide-home .guide-map-icon :is(svg, .gd-icon) { display: block; width: 40px; height: 40px; fill: none; stroke: currentColor; }
#main:not(.module-main) .guide-home .guide-map-copy { display: block; flex: 1 1 auto; min-width: 0; width: 100%; }
#main:not(.module-main) .guide-home .guide-map-copy strong { display: block; margin: 0 0 7px; color: #6d5035; font-size: max(20px, calc(24px * var(--portal-text-scale, 1))); font-weight: 700; line-height: 1.3; letter-spacing: .015em; }
#main:not(.module-main) .guide-home .guide-map-copy small { display: block; color: #7c7060; font-size: calc(13.5px * var(--portal-text-scale, 1)); line-height: 1.6; }
#main:not(.module-main) .guide-home .guide-map-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--guide-map-border); color: #7f715f; font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.5; }
#main:not(.module-main) .guide-home .guide-map-count small { color: inherit; font-size: inherit; }

@media (max-width: 1400px) {
  #main:not(.module-main) .guide-home .guide-map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  #main:not(.module-main) .guide-home .guide-map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #main:not(.module-main) .guide-home .page-heading { margin-bottom: 14px; }
  #main:not(.module-main) .guide-home .page-heading .eyebrow { display: none; }
  #main:not(.module-main) .guide-home .page-heading h1 { font-size: calc(24px * var(--portal-text-scale, 1)); }
  #main:not(.module-main) .guide-home .lookup-categories .filter,
  #main:not(.module-main) .guide-home .guide-map-top .button { min-height: 44px; }
  #main:not(.module-main) .guide-home .guide-map-top { gap: 8px; margin-bottom: 12px; padding: 0; }
  #main:not(.module-main) .guide-home .guide-map-top :is(h1, h2) { font-size: calc(24px * var(--portal-text-scale, 1)); }
  #main:not(.module-main) .guide-home .guide-map-top p { font-size: calc(13px * var(--portal-text-scale, 1)); }
  #main:not(.module-main) .guide-home .guide-map-card { min-height: 210px; gap: 10px; padding: 14px 12px; border-radius: 10px; }
  #main:not(.module-main) .guide-home .guide-map-copy strong { margin-bottom: 6px; font-size: max(20px, calc(20px * var(--portal-text-scale, 1))); line-height: 1.35; }
  #main:not(.module-main) .guide-home .guide-map-copy small { font-size: calc(13px * var(--portal-text-scale, 1)); line-height: 1.55; }
  #main:not(.module-main) .guide-home .guide-map-count { gap: 4px; padding-top: 8px; font-size: calc(11px * var(--portal-text-scale, 1)); }
}
@media (max-width: 350px) {
  #main:not(.module-main) .guide-home .guide-map-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  #main:not(.module-main) .guide-home .guide-map-card { transition: none; }
}

/* Calendar density changes spacing; calendar text has an independent control. */
#main:not(.module-main) .calendar-panel {
  --portal-day-min: var(--portal-calendar-cell-height, 155px);
  --portal-week-min: max(260px, calc(var(--portal-day-min) * 2.2));
  --portal-cell-pad: 10px;
  --portal-event-pad: 6px;
  --portal-event-gap: 6px;
  padding: calc(20px * var(--portal-ui-scale));
  min-width: 0;
  font-size: var(--portal-calendar-font);
}

html[data-portal-calendar-density="compact"] #main:not(.module-main) .calendar-panel { --portal-cell-pad: 7px; --portal-event-pad: 4px; --portal-event-gap: 4px; }
html[data-portal-calendar-density="spacious"] #main:not(.module-main) .calendar-panel { --portal-cell-pad: 15px; --portal-event-pad: 10px; --portal-event-gap: 9px; }
#main:not(.module-main) .native-calendar { width: 100%; border-radius: 14px; box-shadow: none; }
#main:not(.module-main) .native-calendar-top { gap: calc(16px * var(--portal-ui-scale)); padding-bottom: calc(16px * var(--portal-ui-scale)); }
#main:not(.module-main) .native-calendar-period h3 { font-size: 1.3em; }
#main:not(.module-main) .native-calendar :is(.button, .calendar-source) { font-size: .88em; }
#main:not(.module-main) .native-calendar :is(.calendar-source small, .calendar-footer, .calendar-help) { font-size: .8em; }
#main:not(.module-main) .native-calendar-source-list > summary { font-size: .84em; }
#main:not(.module-main) .native-calendar-source-list > summary > span { font-size: .82em; }
#main:not(.module-main) .native-month-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
#main:not(.module-main) .native-month { width: 100%; min-width: max(630px, 42em); }
#main:not(.module-main) .native-weekdays > div { padding: calc(8px * var(--portal-ui-scale)) 4px; font-size: .8em; }
#main:not(.module-main) .native-month-day { min-height: calc(var(--portal-day-min) * var(--portal-ui-scale)); padding: calc(var(--portal-cell-pad) * var(--portal-ui-scale)); }
#main:not(.module-main) .native-day-heading { gap: calc(6px * var(--portal-ui-scale)); margin-bottom: calc(var(--portal-event-gap) * var(--portal-ui-scale)); font-size: .8em; }
#main:not(.module-main) .native-day-number { width: calc(26px * var(--portal-ui-scale)); height: calc(26px * var(--portal-ui-scale)); font-size: 1.05em; }
#main:not(.module-main) :is(.native-month-events, .native-week-events) { gap: calc(var(--portal-event-gap) * var(--portal-ui-scale)); }
#main:not(.module-main) .native-event,
#main:not(.module-main) .native-event.compact,
#main:not(.module-main) .native-week .native-event { min-width: 0; padding: calc(var(--portal-event-pad) * var(--portal-ui-scale)) calc((var(--portal-event-pad) + 2px) * var(--portal-ui-scale)); gap: 2px; line-height: 1.45; }
#main:not(.module-main) .native-event-title,
#main:not(.module-main) .native-event.compact .native-event-title,
#main:not(.module-main) .native-week .native-event-title { font-size: 1em; line-height: 1.5; }
#main:not(.module-main) .native-event.compact .native-event-title { white-space: normal; overflow: visible; text-overflow: clip; }
#main:not(.module-main) .native-event-time,
#main:not(.module-main) .native-event.compact .native-event-time,
#main:not(.module-main) .native-event-source,
#main:not(.module-main) .native-week .native-event-source { font-size: .76em; }
#main:not(.module-main) :is(.native-more, .native-day-empty) { font-size: .8em; }
#main:not(.module-main) .native-week { width: 100%; grid-template-columns: repeat(7, minmax(0, 1fr)); }
#main:not(.module-main) .native-week-day { min-height: calc(var(--portal-week-min) * var(--portal-ui-scale)); padding: calc(var(--portal-cell-pad) * var(--portal-ui-scale)); }
#main:not(.module-main) .native-agenda-day { padding: calc(var(--portal-cell-pad) * var(--portal-ui-scale)); }
#main:not(.module-main) .native-agenda-events { gap: calc(var(--portal-event-gap) * var(--portal-ui-scale)); }
#main:not(.module-main) .native-agenda-events .native-event { padding: calc(var(--portal-event-pad) * var(--portal-ui-scale)) calc((var(--portal-event-pad) + 4px) * var(--portal-ui-scale)); }
#main:not(.module-main) .native-agenda-events .native-event-title { font-size: 1em; }

/* Widget editing guidance; legacy continuous resize controls stay hidden. */
#main:not(.module-main) .portal-edit-help,
#main:not(.module-main) .portal-drag-handle { display: none; }

html[data-portal-editing="true"] #main:not(.module-main) .portal-edit-help {
  display: block;
  margin: 0 0 18px;
  padding: 11px 14px;
  border: 1px solid #dce7cf;
  border-left: 3px solid #8da971;
  border-radius: 9px;
  background: #f2f6ed;
  color: #61744f;
  font-size: .85em;
  line-height: 1.7;
}

/* This drawer styles only the appearance editor, never shared app dialogs. */
#appearance-dialog.appearance-dialog {
  position: fixed;
  inset: 16px 16px auto auto;
  width: min(500px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce1d4;
  border-radius: 18px;
  background: #fffefa;
  color: #4a463c;
  box-shadow: 0 12px 48px #34412c29;
  font-size: 14px;
  line-height: 1.6;
}

#appearance-dialog.appearance-dialog[open] { display: flex; flex-direction: column; }
#appearance-dialog::backdrop { background: #2737211c; backdrop-filter: none; }
#appearance-dialog .appearance-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 20px; border-bottom: 1px solid #e4e7db; }
#appearance-dialog .appearance-head h2 { margin: 0; color: #5c674d; font-size: 19px; line-height: 1.4; }
#appearance-dialog .appearance-head :is(.close, button) { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 40px; padding: 7px; flex: 0 0 auto; border: 0; border-radius: 10px; background: #f1f4eb; color: #617250; font-size: 22px; }
#appearance-dialog .appearance-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px; }
#appearance-dialog .appearance-section { padding: 19px 0; border-bottom: 1px solid #e8eadd; }
#appearance-dialog .appearance-section:last-child { border-bottom: 0; }
#appearance-dialog .appearance-section > details { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e8eadd; }
#appearance-dialog .appearance-section > details > summary { cursor: pointer; }
#appearance-dialog .appearance-section :is(h3, summary) { margin: 0 0 12px; color: #59674c; font-size: 15px; font-weight: 650; }
#appearance-dialog details.appearance-section > summary { cursor: pointer; margin-bottom: 0; padding: 2px 0; }
#appearance-dialog details.appearance-section[open] > summary { margin-bottom: 13px; }
#appearance-dialog .appearance-section p { margin: 6px 0 12px; color: #807d70; font-size: 12px; line-height: 1.7; }
#appearance-dialog .appearance-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center; min-width: 0; margin-top: 13px; }
#appearance-dialog .appearance-control:first-child { margin-top: 0; }
#appearance-dialog .appearance-control > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
#appearance-dialog .appearance-control > span .appearance-range-value { flex: 0 0 auto; }
#appearance-dialog .appearance-control > label { min-width: 0; font-size: 14px; }
#appearance-dialog .appearance-control :is(select, input:not([type="range"]):not([type="checkbox"])) { min-width: 0; max-width: 100%; padding: 9px 10px; border: 1px solid #d6ddcb; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }
#appearance-dialog label.range { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center; min-width: 0; margin: 14px 0 0; font-size: 14px; }
#appearance-dialog .appearance-range-value { color: #657c52; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
#appearance-dialog input[type="range"] { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 28px; margin: 0; accent-color: #6c8c50; cursor: pointer; }
#appearance-dialog input[type="checkbox"] { width: 17px; height: 17px; min-width: 17px; margin: 0; accent-color: #6c8c50; }
#appearance-dialog .appearance-shortcuts { display: grid; gap: 7px; }
#appearance-dialog .appearance-fixed-menu { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
#appearance-dialog .appearance-fixed-menu > span { padding: 4px 7px; border: 1px solid var(--line, #e7e0d5); border-radius: 6px; color: var(--muted, #715a46); font-size: 12px; line-height: 1.5; }
#appearance-dialog .appearance-subheading { margin: 20px 0 8px; color: var(--ink, #49301b); font-size: 13px; }
#appearance-dialog .appearance-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; border: 1px solid #e2e7d8; border-radius: 10px; background: #fafbf6; }
#appearance-dialog .appearance-item :is(label, .checkbox) { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13px; line-height: 1.5; cursor: pointer; }
#appearance-dialog .appearance-item .gd-icon { width: 21px; height: 21px; color: #617b50; }
#appearance-dialog .appearance-item label > span { min-width: 0; overflow-wrap: anywhere; }
#appearance-dialog .appearance-move { display: flex; gap: 3px; flex: 0 0 auto; }
#appearance-dialog .appearance-move button { display: inline-flex; align-items: center; justify-content: center; width: 32px; min-width: 32px; min-height: 35px; padding: 5px; border: 1px solid #dce4d0; border-radius: 7px; background: #fff; color: #637855; font-size: 16px; }
#appearance-dialog .appearance-move button:disabled { opacity: .35; cursor: default; }
#appearance-dialog .appearance-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 20px; border-top: 1px solid #e4e7db; background: #fafbf6; }
#appearance-dialog .appearance-body > .appearance-actions { margin-inline: -20px; }
#appearance-dialog .appearance-actions button { min-height: 40px; padding: 9px 13px; border: 1px solid #d7dfcc; border-radius: 9px; background: #fff; color: #5c704d; font: inherit; font-weight: 600; }
#appearance-dialog .appearance-actions button.primary { border-color: #66814f; background: #66814f; color: #fff; }
#appearance-dialog :is(button, input, select, summary):focus-visible { outline: 3px solid #91ad73; outline-offset: 3px; }

@media (max-width: 1000px) {
  #main:not(.module-main) .native-week { grid-template-columns: 1fr; }
  #main:not(.module-main) .native-week-day { grid-template-columns: minmax(72px, .18fr) minmax(0, 1fr); gap: calc(14px * var(--portal-ui-scale)); }
}

@media (min-width: 761px) and (max-height: 680px) {
  #shell > .sidebar { gap: 10px; padding-block: 16px; }
  #shell > .sidebar .sidebar-bottom { gap: 8px; padding-top: 10px; }
  #shell > .sidebar #sidebar-tools :is(button, a) { min-height: 31px; padding-block: 5px; font-size: .78em; }
}

@media (max-width: 760px) {
  #shell > .sidebar { position: relative; inset: auto; width: 100%; height: auto; min-height: 60px; padding: 8px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; border-right: 0; border-bottom: 1px solid var(--line, #e7e0d5); }
  #shell > .sidebar > .brand { font-size: 1.05em; gap: 9px; }
  #shell > .sidebar > .brand .brand-mark { width: 34px; height: 34px; font-size: 24px; border-radius: 11px; }
  #shell > .sidebar #sidebar-date { display: none; }
  #shell > .sidebar > .mobile-menu-toggle { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 96px; height: 44px; min-height: 44px; margin: 0; padding: 0 10px; border: 1px solid #dce4d2; border-radius: 8px; background: #fafcf6; color: #526b43; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
  #shell > .sidebar > .mobile-menu-toggle .gd-icon { width: 22px; height: 22px; }
  #shell > .sidebar > .mobile-menu-toggle:focus-visible { outline: 3px solid #8ba86e; outline-offset: 2px; }
  #shell > .sidebar #navigation { grid-column: 1 / -1; display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; max-height: 35dvh; gap: 5px; margin: 8px -4px 0; padding: 2px 4px 6px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  #shell > .sidebar #navigation :is(.menu-section-label, .menu-empty-note) { grid-column: 1 / -1; }
  #shell > .sidebar .nav-button { width: 100%; min-height: 44px; margin: 0; padding: 9px 10px; gap: 7px; font-size: .88em; white-space: normal; }
  html[data-portal-sidebar-style="icons"] #shell > .sidebar .nav-button { justify-content: flex-start; }
  html[data-portal-sidebar-style="icons"] #shell > .sidebar .nav-label-text { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal; }
  #shell > .sidebar .nav-icon.gd-icon { width: 20px; height: 20px; }
  #shell > .sidebar .sidebar-bottom { grid-column: 1 / -1; display: none; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 8px; padding-top: 9px; }
  html[data-portal-mobile-menu-open="true"] #shell > .sidebar :is(#navigation, .sidebar-bottom) { display: grid; }
  #shell > .sidebar #sidebar-account { grid-column: 1; grid-row: 1; display: flex; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; padding: 0; font-size: .83em; }
  #shell > .sidebar #sidebar-account .account-role { display: inline; }
  #shell > .sidebar #sidebar-tools { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 6px; }
  #shell > .sidebar #sidebar-tools :is(button, a) { width: auto; min-height: 44px; padding: 6px 9px; font-size: .76em; gap: 5px; }
  #shell > .sidebar #sidebar-tools .gd-icon { width: 15px; height: 15px; }
  #shell > .sidebar .sidebar-privacy { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; min-height: 44px; padding: 0; font-size: .68em; text-align: right; }
  #shell > .sidebar .sidebar-privacy a { display: inline-flex; align-items: center; min-height: 44px; }
  #shell > .workspace { width: 100%; margin-left: 0; }
  #shell > .workspace > .topbar { min-height: 44px; padding: 0 10px; gap: 0; border-bottom: 0; }
  #shell > .workspace > .topbar:has(.topbar-tools) { display: none; }
  #portal-display-float { position: fixed; z-index: 40; right: max(14px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 10px; margin: 0; border: 1px solid var(--line, #dec8aa); border-radius: 50%; background: var(--paper, #fffaf0); color: var(--brown, #4c2b16); box-shadow: 0 3px 13px #4c2b1624; cursor: pointer; }
  #portal-display-float svg { display: block; width: 26px; height: 26px; }
  #portal-display-float[hidden] { display: none; }
  #portal-display-float:focus-visible { outline: 3px solid var(--brown, #4c2b16); outline-offset: 3px; }
  #shell > .workspace > .topbar .top-actions { width: 100%; min-width: 0; }
  #shell > .workspace > .topbar .topbar-tools { width: 100%; flex-wrap: nowrap; }
  #shell > .workspace > .topbar .topbar-tools .portal-font-tools { margin-left: auto; }
  #shell > .workspace > .topbar .page-help-button { min-width: 44px; padding-inline: 6px; }
  #shell > .workspace > .topbar .color-mode-button.portal-desktop-control { display: none; }
  #shell > .workspace > .topbar .portal-display-menu-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 44px; min-height: 44px; margin: 0; padding: 5px 6px; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; font-size: 12px; }
  #shell > .workspace > .topbar .portal-display-menu-button:focus-visible { outline: 3px solid var(--brown, #4c2b16); outline-offset: 2px; }
  .portal-desktop-label { display: none; }
  .portal-mobile-label { display: inline; }
  #shell > .workspace > .topbar .breadcrumb { font-size: 10px; }
  #shell > .workspace > .topbar .portal-font-tools { gap: 3px; }
  #shell > .workspace > .topbar .portal-font-tools button { min-width: 44px; min-height: 44px; padding: 5px 7px; border: 0; background: transparent; font-size: 12px; }
  #shell > .workspace > .topbar .portal-font-tools button[data-font-help] { min-width: 78px; }
  #main:not(.module-main):not(:has(.auth-card)) { padding: calc(18px * var(--portal-ui-scale)) 12px max(calc(28px * var(--portal-ui-scale)), var(--portal-floating-clearance, 0px)); }
  #main:not(.module-main) .portal-home-head { align-items: center; flex-wrap: nowrap; gap: 8px; margin-bottom: 8px; }
  #main:not(.module-main) .portal-home-head { display: none; }
  #main:not(.module-main) .portal-home .widget-add-actions { display: none; }
  #main:not(.module-main) .portal-home .widget-section-heading h2 { display: inline-flex; align-items: center; gap: 7px; }
  #main:not(.module-main) .portal-home .portal-mobile-mascot { display: inline-flex !important; flex: 0 0 32px; width: 32px; height: 32px; }
  #main:not(.module-main) .portal-home-head h1 { font-size: 1.2em; }
  #main:not(.module-main) .portal-shortcuts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 80px), 1fr)); gap: 8px; }
  html[data-portal-home-style="compact"] #main:not(.module-main) .portal-shortcuts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
  /* Keep the same menu order in one touch-scrollable row on a phone. */
  #main:not(.module-main) .portal-home > .portal-apps { display: flex; align-items: stretch; gap: 6px; min-width: 0; max-width: 100%; margin-bottom: 10px; padding: 3px 2px 7px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 2px; scrollbar-width: thin; scrollbar-color: var(--line, #e7dcc8) transparent; }
  #main:not(.module-main) .portal-home .portal-menu-group { display: flex; flex: 0 0 auto; min-width: 0; margin: 0; }
  html #main:not(.module-main) .portal-home .portal-shortcuts { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 6px; margin: 0; }
  html #main:not(.module-main) .portal-home .portal-shortcuts .portal-shortcut { flex: 0 0 72px; width: 72px; min-height: 60px; padding: 3px 4px; gap: 2px; scroll-snap-align: start; }
  html #main:not(.module-main) .portal-home .portal-shortcuts .portal-shortcut .gd-icon { width: 26px; height: 26px; flex: 0 0 26px; }
  html #main:not(.module-main) .portal-home .portal-shortcuts .portal-shortcut .shortcut-label strong { min-height: 2.3em; font-size: calc(10.5px * var(--portal-text-scale, 1)); line-height: 1.15; }
  html[data-portal-home-style="icons"] #main:not(.module-main) .portal-home .portal-shortcuts .portal-shortcut { flex-basis: 48px; width: 48px; min-height: 48px; }
  html[data-portal-home-style="compact"] #main:not(.module-main) .portal-home .portal-shortcuts .portal-shortcut { flex-basis: 140px; width: 140px; }
  html[data-portal-home-style="compact"] #main:not(.module-main) .portal-home .portal-shortcuts .portal-shortcut .shortcut-label strong { min-height: 0; }
  #main:not(.module-main) .portal-home .portal-menu-group > .description { display: none; }
  #main:not(.module-main) .portal-home .widget-section-heading { flex-wrap: wrap; gap: 8px; margin: 12px 0; }
  #main:not(.module-main) .portal-home .widget-section-heading h2 { font-size: 1.05em; white-space: nowrap; }
  #main:not(.module-main) .portal-home .widget-add-actions { flex-wrap: nowrap; gap: 6px; }
  #main:not(.module-main) .portal-home .widget-add-actions .button { min-height: 44px; padding: 6px 8px; white-space: nowrap; }

  #main:not(.module-main) .calendar-panel { padding: calc(12px * var(--portal-ui-scale)); }
  #main:not(.module-main) .native-calendar-top { display: block; }
  #main:not(.module-main) .native-calendar-period { gap: 10px; }
  #main:not(.module-main) .native-calendar-tools { gap: 10px; margin-top: 12px; }
  #main:not(.module-main) .native-calendar-period h3 { font-size: 1.15em; }
  #main:not(.module-main) .native-agenda-events .native-event { grid-template-columns: 5.5em minmax(0, 1fr); }
  #shell > .workspace [data-appearance-edit],
  #shell > .workspace #main:not(.module-main) :is(.portal-drag-handle, .portal-edit-help) { display: none; }
  #appearance-dialog.appearance-dialog { inset: 8px 8px auto auto; width: calc(100vw - 16px); max-width: 500px; max-height: calc(100dvh - 16px); border-radius: 14px; }
  #appearance-dialog .appearance-head { padding: 13px 15px; }
  #appearance-dialog .appearance-head :is(.close, button) { width: 44px; height: 44px; min-height: 44px; }
  #appearance-dialog .appearance-body { padding-inline: 15px; }
  #appearance-dialog .appearance-actions { padding: 13px 15px; }
  #appearance-dialog .appearance-actions button { min-height: 44px; }
  #appearance-dialog .appearance-body > .appearance-actions { margin-inline: -15px; }
}

@media (prefers-reduced-motion: reduce) {
  #main:not(.module-main) .portal-shortcuts .portal-shortcut { transition: none; }
}

/* Module notices and dialogs use the viewport below the shell's measured bar.
 * Keep this in the integrated shell so standalone applications retain their
 * own positioning. The CSS fallback also works before the host is configured. */
@media screen {
  #module-root {
    --portal-module-top-offset: var(--portal-header-inset, 48px);
    --portal-module-left-offset: var(--portal-sidebar-inset, 0px);
    --portal-module-center: calc(50% + var(--portal-module-left-offset) / 2);
  }
  #module-root[data-goodday-module="attendance"] .success-popup,
  #module-root [data-sonner-toaster][data-y-position="top"] {
    top: calc(var(--portal-module-top-offset) + max(12px, env(safe-area-inset-top))) !important;
  }
  #module-root[data-goodday-module="attendance"] .success-popup {
    left: var(--portal-module-center);
    width: calc(100% - var(--portal-module-left-offset) - 32px);
    max-height: calc(100dvh - var(--portal-module-top-offset) - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
    overflow-y: auto;
  }
  #module-root:is([data-goodday-module="attendance"], [data-goodday-module="transport"]) :is(.error-popup, [data-slot="dialog-content"]:not(.transport-menu), [data-slot="alert-dialog-content"]) {
    top: calc(50% + var(--portal-module-top-offset) / 2) !important;
    left: var(--portal-module-center) !important;
    width: calc(100vw - var(--portal-module-left-offset) - 32px) !important;
    max-height: calc(100dvh - var(--portal-module-top-offset) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
  #module-root[data-goodday-module="transport"] .transport-menu {
    top: var(--portal-module-top-offset) !important;
    height: calc(100dvh - var(--portal-module-top-offset));
    max-height: calc(100dvh - var(--portal-module-top-offset));
  }
  #module-root[data-goodday-module="transport"] .paper-preview,
  #module-root[data-goodday-module="cards"] .modal-backdrop { top: var(--portal-module-top-offset); left: var(--portal-module-left-offset); }
  #module-root[data-goodday-module="cards"] .modal-backdrop .scan-modal {
    max-height: calc(100dvh - var(--portal-module-top-offset) - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  @media (min-width: 601px) {
    #module-root [data-sonner-toaster][data-x-position="center"] { left: var(--portal-module-center); }
  }
  @media (max-width: 760px) {
    #module-root[data-goodday-module="attendance"] .success-popup { width: calc(100% - 24px); }
  }
  #module-root:is([data-goodday-module="transport"], [data-goodday-module="cards"], [data-goodday-module="plan-studio"]) .topbar { top: var(--portal-module-top-offset); }
  #module-root[data-goodday-module="transport"] .floating-list-nav { top: calc(var(--transport-header-height, 76px) + var(--portal-module-top-offset)); }

  @media (min-width: 651px) {
    #module-root[data-goodday-module="cards"] .sidebar { top: calc(72px + var(--portal-module-top-offset)); height: calc(100vh - 72px - var(--portal-module-top-offset)); }
  }
  @media (min-width: 761px) {
    #module-root[data-goodday-module="plan-studio"] .sidebar { top: calc(84px + var(--portal-module-top-offset)); height: calc(100vh - 84px - var(--portal-module-top-offset)); }
  }
  @media (max-width: 900px) {
    #module-root[data-goodday-module="cards"] .detail { top: calc(72px + var(--portal-module-top-offset)); }
  }
  @media (max-width: 650px) {
    #module-root[data-goodday-module="cards"] .detail { top: calc(64px + var(--portal-module-top-offset)); }
  }
  @media (max-width: 760px) {
    #module-root { --portal-module-top-offset: var(--portal-header-inset, 0px); }
  }
}

/* Native modules own their screen-only text scaling, including responsive
 * overrides and Shadow DOM controls. Paper and print typography stay native. */

/* Keep small text preferences from causing mobile focus zoom in native forms. */
@media screen and (max-width: 760px) {
  html:is([data-portal-text-size="small"], [data-portal-text-size="large"]) #module-root:is([data-goodday-module="attendance"], [data-goodday-module="transport"], [data-goodday-module="cards"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, [data-slot="select-trigger"], [data-slot="select-item"]) {
    font-size: max(16px, calc(16px * var(--portal-text-scale, 1)));
  }
}

/* Official GOOD DAY identity stays within the portal's own surfaces. */
:root {
  --goodday-orange: #fe4528;
  --goodday-yellow: #ffc000;
  --goodday-green: #20c74c;
  --goodday-blue: #00a7eb;
  --goodday-brown: #4c2b16;
  --goodday-cream: #fff8ea;
}

#shell > .sidebar > .brand.portal-brand-lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; max-width: 180px; color: var(--goodday-brown); letter-spacing: 0; text-decoration: none; }
#shell > .sidebar > .portal-brand-lockup .portal-brand-logo { display: block; flex: 0 1 auto; width: 176px; max-width: 100%; height: auto; object-fit: contain; }
#shell > .sidebar > .portal-brand-lockup > small { margin: 0; color: #806247; font-size: 11px; font-weight: 550; line-height: 1.4; }
#shell > .sidebar .nav-button { color: var(--goodday-brown); }
#shell > .sidebar .nav-button:hover { background: #fff3e3; color: var(--goodday-brown); }
#shell > .sidebar .nav-button.active { border-color: #f6d3b9; background: #fff0df; color: var(--goodday-brown); box-shadow: inset 3px 0 0 var(--goodday-orange); }
#shell > .sidebar .nav-icon.gd-icon { width: 24px; height: 24px; color: var(--goodday-brown); }

#main:not(.module-main) .brand-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
#main:not(.module-main) .brand-heading h1 { min-width: 0; margin: 0; color: var(--goodday-brown); overflow-wrap: anywhere; }
#main:not(.module-main) .brand-mascot,
#detail-dialog .brand-mascot { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 56px; height: 56px; }
#main:not(.module-main) .brand-mascot img,
#detail-dialog .brand-mascot img { display: block; width: 100%; max-width: 100%; height: 100%; object-fit: contain; }

#main:not(.module-main) .portal-shortcuts .portal-shortcut { border-color: #ebdeca; background: #fffdf6; color: var(--goodday-brown); }
#main:not(.module-main) .portal-shortcuts .portal-shortcut > .gd-icon { width: 24px; height: 24px; border-radius: 6px; background: #ffc0001f; color: var(--goodday-brown); }
#main:not(.module-main) .portal-shortcuts .portal-shortcut:hover { border-color: #efba91; background: #fff3e1; box-shadow: 0 2px 7px #4c2b160a; }
#main:not(.module-main) .portal-shortcuts .portal-shortcut:focus-visible { outline-color: #ce6b31; }

#main:not(.module-main) .portal-widget { --widget-brand-accent: var(--goodday-orange); border-color: #e8dcc8; }
#main:not(.module-main) .portal-widget[data-widget-id="calendar"] { --widget-brand-accent: var(--goodday-yellow); }
#main:not(.module-main) .portal-widget:is([data-widget-id="attendance"], [data-widget-id="todoist"]) { --widget-brand-accent: var(--goodday-green); }
#main:not(.module-main) .portal-widget[data-widget-id="guide"] { --widget-brand-accent: var(--goodday-blue); }
#main:not(.module-main) .portal-widget-head { border-bottom-color: #eadfc8; background: var(--goodday-cream); box-shadow: inset 3px 0 0 var(--widget-brand-accent); }
#main:not(.module-main) .portal-widget-head h2,
#main:not(.module-main) .portal-widget-head > .gd-icon { color: var(--goodday-brown); }

#main:not(.module-main) .guide-home .page-heading { display: flex; flex-flow: row nowrap; align-items: center; justify-content: flex-start; }
#main:not(.module-main) .guide-home .page-heading > div { flex: 1 1 0; min-width: 0; }
#main:not(.module-main) .guide-home .page-heading > .brand-mascot-guide { flex: 0 0 auto; width: 64px; height: 64px; }
#main:not(.module-main) .guide-home .page-heading h1 { color: var(--goodday-brown); }
#main:not(.module-main) .guide-home .guide-map-card { --guide-map-surface: #fff8de; --guide-map-border: #ecdda7; --guide-map-accent: var(--goodday-brown); --guide-brand-accent: var(--goodday-yellow); border-top-color: var(--guide-brand-accent); }
#main:not(.module-main) .guide-home .guide-map-card[data-guide-tone="sage"] { --guide-map-surface: #f1f9ec; --guide-map-border: #cee5c3; --guide-map-accent: var(--goodday-brown); --guide-brand-accent: var(--goodday-green); }
#main:not(.module-main) .guide-home .guide-map-card[data-guide-tone="apricot"] { --guide-map-surface: #fff0e5; --guide-map-border: #efcfb6; --guide-map-accent: var(--goodday-brown); --guide-brand-accent: var(--goodday-orange); }
#main:not(.module-main) .guide-home .guide-map-card[data-guide-tone="cream"] { --guide-map-surface: #fff8de; --guide-map-border: #ecdda7; --guide-map-accent: var(--goodday-brown); --guide-brand-accent: var(--goodday-yellow); }
#main:not(.module-main) .guide-home .guide-map-card[data-guide-tone="rose"] { --guide-map-surface: #eff8fc; --guide-map-border: #cce4ee; --guide-map-accent: var(--goodday-brown); --guide-brand-accent: var(--goodday-blue); }
#main:not(.module-main) .guide-home .guide-map-copy strong { color: var(--goodday-brown); }

#detail-dialog .page-help-intro { display: flex; align-items: flex-start; gap: 12px; min-width: 0; margin: 0 0 16px; }
#detail-dialog .page-help-intro .page-help-summary { flex: 1 1 auto; min-width: 0; margin: 0; border-color: #eaddc3; background: var(--goodday-cream); color: var(--goodday-brown); }

@keyframes portal-brand-arrive {
  from { opacity: .8; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  #shell > .sidebar > .portal-brand-lockup .portal-brand-logo,
  #main:not(.module-main) .brand-mascot img,
  #detail-dialog .brand-mascot img { animation: portal-brand-arrive .36s ease-out 1 both; }
}

@media (max-width: 760px) {
  #shell > .sidebar > .brand.portal-brand-lockup { flex-direction: row; align-items: center; gap: 7px; width: auto; max-width: 100%; }
  #shell > .sidebar > .portal-brand-lockup .portal-brand-logo { width: 114px; max-width: 100%; height: auto; }
  #shell > .sidebar > .portal-brand-lockup > small { font-size: 10px; }
  #shell > .sidebar .nav-icon.gd-icon { width: 24px; height: 24px; }
  #main:not(.module-main) .portal-home-head .brand-heading { gap: 8px; }
  #main:not(.module-main) .portal-home-head .brand-mascot { width: 44px; height: 44px; }
  #main:not(.module-main) .guide-home .page-heading { gap: 10px; }
  #main:not(.module-main) .guide-home .page-heading > .brand-mascot-guide { width: 48px; height: 48px; }
  #detail-dialog .page-help-intro { gap: 9px; }
  #detail-dialog .page-help-intro .brand-mascot { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce), print {
  #shell > .sidebar > .portal-brand-lockup .portal-brand-logo,
  #main:not(.module-main) .brand-mascot img,
  #detail-dialog .brand-mascot img { animation: none; transform: none; }
}

/* Dedicated grips consume touch gestures; widget content keeps normal scrolling. */
#main:not(.module-main) .widget-drag-handle,
#appearance-dialog .widget-choice-drag { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#appearance-dialog .appearance-item.widget-choice { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; gap: 4px 8px; }
#appearance-dialog .widget-choice-label { min-width: 0; }
#appearance-dialog .widget-choice-drag { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; margin: 2px 0 0; padding: 0; border: 1px solid var(--line, #dec8aa); border-radius: 8px; background: var(--paper, #fffdf7); color: var(--ink, #4c2b16); font: inherit; font-size: 24px; cursor: grab; }
#appearance-dialog .widget-choice-drag:active { cursor: grabbing; }
#appearance-dialog .widget-choice-drag:disabled { visibility: hidden; }
#appearance-dialog .widget-choice-drag:focus-visible { outline: 3px solid var(--green, #26994b); outline-offset: 2px; }
#appearance-dialog .widget-choice.is-dragging { opacity: .5; }
#appearance-dialog .widget-choice.is-drop-target,
#main:not(.module-main) .portal-widget.is-drop-target { outline: 2px dashed var(--green, #26994b); outline-offset: 2px; background: var(--green-bg, #eff8ec); }
#appearance-dialog .widget-edit-start { min-height: 44px; margin-top: 12px; white-space: normal; }
@media (max-width: 760px) {
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .portal-widget-tools { display: flex; flex: 1 0 100%; justify-content: flex-start; margin: 0; padding-top: 4px; border-top: 1px solid var(--line, #dec8aa); }
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-drag-handle { display: inline-flex; min-width: 44px; min-height: 44px; font-size: 24px; }
  html[data-portal-editing="true"] #shell > .workspace [data-appearance-edit] { display: inline-flex; min-height: 44px; }
  html[data-portal-editing="true"] #main:not(.module-main) .portal-home-head { display: flex; height: 0; margin: 0; }
  html[data-portal-editing="true"] #main:not(.module-main) .portal-home-head .brand-heading,
  html[data-portal-editing="true"] #main:not(.module-main) .portal-home-actions > [data-appearance-open] { display: none; }
  html[data-portal-editing="true"] #main:not(.module-main) .portal-home-actions > [data-appearance-edit] { position: fixed; z-index: 40; right: var(--portal-floating-right, max(14px, env(safe-area-inset-right))); bottom: var(--portal-floating-base, calc(16px + env(safe-area-inset-bottom))); margin: 0; border-color: var(--line, #dec8aa); background: var(--paper, #fffdf7); color: var(--ink, #4c2b16); box-shadow: 0 3px 13px #4c2b1624; }
}

/* Lucide UI symbols inherit nearby text; navigation wrappers retain their compact sizes. */
svg.gd-ui-icon { display: inline-block; width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -.125em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:is(button, a) > svg.gd-ui-icon { pointer-events: none; }
.task-symbol > svg.gd-ui-icon { width: 18px; height: 18px; }
.notification-choice-icon > svg.gd-ui-icon { width: 24px; height: 24px; }

.notification-card > summary::after, #portal-auto-guide .auto-guide-options > summary::after { content: ""; display: inline-block; width: 1em; height: 1em; background: currentColor; mask: url("data:image/svg+xml,%3Csvg%20width%3D%221em%22%20height%3D%221em%22%20class%3D%22lucide%20lucide-chevron-down%20gd-ui-icon%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20aria-hidden%3D%22true%22%20focusable%3D%22false%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; }
.notification-card[open] > summary::after { content: ""; transform: rotate(180deg); }
.checklist li::before { content: ""; width: 1em; height: 1em; top: .7em; background: currentColor; mask: url("data:image/svg+xml,%3Csvg%20class%3D%22lucide%20lucide-square%20gd-ui-icon%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20aria-hidden%3D%22true%22%20focusable%3D%22false%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; }
/* portal-module-typography-v1 */
@media screen {

#shell > .sidebar {
  font-size: var(--portal-sidebar-font);
}

#shell > .sidebar > .brand {
  font-size: 1.18em;
}
#shell > .sidebar > .brand small { font-size: .65em; }

#shell > .sidebar #sidebar-date {
  font-size: .86em;
  line-height: 1.6;
}

#shell > .sidebar .nav-button {
  font-size: 1em;
  line-height: 1.55;
}

#shell > .sidebar #navigation .menu-section-label { font-size: .72em; line-height: 1.5; }
#shell > .sidebar #navigation .menu-empty-note { font-size: .75em; line-height: 1.7; }

#shell > .sidebar #sidebar-account {
  font-size: .94em;
  line-height: 1.5;
}

#shell > .sidebar #sidebar-account .account-name { font-size: 1em; }
#shell > .sidebar #sidebar-account :is(.account-role, small) { font-size: .8em; }

#shell > .sidebar #sidebar-tools :is(button, a) {
  font: inherit;
  font-size: .83em;
  line-height: 1.45;
}
#shell > .sidebar .sidebar-privacy { font-size: .72em; line-height: 1.6; }
#shell > .workspace > .topbar .portal-font-tools button { font-size: calc((13px) * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main):not(:has(.auth-card)) {
  font-size: var(--portal-content-font);
  line-height: 1.7;
}

#main:not(.module-main):not(:has(.auth-card)) :where(p, li, td, label, .description, .lead, .panel-copy, .rich-text, .field, .app-link strong) { font-size: 1em; }
#main:not(.module-main):not(:has(.auth-card)) :where(.button, input, textarea, select) { font-size: .9em; }
#main:not(.module-main):not(:has(.auth-card)) :where(.check-help, .form-help, .source, .meta, .app-link small, .panel-head small, small) { font-size: .82em; }
#main:not(.module-main):not(:has(.auth-card)) h1 { font-size: 1.6em; }
#main:not(.module-main):not(:has(.auth-card)) h2 { font-size: 1.22em; }
#main:not(.module-main):not(:has(.auth-card)) h3 { font-size: 1.05em; }

#main:not(.module-main) .portal-home-head h1 { font-size: 1.3em; }

#main:not(.module-main) .portal-shortcuts .portal-shortcut {
  font-size: 1em;
  line-height: 1.5;
}
#main:not(.module-main) .portal-shortcut .shortcut-label strong { font-size: calc(11.5px * var(--portal-text-scale, 1)); line-height: 1.2; }
#main:not(.module-main) .portal-menu-group > .menu-section-label { font-size: calc((13px) * var(--portal-text-scale, 1)); line-height: 1.6; }
#main:not(.module-main) .portal-menu-group > .menu-section-label small { font-size: calc((11px) * var(--portal-text-scale, 1)); }

#main:not(.module-main) .portal-widget-head h2 { font-size: calc(15px * var(--portal-text-scale, 1)); line-height: 1.4; }
#detail-dialog .home-compose-form .field { font-size: calc((14px) * var(--portal-text-scale, 1)); }
#detail-dialog .home-compose-form :is(input, select, textarea) { font-size: calc((16px) * var(--portal-text-scale, 1)); }
#detail-dialog .home-compose-success { font-size: calc((22px) * var(--portal-text-scale, 1)); }
#main:not(.module-main) .portal-widget-head :is(.button, button, a) { font: inherit; font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.35; }

@media (min-width: 761px) {
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget .widget-resize-handle {
    font-size: calc((21px) * var(--portal-text-scale, 1));
    line-height: 1;
  }
}

#main:not(.module-main) .portal-widget-body {
  font-size: .9em;
  line-height: 1.6;
}
#main:not(.module-main) .widget-kpi strong { font-size: calc(26px * var(--portal-text-scale, 1)); line-height: 1.2; }
#main:not(.module-main) .widget-kpi :is(span, small) { font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.45; }
#main:not(.module-main) .widget-row { font: inherit; line-height: 1.5; }
#main:not(.module-main) .widget-row small { font-size: .86em; }
#main:not(.module-main) .attendance-current small { font-size: .85em; }
#main:not(.module-main) .attendance-state { font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main) .attendance-details dt { font-size: .86em; }
#main:not(.module-main) .attendance-details dd { line-height: 1.5; }
#main:not(.module-main) .attendance-details dd strong { font-size: calc(15px * var(--portal-text-scale, 1)); }
#main:not(.module-main) .attendance-details dd small { font-size: .83em; }
#appearance-dialog .attendance-widget-settings > summary { line-height: 1.6; }
#main:not(.module-main) :is(.widget-empty, .widget-note) { font-size: .92em; line-height: 1.7; }
#main:not(.module-main) .transport-overview-summary .transport-overview-date { font-size: .82em; }
#main:not(.module-main) .transport-overview-counts > span { font-size: .82em; line-height: 1.5; }
#main:not(.module-main) .transport-overview-counts strong { font-size: 1.08em; }
#main:not(.module-main) .transport-schedule-heading { font-size: .75em; }
#main:not(.module-main) .transport-schedule-row { font-size: calc(15px * var(--portal-text-scale, 1)); line-height: 1.5; }
#main:not(.module-main) .transport-schedule-kind small { font-size: .78em; line-height: 1.4; }
#main:not(.module-main) .transport-schedule-open { font: inherit; line-height: inherit; }
#main:not(.module-main) :is(.transport-schedule-note, .transport-schedule-empty) { font-size: .82em; line-height: 1.6; }
#main:not(.module-main) .widget-link-row { font: inherit; line-height: 1.6; }
#main:not(.module-main) .widget-link-row strong { font-size: 1em; }
#main:not(.module-main) .widget-link-row small { font-size: .88em; line-height: 1.7; }
#main:not(.module-main) .widget-clock-date { font-size: calc(15px * var(--portal-text-scale,1)); line-height: 1.6; }
#main:not(.module-main) .widget-clock-time { font-size: calc(44px * var(--portal-text-scale,1)); line-height: 1.2; }
#main:not(.module-main) .portal-widget[data-widget-size="medium"] .widget-clock-time { font-size: calc(64px * var(--portal-text-scale,1)); }
#main:not(.module-main) .portal-widget[data-widget-size="large"] .widget-clock-time { font-size: calc(80px * var(--portal-text-scale,1)); }
#main:not(.module-main) .widget-clock small { font-size: .88em; }
#appearance-dialog .widget-choice-copy strong { font-size: calc((14px) * var(--portal-text-scale, 1)); line-height: 1.6; }
#appearance-dialog .widget-choice-copy small { font-size: calc((12px) * var(--portal-text-scale, 1)); line-height: 1.7; }
@media(max-width:760px) {
 #main:not(.module-main) .portal-widget:is([data-widget-size="medium"],[data-widget-size="large"]) .widget-clock-time { font-size: calc(48px * var(--portal-text-scale,1)); }
 #appearance-dialog .widget-choice-copy strong { font-size: calc((15px) * var(--portal-text-scale, 1)); }
 #appearance-dialog .widget-choice-copy small { font-size: calc((13px) * var(--portal-text-scale, 1)); }
}
#main:not(.module-main) .portal-widget-body .todoist-widget-status { font-size: .95em; line-height: 1.65; }
#main:not(.module-main) .portal-widget-body .todoist-view-control { font: inherit; }
#main:not(.module-main) .portal-widget-body .todoist-view-control select { font: inherit; line-height: 1.4; }
#main:not(.module-main) .portal-widget-body .todoist-task-group h3 { font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.5; }
#main:not(.module-main) .portal-widget-body .todoist-task-link { line-height: 1.55; }
#main:not(.module-main) .portal-widget-body .todoist-task-meta { font-size: .85em; line-height: 1.6; }
#main:not(.module-main) .portal-widget-body .todoist-summary { font-size: .88em; line-height: 1.6; }
#main:not(.module-main) .portal-widget-body .todoist-actions :is(.button, button, a) { font: inherit; font-size: .88em; line-height: 1.5; }
#detail-dialog .portal-display-actions .button { font-size: var(--portal-content-font, 16px); }
#detail-dialog .portal-display-font h3 { font-size: .9em; }
#detail-dialog .portal-display-font .portal-font-tools button { font: inherit; font-size: .9em; }
#portal-back-to-top { font: inherit; font-size: calc((12px) * var(--portal-text-scale, 1)); line-height: 1.5; }
#shell > .workspace > .topbar .page-help-button {
  font: inherit;
  font-size: calc((12px) * var(--portal-text-scale, 1));
  line-height: 1.4;
}

#detail-dialog .page-help-summary {
  font-size: var(--portal-content-font, 16px);
  line-height: 1.75;
}

#detail-dialog .page-help-tips {
  font-size: calc(var(--portal-content-font, 16px) * .94);
  line-height: 1.8;
}
#detail-dialog .page-help-links :is(a, button) { font-size: calc(var(--portal-content-font, 16px) * .88); line-height: 1.5; }
#main:not(.module-main) .browser-helper-card > p { line-height: 1.75; }
#main:not(.module-main) .browser-helper-steps { line-height: 1.8; }
#main:not(.module-main) .browser-helper-card .browser-helper-download {
  font: inherit;
  font-size: .9em;
  line-height: 1.5;
}

@media (max-width: 760px) {
  #shell > .workspace > .topbar .page-help-button { font-size: calc((12px) * var(--portal-text-scale, 1)); }
}

@media (max-width: 760px) {
  #main:not(.module-main) .portal-widget-body .todoist-view-control select { font-size: max(calc(16px * var(--portal-text-scale, 1)), 1em); }
}
#main:not(.module-main) .guide-home .page-heading .eyebrow { font-size: calc(10px * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main) .guide-home .page-heading h1 { font-size: calc(28px * var(--portal-text-scale, 1)); line-height: 1.35; }
#main:not(.module-main) .guide-home .page-heading .lead { font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.6; }
#main:not(.module-main) .guide-home .lookup-label { font-size: calc(13px * var(--portal-text-scale, 1)); line-height: 1.5; }
#main:not(.module-main) .guide-home .lookup-input > span { font-size: calc((22px) * var(--portal-text-scale, 1)); line-height: 1; }
#main:not(.module-main) .guide-home .lookup-input input { font: inherit; font-size: max(16px, calc(15px * var(--portal-text-scale, 1))); line-height: 1.4; }
#main:not(.module-main) .guide-home .lookup-categories .filter { font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main) .guide-home .guide-map-top .button { font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.4; }
#main:not(.module-main) .guide-home .guide-map-top :is(h1, h2) { font-size: calc(28px * var(--portal-text-scale, 1)); line-height: 1.35; }
#main:not(.module-main) .guide-home .guide-map-top p { font-size: calc(14px * var(--portal-text-scale, 1)); line-height: 1.7; }

#main:not(.module-main) .guide-home .guide-map-card {
  font: inherit;
  line-height: 1.5;
}
#main:not(.module-main) .guide-home .guide-map-copy strong { font-size: max(20px, calc(24px * var(--portal-text-scale, 1))); line-height: 1.3; }
#main:not(.module-main) .guide-home .guide-map-copy small { font-size: calc(13.5px * var(--portal-text-scale, 1)); line-height: 1.6; }
#main:not(.module-main) .guide-home .guide-map-count { font-size: calc(12px * var(--portal-text-scale, 1)); line-height: 1.5; }
#main:not(.module-main) .guide-home .guide-map-count small { font-size: inherit; }
@media (max-width: 760px) {
  #main:not(.module-main) .guide-home .page-heading h1 { font-size: calc(24px * var(--portal-text-scale, 1)); }
  #main:not(.module-main) .guide-home .guide-map-top :is(h1, h2) { font-size: calc(24px * var(--portal-text-scale, 1)); }
  #main:not(.module-main) .guide-home .guide-map-top p { font-size: calc(13px * var(--portal-text-scale, 1)); }
  #main:not(.module-main) .guide-home .guide-map-copy strong { font-size: max(20px, calc(20px * var(--portal-text-scale, 1))); line-height: 1.35; }
  #main:not(.module-main) .guide-home .guide-map-copy small { font-size: calc(13px * var(--portal-text-scale, 1)); line-height: 1.55; }
  #main:not(.module-main) .guide-home .guide-map-count { font-size: calc(11px * var(--portal-text-scale, 1)); }
}
#main:not(.module-main) .calendar-panel {
  font-size: var(--portal-calendar-font);
}
#main:not(.module-main) .native-calendar-period h3 { font-size: 1.3em; }
#main:not(.module-main) .native-calendar :is(.button, .calendar-source) { font-size: .88em; }
#main:not(.module-main) .native-calendar :is(.calendar-source small, .calendar-footer, .calendar-help) { font-size: .8em; }
#main:not(.module-main) .native-calendar-source-list > summary { font-size: .84em; }
#main:not(.module-main) .native-calendar-source-list > summary > span { font-size: .82em; }
#main:not(.module-main) .native-weekdays > div { font-size: .8em; }
#main:not(.module-main) .native-day-heading { font-size: .8em; }
#main:not(.module-main) .native-day-number { font-size: 1.05em; }
#main:not(.module-main) .native-event,
#main:not(.module-main) .native-event.compact,
#main:not(.module-main) .native-week .native-event { line-height: 1.45; }
#main:not(.module-main) .native-event-title,
#main:not(.module-main) .native-event.compact .native-event-title,
#main:not(.module-main) .native-week .native-event-title { font-size: 1em; line-height: 1.5; }
#main:not(.module-main) .native-event-time,
#main:not(.module-main) .native-event.compact .native-event-time,
#main:not(.module-main) .native-event-source,
#main:not(.module-main) .native-week .native-event-source { font-size: .76em; }
#main:not(.module-main) :is(.native-more, .native-day-empty) { font-size: .8em; }
#main:not(.module-main) .native-agenda-events .native-event-title { font-size: 1em; }

html[data-portal-editing="true"] #main:not(.module-main) .portal-edit-help {
  font-size: .85em;
  line-height: 1.7;
}
#appearance-dialog.appearance-dialog {
  font-size: calc((14px) * var(--portal-text-scale, 1));
  line-height: 1.6;
}
#appearance-dialog .appearance-head h2 { font-size: calc((19px) * var(--portal-text-scale, 1)); line-height: 1.4; }
#appearance-dialog .appearance-head :is(.close, button) { font-size: calc((22px) * var(--portal-text-scale, 1)); }
#appearance-dialog .appearance-section :is(h3, summary) { font-size: calc((15px) * var(--portal-text-scale, 1)); }
#appearance-dialog .appearance-section p { font-size: calc((12px) * var(--portal-text-scale, 1)); line-height: 1.7; }
#appearance-dialog .appearance-control > label { font-size: calc((14px) * var(--portal-text-scale, 1)); }
#appearance-dialog .appearance-control :is(select, input:not([type="range"]):not([type="checkbox"])) { font: inherit; font-size: calc((14px) * var(--portal-text-scale, 1)); }
#appearance-dialog label.range { font-size: calc((14px) * var(--portal-text-scale, 1)); }
#appearance-dialog .appearance-range-value { font-size: calc((13px) * var(--portal-text-scale, 1)); }
#appearance-dialog .appearance-fixed-menu > span { font-size: calc((12px) * var(--portal-text-scale, 1)); line-height: 1.5; }
#appearance-dialog .appearance-subheading { font-size: calc((13px) * var(--portal-text-scale, 1)); }
#appearance-dialog .appearance-item :is(label, .checkbox) { font-size: calc((13px) * var(--portal-text-scale, 1)); line-height: 1.5; }
#appearance-dialog .appearance-move button { font-size: calc((16px) * var(--portal-text-scale, 1)); }
#appearance-dialog .appearance-actions button { font: inherit; }

@media (min-width: 761px) and (max-height: 680px) {
  #shell > .sidebar #sidebar-tools :is(button, a) { font-size: .78em; }
}

@media (max-width: 760px) {
  #shell > .sidebar > .brand { font-size: 1.05em; }
  #shell > .sidebar > .brand .brand-mark { font-size: calc((24px) * var(--portal-text-scale, 1)); }
  #shell > .sidebar > .mobile-menu-toggle { font: inherit; font-size: calc((12px) * var(--portal-text-scale, 1)); }
  #shell > .sidebar .nav-button { font-size: .88em; }
  #shell > .sidebar #sidebar-account { font-size: .83em; }
  #shell > .sidebar #sidebar-tools :is(button, a) { font-size: .76em; }
  #shell > .sidebar .sidebar-privacy { font-size: .68em; }
  #shell > .workspace > .topbar .portal-display-menu-button { font: inherit; font-size: calc((12px) * var(--portal-text-scale, 1)); }
  #shell > .workspace > .topbar .breadcrumb { font-size: calc((10px) * var(--portal-text-scale, 1)); }
  #shell > .workspace > .topbar .portal-font-tools button { font-size: calc((12px) * var(--portal-text-scale, 1)); }
  #main:not(.module-main) .portal-home-head h1 { font-size: 1.2em; }
  html #main:not(.module-main) .portal-home .portal-shortcuts .portal-shortcut .shortcut-label strong { font-size: calc(10.5px * var(--portal-text-scale, 1)); line-height: 1.15; }
  #main:not(.module-main) .portal-home .widget-section-heading h2 { font-size: 1.05em; }
  #main:not(.module-main) .native-calendar-period h3 { font-size: 1.15em; }
}
@media screen and (max-width: 760px) {
  html:is([data-portal-text-size="small"], [data-portal-text-size="large"]) #module-root:is([data-goodday-module="attendance"], [data-goodday-module="transport"], [data-goodday-module="cards"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, [data-slot="select-trigger"], [data-slot="select-item"]) {
    font-size: max(16px, calc(16px * var(--portal-text-scale, 1)));
  }
}
#shell > .sidebar > .portal-brand-lockup > small { font-size: calc((11px) * var(--portal-text-scale, 1)); line-height: 1.4; }

@media (max-width: 760px) {
  #shell > .sidebar > .portal-brand-lockup > small { font-size: calc((10px) * var(--portal-text-scale, 1)); }
}
#appearance-dialog .widget-choice-drag { font: inherit; font-size: calc((24px) * var(--portal-text-scale, 1)); }
@media (max-width: 760px) {
  html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-drag-handle { font-size: calc((24px) * var(--portal-text-scale, 1)); }
}
}

/* nav-label-marquee-v1: desktop labels stay one line; only their text moves. */
@media screen and (min-width: 761px) {
  #shell > .sidebar > .brand.portal-brand-lockup {
    width: calc(100% + 32px * var(--portal-ui-scale, 1)); max-width: none;
    margin-inline: calc(-16px * var(--portal-ui-scale, 1));
    box-sizing: border-box; padding-inline: 6px;
  }
  /* Preserve the original logo size when the person widens the sidebar. */
  #shell > .sidebar > .portal-brand-lockup .portal-brand-logo { width: 100%; max-width: 176px; height: auto; }
  #shell > .sidebar .nav-button { white-space: nowrap; }
  #shell > .sidebar .nav-button > .nav-label-text {
    display: block; flex: 1 1 0; min-width: 0; max-width: 100%; overflow: hidden;
    white-space: nowrap; overflow-wrap: normal; text-overflow: clip;
  }
  #shell > .sidebar .nav-label-text > .gd-menu-label-text,
  #shell > .workspace > .portal-banner #banner-apps .shortcut-label > .gd-menu-label-text {
    display: inline-block; width: max-content; max-width: none; white-space: nowrap;
    vertical-align: top; transform: translateX(0);
  }
}

/* The common staff dialog owns these settings on desktop and mobile. */
.personnel-settings-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 18px}
.personnel-settings-tabs .button{min-height:40px;flex:1 1 150px}
.personnel-attendance{min-width:0}
.personnel-attendance form{padding:16px 0;border-top:1px solid var(--line,#e4dacb);margin:0}
.personnel-attendance h3{font-size:1.06em;margin:0 0 10px}
.personnel-attendance h3 small{font-size:.85em;font-weight:normal;margin-left:6px}
.personnel-attendance .field{min-width:0}
.personnel-attendance [hidden]{display:none!important}
.personnel-attendance input,.personnel-attendance textarea,.personnel-attendance select{max-width:100%;min-width:0}
.personnel-attendance .button-row{flex-wrap:wrap;gap:8px}
.personnel-attendance .button{min-height:40px;white-space:normal}
.personnel-attendance-notice:empty,.personnel-attendance .form-error:empty{display:none}
.personnel-attendance-notice{color:var(--green,#476744);font-weight:600}
.personnel-qualification{border:1px solid var(--line,#e4dacb);border-radius:10px;margin-bottom:10px;overflow:hidden;background:var(--paper,#fffdf8)}
.personnel-qualification>summary{padding:12px;font-weight:600;overflow-wrap:anywhere;cursor:pointer}
.personnel-qualification-body{display:grid;gap:10px;padding:0 12px 12px}
.personnel-attendance-confirm{border:2px solid var(--orange,#eb633e);border-radius:12px;padding:14px;margin:10px 0;background:var(--paper,#fffdf8);scroll-margin-top:15px}
.personnel-attendance-confirm dl{margin:12px 0}
.personnel-attendance-confirm dl>div{padding:6px 0;border-bottom:1px solid var(--line,#e4dacb)}
.personnel-attendance-confirm dt{font-weight:700}
.personnel-attendance-confirm dd{margin:4px 0 0;overflow-wrap:anywhere}
.personnel-attendance-reload{border-top:1px solid var(--line,#e4dacb);padding-top:14px;align-items:center}
@media(max-width:760px){.personnel-attendance .personnel-fields{grid-template-columns:1fr}.personnel-attendance form{padding:14px 0}.personnel-settings-tabs .button{flex-basis:120px}.personnel-attendance .button{min-height:44px}}

/* A single home toolbar; app catalog is independent of the selected menu. */
#main:not(.module-main) .portal-home-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 12px; }
#main:not(.module-main) .portal-home-toolbar > h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 1.1em; }
#main:not(.module-main) .portal-home-toolbar .portal-home-mascot { display: inline-flex; width: 36px; height: 36px; flex: 0 0 36px; }
#main:not(.module-main) .portal-home-toolbar .portal-home-head { margin: 0; max-width: 100%; }
#main:not(.module-main) .portal-home-toolbar .portal-home-actions { align-items: center; gap: 6px; }
#main:not(.module-main) .portal-home-toolbar .widget-add-actions { gap: 6px; }
#main:not(.module-main) .portal-home-toolbar .button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 6px 10px; white-space: nowrap; font-size: .88em; }
#main:not(.module-main) .portal-home-toolbar .button[aria-pressed="true"] { border-color: var(--brown, #6f4d2f); background: var(--cream, #fff4df); }
#main:not(.module-main) .portal-all-apps { display: grid; gap: 22px; }
#main:not(.module-main) .all-apps-intro { margin: 0; }
#main:not(.module-main) .all-apps-category { min-width: 0; }
#main:not(.module-main) .all-apps-category h2 { margin: 0 0 8px; font-size: 1.05em; }
#main:not(.module-main) .all-apps-category .app-link { min-width: 0; }
#main:not(.module-main) .all-apps-category .app-link strong { overflow-wrap: anywhere; }
#main:not(.module-main) .all-apps-window-help { margin: 0; }
@media (min-width: 761px) and (max-width: 1100px) {
 #main:not(.module-main) .portal-home-toolbar { align-items: flex-start; }
 #main:not(.module-main) .portal-home-toolbar .portal-home-head { flex: 1 1 100%; }
 #main:not(.module-main) .portal-home-toolbar .portal-home-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
 #main:not(.module-main) .portal-home-toolbar { margin: 0 0 10px; gap: 8px; }
 #main:not(.module-main) .portal-home-toolbar .portal-home-mascot { width: 32px; height: 32px; flex-basis: 32px; }
 #main:not(.module-main) .portal-home-toolbar > h2 { font-size: 1.05em; }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-home-toolbar .portal-home-head { flex: 0 0 0; }
 #main:not(.module-main) .portal-home-toolbar .button { min-height: 44px; }
 #main:not(.module-main) .portal-all-apps { gap: 18px; }
}

/* GOOD DAY portal surface refresh. Append after existing appearance rules.
   Screen chrome only: no font scales, widget dimensions, editing palette,
   module roots, document paper, print rules, new assets or dependencies. */
@media screen {
  #shell {
    --modern-canvas: #f6f5f1;
    --modern-surface: #ffffff;
    --modern-soft: #f1f3ee;
    --modern-tint-green: #f5faf4;
    --modern-tint-apricot: #fff8f3;
    --modern-tint-sand: #faf9f3;
    --modern-ink: #362b25;
    --modern-muted: #6b645d;
    --modern-line: #dfe2da;
    --modern-control-line: #a5aea0;
    --modern-green: #246b49;
    --modern-green-strong: #1b593b;
    --modern-green-soft: #eaf3ec;
    --modern-primary: #246b49;
    --modern-primary-hover: #1b593b;
    --modern-primary-ink: #ffffff;
    --modern-orange: #c64d2d;
    --modern-orange-ink: #ffffff;
    --modern-focus: #246b49;
    --modern-shadow: 0 2px 7px #362b2507, 0 8px 24px #362b2504;
    background: var(--modern-canvas);
  }
  html[data-portal-color-mode="dark"] #shell {
    --modern-canvas: #181c19;
    --modern-surface: #242a25;
    --modern-soft: #2c342e;
    --modern-tint-green: #263229;
    --modern-tint-apricot: #302b25;
    --modern-tint-sand: #2c2e26;
    --modern-ink: #f3f0e7;
    --modern-muted: #c0c6bb;
    --modern-line: #414b41;
    --modern-control-line: #788773;
    --modern-green: #a0d4b1;
    --modern-green-strong: #c5e8cf;
    --modern-green-soft: #2b4032;
    --modern-primary: #2d754d;
    --modern-primary-hover: #25633f;
    --modern-primary-ink: #ffffff;
    --modern-orange: #ffae86;
    --modern-orange-ink: #362b25;
    --modern-focus: #a0d4b1;
    --modern-shadow: 0 2px 8px #00000012;
  }
  html #shell.app-shell > .workspace { background: var(--modern-canvas); }
  #shell #main:not(.module-main) { color: var(--modern-ink); }

  /* The logo supplies the brand color; navigation stays quiet and legible. */
  html #shell.app-shell > .sidebar {
    background: var(--modern-surface);
    border-right-color: var(--modern-line);
    box-shadow: none;
  }
  html #shell.app-shell > .sidebar .nav-button {
    border-radius: 9px;
    color: var(--modern-ink);
    background: transparent;
    box-shadow: none;
  }
  html #shell.app-shell > .sidebar .nav-button:hover { background: var(--modern-soft); }
  html #shell.app-shell > .sidebar .nav-button.active {
    border-color: transparent;
    background: var(--modern-green-soft);
    color: var(--modern-green);
    box-shadow: inset 3px 0 var(--modern-green);
  }
  html #shell.app-shell > .sidebar .nav-icon.gd-icon { color: currentColor; }
  html #shell.app-shell > .sidebar :is(#sidebar-date, .account-role, .sidebar-privacy, .sidebar-privacy a) { color: var(--modern-muted); }
  html #shell.app-shell > .sidebar #navigation .menu-favorites-label,
  html #shell.app-shell > .sidebar .sidebar-bottom { border-color: var(--modern-line); }
  html #shell.app-shell > .sidebar #sidebar-tools :is(button, a) {
    border-color: transparent;
    background: var(--modern-soft);
    color: var(--modern-ink);
    border-radius: 8px;
  }
  html #shell.app-shell > .sidebar #sidebar-tools :is(button, a):hover { background: var(--modern-green-soft); }

  /* Keep the banner compact; no blur, background image or new animation. */
  html #shell.app-shell > .workspace > .topbar.portal-banner {
    background: var(--modern-surface);
    border-bottom-color: var(--modern-line);
    box-shadow: 0 1px 0 #362b2503;
    color: var(--modern-ink);
  }
  html #shell.app-shell > .workspace > .portal-banner :is(.portal-banner-shortcut, .portal-banner-menu-toggle, .page-help-button, .color-mode-button, .portal-font-tools button, .portal-banner-collapse) {
    border-color: transparent;
    border-radius: 8px;
    background: var(--modern-soft);
    color: var(--modern-ink);
  }
  html #shell.app-shell > .workspace > .portal-banner :is(.portal-banner-shortcut, .portal-banner-menu-toggle, .page-help-button, .color-mode-button, .portal-font-tools button, .portal-banner-collapse):hover {
    background: var(--modern-green-soft);
    color: var(--modern-green);
  }
  html #shell.app-shell > .workspace > .portal-banner .portal-banner-shortcut.active {
    background: var(--modern-green-soft);
    border-color: var(--modern-green);
    color: var(--modern-green);
  }

  /* One surface for each block, rather than another tinted box inside it. */
  #shell #main:not(.module-main) :is(.panel, .stat, .start-card, .contact-card, .setup-card) {
    border-color: var(--modern-line);
    border-radius: 14px;
    background: var(--modern-surface);
    color: var(--modern-ink);
    box-shadow: var(--modern-shadow);
  }
  #shell #main:not(.module-main) .panel .panel {
    border-radius: 10px;
    box-shadow: none;
  }
  #shell #main:not(.module-main) .panel-head {
    padding: 14px 18px;
    background: transparent;
    border-color: var(--modern-line);
  }
  #shell #main:not(.module-main) :is(.description, .lead, .check-help, .meta, .panel-head small, .app-link small) { color: var(--modern-muted); }
  #shell #main:not(.module-main) :is(.toolbar, .portal-home-toolbar) { gap: 8px 12px; }
  #shell #main:not(.module-main) :is(.page-heading, .portal-home-toolbar, .all-apps-category) :is(h1, h2, h3) { color: var(--modern-ink); }

  #shell #main:not(.module-main) .button {
    border-color: var(--modern-control-line);
    border-radius: 8px;
    background: var(--modern-surface);
    color: var(--modern-ink);
    box-shadow: none;
    filter: none;
  }
  #shell #main:not(.module-main) .button:hover:not(:disabled) {
    background: var(--modern-soft);
    border-color: var(--modern-green);
  }
  #shell #main:not(.module-main) .button.primary {
    background: var(--modern-primary);
    border-color: var(--modern-primary);
    color: var(--modern-primary-ink);
  }
  #shell #main:not(.module-main) .button.primary:hover:not(:disabled) { background: var(--modern-primary-hover); color: var(--modern-primary-ink); }
  #shell #main:not(.module-main) .button.orange { background: var(--modern-orange); border-color: var(--modern-orange); color: var(--modern-orange-ink); }
  #shell #main:not(.module-main) .button.orange:hover:not(:disabled) { background: var(--modern-orange); color: var(--modern-orange-ink); }
  #shell #main:not(.module-main) .button.ghost { background: transparent; border-color: transparent; color: var(--modern-green); }
  #shell #main:not(.module-main) .button.danger { color: var(--modern-orange); }
  #shell #main:not(.module-main) .button[aria-pressed="true"]:not(.primary) {
    border-color: var(--modern-green);
    background: var(--modern-green-soft);
    color: var(--modern-green);
  }
  #shell #main:not(.module-main) :is(.field input, .field select, .field textarea, .search, .todoist-view-control select):not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
    border-color: var(--modern-control-line);
    border-radius: 8px;
    background: var(--modern-surface);
    color: var(--modern-ink);
    box-shadow: none;
  }
  #shell #main:not(.module-main) :is(input, textarea)::placeholder { color: var(--modern-muted); opacity: 1; }

  #shell #main:not(.module-main) :is(.app-link, .portal-shortcuts .portal-shortcut) {
    border-color: var(--modern-line);
    border-radius: 11px;
    background: var(--modern-surface);
    color: var(--modern-ink);
    box-shadow: 0 1px 2px #362b2504;
    transition: none;
  }
  #shell #main:not(.module-main) .app-link { gap: 12px; padding: 14px 16px; }
  #shell #main:not(.module-main) :is(.app-link, .portal-shortcuts .portal-shortcut):hover {
    border-color: var(--modern-green);
    background: var(--modern-green-soft);
    box-shadow: none;
  }
  #shell #main:not(.module-main) .app-link > .gd-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 7px;
    border-radius: 10px;
    color: var(--modern-green);
    background: var(--modern-green-soft);
  }
  #shell #main:not(.module-main) .portal-shortcuts .portal-shortcut > .gd-icon { background: transparent; color: var(--modern-green); }
  #shell #main:not(.module-main) .app-link > span:nth-child(2) { flex: 1; min-width: 0; }
  #shell #main:not(.module-main) .app-link > span:last-child:not(:nth-child(2)) { margin-left: auto; color: var(--modern-muted); }

  #shell #main:not(.module-main) .portal-widget {
    border-color: var(--modern-line);
    border-radius: 18px;
    background: var(--modern-surface);
    color: var(--modern-ink);
    box-shadow: var(--modern-shadow);
  }
  /* Bento color comes from the existing card identity, never its position.
     Personal width, height, order, scroll regions and grid spans remain intact. */
  #shell #main:not(.module-main) .portal-widget:is([data-widget-id="attendance"], [data-widget-id="shifts"]) { background: var(--modern-tint-green); }
  #shell #main:not(.module-main) .portal-widget:is([data-widget-id="transport"], [data-widget-id="transport-overview"]) { background: var(--modern-tint-apricot); }
  #shell #main:not(.module-main) .portal-widget:is([data-widget-id="calendar"], [data-widget-id="agenda"]) { background: var(--modern-tint-sand); }
  #shell #main:not(.module-main) .portal-widget-head {
    padding: 6px 12px;
    border-bottom-color: var(--modern-line);
    background: transparent;
    box-shadow: none;
  }
  #shell #main:not(.module-main) .portal-widget-head h2 { color: var(--modern-ink); }
  #shell #main:not(.module-main) .portal-widget-head h2 .gd-icon,
  #shell #main:not(.module-main) .portal-widget-head > .gd-icon { color: var(--modern-green); }
  #shell #main:not(.module-main) .portal-widget-actions :is(.button, button, a) {
    border-color: transparent;
    border-radius: 7px;
    color: var(--modern-green);
    background: var(--modern-green-soft);
  }
  #shell #main:not(.module-main) .portal-widget-actions :is(.button, button, a):hover {
    background: var(--modern-soft);
    border-color: var(--modern-green);
  }
  #shell #main:not(.module-main) .portal-widget-body { padding: 12px; scrollbar-color: var(--modern-control-line) transparent; }
  #shell #main:not(.module-main) :is(.widget-kpi, .transport-overview-counts > span) {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  #shell #main:not(.module-main) .widget-kpi { padding: 8px; }
  #shell #main:not(.module-main) .widget-kpi + .widget-kpi { border-left: 1px solid var(--modern-line); }
  #shell #main:not(.module-main) .widget-kpi strong { color: var(--modern-green); }
  #shell #main:not(.module-main) :is(.widget-row, .widget-link-row, .transport-schedule-row, .attendance-next, .todoist-task-item, .todoist-task-group h3) { border-color: var(--modern-line); }
  #shell #main:not(.module-main) :is(.widget-row small, .widget-note, .widget-empty, .widget-kpi span, .widget-kpi small, .attendance-details dt, .attendance-details dd small, .attendance-current small, .transport-overview-date, .todoist-task-meta, .todoist-summary) { color: var(--modern-muted); }
  #shell #main:not(.module-main) :is(.widget-row:is(a, button), .widget-link-row):hover { background: var(--modern-soft); color: var(--modern-green); }
  #shell #main:not(.module-main) .attendance-state { border-color: transparent; background: var(--modern-green-soft); color: var(--modern-green); border-radius: 5px; }
  #shell #main:not(.module-main) .todoist-widget-status { border-color: transparent; border-radius: 8px; background: var(--modern-soft); color: var(--modern-muted); }
  #shell #main:not(.module-main) .todoist-task-link { color: var(--modern-green); }
  #shell #main:not(.module-main) .todoist-task-link:hover { color: var(--modern-green-strong); }

  /* More specific than legacy focus rules; geometry remains owned by runtime. */
  #shell :is(.sidebar, .portal-banner) :is(button, a, input, select):focus-visible,
  #shell #main:not(.module-main) :is(button, a, input, select, textarea):focus-visible {
    outline: 3px solid var(--modern-focus);
    outline-offset: 2px;
  }
  #shell #main:not(.module-main) .portal-widget-actions :is(button, a):focus-visible { outline-offset: -1px; }
}
@media screen and (max-width: 760px) {
  html #shell.app-shell > .sidebar { border-bottom-color: var(--modern-line); }
  #shell #main:not(.module-main) .panel-head { padding: 12px 14px; }
  #shell #main:not(.module-main) .app-link { padding: 12px; }
  #shell #main:not(.module-main) .portal-widget-head { padding: 6px 12px; }
  #shell #main:not(.module-main) .portal-widget-actions :is(.button, button, a),
  #shell #main:not(.module-main) .todoist-actions :is(.button, button, a) { min-width: 44px; min-height: 44px; }
  #shell #main:not(.module-main) .portal-widget-actions :is(.widget-create-button, .widget-attendance-settings) { width: 44px; min-width: 44px; height: 44px; }
  #shell #main:not(.module-main) :is(.button, .field input, .field select, .search):not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-height: 44px; }
}

/* Candidate fragment: merge after the existing appearance typography. Screen UI only. */
@media screen {
  #detail-dialog .portal-font-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr));
    gap: 8px;
    margin-block: 16px;
  }
  #detail-dialog .portal-font-options .button {
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    font: inherit;
    font-size: var(--portal-content-font, 16px);
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #detail-dialog .portal-font-options [aria-pressed="true"] {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }
  #shell > .workspace > .topbar .portal-font-tools button[data-font-help] {
    min-width: 112px;
    white-space: nowrap;
  }
}
@media screen and (max-width: 760px) {
  html:is([data-portal-text-size="xlarge"], [data-portal-text-size="xxlarge"]) #module-root:is([data-goodday-module="attendance"], [data-goodday-module="transport"], [data-goodday-module="cards"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, [data-slot="select-trigger"], [data-slot="select-item"]) {
    font-size: max(16px, calc(16px * var(--portal-text-scale, 1)));
  }
}

/* Unified home editor: added after the existing portal appearance styles. */
#main:not(.module-main) [data-home-widget-editor]:empty { display: none; }
#main:not(.module-main) .home-widget-editor-panel[hidden] { display: none; }
#main:not(.module-main) .home-widget-editor-panel { margin: 0 0 18px; padding: 16px; border: 1px solid var(--line, #dec8aa); border-radius: 14px; background: var(--paper, #fffefa); box-shadow: 0 4px 18px #27160808; }
#main:not(.module-main) .home-widget-editor-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin: 0 0 12px; }
#main:not(.module-main) .home-widget-editor-heading h3 { margin: 0; color: var(--ink, #4c2b16); font: inherit; font-weight: 650; }
#main:not(.module-main) .home-widget-editor-heading p { margin: 5px 0 0; color: var(--muted, #837a6c); font-size: .88em; line-height: 1.65; }
#main:not(.module-main) .home-widget-editor-heading .button { flex: 0 0 auto; white-space: nowrap; min-height: 40px; }
#main:not(.module-main) .home-widget-mobile-help { display: none; }
#main:not(.module-main) .home-widget-palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; max-height: 300px; overflow-y: auto; padding: 2px; }
#main:not(.module-main) .home-widget-palette-item { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; align-items: start; min-width: 0; padding: 12px 12px 14px; border: 1px solid var(--line, #dec8aa); border-radius: 10px; background: var(--cream, #fff4dc); color: var(--ink, #4c2b16); cursor: grab; }
#main:not(.module-main) .home-widget-palette-item.is-dragging { opacity: .45; }
#main:not(.module-main) .home-widget-palette-item > .gd-icon { width: 22px; height: 22px; color: var(--brown, #6f431f); }
#main:not(.module-main) .home-widget-palette-item strong { display: block; font-size: .9em; line-height: 1.5; font-weight: 650; overflow-wrap: anywhere; }
#main:not(.module-main) .home-widget-palette-item small { display: block; margin-top: 3px; color: var(--muted, #837a6c); font-size: .78em; line-height: 1.65; overflow-wrap: anywhere; }
#main:not(.module-main) .home-widget-palette-item .button { gap: 3px; min-width: 0; min-height: 36px; padding: 5px 8px; font-size: .82em; white-space: nowrap; }
#main:not(.module-main) .home-widget-palette-item .button svg { width: 14px; height: 14px; }
#main:not(.module-main) .home-widget-palette-item .home-widget-palette-grip { position: absolute; right: 5px; bottom: 2px; width: 13px; height: 13px; opacity: .45; }
#main:not(.module-main) :is(.home-widget-save-status, .home-widget-all-added) { color: var(--muted, #837a6c); font-size: .85em; line-height: 1.65; margin: 12px 0 0; }
#main:not(.module-main) .home-widget-save-status[data-error="true"] { color: var(--error, #a14432); }
#main:not(.module-main) .home-widget-drop-end { display: none; }
html[data-portal-editing="true"] #main:not(.module-main) .home-widget-drop-end { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 76px; padding: 14px; border: 2px dashed var(--line, #dec8aa); border-radius: 12px; color: var(--muted, #837a6c); font-size: .9em; }
#main:not(.module-main) .home-widget-drop-end .gd-icon { width: 20px; height: 20px; }
#main:not(.module-main) .home-widget-drop-end.is-drop-target { border-color: var(--goodday-blue, #00a7eb); background: color-mix(in srgb, var(--goodday-blue, #00a7eb) 10%, var(--paper, #fffefa)); color: var(--ink, #4c2b16); }
html[data-portal-editing="true"] #main:not(.module-main) .portal-widget { overflow: visible; }
html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-body { border-radius: 0 0 11px 11px; }
#main:not(.module-main) .portal-widget:is(.is-widget-drop-before,.is-widget-drop-after)::after { content: 'ここに配置'; position: absolute; z-index: 4; inset-inline: -3px; height: 4px; background: var(--goodday-blue, #00a7eb); color: var(--ink, #4c2b16); font-size: 11px; font-weight: 650; line-height: 28px; text-align: center; pointer-events: none; box-shadow: 0 0 0 2px var(--paper, #fffefa); }
#main:not(.module-main) .portal-widget.is-widget-drop-before::after { top: -7px; }
#main:not(.module-main) .portal-widget.is-widget-drop-after::after { bottom: -7px; }
#main:not(.module-main) .portal-widget-tools .widget-hide svg { width: 14px; height: 14px; }
@media (max-width: 760px) {
 #main:not(.module-main) .portal-home-head { display: block; }
 #main:not(.module-main) .portal-home-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
 #main:not(.module-main) .portal-home-actions > .button { min-height: 44px; }
 #main:not(.module-main) .home-widget-editor-panel { padding: 12px; }
 #main:not(.module-main) .home-widget-editor-heading { flex-wrap: wrap; gap: 8px; }
 #main:not(.module-main) .home-widget-editor-heading > div { flex: 1 1 160px; }
 #main:not(.module-main) .home-widget-editor-heading .button { min-height: 44px; }
 #main:not(.module-main) .home-widget-desktop-help { display: none; }
 #main:not(.module-main) .home-widget-mobile-help { display: block; }
 #main:not(.module-main) .home-widget-palette { grid-template-columns: minmax(0, 1fr); max-height: 290px; }
 #main:not(.module-main) .home-widget-palette-item { cursor: auto; }
 #main:not(.module-main) .home-widget-palette-item .button { min-height: 44px; min-width: 44px; }
 #main:not(.module-main) .home-widget-palette-grip { display: none; }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .portal-widget-tools { display: flex; width: 100%; justify-content: flex-start; }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-size-options { display: inline-flex; }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-drag-handle { display: none; }
 html[data-portal-editing="true"] #main:not(.module-main) .home-widget-drop-end { display: none; }
}
@media print {
 #main:not(.module-main) :is([data-home-widget-editor],.home-widget-drop-end,.portal-widget-tools) { display: none !important; }
}
@media (max-width: 760px) {
 html[data-portal-editing="true"] #main:not(.module-main) .portal-home-toolbar .portal-home-head { display: block; flex: 1 1 100%; height: auto; margin: 0; }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-home-actions > [data-appearance-edit] { position: static; box-shadow: none; }
}

/* Mobile-first home editing: drag surfaces and contained 44px controls. */
@media screen {
 html[data-portal-editing="true"] #main:not(.module-main) :is(.widget-drag-handle, .widget-resize-handle, .home-widget-palette-item) {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
 }
 html[data-portal-editing="true"] #main:not(.module-main) .home-widget-palette-item button {
  touch-action: manipulation;
 }
}
@media screen and (max-width: 760px) {
 html[data-portal-editing="true"] #main:not(.module-main) .home-widget-palette-item {
  touch-action: pan-y;
 }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .portal-widget-tools {
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
 }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .portal-widget-tools button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  box-sizing: border-box;
  touch-action: manipulation;
 }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .portal-widget-tools .widget-drag-handle {
  display: inline-flex;
  touch-action: none;
 }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head .widget-size-options {
  flex: 0 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
 }
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget-head > .portal-widget-actions {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
 }
 html[data-portal-editing="true"] #main:not(.module-main) .home-widget-editor-heading > div {
  min-width: 0;
  overflow-wrap: anywhere;
 }
 html[data-portal-editing="true"] #main:not(.module-main) :is(.home-widget-editor-heading, .home-widget-palette-item) button {
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  box-sizing: border-box;
 }
}

/* The add palette stays above the full-width canvas, never beside or over it. */
#main:not(.module-main) :is(.home-widget-workspace, .home-widget-canvas) { min-width: 0; }
#main:not(.module-main) .home-widget-workspace { display: block; }
#main:not(.module-main) [data-home-widget-edit-action]:empty { display: none; }
#main:not(.module-main) .home-widget-editor-heading h3 small { display: inline-block; font-size: .75em; font-weight: 500; white-space: nowrap; }
#main:not(.module-main) .home-widget-profile-note { margin: 4px 0 0; color: var(--modern-muted, #746452); font-size: .85em; line-height: 1.5; }
#main:not(.module-main) .home-widget-editor-panel .home-widget-save-status { margin: 0 0 12px; }
#main:not(.module-main) .home-widget-add-panel { border-top: 1px solid var(--line, #dec8aa); padding-top: 4px; }
#main:not(.module-main) .home-widget-add-panel > summary { min-height: 44px; box-sizing: border-box; padding: 10px 4px; font-weight: 650; color: var(--ink, #4c2b16); cursor: pointer; overflow-wrap: anywhere; }
#main:not(.module-main) .home-widget-add-panel > summary:focus-visible { outline: 3px solid var(--goodday-blue, #00a7eb); outline-offset: 2px; border-radius: 6px; }
#main:not(.module-main) .home-widget-add-content > :is(.home-widget-desktop-help,.home-widget-mobile-help) { margin: 6px 0 12px; color: var(--muted, #837a6c); font-size: .9em; line-height: 1.6; }
#main:not(.module-main) .home-widget-add-content { padding-top: 2px; }
@media screen and (min-width: 761px) and (max-width: 1120px) {
 html[data-portal-editing="true"] #main:not(.module-main) .portal-widget { grid-column: span 12; }
}
@media print {
 #main:not(.module-main) .home-widget-workspace { display: block; }
 #main:not(.module-main) [data-home-widget-edit-action] { display: none; }
}

/* Navigation shows presence only; the shared bell retains the unread count. */
@media screen {
 html #shell .sharing-nav-badge[data-sharing-badge] { width:10px; height:10px; min-width:10px; min-height:10px; padding:0; box-sizing:border-box; border:2px solid var(--paper,#fff); border-radius:50%; background:#d9361d; color:transparent; font-size:0; line-height:0; flex:0 0 10px; }
}

/* Google app launch choices; independent of OS app detection. */
#detail-dialog .google-app-launch { display: grid; gap: 12px; min-width: 0; }
#detail-dialog .google-app-launch > p,
#detail-dialog .google-app-launch > h3 { margin: 0; }
#detail-dialog .google-app-launch-actions,
#detail-dialog .google-app-store-links { display: flex; flex-wrap: wrap; gap: 8px; }
#detail-dialog .google-app-launch .button { min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
#detail-dialog .google-app-notification-help a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
@media screen and (max-width: 760px) {
  #detail-dialog .google-app-launch-actions .button,
  #detail-dialog .google-app-store-links .button { width: 100%; justify-content: center; }
}

/* Optional Google companion settings and readable mobile app list. */
#main .google-apps-helper-actions { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
#main .google-apps-helper-actions .button { min-height:44px; white-space:normal; }
#main .google-apps-helper-card summary { cursor:pointer; padding-block:10px; }
@media(max-width:600px) {
 #shell #main .portal-all-apps .links-grid { grid-template-columns:minmax(0,1fr); }
 #shell #main .portal-all-apps .app-link { min-height:68px; gap:12px; }
 #main .google-apps-helper-actions .button { width:100%; }
}

/* Scrolling tucks only the mobile app rows; shared utilities remain available. */
@media screen and (max-width:760px){html[data-mobile-apps-collapsed="true"] #shell > .workspace > .portal-banner #banner-apps{display:none!important}}

/* Independent widget dimensions; the body keeps its existing vertical scroll area.
   Sixty tracks keep resize steps small, with the existing 12px card gutters. */
#shell #main:not(.module-main) .portal-widget {
  container: portal-widget / inline-size;
  font-size: var(--portal-content-font, 16px);
}
@media screen and (min-width: 761px) {
  #shell #main:not(.module-main) .portal-widget-grid {
    grid-template-columns: repeat(60, minmax(0, 1fr));
    gap: 12px 0;
    width: calc(100% + 12px);
    margin-inline: -6px;
  }
  #shell #main:not(.module-main) .portal-widget {
    grid-column: span 30;
    margin-inline: 6px;
  }
  #shell #main:not(.module-main) .portal-widget[data-widget-size="small"] { grid-column: span 15; }
  #shell #main:not(.module-main) .portal-widget[data-widget-size="medium"] { grid-column: span 30; }
  #shell #main:not(.module-main) .portal-widget[data-widget-size="large"] { grid-column: span 60; }
  #shell #main:not(.module-main) .home-widget-drop-end { margin-inline: 6px; }
}
@media screen and (min-width: 761px) and (max-width: 1400px) {
  #shell #main:not(.module-main) .portal-widget[data-widget-size="small"] { grid-column: span 30; }
}
@media screen and (min-width: 761px) and (max-width: 1120px) {
  html[data-portal-editing="true"] #shell #main:not(.module-main) .portal-widget { grid-column: span 60; }
}
@media screen and (min-width: 761px) {
  html #shell #main:not(.module-main) .portal-widget[data-widget-custom-size="true"] {
    grid-column: span var(--widget-custom-columns, 30);
  }
}
#shell #main:not(.module-main) .portal-widget[data-widget-custom-size="true"] {
  height: var(--widget-custom-height, var(--portal-widget-height));
  max-height: none;
}
#shell #main:not(.module-main) .portal-widget[data-widget-custom-size="true"] > .portal-widget-body {
  max-height: none;
}
#shell #main:not(.module-main) .portal-widget-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
#shell #main:not(.module-main) .portal-widget :is(.widget-link-row strong, .todoist-task-link, .sharing-widget-item strong) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
}
#shell #main:not(.module-main) .portal-widget .widget-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 6em), 1fr)); }
#shell #main:not(.module-main) .portal-widget-head h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: normal;
  text-wrap: balance;
}
#shell #main:not(.module-main) .portal-widget[data-widget-density="compact"] > .portal-widget-body { padding: 8px; }
#shell #main:not(.module-main) .portal-widget[data-widget-density="compact"] .native-calendar-top { gap: 6px; padding-bottom: 8px; }
#shell #main:not(.module-main) .portal-widget[data-widget-density="compact"] .calendar-panel {
  --portal-cell-pad: 6px;
  --portal-event-pad: 4px;
  --portal-event-gap: 4px;
}
#shell #main:not(.module-main) .portal-widget .widget-resize-status { display: none; }
html[data-portal-editing="true"] #shell #main:not(.module-main) .portal-widget { padding-bottom: 52px; }
html[data-portal-editing="true"] #shell #main:not(.module-main) .portal-widget .widget-resize-handle {
  position: absolute;
  right: 6px;
  bottom: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--modern-control-line, #cad7bd);
  border-radius: 8px;
  background: var(--modern-green-soft, #f0f5e9);
  color: var(--modern-green, #65814e);
  font: inherit;
  line-height: 1;
  cursor: nwse-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
html[data-portal-editing="true"] #shell #main:not(.module-main) .portal-widget .widget-resize-status {
  position: absolute;
  left: 12px;
  bottom: 15px;
  display: block;
  max-width: calc(100% - 76px);
  margin: 0;
  overflow: hidden;
  color: var(--modern-muted, #746452);
  font-size: .78em;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}
@media screen and (max-width: 760px) {
  #shell #main:not(.module-main) .portal-widget-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    margin-inline: 0;
  }
  #shell #main:not(.module-main) .portal-widget,
  #shell #main:not(.module-main) .portal-widget[data-widget-size],
  #shell #main:not(.module-main) .portal-widget[data-widget-custom-size="true"] {
    grid-column: 1;
    margin-inline: 0;
  }
  #shell #main:not(.module-main) .home-widget-drop-end { margin-inline: 0; }
  html[data-portal-editing="true"] #shell #main:not(.module-main) .portal-widget .widget-resize-handle { cursor: ns-resize; }
}

/* Saved text is the upper bound; constrained cards reduce enlargement only.
   Month columns keep readable widths; long event text opens through its button. */
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-month-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-month { min-width: max(915px, 61em); }
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-month-day {
  min-height: clamp(82px, var(--widget-calendar-day-height, var(--portal-calendar-cell-height, 155px)), 180px);
  padding: 6px;
}
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-month .native-event { padding: 5px 6px; }
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week-day { display: block; }
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) :is(.native-event-title, .native-event.compact .native-event-title, .native-week .native-event-title) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 100%;
  max-height: 3em;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-overflow: ellipsis;
}
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-event-time { flex: 0 0 auto; white-space: nowrap; }
#shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-event-source {
  display: block;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@container portal-widget (width < 56em) {
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-calendar-top { display: flex; flex-direction: column; align-items: stretch; }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-calendar-period { justify-content: space-between; min-width: 0; gap: 8px; }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-calendar-tools { justify-content: space-between; flex-wrap: wrap; min-width: 0; margin-top: 0; }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week { grid-template-columns: minmax(0, 1fr); }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week-day {
    display: grid;
    grid-template-columns: minmax(56px, .18fr) minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    padding: 10px 8px;
  }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week-day + .native-week-day { border-left: 0; border-top: 1px solid var(--modern-line, #e8dfd3); }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week-day .native-day-heading { flex-direction: column; align-items: flex-start; margin-bottom: 0; }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week-events { min-width: 0; }
}
@container portal-widget (width < 30em) {
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week-day { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .native-week-day .native-day-heading { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
}
@container portal-widget (width < 22em) {
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .attendance-details > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  #shell #main:not(.module-main) :is(.portal-widget, .native-calendar-page) .attendance-details dd { text-align: left; }
}

/* Mobile order editor: move compact names instead of full live widgets. */
#appearance-dialog .mobile-widget-order { display:grid; gap:8px; list-style:none; padding:0; margin:8px 0 16px; }
#appearance-dialog .mobile-widget-order > li { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; min-width:0; padding:8px 10px; border:1px solid var(--line,#e2e7d8); border-radius:12px; background:var(--paper,#fffdf7); }
#appearance-dialog .mobile-widget-order > li > span { font:inherit; font-weight:650; line-height:1.35; overflow-wrap:anywhere; }
#appearance-dialog .mobile-widget-order-buttons { display:flex; gap:6px; }
#appearance-dialog .mobile-widget-order-buttons button { display:grid; place-items:center; width:44px; height:44px; padding:0; border:1px solid var(--line,#d7dfcc); border-radius:9px; background:#fff; color:var(--green,#4a7041); font:inherit; touch-action:manipulation; }
#appearance-dialog .mobile-widget-order-buttons button:disabled { opacity:.3; cursor:default; }
#appearance-dialog .mobile-widget-order-buttons svg { width:1.25em; height:1.25em; }
#appearance-dialog .mobile-widget-options { border-top:1px solid var(--line,#e2e7d8); padding-top:12px; }
#appearance-dialog .mobile-widget-options > summary { min-height:44px; padding:8px 0; font:inherit; cursor:pointer; }
#appearance-dialog .mobile-widget-options > div { display:grid; gap:6px; }
#appearance-dialog .mobile-widget-option { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; }
#appearance-dialog .mobile-widget-option label { display:flex; gap:8px; align-items:center; min-height:44px; min-width:0; line-height:1.35; }
#appearance-dialog .mobile-widget-option label span { overflow-wrap:anywhere; }
#appearance-dialog .mobile-widget-option select { min-width:64px; min-height:44px; padding:6px; font:inherit; border:1px solid var(--line,#d7dfcc); border-radius:8px; background:#fff; }
#appearance-dialog[data-widget-order-profile] .description { margin-bottom:6px; }
#appearance-dialog[data-widget-order-profile] #appearance-save-status { min-height:1.5em; margin:0 0 8px; }
@media (max-width:760px) {
 #shell > .workspace #main:not(.module-main) .portal-home-actions [data-appearance-edit] { display:inline-flex; min-height:44px; white-space:normal; }
}

/* Calendar period controls stay with the card heading, outside its scroll area. */
#shell #main:not(.module-main) [data-calendar-widget-header] { flex-wrap:wrap; }
#shell #main:not(.module-main) .widget-calendar-navigation { display:flex; flex:1 0 100%; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 10px; min-width:0; }
#shell #main:not(.module-main) .widget-calendar-period { flex:1 1 10em; min-width:0; margin:0; color:var(--ink,#3e382e); font-size:calc(13px * var(--portal-text-scale,1)); font-weight:650; line-height:1.35; overflow-wrap:break-word; }
#shell #main:not(.module-main) .widget-calendar-paging { display:flex; flex:0 0 auto; gap:4px; margin-left:auto; }
#shell #main:not(.module-main) .portal-widget-head .widget-calendar-paging button { min-width:40px; min-height:40px; padding:4px 8px; font-size:calc(13px * var(--portal-text-scale,1)); }
#shell #main:not(.module-main) .portal-widget-head .widget-calendar-paging button:disabled { opacity:.4; cursor:default; }
#appearance-calendar .calendar-modes { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0 18px; }
#appearance-calendar .calendar-modes button { flex:1 1 64px; min-height:44px; font:inherit; }
#appearance-calendar .calendar-modes button[aria-pressed="true"] { background:var(--green,#4a7041); color:#fff; border-color:var(--green,#4a7041); }
@media (max-width:760px) {
 #shell #main:not(.module-main) .portal-widget-head .widget-calendar-paging button { min-width:44px; min-height:44px; }
}
@media (min-width:761px) {
 #shell #main:not(.module-main) [data-calendar-widget-header] > h2 { flex:0 1 auto; max-width:calc(100% - 24px); }
 #shell #main:not(.module-main) [data-calendar-widget-header] > .widget-calendar-navigation { flex:1 1 auto; max-width:100%; }
}

/* Compact desktop navigation is the default; very short windows compress further. */
@media screen and (min-width:761px) {
 #shell > .sidebar { gap:8px; padding-block:12px; }
 #shell > .sidebar #navigation { padding-block:2px; scroll-padding-block:4px; }
 #shell > .sidebar #navigation .nav-button { min-height:44px; padding-block:6px; margin-bottom:2px; line-height:1.35; }
 #shell > .sidebar #navigation .menu-favorites-label { margin-top:6px; padding-top:6px; }
 #shell > .sidebar .sidebar-bottom { gap:6px; padding-top:8px; }
 #shell > .sidebar #sidebar-tools { gap:3px; }
 #shell > .sidebar #sidebar-tools :is(button,a) { min-height:32px; margin-bottom:0; padding-block:4px; }
}
@media screen and (min-width:761px) and (hover:hover) and (pointer:fine) {
 #shell > .sidebar #navigation .nav-button { min-height:36px; padding-block:4px; }
}
@media screen and (min-width:761px) and (max-height:600px) {
 #shell > .sidebar { gap:6px; padding-block:8px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scroll-padding-block:8px; }
 #shell > .sidebar #navigation { flex:0 0 auto; max-height:none; overflow:visible; }
 #shell > .sidebar .sidebar-bottom { gap:4px; padding-top:6px; }
}
@media screen and (min-width:761px) and (max-height:600px) and (hover:hover) and (pointer:fine) {
 #shell > .sidebar #navigation .nav-button { min-height:32px; padding-block:3px; margin-bottom:1px; line-height:1.3; }
}
@media screen and (min-width:761px) and (any-pointer:coarse) {
 #shell > .sidebar #navigation .nav-button { min-height:44px; padding-block:6px; }
 #shell > .sidebar #sidebar-tools :is(button,a) { min-height:44px; padding-block:6px; }
}

/* The full calendar shares the widget's readable schedules and dedicated viewport. */
#shell #main:not(.module-main) > .native-calendar-page {
  container: portal-widget / inline-size;
  min-width:0;
  padding:0;
  font-size:var(--portal-calendar-font,15px);
}
#shell #main:not(.module-main) .native-calendar-page-head {
  display:flex;
  align-items:center;
  gap:6px 12px;
  min-width:0;
  padding:8px 12px;
  border-bottom:1px solid var(--line,#e8dfd3);
  background:var(--paper,#fffefd);
}
#shell #main:not(.module-main) .native-calendar-page-head .widget-calendar-navigation { flex:1 1 auto; }
#shell #main:not(.module-main) .native-calendar-page-head .widget-calendar-period { font-size:1em; }
#shell #main:not(.module-main) .native-calendar-page-head :is(button,a.button) { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; gap:6px; min-width:40px; min-height:40px; padding:5px 9px; border:1px solid var(--line,#e8dfd3); border-radius:8px; background:var(--paper,#fffefd); color:var(--ink,#433a33); font:inherit; font-size:.9em; text-decoration:none; cursor:pointer; }
#shell #main:not(.module-main) .native-calendar-page-actions { display:flex; flex:0 0 auto; align-items:center; gap:4px; }
#shell #main:not(.module-main) .native-calendar-page-actions > button { flex:0 0 40px; }
#shell #main:not(.module-main) .native-calendar-page-actions > button svg { width:20px; height:20px; }
#shell #main:not(.module-main) .native-calendar-page [data-calendar-viewport] {
  box-sizing:border-box;
  height:var(--calendar-page-height,calc(100dvh - 240px));
  min-height:180px;
  min-width:0;
  padding:8px 10px 10px;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:var(--modern-control-line,#d1d7c7) transparent;
}
#shell #main:not(.module-main) .native-calendar-page [data-calendar-viewport]:focus-visible { outline:3px solid var(--green,#4d8161); outline-offset:-3px; }
#shell #main:not(.module-main) .native-calendar-page .native-month-scroll { margin:0; }
#shell #main:not(.module-main) .native-calendar-page .native-month-day { --widget-calendar-day-height:130px; }
#shell #main:not(.module-main) .native-calendar-page :is(.native-event-title,.native-event.compact .native-event-title,.native-week .native-event-title) { font-size:1em; }
#shell #main:not(.module-main) .native-calendar-page .native-event-time { font-size:.82em; font-weight:650; color:var(--ink,#433a33); }
html[data-portal-page="calendar"] #shell #main:not(.module-main) { padding-top:12px; padding-bottom:12px; }
@media(max-width:760px) {
 #shell #main:not(.module-main) .native-calendar-page-head { gap:6px; padding:6px 8px; }
 #shell #main:not(.module-main) .native-calendar-page-head :is(button,a.button) { min-width:44px; min-height:44px; }
 #shell #main:not(.module-main) .native-calendar-page [data-calendar-viewport] { padding:6px; }
}

/* Route review is a modal above the shell; its only scroll area stays inside the visible viewport. */
@media screen {
  #module-root[data-goodday-module="transport"]:has(.route-adviser-dialog[data-state="open"]) { isolation: auto; }
  #module-root[data-goodday-module="transport"] [data-slot="dialog-content"].route-adviser-dialog[data-state="open"] {
    top: calc(var(--dialog-viewport-top, 0px) + env(safe-area-inset-top) + (var(--dialog-viewport-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 2) !important;
    height: calc(var(--dialog-viewport-height, 100dvh) - 2 * var(--ra-dialog-space, 16px) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    max-height: calc(var(--dialog-viewport-height, 100dvh) - 2 * var(--ra-dialog-space, 16px) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
}

/* Modal primitives escape the module's isolation so the shell cannot cover them.
 * Native <dialog> already uses the top layer; nonmodal popovers/toasts keep their own placement. */
@media screen {
  #module-root[data-goodday-module]:has(
    [data-slot="dialog-overlay"][data-state="open"],
    [data-slot="alert-dialog-overlay"][data-state="open"],
    .error-popup-overlay:not([hidden]),
    .modal-backdrop:not([hidden]),
    [role="dialog"][aria-modal="true"]:not([hidden]):not([data-state="closed"]),
    [role="alertdialog"][aria-modal="true"]:not([hidden]):not([data-state="closed"]),
    .paper-preview
  ) { isolation: auto; }
  #module-root[data-goodday-module] :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"])[data-state="open"]:not(.transport-menu):not(.route-adviser-dialog),
  #module-root[data-goodday-module]:has(.error-popup-overlay:not([hidden])) .error-popup {
    top: calc(var(--dialog-viewport-top, 0px) + env(safe-area-inset-top) + (var(--dialog-viewport-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 2) !important;
    max-height: calc(var(--dialog-viewport-height, 100dvh) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
  #module-root[data-goodday-module="transport"] .transport-menu[data-state="open"] {
    top: calc(var(--dialog-viewport-top, 0px) + env(safe-area-inset-top)) !important;
    height: calc(var(--dialog-viewport-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    max-height: calc(var(--dialog-viewport-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
  #module-root[data-goodday-module="transport"] .paper-preview,
  #module-root[data-goodday-module="cards"] .modal-backdrop {
    top: 0 !important;
    left: 0 !important;
  }
  #module-root[data-goodday-module="cards"] .modal-backdrop {
    box-sizing: border-box;
    padding-block: calc(18px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-bottom));
  }
  #module-root[data-goodday-module="cards"] .modal-backdrop .scan-modal {
    max-height: calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
}
