/* Per-goal date pill + bare month grid (js/long-term-goals/ltg_date_pill.js).

   Sibling of styles/ltg-rating.css and shaped to match it: the same pill
   height, radius and muted-until-hover treatment, so a row carrying both reads
   as one strip of controls rather than two widgets from different eras.

   The grid is `position: fixed` for the same reason the rating picker is — it
   has to escape the `overflow: hidden` scroller every host surface sits in, and
   `<main>`'s transform means it cannot simply be absolute inside the row. It is
   parented through `popoverHost`, so a pill inside the reflection blocker's
   modal opens its grid INSIDE that modal and paints above it. Its z-index only
   has to beat its host's own content, never another overlay. */

.ltg-date {
  position: relative;
  flex: 0 0 auto;
}

.ltg-date-toggle {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  font-size: 0.68rem;
  line-height: 1;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.ltg-date-toggle:hover,
.ltg-date-toggle[aria-expanded='true'] {
  color: var(--ltg-row-color, var(--text-primary));
  border-color: var(--ltg-row-color, var(--border-strong));
  background: var(--utility-surface);
}

/* ── The grid ──────────────────────────────────────────────────────────
   Nothing but the month: its name, two arrows, the weekday letters and the
   numbers. The letters are not decoration — without columns to align to, a run
   of numbers is not a month view. */

.ltg-date-grid {
  position: fixed;
  z-index: 420;
  width: 232px;
  padding: 10px;
  background: var(--card, var(--utility-surface));
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

.ltg-date-grid[hidden] {
  display: none;
}

.ltg-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 6px;
}

.ltg-date-month {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ltg-date-nav {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.ltg-date-nav:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
  background: var(--utility-surface);
}

.ltg-date-week,
.ltg-date-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.ltg-date-week {
  margin-bottom: 2px;
}

.ltg-date-week span {
  display: grid;
  place-items: center;
  height: 18px;
  font-size: 0.6rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.ltg-date-day {
  height: 26px;
  padding: 0;
  font-size: 0.72rem;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.ltg-date-day:hover {
  background: var(--utility-surface);
  border-color: var(--border-subtle);
}

/* Today is outlined; the chosen day is filled. Both can be true at once, and
   the fill has to win — which one you PICKED is the answer the grid is for. */
.ltg-date-day.is-today {
  border-color: var(--border-strong);
}

.ltg-date-day.selected,
.ltg-date-day.selected:hover {
  color: #fff;
  background: var(--ltg-row-color, var(--accent));
  border-color: var(--ltg-row-color, var(--accent));
  font-weight: 600;
}
