/*
 * TAG Legal Desk v2.1, package wp5_calendar: C5 Days that matter, C6 birthdays and milestones, A3 Seasons.
 * Tokens only (the desk's own and the art kit's, each with a fallback), no inline styles anywhere, only transform
 * and opacity move. Light is the default; Dark, Eucalypt, Harbour and High contrast read through the tokens.
 * Works at 390 px with no horizontal scroll: every row wraps and every card keeps max-width 100 percent.
 * The core draws each moment's glass card (section.v21-moment, with data-v21-moment set to the moment's id); this
 * file lays out only what goes inside it, and gives this package's own moment cards their spacing.
 */

/* ---------- shared pieces ---------- */

.v21-cal-art { display: inline-flex; align-items: center; justify-content: center; line-height: 0; flex: none; }
.v21-cal-art svg { display: block; }

.v21-cal-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 16px; min-width: 0; max-width: 100%; }
.v21-cal-body { min-width: 0; display: grid; gap: 4px; }
.v21-cal-title { margin: 0; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.v21-cal-line { margin: 0; font-size: .9375rem; line-height: 1.4375rem; color: var(--ink-2); overflow-wrap: anywhere; }
.v21-cal-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; }
.v21-cal-actions .btn { max-width: 100%; min-height: 44px; white-space: normal; text-align: center; line-height: 1.2; }

.v21-ms-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); flex: none; }

/* ---------- C5: the header motif ---------- */

.v21-day-motif { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; min-height: 24px; padding: 0 8px 0 6px; border-radius: 999px; color: var(--ink-2); font-size: .75rem; line-height: 1rem; font-weight: 600; letter-spacing: 0; white-space: nowrap; vertical-align: middle; }
.v21-day-motif[hidden] { display: none; }
.v21-day-motif-name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 599px) {
  /* The phone header holds only the logo, the count and your chip (bible 2.2): the day's name is not drawn there,
     it is still read aloud through the motif's aria-label, and the 20 px art shows once FLORA passes. */
  .v21-day-motif { padding: 0 2px; min-height: 0; }
  .v21-day-motif-name { display: none; }
}

/* ---------- C5: the calm card (replaces the celebration on a day that matters) ---------- */

