/* The Dashboard page only. Its panels, alerts and notes are shared: see "Panels, alerts and notes" in base.css. */

#dashLogFlight[hidden] { display: none; }

/* Today: panels of their own rather than one card holding everything */
#todayView.today-card { width: 100%; padding: 0; background: none; border: 0; box-shadow: none; }
#todayView.today-card:hover { background: none; border: 0; box-shadow: none; transform: none; }
#todayContainer { display: flex; flex-direction: column; gap: 12px; }
#todayContainer > .pm-announcement { margin: 0; }

/* The greeting and plan, under the page title */
.dash-greeting { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 2px; }
.dash-greeting b { font-weight: 600; color: var(--text-soft); }
.today-greeting { font-size: 18px; font-weight: 700; color: var(--text); }
.today-plan { font-size: 13px; font-weight: 500; color: var(--muted); }
.today-plan span { color: var(--muted); }
.today-plan.is-soon { color: var(--alert-soon); }

/* Next flight and the forecast */
.dash-hero { display: flex; flex-wrap: wrap; gap: 12px; }
.dash-next { flex: 3 1 340px; display: flex; flex-direction: column; }
.dash-weather { flex: 4 1 380px; }
.dash-weather-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.dash-weather-head small { margin: 0; }
.dash-weather-field { font-size: 15px; font-weight: 700; color: var(--text); }
.dash-weather-field .wx-cat { margin: 0 0 0 8px; font-size: 12px; vertical-align: 1px; }
.dash-weather details { margin-top: 10px; font-size: 12px; }
.dash-weather summary { cursor: pointer; color: var(--muted); }
.dash-weather code { display: block; margin-top: 4px; white-space: pre-wrap; font-size: 12px; color: var(--muted); }
.today-preflight-link { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; text-decoration: none; }
.today-preflight-link:hover { text-decoration: underline; }

/* Your training: readouts, what's next and the fact, in one card */
.dash-training .card-header { margin-bottom: 12px; }
.dash-training h2 { margin: 0; font-size: 15px; font-weight: 700; }
.today-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding-bottom: 16px; }
.today-stat { padding: 0 16px; background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
.today-stat:first-child { padding-left: 0; border-left: 0; }
.today-stat span { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.today-stat b { margin-top: 2px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.today-stat b em { font-size: 13px; font-style: normal; font-weight: 500; color: var(--muted); }
.today-stat small { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.today-bar { height: 6px; margin-top: 8px; border-radius: 3px; background: var(--line-light); overflow: hidden; }
.today-bar-fill { height: 100%; border-radius: 3px; background: var(--next); }
.today-bar-fill.done { background: var(--green); }

/* The next milestone beside the projected finish */
.dash-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 32px; padding: 16px 0; border-top: 1px solid var(--line); }
.dash-pair > div { min-width: 0; }
.dash-finish-date { margin-top: 6px; font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.today-milestone { margin-top: 6px; }
.today-milestone-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 16px; color: var(--text); }
.today-milestone-head span { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.today-milestone-next { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* "Did you know?": the foot of the card, nothing like an alert */
.dash-fact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.dash-fact p { flex: 1 1 260px; margin: 0; }
.dash-fact b { font-weight: 600; color: var(--text-soft); }

.today-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Celebrations and Wrapped: quiet panels too */
#todayContainer .story-celebrate { margin: 0; background: var(--card); border: 1px solid var(--line); box-shadow: none; }

/* Totals, inside the streak card: plain figures, no colours of their own */
.dash-totals { margin-top: 14px; border-top: 1px solid var(--line); }
/* Each figure's line is shifted left and the grid clips the first in each row, whatever the column count or hidden figures */
.dash-totals .stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 0; margin-left: -14px; padding: 14px 0; overflow: hidden; }
.dash-totals .stat { margin-left: -1px; padding: 0 14px; background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
.dash-totals .stat b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-totals .stat span { margin-top: 2px; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.dash-totals .stat b .sub-text { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: none; }

#streakContainer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
#streakContainer .plan-details { flex: 2 1 240px; margin: 0; }
.streak-flame { flex: none; font-size: 44px; line-height: 1; }
.streak-hero { display: flex; align-items: center; gap: 14px; flex: 1 1 170px; padding: 0; margin: 0; background: none; border: 0; box-shadow: none; }
.streak-hero.cold { background: none; }
.streak-hero.cold .streak-flame { filter: grayscale(1); opacity: 0.5; }
.streak-value { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.streak-label { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.streak-week { font-size: 13px; }
.streak-week b { color: var(--alert-soon); }
.streak-week.done b { color: var(--green); }

/* Records: plain tiles; a new record is the one thing marked */
#recordsCard .record-tile { background: none; }
#recordsCard .record-tile b { font-size: 16px; font-weight: 700; }
#recordsCard .record-tile span { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }
#recordsCard .record-tile .record-when { font-size: 12px; }
.cal-title { font-size: 14px; }

/* On shared profiles (no Deadlines) the streak card has the row to itself */
.grid:has(> #deadlinesCard.hidden) > #streakCard { grid-column: span 12; }

@media (max-width: 900px) {
  .today-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; }
  .today-stat:nth-child(odd) { padding-left: 0; border-left: 0; }
}

@media (max-width: 600px) {
}

/* Two figures to a row on a phone */
@media (max-width: 600px) {
  .dash-totals .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
