/* CertaRounds — Planner screen styles (src/screens/planner.js). Owned by the Planner agent.
   Semantic tokens only (docs/COMPONENTS.md §2). Everything is scoped under .pl* classes;
   component and widget internals are laid out, never restyled. */

/* ============ Frame & rhythm ============ */
.pl { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }

/* ============ Header ============ */
.pl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); min-width: 0; padding-top: var(--sp-1); }
.pl-head__text { min-width: 0; }
.pl-head__title {
  font-size: var(--fs-30);
  line-height: 1.12;
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
}
.pl-head__sub { margin-top: 6px; font-size: var(--fs-15); line-height: 1.45; color: var(--text-2); max-width: 60ch; }
.pl-head__adjust { flex: 0 0 auto; margin-top: 2px; }

/* ============ Countdown + this week ============ */
.pl-count { display: flex; flex-direction: column; min-width: 0; }
.pl-count__top { display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }
.pl-count__ring { flex: 0 0 auto; }
.pl-count__gem {
  flex: 0 0 auto;
  display: inline-grid; place-items: center;
  width: var(--pl-ring, 76px); height: var(--pl-ring, 76px);
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--border);
}
.pl-count__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.pl-count__label { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-2); line-height: 1.3; }
.pl-count__value {
  font-size: var(--fs-17);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-snug);
  line-height: 1.3;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.pl-count__value--empty { color: var(--text-strong); }
.pl-count__phase { margin: 4px 0 2px; }
.pl-count__note { font-size: var(--fs-13); line-height: 1.45; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pl-count__set { margin-top: var(--sp-2); }
.pl-count__row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px var(--sp-2); margin-top: 4px; }
.pl-count__row .pl-count__phase { margin: 0; }
.pl-count--compact .pl-count__top { gap: var(--sp-3); }
.pl-week .pl-count__week { margin-top: 0; padding-top: 0; border-top: 0; }

.pl-count__facts { margin: 0; display: flex; flex-direction: column; }
.pl-fact { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--divider); }
.pl-fact__l { font-size: var(--fs-13); color: var(--text-2); white-space: nowrap; }
.pl-fact__v { margin: 0; font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-strong); text-align: right; font-variant-numeric: tabular-nums; }
.pl-count__week { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--divider); }
.pl-count__weekhead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.pl-count__h { font-size: var(--fs-15); font-weight: var(--fw-bold); letter-spacing: var(--tracking-snug); color: var(--text-strong); }
.pl-count__weekmeta { font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============ Today — the real prescription ============ */
.pl-today { display: flex; flex-direction: column; min-width: 0; container-type: inline-size; }
.pl-today__head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.pl-today__gem { display: inline-flex; flex: 0 0 auto; }
.pl-today__titles { flex: 1 1 auto; min-width: 0; }
.pl-today__over {
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-accent);
  line-height: 1.3;
}
.pl-today__title {
  margin-top: 2px;
  font-size: var(--fs-20);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-snug);
  line-height: 1.25;
  color: var(--text-strong);
}
.pl-today__meta { margin-top: 2px; font-size: var(--fs-15); line-height: 1.4; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pl-today__meta strong { color: var(--text-strong); font-weight: var(--fw-semibold); }
.pl-dot { margin: 0 6px; color: var(--text-3); }

.pl-today__why { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--divider); }
.pl-today__labelrow { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 24px; margin-bottom: 4px; }
.pl-today__label {
  font-size: var(--fs-12); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--text-3);
}
.pl-today__why .link-more { font-size: var(--fs-13); }
.pl-today__why .link-more:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
.pl-today__text { font-size: var(--fs-15); line-height: 1.5; color: var(--text-2); margin-top: var(--sp-3); }
.pl-today__why .pl-today__text { margin-top: 0; font-size: var(--fs-13); }
.pl-today__bar { margin-top: var(--sp-4); }
.pl-today__focus { margin-top: var(--sp-2); font-size: var(--fs-13); line-height: 1.45; color: var(--text-2); }
.pl-today__focus-l { color: var(--text-3); font-weight: var(--fw-medium); }
.pl-today__topic { display: inline; }
.pl-today__rest { display: flex; align-items: flex-start; gap: var(--sp-2); margin-top: var(--sp-3); font-size: var(--fs-13); line-height: 1.45; color: var(--text-2); }
.pl-today__rest .icon { flex: 0 0 auto; margin-top: 1px; color: var(--text-3); }
.pl-today__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-4); }
.pl-today__actions > .btn { flex: 1 1 auto; }
.pl-today__actions > .btn--primary { flex-grow: 3; }

