/* Redesign:WhatsNew — What's new on Today, scoped to .rd-whatsnew (design: reportwriter.org Designer, whats-new-design-20261114).
   Built from spec/whats-new.css. Change from the spec: no prefers-color-scheme fallback, so the banner always matches the
   site theme (html[data-rdtheme], Redesign:DarkMode) and never turns dark on a light page.
   Light tokens follow the Report Depo shell (--navy, --teal, --soft, etc.).
   Dark mode follows the existing mechanism: html[data-rdtheme=dark],
   with .rd-whatsnew-theme-dark as a fallback. */

.rd-whatsnew {
  --wn-navy: var(--navy, #0B2545);
  --wn-teal: var(--teal-d, #0B7F7B);
  --wn-teal-mid: var(--teal, #0E9F9A);
  --wn-teal-l: var(--teal-l, #E6F6F5);
  --wn-ink: var(--ink, #1B2A3A);
  --wn-mut: var(--mut, #4F6072);
  --wn-line: var(--line, #D5DDE6);
  --wn-soft: var(--soft, #F2F5F8);
  --wn-card: #fff;
  --wn-focus: rgba(11, 127, 123, 0.28);
  --wn-scrim: rgba(11, 37, 69, 0.28);
  --wn-radius: 16px;
  --wn-control: 44px;
  position: relative;
  margin: 0 0 12px;
  z-index: 20;
  font-family: inherit;
}

/* ----- Slim one-line banner (collapsed) ----- */
.rd-whatsnew-bar {
  position: relative;
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--wn-control);
  padding: 0 4px 0 0;
  border: 1px solid var(--wn-line);
  border-radius: 12px;
  background: var(--wn-card);
  box-shadow: 0 1px 2px rgba(11, 37, 69, 0.04);
}

.rd-whatsnew-open,
.rd-whatsnew-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--wn-control);
  min-width: var(--wn-control);
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--wn-teal);
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
}

.rd-whatsnew-open {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 8px 0 14px;
  color: var(--wn-navy);
  text-align: left;
}

.rd-whatsnew-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--wn-teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
}

.rd-whatsnew-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--wn-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rd-whatsnew-text b {
  font-weight: 750;
}

.rd-whatsnew-chevron {
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--wn-teal);
  border-bottom: 2px solid var(--wn-teal);
  transform: rotate(45deg);
  translate: 0 -2px;
}

.rd-whatsnew-open[aria-expanded="true"] {
  background: transparent;
}

.rd-whatsnew-open[aria-expanded="true"] .rd-whatsnew-chevron {
  transform: rotate(225deg);
  translate: 0 2px;
}

.rd-whatsnew-dismiss {
  flex: none;
  color: var(--wn-mut);
  font-size: 18px;
  line-height: 1;
}

.rd-whatsnew-open:hover,
.rd-whatsnew-dismiss:hover {
  background: var(--wn-soft);
}

.rd-whatsnew-open:focus-visible,
.rd-whatsnew-dismiss:focus-visible,
.rd-whatsnew-card:focus-visible {
  outline: 3px solid var(--wn-focus);
  outline-offset: 2px;
}

/* ----- Expanded overlay: drawer (desktop) / sheet (phone). Does not reflow the dashboard. ----- */
.rd-whatsnew-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 21;
  background: var(--wn-scrim);
}

.rd-whatsnew.is-open .rd-whatsnew-scrim {
  display: block;
}

.rd-whatsnew-panel {
  display: none;
  position: absolute;
  z-index: 22;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: min(440px, 100%);
  max-height: min(70vh, 720px);
  overflow: auto;
  padding: 14px 14px 12px;
  border: 1px solid var(--wn-line);
  border-radius: var(--wn-radius);
  background: var(--wn-card);
  box-shadow: 0 16px 40px rgba(11, 37, 69, 0.18);
}

.rd-whatsnew.is-open .rd-whatsnew-panel {
  display: block;
}

.rd-whatsnew-panel-h {
  margin: 0 0 10px;
}

.rd-whatsnew-panel-h h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.2px;
  color: var(--wn-navy);
}

.rd-whatsnew-panel-h p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--wn-mut);
}

.rd-whatsnew-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.rd-whatsnew-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title go" "desc desc";
  align-items: baseline;
  gap: 2px 10px;
  margin: 0;
  padding: 10px 12px;
  min-height: var(--wn-control);
  border: 1px solid var(--wn-line);
  border-radius: 12px;
  background: var(--wn-soft);
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.rd-whatsnew-card h3 {
  grid-area: title;
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  color: var(--wn-navy);
  letter-spacing: -0.1px;
}

.rd-whatsnew-card p {
  grid-area: desc;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--wn-mut);
}

