/* My Work visual shell. Loaded only by manage/my_work.html, after
   calendar_panel.css and my_work.css, and every rule below is scoped to the
   My Work page (.mp-main--mywork / #mp-mywork-root / body:has(#mp-mywork-root)).
   Presentation only: no widget, calendar or reminder behaviour lives here.

   Surfaces reuse the floating sidebar's glass values (manage.css), so the
   sidebar itself is never touched. */

.mp-main--mywork {
  /* Colours come from the theme tokens (manage_theme.css); the fallbacks are
     the dark values, so the page looks the same if the tokens are missing. */
  --mw-surface: var(--surface-main, rgba(35, 33, 38, 0.9));
  --mw-surface-solid: var(--surface-main-solid, #39373c);
  --mw-line: var(--chrome-line, rgba(255, 255, 255, 0.1));
  --mw-shadow: var(--shadow-md, 0 8px 32px rgba(0, 0, 0, 0.12));
  --mw-text: var(--chrome-text, rgba(255, 255, 255, 0.92));
  --mw-muted: var(--chrome-muted, rgba(255, 255, 255, 0.56));
  --mw-accent: #ff681f;
  --mw-radius: 24px;
  --mw-card-radius: 16px;
  --mw-gap: 12px;
  --mw-card-line: var(--card-line, #e6e9ee);
  --mw-raised: var(--chrome-raised, rgba(255, 255, 255, 0.07));
  --mw-raised-line: var(--chrome-raised-line, rgba(255, 255, 255, 0.09));
  --mw-control-line: var(--chrome-control-line, rgba(255, 255, 255, 0.16));
  --mw-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --mw-time: 240ms;
  --mw-panel-w: 218px; /* right panel: 273px - 20% */
}

/* The Brain launcher's position is shared by every Manage page
   (manage_theme.css); My Work no longer overrides it. */

/* -- Greeting (replaces crumb / eyebrow / title / subtitle) ---------------- */

/* The crumb row stays in the markup (shared base template); My Work hides it. */
.mp-main--mywork .mp-topbar {
  display: none;
}

.mp-mywork__greeting {
  margin: 0;
  color: #18212b;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* -- Widget cards: light, thin border, minimal shadow ---------------------- */

/* Phones keep the existing stacked card styles from my_work.css. */
@media (min-width: 561px) {
  .mp-main--mywork .mp-widget-grid {
    gap: var(--mw-gap);
    margin-top: 18px;
  }

  .mp-main--mywork .mp-count-card {
    min-height: 200px;
    padding: 18px;
    border: 1px solid var(--mw-card-line);
    border-radius: var(--mw-card-radius);
    background: var(--surface-card, #fff);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(17, 24, 39, 0.05));
  }

  .mp-main--mywork .mp-count-card--link:hover {
    transform: none;
    border-color: var(--card-line-hover, #c9d1da);
    box-shadow: var(--card-hover-shadow, 0 2px 8px rgba(17, 24, 39, 0.08));
  }

  .mp-main--mywork .mp-count-card__title {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  /* Metrics: readable, not oversized. */
  .mp-main--mywork .mp-count-card__primary-value {
    min-width: 60px;
    min-height: 56px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 2.1rem;
    font-weight: 750;
    letter-spacing: -0.04em;
  }

  .mp-main--mywork .mp-count-card__primary-label {
    font-size: 0.92rem;
    font-weight: 700;
  }

  .mp-main--mywork .mp-count-card__stat {
    min-height: 54px;
    border-color: var(--card-line-soft, #eef0f3);
    border-radius: 10px;
  }

  .mp-main--mywork .mp-count-card__stat-value {
    font-size: 1.25rem;
    font-weight: 750;
  }

  .mp-main--mywork .mp-dvir-row__value {
    font-size: 1.4rem;
  }
}

/* -- Right panel: bell launcher -------------------------------------------- */

/* Greeting row: heading on the left, the bell on the right. The bell shows
   only while the panel is collapsed; clicking it opens the panel as before. */
.mp-mywork__head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px; /* same height with or without the bell: no jump on toggle */
}

.mp-main--mywork .mp-cal__collapsed-btn {
  position: relative;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--mw-raised-line);
  border-radius: 50%;
  background: var(--mw-raised);
  color: var(--mw-text);
  box-shadow: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.mp-mywork:has(#mp-cal[data-state="collapsed"]) .mp-cal__collapsed-btn {
  display: inline-flex;
}

.mp-main--mywork .mp-cal__collapsed-btn svg {
  width: 18px;
  height: 18px;
}

.mp-main--mywork .mp-cal__collapsed-btn:hover {
  border-color: var(--mw-control-line);
  background: var(--chrome-hover-strong, rgba(255, 255, 255, 0.12));
  color: var(--chrome-strong, #fff);
}

.mp-main--mywork .mp-cal__collapsed-btn:focus-visible {
  outline: 2px solid var(--mw-accent);
  outline-offset: 2px;
}

/* -- Edit layout: pencil (same button as the bell) and the edit bar ---------- */

.mw-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.mp-main--mywork .mw-edit-btn {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--mw-raised-line);
  border-radius: 50%;
  background: var(--mw-raised);
  color: var(--mw-text);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

/* Desktop only. */
@media (min-width: 1100px) {
  .mp-main--mywork .mw-edit-btn {
    display: inline-flex;
  }
}

.mp-main--mywork .mw-edit-btn svg {
  width: 18px;
  height: 18px;
}

.mp-main--mywork .mw-edit-btn:hover {
  border-color: var(--mw-control-line);
  background: var(--chrome-hover-strong, rgba(255, 255, 255, 0.12));
  color: var(--chrome-strong, #fff);
}

.mp-main--mywork .mw-edit-btn:focus-visible {
  outline: 2px solid var(--mw-accent);
  outline-offset: 2px;
}

.mp-mywork.is-editing-layout .mw-head-actions {
  display: none;
}

.mw-editbar {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.mw-editbar[hidden] {
  display: none;
}

.mw-editbar__hint {
  margin-right: 4px;
  color: var(--mw-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.mw-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.mw-btn--ghost {
  background: transparent;
  color: var(--mw-muted);
}

.mw-btn--ghost:hover {
  background: var(--mw-raised);
  color: var(--mw-text);
}

.mw-btn--secondary {
  border-color: var(--mw-control-line);
  background: var(--mw-raised);
  color: var(--mw-text);
}

.mw-btn--secondary:hover {
  background: var(--chrome-hover-strong, rgba(255, 255, 255, 0.12));
}

.mw-btn--primary {
  background: var(--accent, #ff5a00);
  color: var(--text-on-accent, #fff);
}

.mw-btn--primary:hover {
  background: color-mix(in srgb, var(--accent, #ff5a00) 88%, #000);
}

.mw-btn:focus-visible {
  outline: 2px solid var(--mw-accent);
  outline-offset: 2px;
}

.mw-btn:disabled {
  cursor: progress;
  opacity: 0.6;
}

/* -- Right panel: mini month calendar --------------------------------------- */

.mp-main--mywork .mp-cal__mini {
  flex: 0 0 auto;
  padding: 12px 10px 10px;
  border: 1px solid var(--mw-raised-line);
  border-bottom: 1px solid var(--mw-raised-line);
  border-radius: var(--mw-card-radius);
  background: var(--mw-raised);
}

.mp-main--mywork .mp-cal__mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 0 6px;
  margin-bottom: 10px;
}

.mp-main--mywork .mp-cal__mini-month {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--chrome-strong, #fff);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-main--mywork .mp-cal__mini-nav {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.mp-main--mywork .mp-cal__mini-step,
.mp-main--mywork .mp-cal__mini .mp-cal__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mw-muted);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.mp-main--mywork .mp-cal__mini .mp-cal__icon-btn {
  margin-left: 4px;
}

.mp-main--mywork .mp-cal__mini-step:hover,
.mp-main--mywork .mp-cal__mini .mp-cal__icon-btn:hover {
  background: var(--chrome-hover-strong, rgba(255, 255, 255, 0.1));
  color: var(--chrome-strong, #fff);
}

/* Sidebar's chevrons-left, mirrored: the panel collapses towards the right edge. */
.mp-main--mywork .mp-cal__collapse-icon {
  width: 18px;
  height: 18px;
  transform: scaleX(-1);
}

.mp-main--mywork .mp-cal__mini-weekdays,
.mp-main--mywork .mp-cal__mini-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.mp-main--mywork .mp-cal__mini-weekdays {
  margin-bottom: 4px;
}

.mp-main--mywork .mp-cal__mini-weekdays span {
  color: var(--chrome-faint, rgba(255, 255, 255, 0.42));
  font-size: 0.64rem;
  font-weight: 650;
  line-height: 18px;
  text-align: center;
}

.mp-main--mywork .mp-cal__mini-days {
  row-gap: 2px;
}

.mp-main--mywork .mp-cal__mini-day {
  justify-self: center;
  width: 30px;
  max-width: 100%;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--chrome-text-2, rgba(255, 255, 255, 0.86));
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.mp-main--mywork .mp-cal__mini-day.is-outside {
  color: var(--chrome-disabled, rgba(255, 255, 255, 0.3));
}

.mp-main--mywork .mp-cal__mini-day:hover {
  background: var(--chrome-hover, rgba(255, 255, 255, 0.09));
  color: var(--chrome-strong, #fff);
}

.mp-main--mywork .mp-cal__mini-day.is-today {
  color: var(--accent-text-chrome, #ff9a62);
  font-weight: 750;
  box-shadow: var(--today-ring, inset 0 0 0 1px rgba(255, 104, 31, 0.55));
}

.mp-main--mywork .mp-cal__mini-day.is-selected,
.mp-main--mywork .mp-cal__mini-day.is-selected:hover {
  background: var(--mw-accent);
  color: var(--text-on-accent, #fff);
  font-weight: 750;
  box-shadow: none;
}

.mp-main--mywork .mp-cal__mini button:focus-visible,
.mp-main--mywork .mp-cal__day-head button:focus-visible {
  outline: 2px solid var(--chrome-focus, rgba(255, 255, 255, 0.85));
  outline-offset: 1px;
}

/* -- Right panel: dark daily schedule --------------------------------------- */

.mp-main--mywork .mp-cal__body {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--chrome-divider, rgba(255, 255, 255, 0.06));
  border-radius: var(--mw-card-radius);
  background: var(--chrome-inset, rgba(0, 0, 0, 0.14));
  color: var(--mw-text);
}

.mp-main--mywork .mp-cal__day-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 8px 14px;
  border-bottom: 1px solid var(--chrome-divider, rgba(255, 255, 255, 0.06));
}

.mp-main--mywork .mp-cal__range {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--chrome-strong, #fff);
  font-size: 0.8rem;
  font-weight: 650;
  text-align: left;
}

.mp-main--mywork .mp-cal__today-btn {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--mw-control-line);
  border-radius: 999px;
  background: transparent;
  color: var(--mw-text);
  font-size: 0.7rem;
  font-weight: 650;
}

.mp-main--mywork .mp-cal__today-btn:hover {
  border-color: rgba(255, 104, 31, 0.7);
  background: rgba(255, 104, 31, 0.12);
  color: var(--chrome-strong, #fff);
}

.mp-main--mywork .mp-cal__empty {
  margin: 0;
  padding: 28px 16px;
  color: var(--mw-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.mp-main--mywork .mp-cal__empty[hidden] {
  display: none;
}

.mp-main--mywork .mp-cal__state {
  margin: 12px;
  padding: 18px 14px;
  border: 1px solid var(--chrome-divider, rgba(255, 255, 255, 0.08));
  background: var(--chrome-raised, rgba(255, 255, 255, 0.04));
  color: var(--mw-muted);
}

.mp-main--mywork .mp-cal__state-title {
  color: var(--chrome-strong, #fff);
}

.mp-main--mywork .mp-cal__skeleton {
  margin: 12px 0 0;
  height: 140px;
  background: linear-gradient(90deg, var(--chrome-raised, rgba(255, 255, 255, 0.04)) 25%, var(--chrome-hover, rgba(255, 255, 255, 0.08)) 37%, var(--chrome-raised, rgba(255, 255, 255, 0.04)) 63%);
  background-size: 400% 100%;
}

.mp-main--mywork .mp-cal__allday {
  padding: 8px 10px;
  border-bottom-color: var(--chrome-divider, rgba(255, 255, 255, 0.06));
}

.mp-main--mywork .mp-cal__allday-chip {
  background: rgba(255, 104, 31, 0.18);
  color: var(--chrome-strong, #fff);
  font-weight: 650;
}

.mp-main--mywork .mp-cal__allday-chip:focus-visible {
  outline: 2px solid var(--chrome-focus, rgba(255, 255, 255, 0.85));
  outline-offset: 1px;
}

.mp-main--mywork .mp-cal__scroll {
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--chrome-scroll, rgba(255, 255, 255, 0.18)) transparent;
}

.mp-main--mywork .mp-cal__scroll::-webkit-scrollbar-thumb {
  background: var(--chrome-scroll, rgba(255, 255, 255, 0.18));
}

.mp-main--mywork .mp-cal__timeline {
  margin: 0 8px 0 4px;
}

.mp-main--mywork .mp-cal__hour-row {
  border-top-color: var(--chrome-divider, rgba(255, 255, 255, 0.06));
}

.mp-main--mywork .mp-cal__hour-label {
  color: var(--chrome-faint, rgba(255, 255, 255, 0.42));
  font-weight: 600;
}

.mp-main--mywork .mp-cal__day-col {
  border-left-color: var(--chrome-divider, rgba(255, 255, 255, 0.07));
}

.mp-main--mywork .mp-cal__now-line {
  border-top-color: var(--mw-accent);
}

.mp-main--mywork .mp-cal__now-line::before {
  background: var(--mw-accent);
}

.mp-main--mywork .mp-cal__event {
  --mp-event-bg: var(--event-bg, rgba(255, 255, 255, 0.08));
  --mp-event-border: var(--event-line, rgba(255, 255, 255, 0.08));
  border-left: 3px solid rgba(255, 104, 31, 0.7);
  color: var(--chrome-strong, #fff);
}

.mp-main--mywork .mp-cal__event:hover {
  border-left-color: var(--mw-accent);
  background: var(--chrome-hover-strong, rgba(255, 255, 255, 0.12));
  box-shadow: none;
}

.mp-main--mywork .mp-cal__event.is-selected {
  border-left-color: var(--mw-accent);
  background: rgba(255, 104, 31, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 104, 31, 0.7);
}

.mp-main--mywork .mp-cal__event:focus-visible {
  outline: 2px solid var(--chrome-focus, rgba(255, 255, 255, 0.85));
  outline-offset: 1px;
  box-shadow: none;
}

/* Titles wrap to two lines when the meeting is tall enough. */
.mp-main--mywork .mp-cal__event-title {
  display: -webkit-box;
  color: var(--chrome-strong, #fff);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mp-main--mywork .mp-cal__event.is-compact .mp-cal__event-title {
  display: block;
  white-space: nowrap;
}

.mp-main--mywork .mp-cal__event-time {
  color: var(--chrome-muted, rgba(255, 255, 255, 0.55));
}

/* -- Right panel: Notifications (mentions list, manage_notifications.css) -- */

.mp-main--mywork .mp-cal__notifications {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Heading lines up with the text inside the cards above (14px inset). */
/* Narrow panel (218px): "Mark all as read" wraps under the title instead of
   squeezing it (the count chip must never cover the heading). */
.mp-main--mywork .mp-cal__notifications-head {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  min-width: 0;
  padding: 4px 6px 10px 15px;
}

.mp-main--mywork .mp-cal__notifications-title {
  flex: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--chrome-strong, #fff);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.mp-main--mywork .mp-cal__notifications-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--mw-raised-line);
  border-radius: var(--mw-card-radius);
  /* Solid: the fiber-lines background must not show through (stray line). */
  background: var(--mw-surface-solid);
}

/* -- Desktop (floating sidebar breakpoint, >= 961px) ----------------------- */

@media (min-width: 961px) {
  /* Same top/bottom gaps as the sidebar (manage.css: 12px + safe area), so
     both containers share their top and bottom edges. The page itself does
     not scroll; each container scrolls its own content. */
  .mp-main.mp-main--mywork {
    overflow: hidden;
    padding: calc(var(--mw-gap) + var(--safe-top, 0px)) var(--mw-gap)
      calc(var(--mw-gap) + var(--safe-bottom, 0px));
  }

  .mp-main--mywork .mp-mywork {
    align-items: stretch;
    gap: var(--mw-gap);
    height: 100%;
  }

  /* The rounded container itself does not scroll (it clips to its corners);
     the inner area below the greeting does, with its scrollbar inset from
     the outer edge and clear of the rounded corners. Overlays (modals) live
     outside this container and are unaffected. */
  .mp-main--mywork .mp-mywork__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 22px 8px 10px 18px;
    color: var(--mw-text);
    color-scheme: var(--chrome-scheme, normal);
    background: var(--mw-surface);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--mw-line);
    border-radius: var(--mw-radius);
    box-shadow: var(--mw-shadow);
  }

  .mp-main--mywork .mp-mywork__head {
    padding-right: 10px;
    transition: padding-top var(--mw-time) var(--mw-ease);
  }

  .mp-main--mywork .mp-mywork__greeting {
    flex: 0 1 auto;
    padding: 2px 8px 0;
    color: var(--chrome-strong, #fff);
  }

  .mp-main--mywork .mp-mywork__scroll {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 14px;
    padding: 4px 10px 14px 4px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--chrome-scroll, rgba(255, 255, 255, 0.22)) transparent;
  }

  .mp-main--mywork .mp-mywork__scroll > .mp-widget-grid {
    margin-top: 0;
  }

  /* Right panel: --mw-panel-w (273px - 20%), full height. */
  .mp-main--mywork .mp-cal,
  .mp-main--mywork .mp-cal[data-state="compact"],
  .mp-main--mywork .mp-cal[data-state="expanded"] {
    position: relative;
    top: auto;
    flex: 0 0 var(--mw-panel-w);
    align-self: stretch;
    width: var(--mw-panel-w);
    height: auto;
    max-height: none;
    transition: flex-basis var(--mw-time) var(--mw-ease), width var(--mw-time) var(--mw-ease),
      margin-left var(--mw-time) var(--mw-ease);
  }

  /* Collapsed: no right column at all. The negative margin cancels the flex
     gap, so the central block ends 12px from the right edge, as on the left. */
  .mp-main--mywork .mp-cal[data-state="collapsed"] {
    flex: 0 0 0;
    width: 0;
    align-self: flex-start;
    margin-left: calc(-1 * var(--mw-gap));
  }

  /* Collapsed: the launcher sits inside the central block (bottom/right 20px);
     the block keeps room below the last card for it. */
  .mp-mywork:has(#mp-cal[data-state="collapsed"]) .mp-mywork__main {
    position: relative;
    padding-bottom: 84px;
  }

  .mp-main--mywork .mp-mywork__scroll {
    container: mw-cards / inline-size;
  }

  /* The glass lives on the panel, not on .mp-cal: a backdrop-filter there
     would trap the event modal (a fixed-position child of .mp-cal). */
  .mp-main--mywork .mp-cal__panel {
    gap: 8px;
    height: 100%;
    max-height: none;
    padding: 8px;
    background: var(--mw-surface);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--mw-line);
    border-radius: var(--mw-radius);
    box-shadow: var(--mw-shadow);
  }

  /* ~30% mini calendar (its natural height), ~35% schedule, 35% Notifications. */
  .mp-main--mywork .mp-cal__body {
    flex: 1 1 0;
    min-height: 120px;
  }

  .mp-main--mywork .mp-cal__notifications {
    flex: 0 0 35%;
  }
}

/* Collapsed: 5 card columns wherever five fit (card area >= 1100px, i.e. from
   ~1440px, or narrower with the sidebar collapsed); below that the grid keeps
   its automatic columns so card content is never cut off. A title next to a
   top-right link wraps instead of running under it. */
@container mw-cards (min-width: 1100px) {
  .mp-mywork:has(#mp-cal[data-state="collapsed"]) .mp-count-card:has(> .mp-count-card__viewall) .mp-count-card__title {
    padding-right: 84px;
  }
}

/* -- Tablet / phone (sidebar becomes the white top header, <= 960px) -------- */

@media (max-width: 960px) {
  .mp-main--mywork .mp-topbar {
    display: none;
  }

  .mp-main--mywork .mp-mywork__main {
    padding: 18px 16px 20px;
    color: var(--mw-text);
    background: var(--mw-surface-solid);
    border: 1px solid var(--mw-line);
    border-radius: 20px;
  }

  .mp-main--mywork .mp-mywork__greeting {
    padding: 0 2px;
    color: var(--chrome-strong, #fff);
    font-size: 1.35rem;
  }

  .mp-main--mywork .mp-cal__panel {
    gap: 10px;
    padding: 10px;
    background: var(--mw-surface-solid);
    border: 1px solid var(--mw-line);
    border-radius: 20px;
    box-shadow: none;
  }

  .mp-main--mywork .mp-cal__body {
    flex: 1 1 auto;
  }

  .mp-main--mywork .mp-cal__notifications {
    flex: 0 0 auto;
  }

  .mp-main--mywork .mp-cal__notifications-body {
    min-height: 140px;
  }

  /* Collapsed: no right column (the bell is in the greeting row). */
  .mp-main--mywork .mp-cal[data-state="collapsed"] {
    flex: 0 0 0;
    width: 0;
    height: 0;
    min-height: 0;
    margin-left: calc(-1 * var(--mw-gap));
  }
}

/* 861-960px: the existing side-by-side layout keeps the panel narrow. */
@media (min-width: 861px) and (max-width: 960px) {
  .mp-main--mywork .mp-mywork {
    gap: var(--mw-gap);
  }

  .mp-main--mywork .mp-cal,
  .mp-main--mywork .mp-cal[data-state="compact"],
  .mp-main--mywork .mp-cal[data-state="expanded"] {
    flex: 0 0 var(--mw-panel-w);
    width: var(--mw-panel-w);
  }

  .mp-main--mywork .mp-cal__notifications {
    flex: 0 0 30%;
  }
}

/* Stacked (561-860px): the panel sits under the widgets; the schedule has a
   fixed, scrollable height and the mini calendar keeps a compact width. */
@media (min-width: 561px) and (max-width: 860px) {
  .mp-main--mywork .mp-mywork {
    gap: var(--mw-gap);
  }

  .mp-main--mywork .mp-cal__panel {
    height: auto;
    max-height: none;
  }

  .mp-main--mywork .mp-cal__mini > * {
    max-width: 340px;
    margin-inline: auto;
  }

  .mp-main--mywork .mp-cal__body {
    flex: 0 0 auto;
    height: 440px;
  }
}

/* Narrow side panel (>= 861px, --mw-panel-w): internals scaled to ~80% with
   the width, so nothing clips or wraps. Sizes and spacing only. */
@media (min-width: 861px) {
  .mp-main--mywork .mp-cal__panel {
    gap: 8px;
    padding: 8px;
  }

  .mp-main--mywork .mp-cal__mini {
    padding: 10px 8px 8px;
  }

  .mp-main--mywork .mp-cal__mini-head {
    gap: 3px; /* title-to-arrows; the 22px buttons add their own inset */
    padding: 0 0 0 4px;
    margin-bottom: 8px;
  }

  .mp-main--mywork .mp-cal__mini-month {
    font-size: 0.75rem;
  }

  .mp-main--mywork .mp-cal__mini-nav {
    gap: 1px;
  }

  .mp-main--mywork .mp-cal__mini-step,
  .mp-main--mywork .mp-cal__mini .mp-cal__icon-btn {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }

  .mp-main--mywork .mp-cal__mini .mp-cal__icon-btn {
    margin-left: 3px;
  }

  .mp-main--mywork .mp-cal__mini-step svg {
    width: 11px;
    height: 11px;
  }

  .mp-main--mywork .mp-cal__collapse-icon {
    width: 14px;
    height: 14px;
  }

  .mp-main--mywork .mp-cal__mini-weekdays {
    margin-bottom: 3px;
  }

  .mp-main--mywork .mp-cal__mini-weekdays span {
    font-size: 0.625rem;
    line-height: 14px;
  }

  .mp-main--mywork .mp-cal__mini-day {
    width: 24px;
    height: 22px;
    border-radius: 7px;
    font-size: 0.6875rem;
  }

  .mp-main--mywork .mp-cal__day-head {
    gap: 6px;
    padding: 7px 8px 6px 11px;
  }

  .mp-main--mywork .mp-cal__range {
    font-size: 0.6875rem;
  }

  .mp-main--mywork .mp-cal__today-btn {
    padding: 3px 8px;
    font-size: 0.625rem;
  }

  .mp-main--mywork .mp-cal__empty {
    padding: 22px 12px;
    font-size: 0.6875rem;
  }

  .mp-main--mywork .mp-cal__state {
    margin: 10px;
    padding: 14px 11px;
    font-size: 0.72rem;
  }

  .mp-main--mywork .mp-cal__allday {
    padding: 6px 8px;
  }

  .mp-main--mywork .mp-cal__allday-chip {
    font-size: 0.64rem;
  }

  .mp-main--mywork .mp-cal__timeline {
    margin: 0 6px 0 3px;
  }

  .mp-main--mywork .mp-cal__hour-label-col {
    flex-basis: 35px;
    width: 35px;
  }

  .mp-main--mywork .mp-cal__hour-label {
    padding-right: 6px;
    font-size: 0.625rem;
  }

  .mp-main--mywork .mp-cal__event {
    padding: 5px 6px 5px 7px;
  }

  .mp-main--mywork .mp-cal__event.is-compact {
    padding: 2px 5px 2px 6px;
  }

  .mp-main--mywork .mp-cal__event-title {
    font-size: 0.6875rem;
  }

  .mp-main--mywork .mp-cal__event-time {
    font-size: 0.625rem;
  }

  .mp-main--mywork .mp-cal__notifications-head {
    padding: 3px 4px 8px 12px;
  }

  .mp-main--mywork .mp-cal__notifications-title {
    font-size: 0.8rem;
  }
}

/* Phone (<= 560px): the existing full-screen calendar keeps its behaviour;
   only its surface changes. The safe-area padding moves from the header
   (now a card) to the panel. */
@media (max-width: 560px) {
  .mp-main--mywork .mp-cal[data-state="compact"] .mp-cal__panel,
  .mp-main--mywork .mp-cal[data-state="expanded"] .mp-cal__panel {
    padding: calc(10px + var(--safe-top, env(safe-area-inset-top, 0px)))
      calc(10px + var(--safe-right, env(safe-area-inset-right, 0px)))
      calc(10px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)))
      calc(10px + var(--safe-left, env(safe-area-inset-left, 0px)));
    border: 0;
    border-radius: 0;
  }

  .mp-main--mywork .mp-cal[data-state="compact"] .mp-cal__header,
  .mp-main--mywork .mp-cal[data-state="expanded"] .mp-cal__header {
    padding: 12px 10px 10px;
  }

  .mp-main--mywork .mp-cal__mini > * {
    max-width: 360px;
    margin-inline: auto;
  }

  .mp-main--mywork .mp-cal__body {
    flex: 1 1 0;
    min-height: 0;
  }

  .mp-main--mywork .mp-cal__notifications {
    flex: 0 0 26%;
  }

  .mp-main--mywork .mp-cal__notifications-body {
    min-height: 0;
  }

  .mp-main--mywork .mp-mywork__main {
    padding: 16px 12px 14px;
  }
}

/* The meeting reminder is global (meeting_reminders.css): top-center on every
   page; the former My Work-only notch is gone. */

/* -- Reduced motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .mp-main--mywork .mp-cal,
  .mp-main--mywork .mp-cal__collapsed-btn,
  .mp-main--mywork .mp-mywork__head,
  .mp-main--mywork .mp-count-card--link {
    transition: none;
  }
}
