/* Daily — check-in, free pull, mail.

   Twenty-eight tiles have to fit above the fold alongside a collect button
   and a free-pull card, so the calendar is a 7-column grid of small tiles
   rather than a list. Seven across is not arbitrary: a week per row is the
   shape everyone already reads a calendar in. */

.dl-free {
  display: flex;
  gap: var(--s3);
  align-items: center;
  padding: var(--s3);
  border-radius: var(--rad-md);
  background: var(--panel-face);
  box-shadow: var(--cast-sm);
}
/* Something waiting gets the gold edge; something spent does not. */
.dl-free.is-ready {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-300) 50%, transparent),
              0 0 16px color-mix(in srgb, var(--gold-300) 16%, transparent),
              var(--cast-sm);
}

.dl-free-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--ink-800);
}
.dl-free.is-ready .dl-free-mark { animation: dl-pulse 2.6s var(--ease-out) infinite; }
@keyframes dl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold-300) 36%, transparent); }
  50% { box-shadow: 0 0 0 7px transparent; }
}

.dl-free-text { display: grid; flex: 1; min-width: 0; gap: 1px; }
.dl-free-text strong { color: var(--text-cream); font-size: var(--fz-body); }
.dl-free-sub { color: var(--text-muted); font-size: var(--fz-tiny); }

.dl-head {
  display: flex;
  gap: var(--s2);
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--s2);
}
.dl-sub { margin: 2px 0 0; color: var(--text-muted); font-size: var(--fz-tiny); }
.dl-streak {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 1px var(--s2);
  border-radius: var(--rad-pill);
  background: var(--ink-800);
  color: var(--gold-200);
  font-size: var(--fz-tiny);
  font-weight: 700;
}

.dl-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: var(--s3);
}

.dl-day {
  position: relative;
  display: grid;
  aspect-ratio: 1 / 1;
  align-content: center;
  justify-items: center;
  gap: 1px;
  border-radius: var(--rad-sm);
  background: var(--ink-800);
  color: var(--text-muted);
}
.dl-day-n { font-size: 0.56rem; font-weight: 700; }
.dl-day-tok {
  display: inline-flex;
  gap: 1px;
  align-items: center;
  color: var(--gold-200);
  font-size: 0.52rem;
  font-weight: 700;
}

/* A milestone is worth the detour, so it says so with a gold edge rather
   than with a bigger tile — a 7-column grid cannot afford a wide cell. */
.dl-day.is-milestone {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-300) 55%, transparent);
}
.dl-day.is-claimed { background: var(--ink-700); opacity: 0.45; }
.dl-day.is-today {
  background: color-mix(in srgb, var(--gold-300) 22%, var(--ink-800));
  box-shadow: inset 0 0 0 2px var(--gold-300);
  color: var(--text-cream);
}
.dl-day-tick {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--success);
}

.dl-note {
  margin: var(--s3) 0 0;
  color: var(--text-muted);
  font-size: var(--fz-tiny);
  line-height: 1.4;
}

/* --- mail ------------------------------------------------------------------ */

.dl-mail { display: grid; gap: var(--s2); }

.dl-letter {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--s2);
  align-items: center;
  padding: var(--s2);
  border-radius: var(--rad-sm);
  background: var(--ink-700);
}
.dl-letter.is-read { opacity: 0.55; }

.dl-letter-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink-800);
  color: var(--gold-200);
}
.dl-letter-text { display: grid; min-width: 0; gap: 1px; }
.dl-letter-text strong { color: var(--text-cream); font-size: var(--fz-small); }
.dl-letter-body {
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--fz-tiny);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-letter-done { color: var(--text-muted); font-size: var(--fz-tiny); }
/* Attachments sit on their own row under the letter, so a long subject and a
   reward chip never fight for the same width. */
.dl-letter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  grid-column: 2 / -1;
}

.dl-empty {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  padding: var(--s4) var(--s3);
  color: var(--text-muted);
  text-align: center;
}
.dl-empty p { margin: 0; font-size: var(--fz-small); }

/* No wider grid on tablet.

   Fourteen columns was tried and measured: it halved the calendar's height
   and the screen fell to 52% fill against 97% on a phone. Wider columns make
   content SHORTER, and a taller frame needs taller content — the same trap
   the roster's five-column convention set earlier in this project.

   Seven columns on a wide screen means bigger square tiles, which fills the
   frame and makes the numbers easier to read at the same time. */
@media (min-width: 720px) {
  .dl-cal { gap: var(--s2); }
  /* Taller than square. A tablet frame is 1112px and the calendar at 1:1
     left a quarter of it empty; stretching the tiles downward is the only
     axis that actually fills a tall frame. */
  .dl-day { aspect-ratio: 5 / 7; }
  .dl-day-n { font-size: 0.82rem; }
  .dl-day-tok { font-size: 0.7rem; }
  .dl-free { padding: var(--s4); }
  .dl-free-mark { width: 64px; height: 64px; }
  .dl-cal { margin-top: var(--s4); }
  .dl-note { margin-top: var(--s4); }
}

/* The painted calendar mark sits beside the heading rather than replacing it:
   an icon alone is a guess, a heading alone was a line of plain text. */
.dl-head-title { display: flex; gap: var(--s2); align-items: center; }
.dl-head-title .kit-panel-title { margin: 0; }