/* the mix: an inline sentence… */
.pl-mix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--sp-3); font-size: var(--fs-13); line-height: 1.5; color: var(--text-2); }
.pl-mix__item { min-width: 0; }   /* a two-column mini grid: no separator can dangle at a line end (R1 P2) */
.pl-mix__n { color: var(--text-strong); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* …and a stat strip, only when every figure fits on ONE row (R5 P1: a figure is never orphaned on a
   second row). Up to four figures from a 520 px card; five from 610 px (1440 desktops); six or more,
   and five on narrower cards (1280–1366), keep the two-column list above. Labels stay on one line. */
@container (min-width: 520px) {
  .pl-today :is(.pl-mix--1, .pl-mix--2, .pl-mix--3, .pl-mix--4) { display: flex; flex-wrap: nowrap; gap: 0; margin: var(--sp-2) 0 0 calc(-1 * var(--sp-4)); overflow: hidden; }
  .pl-today :is(.pl-mix--1, .pl-mix--2, .pl-mix--3, .pl-mix--4) .pl-mix__item { flex: 1 0 auto; display: flex; flex-direction: column; gap: 2px; margin-left: -1px; padding: 0 var(--sp-5) 0 var(--sp-4); border-left: 1px solid var(--divider); min-width: 0; }
  .pl-today :is(.pl-mix--1, .pl-mix--2, .pl-mix--3, .pl-mix--4) .pl-mix__n { font-size: var(--fs-24); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); line-height: 1.15; }
  /* the same words as the phone list and Home ("4 from weak topics" = questions, R3 P1) */
  .pl-today :is(.pl-mix--1, .pl-mix--2, .pl-mix--3, .pl-mix--4) .pl-mix__l { display: block; font-size: var(--fs-13); line-height: 1.35; white-space: nowrap; }
  .pl-today :is(.pl-mix--1, .pl-mix--2, .pl-mix--3, .pl-mix--4) .pl-mix__l::first-letter { text-transform: uppercase; }
}
@container (min-width: 610px) {
  .pl-today .pl-mix--5 { display: flex; flex-wrap: nowrap; gap: 0; margin: var(--sp-2) 0 0 calc(-1 * var(--sp-4)); overflow: hidden; }
  .pl-today .pl-mix--5 .pl-mix__item { flex: 1 0 auto; display: flex; flex-direction: column; gap: 2px; margin-left: -1px; padding: 0 var(--sp-4) 0 var(--sp-4); border-left: 1px solid var(--divider); min-width: 0; }
  .pl-today .pl-mix--5 .pl-mix__n { font-size: var(--fs-24); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); line-height: 1.15; }
  .pl-today .pl-mix--5 .pl-mix__l { display: block; font-size: var(--fs-13); line-height: 1.35; white-space: nowrap; }
  .pl-today .pl-mix--5 .pl-mix__l::first-letter { text-transform: uppercase; }
}

/* ============ Shared: rest dot, flag pill, plan note ============ */
.pl-rest-dot {
  display: inline-grid; place-items: center;
  width: var(--pl-art, 32px); height: var(--pl-art, 32px);
  border-radius: 50%;
  border: 1.5px dashed var(--border-control);
  color: var(--text-3);
  flex: 0 0 auto;
}
.pl-flag { white-space: nowrap; }
.pl-plan-note { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-13); line-height: 1.45; color: var(--text-2); }
.pl-plan-note .icon { flex: 0 0 auto; margin-top: 1px; color: var(--text-accent); }

