/* One daily edition, whether it sits on the page or inside the bell. */
.mley-updates {
  box-sizing: border-box;
  min-width: 0;
  container-type: inline-size;
  scroll-margin-top: calc(var(--mley-header-height, 61px) + 1rem);
  padding: clamp(1rem, 2.6vw, 2rem);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--bg-surface);
  color: var(--text-color);
  font: var(--text-small)/var(--leading-ui) var(--font-ui);
  overflow-wrap: anywhere;
}
.mley-updates[hidden], .mley-updates [hidden], .mley-updates-backdrop[hidden] { display: none !important; }
.mley-updates__masthead, .mley-updates__controls {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
}
.mley-updates__masthead > div:first-child { flex: 1 1 10rem; }
.mley-updates__eyebrow {
  margin: 0 0 .35rem; color: var(--brand-text); font-size: var(--text-caption);
  font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: .12em;
}
.mley-updates .mley-updates__title {
  margin: 0; color: var(--text-color); font: 700 clamp(1.5rem, 4.8cqi, 2.25rem)/1.1 var(--font-ui);
  letter-spacing: -.04em; text-wrap: balance;
}
.mley-updates button { font: inherit; color: var(--text-muted); background: transparent; border: 0; cursor: pointer; }
.mley-updates__days {
  position: relative; isolation: isolate; display: inline-grid; grid-template-columns: repeat(2, 1fr);
  padding: 3px; background: var(--bg-surface-2); border-radius: 12px;
}
.mley-updates__days::before {
  content: ""; position: absolute; z-index: -1; inset: 3px auto 3px 3px; width: calc(50% - 3px);
  box-sizing: border-box; border: 1px solid var(--border-color); border-radius: 9px;
  background: var(--bg-surface); box-shadow: 0 1px 2px rgb(0 0 0 / .08); transition: transform 180ms ease-out;
}
.mley-updates__days:has([data-updates-day="ayer"][aria-pressed="true"])::before { transform: translateX(100%); }
.mley-updates__days button { min-height: 44px; min-width: 48px; padding: 0 .6rem; font-weight: var(--weight-semibold); }
.mley-updates__days [aria-pressed="true"], .mley-updates__sources [aria-selected="true"] { color: var(--text-color); }
.mley-updates__controls { margin-top: 1rem; border-bottom: 1px solid var(--border-color); }
.mley-updates__sources { display: inline-flex; gap: 1rem; }
.mley-updates__sources button {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem 0;
  border-bottom: 2px solid transparent; font-weight: var(--weight-semibold);
}
.mley-updates__sources [aria-selected="true"] { border-bottom-color: var(--brand-text); }
.mley-updates__sources .mley-navigation-icon { width: 1.1rem; height: 1.1rem; }
.mley-updates__date, .mley-updates__status, .mley-updates__item-label, .mley-updates__item-meta {
  color: var(--text-muted); font-size: var(--text-caption);
}
.mley-updates__date { font-variant-numeric: tabular-nums; }
.mley-updates__status { margin: 1.1rem 0 .6rem; }
.mley-updates__status:empty { margin: 0; }
.mley-updates__list { list-style: none; margin: 0; padding: 0; }
.mley-updates__item { padding: .9rem 0; border-bottom: 1px solid var(--border-color); }
.mley-updates__item-label { display: block; margin-bottom: .55rem; font-weight: var(--weight-semibold); }
.mley-updates .mley-updates__item-title {
  display: block; width: fit-content; color: var(--text-color); text-decoration: none;
  font-size: var(--text-body); line-height: 1.4; font-weight: var(--weight-semibold);
}
.mley-updates__item-meta { margin: .3rem 0 0; line-height: 1.4; }
.mley-updates__retry, .mley-updates__footer a {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem 0;
  color: var(--accent-color); font-size: var(--text-small); font-weight: var(--weight-semibold); text-decoration: none;
}
.mley-updates__retry:disabled { cursor: wait; }
.mley-updates__footer { display: flex; justify-content: flex-end; margin-top: .4rem; }
.mley-updates :is(a, button):hover { color: var(--accent-color); text-decoration: none; }
.mley-updates :is(a, button):focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; border-radius: 4px; }
.mley-updates__close { width: 44px; height: 44px; padding: 0; }
.mley-updates button.mley-updates__close { font-size: 1.5rem; }
@container (max-width: 25rem) {
  .mley-updates__controls { flex-direction: column-reverse; align-items: flex-start; gap: .25rem; }
  .mley-updates__masthead { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .mley-updates__days::before { transition: none; } }

.mley-home-with-updates[data-updates-layout="reading"] > .mley-updates { grid-row: 1; }

/* The bell owns its scroll area and existing surface. */
.mley-updates--embedded { margin-top: 1rem; padding: 1rem 0 0; border: 0; border-top: 1px solid var(--border-color); border-radius: 0; background: transparent; }
.mley-updates-trigger[aria-expanded="true"] { color: var(--accent-color); background: var(--accent-color-soft); }
.mley-updates-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .28); }
.mley-updates--panel {
  position: fixed; top: calc(var(--mley-header-height, 61px) + 8px); right: max(16px, env(safe-area-inset-right));
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - var(--mley-header-height, 61px) - 24px - max(var(--mley-reader-dock-height, 0px), env(safe-area-inset-bottom)));
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-card);
}
.mley-updates--panel .mley-updates__body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 767px), (max-width: 1199px) and (max-height: 500px) {
  .mley-updates--panel {
    inset: 0; width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .mley-updates--panel .mley-updates__body { flex: 1; }
  body:has(.mley-updates--panel:not([hidden])) .mley-article-dock { visibility: hidden; }
}
@media print { .mley-updates--panel, .mley-updates-backdrop { display: none !important; } }
