/* ADR 0031 - living study plan. Prefixes: sp- (plan pages), today- (dashboard slot #0).
   Colours come from the site tokens so the surfaces are theme-aware in light and dark. */

/* ── dashboard "Today" card (slot #0) ─────────────────────────────────────────── */
.today-card {
    border: 1px solid var(--bs-border-color, #e2e2e8);
    border-radius: .7rem;
    padding: .75rem .85rem;
    margin-bottom: .75rem;
    background: var(--bs-card-bg, #fff);   /* was --bs-body-bg: the cream page ground, so the card vanished into it */
}
.today-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.today-eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color, #6b7280); font-weight: 700; }
.today-overdue { font-size: .72rem; font-weight: 700; color: #b4530a; text-decoration: none; }
.today-done { font-size: .86rem; color: var(--bs-secondary-color, #6b7280); margin: .2rem 0 .5rem; }
.today-tasks { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.today-task { display: flex; align-items: center; gap: .5rem; }
.today-task-main { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.today-task-title { font-size: .88rem; font-weight: 600; }
.today-task-min { font-size: .72rem; color: var(--bs-secondary-color, #6b7280); }
.today-task-cta { font-size: .8rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.today-tick {
    width: 1.5rem; height: 1.5rem; flex: 0 0 auto; border-radius: 50%;
    border: 1.5px solid var(--bs-border-color, #cfd2da); background: transparent; color: var(--bs-secondary-color, #9aa0ab);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.today-tick:hover { border-color: var(--bs-primary, #2f4be0); color: var(--bs-primary, #2f4be0); }
.today-tick svg { width: .85rem; height: .85rem; }
.today-see { font-size: .8rem; font-weight: 700; text-decoration: none; }
.today-card--empty .today-done { margin-top: .3rem; }

/* past exam-date nudge (ADR 0031 Appendix C nit) - shown on both the card and the /plan header */
.today-passed, .sp-passed {
    display: inline-block; font-size: .8rem; font-weight: 700; text-decoration: none;
    color: #b4530a; background: rgba(180, 83, 10, .1); border-radius: .35rem; padding: .2rem .5rem;
}
.today-passed { margin-bottom: .5rem; }

/* task accents by kind */
.today-task--mock .today-task-title { color: #7a3ad6; }
.today-task--exam .today-task-title { color: #b4530a; }

/* ── /plan page ───────────────────────────────────────────────────────────────── */
/* White paper surfaces on the page ground (never --bs-body-bg, which IS the cream ground), one accent colour per
   task kind, today full-width, and the weeks as fixed Monday-Sunday grids. */
.sp-shell { max-width: 64rem; }
.sp-back { display: inline-block; margin-bottom: .75rem; font-size: .88rem; font-weight: 600; text-decoration: none; }
.sp-title { font-size: 1.6rem; margin: .15rem 0 0; }
.sp-sub { margin: .3rem 0 0; color: var(--bs-secondary-color); font-size: .9rem; }
.sp-change { font-weight: 600; text-decoration: none; }
.sp-h2 { font-size: 1rem; font-weight: 700; color: var(--bs-heading-color); margin: 0 0 .6rem; display: flex; align-items: baseline; gap: .6rem; }
.sp-h2 span { font-size: .82rem; font-weight: 500; color: var(--bs-secondary-color); }

/* kind accents - one variable, used by the row icon tile, the chip bar and titles */
.sp-kind--practice { --sp-k: 47, 75, 224; }
.sp-kind--review { --sp-k: 14, 143, 110; }
.sp-kind--mock { --sp-k: 122, 58, 214; }
.sp-kind--flashcards { --sp-k: 180, 130, 0; }
.sp-kind--lesson { --sp-k: 47, 127, 214; }
.sp-kind--rest { --sp-k: 120, 128, 140; }
.sp-kind--exam { --sp-k: 196, 90, 16; }
.sp-kind--placement { --sp-k: 47, 75, 224; }
.sp-kind--oscestation { --sp-k: 14, 143, 110; }
.sp-kind--aipatient { --sp-k: 160, 60, 170; }

.sp-hero {
  display: flex; align-items: stretch; justify-content: space-between; gap: 1.5rem;
  background: var(--bs-card-bg); border: 1px solid var(--bs-border-color); border-radius: 16px;
  box-shadow: var(--mx-elevation-sm); padding: 1.25rem 1.4rem; margin-bottom: 1.4rem;
}
.sp-hero-main { flex: 1 1 auto; min-width: 0; }
.sp-week-progress { margin-top: 1rem; max-width: 26rem; }
.sp-week-progress-row { display: flex; justify-content: space-between; font-size: .82rem; color: var(--bs-secondary-color); margin-bottom: .35rem; }
.sp-week-progress-row strong { color: var(--bs-heading-color); }
.sp-bar { height: .45rem; border-radius: 999px; background: var(--bs-tertiary-bg); overflow: hidden; }
.sp-bar span { display: block; height: 100%; border-radius: inherit; background: var(--mx-teal-ink, #0e8f6e); transition: width .3s ease; }
.sp-count {
  flex: 0 0 auto; min-width: 8.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border-radius: 12px; padding: .8rem 1rem; background: rgba(var(--bs-primary-rgb), .07); color: var(--bs-link-color);
}
.sp-count.is-near { background: rgba(196, 90, 16, .09); color: #b4530a; }
.sp-count-num { font-family: var(--mx-font-serif, Georgia, serif); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.sp-count-lbl { font-size: .8rem; font-weight: 600; margin-top: .3rem; }

.sp-today { margin-bottom: 1.6rem; }
.sp-rest-note { color: var(--bs-secondary-color); }
.sp-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .9rem;
  background: var(--bs-card-bg); border: 1px solid var(--bs-border-color); border-left: 4px solid rgb(var(--sp-k));
  border-radius: 12px; padding: .85rem 1rem; margin-bottom: .55rem; box-shadow: var(--mx-elevation-sm);
}
/* Done and skipped read as settled through a quieter ground and the muted ink - never opacity, which took their
   text to 2.4-2.8:1. The "✓ Done" state and the coloured edge still say which. */
.sp-row.is-done, .sp-row.is-skipped { box-shadow: none; background: var(--mx-panel-2, var(--bs-tertiary-bg)); }
.sp-row.is-done .sp-row-title, .sp-row.is-skipped .sp-row-title { color: var(--bs-secondary-color); }
.sp-row-ico {
  width: 2.3rem; height: 2.3rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--sp-k), .1); color: rgb(var(--sp-k));
}
.sp-row-ico svg { width: 1.2rem; height: 1.2rem; }
.sp-row-title { font-weight: 700; color: var(--bs-heading-color); }
.sp-row-detail { font-size: .86rem; color: var(--bs-secondary-color); margin-top: .1rem; }
.sp-row-min { font-size: .78rem; font-weight: 600; color: var(--bs-secondary-color); white-space: nowrap; font-family: var(--mx-font-mono); }
.sp-row-act { display: flex; align-items: center; gap: .7rem; white-space: nowrap; }
.sp-link { background: none; border: 0; padding: 0; font-size: .82rem; color: var(--bs-secondary-color); cursor: pointer; }
.sp-link:hover { color: var(--bs-link-color); text-decoration: underline; }
.sp-state { font-size: .8rem; font-weight: 700; color: var(--bs-secondary-color); }
.sp-state.is-done { color: var(--mx-teal-ink, #0e8f6e); }

.sp-week { margin-bottom: 1.4rem; }
.sp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }   /* one size, whatever the count */
.sp-day {
  background: var(--bs-card-bg); border: 1px solid var(--bs-border-color); border-radius: 12px; box-shadow: var(--mx-elevation-sm);
  padding: .7rem; min-height: 7.5rem; display: flex; flex-direction: column; gap: .45rem;
}
.sp-day.is-today { border-color: rgba(var(--bs-primary-rgb), .7); box-shadow: 0 0 0 1px rgba(var(--bs-primary-rgb), .7) inset, var(--mx-elevation-sm); }
.sp-day.is-rest { background: color-mix(in srgb, var(--bs-card-bg) 55%, transparent); box-shadow: none; }
.sp-day.is-past { background: color-mix(in srgb, var(--bs-card-bg) 55%, transparent); box-shadow: none; }
.sp-day-date { font-size: .8rem; font-weight: 700; color: var(--bs-heading-color); }
.sp-day-date span { color: var(--bs-secondary-color); font-weight: 600; margin-right: .15rem; }
.sp-day.is-today .sp-day-date span { color: var(--bs-link-color); }
.sp-day-rest { font-size: .8rem; color: var(--bs-secondary-color); margin-top: auto; }
/* Exam day is the destination, so it looks like one. */
.sp-day.is-exam { background: rgba(196, 90, 16, .07); border-color: rgba(196, 90, 16, .45); }
.sp-exam { display: flex; flex-direction: column; gap: .2rem; margin-top: auto; color: #b4530a; }
.sp-exam svg { width: 1.4rem; height: 1.4rem; }
.sp-exam strong { font-size: .95rem; }
.sp-exam span { font-size: .75rem; color: var(--bs-secondary-color); }
.sp-chip {
  display: flex; flex-direction: column; gap: .1rem; text-decoration: none;
  border-radius: 8px; padding: .4rem .5rem; background: rgba(var(--sp-k), .08); border-left: 3px solid rgb(var(--sp-k));
}
a.sp-chip:hover { background: rgba(var(--sp-k), .14); text-decoration: none; }
.sp-chip-title { font-size: .78rem; font-weight: 650; line-height: 1.25; color: var(--bs-heading-color); }
.sp-chip-meta { font-size: .7rem; color: var(--bs-secondary-color); }
.sp-chip.is-done { background: rgba(var(--sp-k), .04); }
.sp-chip.is-done .sp-chip-title, .sp-chip.is-skipped .sp-chip-title { color: var(--bs-secondary-color); }
.sp-chip.is-done .sp-chip-meta { color: var(--mx-teal-ink, #0e8f6e); font-weight: 700; }
.sp-chip.is-missed .sp-chip-meta { color: #b4530a; font-weight: 700; }
.sp-chip.is-skipped { background: transparent; }

.sp-foot { display: flex; gap: .6rem; margin-top: 1.2rem; }

@media (max-width: 860px) {
  .sp-grid { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
}
@media (max-width: 600px) {
  .sp-hero { flex-direction: column; }
  .sp-count { flex-direction: row; gap: .6rem; justify-content: flex-start; }
  .sp-row { grid-template-columns: auto minmax(0, 1fr); }
  .sp-row-min { grid-column: 2; }
  .sp-row-act { grid-column: 1 / -1; }
}

/* ── settings + placement ─────────────────────────────────────────────────────── */
/* Each setting is a paper panel; the chips and buttons used to sit loose on the page ground. */
.sp-set-group {
  margin: 0 0 .9rem; padding: 1rem 1.2rem 1.1rem;
  background: var(--mx-nav-card, #fff); border: 1px solid var(--bs-border-color);
  border-radius: 14px; box-shadow: var(--mx-elevation-sm);
}
.sp-set-group > h2, .sp-set-group > .sp-set-label { margin: 0 0 .6rem; font-size: .95rem; font-weight: 700; color: var(--bs-heading-color); }
.sp-set-group > .sp-set-sub { margin-top: 1.1rem; }
.sp-set-actions { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--bs-border-color); }
.sp-set-foot { margin: .4rem 0 0; font-size: .88rem; display: flex; gap: .4rem; align-items: baseline; flex-wrap: wrap; }
.sp-day-toggles, .sp-min-choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.sp-day-toggle, .sp-min-choice { border: 1px solid var(--bs-border-color, #cfd2da); background: var(--mx-nav-card, #fff); color: var(--bs-body-color); border-radius: .45rem; padding: .35rem .7rem; cursor: pointer; font-size: .85rem; }
.sp-day-toggle.is-on, .sp-min-choice.is-on { border-color: var(--bs-primary, #2f4be0); background: var(--bs-primary, #2f4be0); color: #fff; }
.sp-cal-url { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sp-cal-url code { word-break: break-all; }

.sp-place-band { font-size: 1.1rem; font-weight: 800; margin-bottom: .8rem; }
.sp-place-domains { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1rem; }
.sp-place-domain-top { display: flex; justify-content: space-between; font-size: .84rem; }
.sp-place-track { height: .5rem; border-radius: .3rem; background: var(--bs-tertiary-bg, #eceef5); overflow: hidden; margin-top: .2rem; }
.sp-place-fill { height: 100%; background: var(--bs-primary, #2f4be0); }