/* ============ Agenda (phone, tablet, desktop < 1200) ============ */
.pl-agenda { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; margin-top: var(--sp-2); }
.pl-agenda__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px var(--sp-3); }
.pl-agenda__title { font-size: var(--fs-20); font-weight: var(--fw-bold); letter-spacing: var(--tracking-snug); color: var(--text-strong); line-height: 1.3; }
.pl-agenda__totals { font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pl-agenda__sub { font-size: var(--fs-13); line-height: 1.45; color: var(--text-2); }
.pl-agenda .pl-plan-note { margin-top: 2px; }
.pl-agenda__group { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.pl-agenda__week {
  padding-left: 4px;
  font-size: var(--fs-12); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--text-3); line-height: 1.3;
}
.pl-agenda__card { overflow: hidden; }
.pl-agenda__list > li + li { border-top: 1px solid var(--divider); }

.pl-row {
  display: grid;
  grid-template-columns: 40px 32px minmax(0, 1fr) auto 18px;
  align-items: center;
  column-gap: var(--sp-3);
  width: 100%;
  min-height: 68px;
  padding: 12px 14px 12px 10px;
  text-align: left;
  color: var(--text);
  transition: background var(--dur-1) var(--ease-out);
}
.pl-row:hover { background: var(--surface-hover); }
.pl-row:active { background: var(--surface-pressed); }
.pl-row:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.pl-agenda__list > li:first-child .pl-row:focus-visible { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.pl-agenda__list > li:last-child .pl-row:focus-visible { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.pl-row__date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.pl-row__dow { font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-3); }
.pl-row__num { margin-top: 2px; font-size: var(--fs-20); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.pl-row__art { display: inline-flex; justify-content: center; }
.pl-row__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pl-row__flag {
  font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--text-3); line-height: 1.35;
}
.pl-row__title { font-size: var(--fs-15); font-weight: var(--fw-semibold); line-height: 1.3; color: var(--text-strong); overflow-wrap: break-word; }
.pl-row__sub { font-size: var(--fs-13); line-height: 1.4; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pl-row__chev { color: var(--text-3); justify-self: end; }
.pl-row--rest .pl-row__title { font-weight: var(--fw-medium); color: var(--text-2); }
.pl-row--rest .pl-row__num { color: var(--text-2); }
.pl-row--exam .pl-row__flag { color: var(--success-strong); }
.pl-row--exam { background: var(--success-bg); }
.pl-row--exam:hover { background: var(--success-bg); box-shadow: inset 0 0 0 999px var(--surface-hover); }
.pl-row--mock .pl-row__flag, .pl-row--final .pl-row__flag, .pl-row--final-review .pl-row__flag { color: var(--text-accent); }

/* ============ Day detail (docked panel and sheet) ============ */
.pl-detail { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.pl-detail__head { display: flex; align-items: flex-start; gap: var(--sp-3); min-width: 0; }
.pl-detail__art { display: inline-flex; flex: 0 0 auto; }
.pl-detail__titles { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-detail__over { display: flex; align-items: center; flex-wrap: wrap; gap: 6px var(--sp-2); }
.pl-detail__date { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-2); }
.pl-detail__title {
  font-size: var(--fs-20);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-snug);
  line-height: 1.25;
  color: var(--text-strong);
  overflow-wrap: break-word;
}
.pl-detail__sub { font-size: var(--fs-15); line-height: 1.4; color: var(--text-2); }
.pl-detail__why { font-size: var(--fs-15); line-height: 1.55; color: var(--text-2); max-width: 70ch; }
.pl-detail__note { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-13); line-height: 1.45; color: var(--text-2); max-width: 70ch; }
.pl-detail__note .icon { flex: 0 0 auto; margin-top: 1px; color: var(--text-3); }
.pl-detail__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pl-detail__today { display: flex; flex-direction: column; gap: var(--sp-4); }
.pl-detail__group { display: flex; flex-direction: column; gap: 6px; }
.pl-detail__h {
  font-size: var(--fs-12); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--text-3); line-height: 1.3;
}
.pl-detail__list { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: var(--fs-15); line-height: 1.5; max-width: 70ch; }

/* stats: value over label */
.pl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.pl-stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: 0 var(--sp-3); min-width: 0; }
.pl-stat:first-child { padding-left: 0; }
.pl-stat + .pl-stat { border-left: 1px solid var(--divider); }
.pl-stat__v { margin: 0; font-size: var(--fs-20); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); line-height: 1.15; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.pl-stat__l { font-size: var(--fs-13); line-height: 1.35; color: var(--text-2); }