.rd-whatsnew-go {
  grid-area: go;
  color: var(--wn-teal);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.rd-whatsnew-card:hover {
  border-color: var(--wn-teal-mid);
}

.rd-whatsnew-card:hover .rd-whatsnew-go {
  text-decoration: underline;
}

.rd-whatsnew[hidden] {
  display: none !important;
}

/* Phone / narrow: bottom sheet so the greeting, banner, and start of the day stay visible. */
@media (max-width: 720px) {
  .rd-whatsnew-text {
    white-space: nowrap;
  }
  .rd-whatsnew-more {
    display: none;
  }
  .rd-whatsnew-bar {
    gap: 2px;
  }
  .rd-whatsnew-open {
    gap: 8px;
    padding: 0 6px 0 12px;
  }
  .rd-whatsnew-panel {
    position: fixed;
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 60px;
    width: auto;
    max-height: calc(100vh - 320px);
    padding: 12px 10px 10px;
  }
  .rd-whatsnew-card {
    padding: 8px 10px;
    gap: 1px 8px;
  }
  .rd-whatsnew-card h3,
  .rd-whatsnew-card p {
    font-size: 13px;
  }
  .rd-whatsnew-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rd-whatsnew-panel,
  .rd-whatsnew-bar,
  .rd-whatsnew-open,
  .rd-whatsnew-chevron,
  .rd-whatsnew-scrim {
    transition: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .rd-whatsnew-chevron {
    transition: transform 0.15s ease, translate 0.15s ease;
  }
  .rd-whatsnew-scrim {
    transition: background 0.15s ease;
  }
}

/* ----- Dark mode: existing html[data-rdtheme=dark], plus fallbacks ----- */
html[data-rdtheme="dark"] .rd-whatsnew,
.rd-whatsnew-theme-dark.rd-whatsnew {
  --wn-navy: var(--navy, #E8EFF8);
  --wn-teal: var(--teal-d, #1C9E99);
  --wn-teal-mid: var(--teal, #22B8B2);
  --wn-teal-l: var(--teal-l, #10302F);
  --wn-ink: var(--ink, #DCE4EE);
  --wn-mut: var(--mut, #9DB0C4);
  --wn-line: var(--line, #2A394B);
  --wn-soft: var(--soft, #0F1823);
  --wn-card: #141F2C;
  --wn-focus: rgba(34, 184, 178, 0.4);
  --wn-scrim: rgba(0, 0, 0, 0.5);
}

html[data-rdtheme="dark"] .rd-whatsnew-bar,
html[data-rdtheme="dark"] .rd-whatsnew-panel,
.rd-whatsnew-theme-dark .rd-whatsnew-bar,
.rd-whatsnew-theme-dark .rd-whatsnew-panel {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html[data-rdtheme="dark"] .rd-whatsnew-badge,
.rd-whatsnew-theme-dark .rd-whatsnew-badge {
  background: #0E8580;
  color: #fff;
}

html[data-rdtheme="dark"] .rd-whatsnew-go,
.rd-whatsnew-theme-dark .rd-whatsnew-go {
  color: #5FD3CE;
}

/* Billing card: one card, several destinations. The main link covers the card; the extra links sit above it. */
.rd-whatsnew-card-multi { position: relative; grid-template-areas: "title go" "desc desc" "extra extra"; }
.rd-whatsnew-card-multi .rd-whatsnew-main { text-decoration: none; }
.rd-whatsnew-card-multi .rd-whatsnew-main::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.rd-whatsnew-card-multi .rd-whatsnew-main:focus-visible { outline: none; }
.rd-whatsnew-card-multi .rd-whatsnew-main:focus-visible::after { outline: 3px solid var(--wn-focus); outline-offset: 2px; }
.rd-whatsnew-card-multi:hover .rd-whatsnew-main { text-decoration: underline; }
.rd-whatsnew-extra { grid-area: extra; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.rd-whatsnew-extra:empty { display: none; }
.rd-whatsnew-extra a { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 32px; color: var(--wn-teal); font-size: 13px; font-weight: 650; text-decoration: none; }
.rd-whatsnew-extra a:hover { text-decoration: underline; }
.rd-whatsnew-extra a:focus-visible { outline: 3px solid var(--wn-focus); outline-offset: 2px; border-radius: 6px; }
html[data-rdtheme="dark"] .rd-whatsnew-extra a, .rd-whatsnew-theme-dark .rd-whatsnew-extra a { color: #5FD3CE; }

/* Dismissed in this browser (rd-whatsnew.js writes the dismissed versions on <html> before the page paints). */
html[data-rdwn-dismissed~="2026-11"] .rd-whatsnew[data-dismiss-version="2026-11"] { display: none !important; }

/* Phone sheet anchored under the banner (top set by rd-whatsnew.js), down to the bottom of the screen. */
@media (max-width: 720px) { .rd-whatsnew.rd-whatsnew-hastop .rd-whatsnew-panel { top: var(--wn-sheet-top); max-height: none; } }

/* While open the page behind does not scroll on a phone (the sheet scrolls instead). */
@media (max-width: 720px) { html.rd-whatsnew-lock, html.rd-whatsnew-lock body { overflow: hidden; } }
/* The round light/dark switch would sit on top of the sheet's last card on a phone; it comes back when the sheet closes. */
@media (max-width: 720px) { html.rd-whatsnew-lock .rd-themetog { display: none; } }
