/* r13-history.css — release 13, Lane L3b: History with the month calendar (the phone layout), the day card and the list.
   Rules start with :root[data-look='new'] and use the --r13-* tokens of r13-base.css (light, dark, the palettes, right to left by
   logical properties). Loaded after r13-base.css and before look.css. The website arrangement is Lane L3c's (r13-web.css). */

/* ── the classic History inside the new frame: its own title, switch, weigh-ins line and calendar give way to the new pieces ── */
:root[data-look='new'] .r13-history-classic>h1,:root[data-look='new'] .r13-history-classic>.page-date,
:root[data-look='new'] .r13-history-classic>.title-act,:root[data-look='new'] .r13-history-classic>.history-switch,
:root[data-look='new'] .r13-history-classic>.weigh-ins-moved{display:none}
/* the phone: the whole classic calendar card; the website keeps its day panel (edit tools) for Lane L3c and drops only its month */
:root[data-look='new'] .r13-frame[data-layout='phone'] .r13-history-classic .calendar{display:none}
:root[data-look='new'] .r13-frame[data-layout='web'] .r13-history-classic .calendar-month{display:none}
/* the release 13 gate: inside the new website frame the classic History is ONE column (the new month and day panel are the frame's
   own); its three-column website grid pushed the day panel past the main column */
:root[data-look='new'] .r13-frame[data-layout='web'] .r13-history-classic .history-view[data-history-view=Workouts]:not([hidden]){display:flex;flex-direction:column;gap:var(--r13-gap);min-width:0}
:root[data-look='new'] .r13-frame[data-layout='web'] .r13-history-classic .history-view .calendar-day{max-width:100%;min-width:0;box-sizing:border-box}
:root[data-look='new'] .r13-history-classic{display:flex;flex-direction:column;gap:var(--r13-gap);min-width:0}

/* ── the switch and the weigh-ins line ── */
:root[data-look='new'] .r13-history-top{display:flex;flex-direction:column;gap:6px;min-width:0}
:root[data-look='new'] .r13-history-switch{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;width:100%;margin:0}
:root[data-look='new'] .r13-weigh-ins{margin:0;font-size:13px;color:var(--r13-muted)}

/* ── the month calendar ── */
:root[data-look='new'] .r13-cal{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border-radius:var(--r13-card-radius);background:var(--r13-surface);min-width:0}
:root[data-look='new'] .r13-cal-top{display:flex;align-items:center;gap:6px}
:root[data-look='new'] .r13-cal-top h2{flex:1;margin:0;font-size:17px;font-weight:700;color:var(--r13-ink)}
:root[data-look='new'] .r13-cal-steps{display:flex;gap:6px}
:root[data-look='new'] .r13-cal-step{display:grid;place-items:center;min-width:44px;min-height:44px;border-radius:50%;background:var(--r13-sunk);color:var(--r13-ink)}
:root[data-look='new'][dir='rtl'] .r13-cal-step svg{transform:scaleX(-1)}
:root[data-look='new'] .r13-cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;min-width:0}
/* the release 13 gate: below 360 px the month runs edge to edge (as the classic calendar does), so each day stays a 44 px target */
@media (max-width:359px){:root[data-look='new'] .r13-cal{margin-inline:calc(2px - var(--kgym-gutter));padding-inline:2px;border-radius:0}
  :root[data-look='new'] .r13-cal-top{padding-inline:10px}:root[data-look='new'] .r13-cal-grid{gap:1px}}
:root[data-look='new'] .r13-cal-head{text-align:center;font-size:13px;color:var(--r13-muted);padding-block:2px}
:root[data-look='new'] .r13-cal-day{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:44px;
  aspect-ratio:auto;max-width:none;width:100%;padding:2px 0;border:0;border-radius:12px;background:transparent;color:var(--r13-ink);font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}
/* today ringed, the chosen day dark */
:root[data-look='new'] .r13-cal-day.is-today{background:transparent;color:var(--r13-ink);box-shadow:inset 0 0 0 2px var(--r13-accent)}
:root[data-look='new'] .r13-cal-day[aria-pressed='true'],:root[data-look='new'] .r13-cal-day.is-today[aria-pressed='true']{background:var(--r13-ink);color:var(--r13-surface);box-shadow:none}
:root[data-look='new'] .r13-cal-marks{display:flex;gap:3px;min-height:8px}
:root[data-look='new'] .r13-mark{display:inline-block;width:8px;height:8px;border-radius:50%;vertical-align:middle}
:root[data-look='new'] .r13-mark.is-workout{background:var(--r13-met)}
:root[data-look='new'] .r13-mark.is-cardio{border-radius:2px;background:var(--r13-low)}
:root[data-look='new'] .r13-mark.is-planned{box-shadow:inset 0 0 0 1.5px var(--r13-accent)}
:root[data-look='new'] .r13-cal-day[aria-pressed='true'] .r13-mark.is-planned{box-shadow:inset 0 0 0 1.5px var(--r13-surface)}
:root[data-look='new'] .r13-cal-names{display:flex;flex-direction:column;gap:1px;width:100%;font-size:13px;font-weight:400;line-height:1.2;overflow:hidden}
:root[data-look='new'] .r13-cal-names span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
:root[data-look='new'] .r13-cal-legend{display:flex;flex-wrap:wrap;gap:14px;margin:4px 0 0;font-size:13px;color:var(--r13-muted)}

/* ── the chosen day's card ── */
:root[data-look='new'] .r13-day{display:flex;flex-direction:column;gap:8px;padding:8px 12px;border-radius:var(--r13-card-radius);background:var(--r13-surface);min-width:0}
:root[data-look='new'] .r13-day-title{margin:0;font-size:15px}
:root[data-look='new'] .r13-day-workout{display:flex;flex-direction:column;gap:8px;min-width:0}
:root[data-look='new'] .r13-day-workout+.r13-day-workout{padding-top:8px;border-top:1px solid var(--r13-line)}
:root[data-look='new'] .r13-day-row{display:flex;align-items:center;gap:8px;min-width:0}
:root[data-look='new'] .r13-day-figure{flex:none;width:64px;min-width:0}
:root[data-look='new'] .r13-day-figure .r13-figure,:root[data-look='new'] .r13-day-figure svg:not(.r13-fg-defs){width:100%;height:auto}
:root[data-look='new'] .r13-day-figure .map-legend,:root[data-look='new'] .r13-day-figure .map-caption,
:root[data-look='new'] .r13-day-figure .map-side.side-back{display:none}
:root[data-look='new'] .r13-day-figure .body-map{display:block;margin:0;padding:0}
:root[data-look='new'] .r13-day-figure .map-side{display:block;width:100%;margin:0}
:root[data-look='new'] .r13-day-words{flex:1;min-width:0}
:root[data-look='new'] .r13-day-words h3{margin:0;font-size:15px;line-height:1.3;color:var(--r13-ink);overflow-wrap:anywhere}
:root[data-look='new'] .r13-day-meta{margin:2px 0 0;font-size:13px;color:var(--r13-muted)}
:root[data-look='new'] .r13-day-open{flex:none}
:root[data-look='new'] .r13-day-acts{margin:0;padding:0;list-style:none;font-size:14px;display:flex;flex-direction:column;gap:4px}
:root[data-look='new'] .r13-day-planned{margin:0;font-size:14px;color:var(--r13-ink)}

/* ── the workout page (the classic page, opened from the day card) ── */
:root[data-look='new'] .r13-frame[data-page] .r13-history-classic .day-summary{border-radius:var(--r13-card-radius)}