/* sheet: stats in a quiet well, actions stacked on phones */
.pl-detail--sheet .pl-stats { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); }
@media (max-width: 767px) {
  .pl-detail--sheet .pl-detail__actions { flex-direction: column; align-items: stretch; }
  .pl-detail--sheet .pl-detail__actions > .btn { width: 100%; }
}

/* ============ Calendar (desktop ≥ 1200) ============ */
.pl-cal { display: flex; flex-direction: column; min-width: 0; }
.pl-cal .w-head { margin-bottom: var(--sp-4); }
.pl-cal__totals { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-cal .pl-plan-note { margin: calc(-1 * var(--sp-1)) 0 var(--sp-4); }
.pl-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }

.pl-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-width: 0; min-height: 156px;
  padding: 12px 12px 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
  text-align: left;
  transition: background var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.pl-tile:hover { background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--border-hover); }
.pl-tile:active { background: var(--surface-pressed); }
.pl-tile:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--border-hover), var(--focus-ring); }
.pl-tile__date { display: flex; align-items: baseline; gap: 6px; width: 100%; line-height: 1.2; }
.pl-tile__dow { font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-3); }
.pl-tile__num { font-size: var(--fs-17); font-weight: var(--fw-bold); letter-spacing: var(--tracking-snug); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-tile__art { display: inline-flex; margin: 4px 0 2px; }
.pl-tile__head {
  font-size: var(--fs-13); font-weight: var(--fw-semibold); line-height: 1.3; color: var(--text-strong);
  overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pl-tile__tag { font-size: var(--fs-12); line-height: 1.35; color: var(--text-2); overflow-wrap: break-word; }   /* wraps, never ellipsized (D6/D18) */
/* ink-3 measures under 4.5:1 on tinted tiles: step up to ink-2 there (R1 P2) */
.pl-tile.is-today .pl-tile__foot, .pl-tile--mock .pl-tile__foot, .pl-tile--exam .pl-tile__foot,
.pl-tile--mock .pl-tile__dow, .pl-tile--exam .pl-tile__dow { color: var(--text-2); }
.pl-tile__foot { margin-top: auto; padding-top: 4px; font-size: var(--fs-12); line-height: 1.3; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pl-tile__flag { font-weight: var(--fw-semibold); }

/* kinds */
/* today = lavender fill + "Today"; the open day = violet outline (never two outlines, R1 P2) */
.pl-tile.is-today { background: var(--selected-bg); box-shadow: none; }
.pl-tile.is-today .pl-tile__flag { color: var(--text-accent); }
.pl-tile.is-today .pl-tile__dow { color: var(--text-accent); }
.pl-tile--rest { background: transparent; box-shadow: none; outline: 1.5px dashed var(--border-strong); outline-offset: -1.5px; }
.pl-tile--rest:hover { background: var(--surface-hover); box-shadow: none; }
.pl-tile--rest .pl-tile__head { color: var(--text-2); font-weight: var(--fw-medium); }
.pl-tile--rest .pl-tile__num { color: var(--text-2); }
.pl-tile--mock { background: var(--accent-soft); box-shadow: none; }
.pl-tile--mock .pl-tile__status { color: var(--accent-soft-fg); font-weight: var(--fw-medium); }
.pl-tile--exam { background: var(--success-bg); box-shadow: inset 0 0 0 1px var(--success-border); }
.pl-tile--exam .pl-tile__flag { color: var(--success-strong); }
/* selected: the strongest ring wins over every kind */
.pl-tile.is-selected { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow-card); }
.pl-tile.is-selected:not(.pl-tile--mock):not(.pl-tile--exam):not(.is-today) { background: var(--surface); }
.pl-tile--rest.is-selected { outline-color: transparent; }
.pl-tile.is-selected:focus-visible { box-shadow: inset 0 0 0 2px var(--primary), var(--focus-ring); }

.pl-cal__detail { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--divider); }
.pl-cal__detail .pl-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, auto);
  grid-template-areas: "head stats" "body body" "note actions";
  column-gap: var(--sp-7);
  row-gap: var(--sp-4);
  align-items: start;
}
.pl-cal__detail .pl-detail__head { grid-area: head; }
.pl-cal__detail .pl-stats { grid-area: stats; min-width: 300px; padding-top: 6px; }
.pl-cal__detail .pl-detail__why, .pl-cal__detail .pl-detail__today { grid-area: body; }
.pl-cal__detail .pl-detail__note { grid-area: note; align-self: center; }
.pl-cal__detail .pl-detail__actions { grid-area: actions; justify-content: flex-end; align-self: center; }
.pl-cal__detail .pl-detail__today { flex-direction: row; gap: var(--sp-7); }
.pl-cal__detail .pl-detail__today > .pl-detail__group { flex: 1 1 0; min-width: 0; }