.v21-calm-card { display: grid; justify-items: center; text-align: center; gap: 8px; max-width: 100%; min-width: 0; }
.v21-calm-motif { margin-bottom: 4px; }
.v21-calm-day { margin: 0; font-size: .75rem; line-height: 1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.clear .v21-calm-title, .v21-calm-title { margin: 0; font-size: 1.75rem; line-height: 2.125rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.v21-calm-line { margin: 0; max-width: 40ch; font-size: .9375rem; line-height: 1.4375rem; color: var(--ink-2); }
.v21-calm-note { margin: 4px 0 0; }

/* ---------- C5: the minute's silence ---------- */

.v21-silence-text { margin: 0; min-width: 0; font-size: 1rem; line-height: 1.5rem; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 599px) {
  .v21-silence-actions { flex-direction: column; align-items: stretch; }
  .v21-silence-actions .btn { width: 100%; }
}

/* An opacity scrim over the desk for one minute. It sits inside #app-main at z-index 45: above the board, the rail
   and an open job (30), and below every welfare layer (the job's welfare band 46, the board's 48, the welfare
   view 60, the cover's 160), so a live welfare band always stays on top and solid. It never takes a click. */
.v21-silence-scrim { position: fixed; inset: 0; z-index: 45; background: var(--scrim, rgba(12,16,13,.32)); opacity: 0; pointer-events: none; transition: opacity 600ms var(--ease-inout, ease-in-out); }
.v21-silence-scrim.is-on { opacity: 1; }
:root[data-calm="on"] .v21-silence-scrim { transition-duration: 120ms; }

/* ---------- C6: the birthday card ---------- */

.v21-bday-sprig { align-self: start; }
.v21-bday-fern { margin-top: 4px; }

/* ---------- C6: Settings, Days to remember ---------- */

.v21-dates { min-width: 0; }
.v21-dates-hint, .v21-dates-msg { margin: 0; }
.v21-dates-msg:empty { display: none; }
.v21-date-row { display: grid; gap: 6px; min-width: 0; }
.v21-date-label { font-weight: 600; color: var(--ink); }
.v21-date-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.v21-date-ctrl .btn { min-height: 44px; }
.v21-select, .v21-date { min-height: 44px; max-width: 100%; box-sizing: border-box; padding: 0 12px; border-radius: 12px; border: 1px solid var(--edge-strong); background: var(--solid); color: var(--ink); }
.v21-date { min-width: 0; }
:root[data-theme="high_contrast"] .v21-select, :root[data-theme="high_contrast"] .v21-date { border: 2px solid #000; }

/* ---------- Profile sections (C6 milestones, A3 the season) ---------- */

.v21-prof { display: grid; gap: 10px; min-width: 0; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--glass-rim); }
.v21-prof h3 { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.v21-prof p { margin: 0; }
.v21-prof-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.v21-prof-sub { margin: 4px 0 0; font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.v21-prof-list, .v21-tally { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.v21-prof-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.v21-prof-text { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.v21-prof-name { font-weight: 600; color: var(--ink); }
.v21-tally li { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- A3: the season line and the season tint ---------- */

.v21-season-line { margin: 0; }
/* FL-05: the season tints only the Clear panel's sweep (at most 8 percent, from the art kit's season.css).
   Without the art it is transparent; High contrast is always transparent. Never text, a job or a status. */
:root[data-season] .clear .sweep { background-color: var(--season-tint, transparent); }
:root[data-theme="high_contrast"] .clear .sweep { background-color: transparent; }

/* ---------- A3: the finale ---------- */

.v21-finale { position: relative; display: grid; justify-items: center; text-align: center; gap: 8px; max-width: 100%; min-width: 0; box-sizing: border-box; overflow: hidden; }
.v21-finale-spray { justify-self: end; max-width: 100%; }
.v21-finale-spray svg { width: 320px; height: 120px; max-width: 100%; }
.v21-finale-medal svg { width: 96px; height: 96px; }
.clear .v21-finale-title, .v21-finale-title { margin: 0; font-size: 1.75rem; line-height: 2.125rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.v21-finale-line { margin: 0; max-width: 44ch; font-size: .9375rem; line-height: 1.4375rem; color: var(--ink-2); }
.v21-finale-thanks { color: var(--ink); font-weight: 600; }
.v21-finale-next { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 4px 0 0; }
.v21-finale-peek { opacity: .4; }
.v21-finale .v21-cal-actions { justify-content: center; width: 100%; }

/* ---------- welfare first and the quiet period ---------- */

/* The core hides every [data-v21="game"] while data-quiet is on; these lines keep this package's own pieces hidden
   even before the core's stylesheet loads. Commemoration pieces hide only during a live welfare message, which the
   page itself handles (and the core marks with data-v21-welfare). */
:root[data-quiet="on"] .v21-season-line[data-v21="game"],
:root[data-quiet="on"] .v21-cal-card[data-v21="game"],
:root[data-quiet="on"] .v21-finale[data-v21="game"] { display: none; }
:root[data-v21-welfare="on"] .v21-day-motif,
:root[data-v21-welfare="on"] .v21-silence-scrim { display: none; }

/* ---------- motion, forced colours ---------- */

@media (prefers-reduced-motion: reduce) {
  .v21-silence-scrim { transition-duration: 120ms; }
}
:root[data-motion="reduced"] .v21-silence-scrim { transition-duration: 120ms; }
@media (forced-colors: active) {
  .v21-select, .v21-date { border: 1px solid CanvasText; }
  .v21-silence-scrim { background: Canvas; }
  .v21-silence-scrim.is-on { opacity: .6; }
}