/* ============ Adjust sheet ============ */
.pl-adjust { display: flex; flex-direction: column; gap: var(--sp-6); }
.pl-adjust__sec { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.pl-adjust__h { font-size: var(--fs-15); font-weight: var(--fw-bold); color: var(--text-strong); }
.pl-adjust__none { display: flex; margin-top: 2px; }
.pl-adjust__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pl-daytog {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; min-height: 56px;
  border-radius: var(--r-md);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
  color: var(--text-3);
  font-size: var(--fs-13); font-weight: var(--fw-medium);
  transition: background var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.pl-daytog:hover { background: var(--surface-hover); box-shadow: inset 0 0 0 1.5px var(--border-hover); }
.pl-daytog:active { background: var(--surface-pressed); }
.pl-daytog:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--border-hover), var(--focus-ring); }
.pl-daytog.is-on { background: var(--selected-bg); box-shadow: inset 0 0 0 1.5px var(--selected-border); color: var(--text-accent); font-weight: var(--fw-semibold); }
.pl-daytog.is-on:focus-visible { box-shadow: inset 0 0 0 1.5px var(--selected-border), var(--focus-ring); }
.pl-daytog__l { line-height: 1.2; }
.pl-adjust__foot { display: flex; justify-content: flex-end; gap: var(--sp-3); width: 100%; }
@media (max-width: 767px) { .pl-adjust__foot > .btn:last-child { flex: 1 1 auto; } }

/* ============ Tablet ≥ 768 ============ */
@media (min-width: 768px) {
  .pl { gap: var(--sp-5); }
  .pl-head { align-items: flex-end; }
  .pl-head__title { font-size: var(--fs-36); line-height: 1.1; }
  .pl-head__sub { font-size: var(--fs-17); }
  .pl-count__value { font-size: var(--fs-20); }
  .pl-today__title { font-size: var(--fs-24); }
  .pl-today__meta { font-size: var(--fs-17); }
  .pl-today__why .pl-today__text, .pl-today__focus { font-size: var(--fs-15); }
  .pl-row { grid-template-columns: 44px 36px minmax(0, 1fr) auto 18px; min-height: 72px; padding: 14px 18px 14px 14px; }
}

/* ============ Desktop ≥ 1024 ============ */
@media (min-width: 1024px) {
  .pl { gap: var(--sp-6); }
  .pl-head { padding-top: 0; }
  /* the cards hug their content: no dead band above Start (R1 P2) */
  /* each card ends with its content: no blank bands inside the exam card (R4 P2) */
  .pl-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: var(--sp-6); align-items: start; }
  /* the card matches the Today card's height: its blocks sit at the top and "This week" at the foot */
  .pl-count--wide .pl-count__top { padding-bottom: var(--sp-5); }
  .pl-count--wide .pl-count__facts, .pl-count--wide .pl-count__why { margin-bottom: var(--sp-4); }
  .pl-today__actions { margin-top: var(--sp-5); }
}

/* ============ Exam day (a milestone moment: small Dr. Round) ============ */
.pl-today__examrow { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); min-width: 0; }
.pl-today__examtext { flex: 1 1 auto; min-width: 0; }
.pl-today__mascot { flex: 0 0 auto; display: inline-flex; margin: calc(-1 * var(--sp-2)) 0 calc(-1 * var(--sp-2)); }
@media (min-width: 1024px) and (max-width: 1199px) {
  .pl-top { grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); }
}

/* ============ F1 additions ============ */
/* Study days as the pattern they are (R1 P1): filled letter = study day, dashed moon = rest day */
.pl-pattern { display: inline-flex; gap: 4px; }
.pl-pattern__d {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; font-weight: var(--fw-bold); line-height: 1;
}
.pl-pattern__d.is-on { background: var(--accent-soft); color: var(--accent-soft-fg); }
.pl-pattern__d.is-off { color: var(--text-3); border: 1.5px dashed var(--border-control); }

/* E13: today's optional extra round */
/* a divider row inside the Today card, not a third card depth (R3 P2); Start stays on the title row */
.pl-extra {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-top: var(--sp-4); padding-top: var(--sp-4);
  border-top: 1px solid var(--divider);
  min-width: 0;
}
.pl-extra__art { display: inline-flex; flex: 0 0 auto; }
.pl-extra__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pl-extra__over { font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-2); line-height: 1.35; }
.pl-extra__title { font-size: var(--fs-15); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.3; overflow-wrap: break-word; }
.pl-extra__sub { font-size: var(--fs-13); color: var(--text-2); line-height: 1.4; }
.pl-extra__go { flex: 0 0 auto; }

/* agenda rows: minutes on the right, eyebrow only on non-suggested days */
.pl-row__meta { font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* the day sheet focuses its title (not the state-changing action); a title is not a control */
.pl-detail__title:focus { outline: none; }

/* ============ F3 additions ============ */
/* D18: Focus exactly as Home shows it — phone line "Focus: <first> +N", wider cards topic chips + "+N more" */
.pl-today__more { white-space: nowrap; color: var(--text-2); font-weight: var(--fw-semibold); }
.pl-focus { margin-top: var(--sp-3); min-width: 0; }
.pl-focus__label { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-strong); margin-bottom: var(--sp-2); }
.pl-focus__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); min-width: 0; }
.pl-focus__chips > li { min-width: 0; }
.pl-focus__more { display: inline-flex; align-items: center; font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-2); padding: 0 var(--sp-1); }

/* "How it was chosen": 26 px tall + the link's 10 px halo = a 46 px target (D7) */
.pl-today__whylink { min-height: 26px; }

/* 1024–1199 (laptops, iPad landscape): the agenda runs two rows across instead of one ~900 px row (R3 P2) */
@media (min-width: 1024px) {
  .pl-agenda__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-agenda__list > li + li { border-top: 0; }
  .pl-agenda__list > li:nth-child(n+3) { border-top: 1px solid var(--divider); }
  .pl-agenda__list > li:nth-child(even) { border-left: 1px solid var(--divider); }
  .pl-agenda__list > li .pl-row:focus-visible { border-radius: 0; }
}
.pl-count__why { margin-top: var(--sp-3); font-size: var(--fs-13); line-height: 1.5; color: var(--text-2); }
.pl-nowrap { white-space: nowrap; }

/* ============ F4 additions ============ */
/* tile grammar = the list rows': specialty · section (weak days) · one status line (R4 P2) */
.pl-tile__status { font-size: var(--fs-12); line-height: 1.35; font-weight: var(--fw-medium); color: var(--text-2); overflow-wrap: break-word; }
.pl-tile--weak .pl-tile__tag { color: var(--text); }
.pl-tile--exam .pl-tile__status { color: var(--success-strong); }
.pl-row__flag--spec { color: var(--text-2); }

/* 1024–1199: an odd day count leaves no empty half-row — the last day spans both columns (R4 P2) */
@media (min-width: 1024px) {
  .pl-agenda__list > li:last-child:nth-child(odd) { grid-column: 1 / -1; border-left: 0; }
}

/* phones: a focused row or button always stops above the tab bar (R4 P2; the shell-wide
   scroll-padding-bottom is routed to the shell) */
@media (max-width: 767px) {
  .pl button, .pl a { scroll-margin-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); }
}

/* desktop: the subtitle takes one line, so the 14-day grid starts higher (R4 P2) */
@media (min-width: 1024px) { .pl-head__sub { max-width: none; } }
@media (min-width: 1024px) { .pl-count--wide .pl-count__why { margin-top: 0; } }
/* 360-class phones: the three sheet stats keep one-line labels ("3 reviews due", R4 P2) */
@media (max-width: 400px) {
  .pl-detail--sheet .pl-stats { padding: var(--sp-3); }
  .pl-detail--sheet .pl-stat { padding: 0 var(--sp-2); }
  .pl-detail--sheet .pl-stat:first-child { padding-left: 0; }
  .pl-detail--sheet .pl-stat__l { white-space: nowrap; }
}
