/* r13-web.css — release 13, Lane L3c: the WEBSITE layout (900 px and wider) of every new-look screen (src/client/r13/web/*).
   Website-only rules: every rule sits inside @media (min-width:900px) and starts with :root[data-look='new'], using the --r13-*
   tokens of r13-base.css. Loaded after the other r13 sheets and before look.css.
   The owner's rule: the website has its OWN layout, never the phone column stretched. The frame (frame.ts, r13-base.css) draws
   up to three columns — .r13-side (the workout's path list), .r13-main, .r13-aside — and each screen's arrangement decides what
   goes where; this sheet gives each screen its own column widths (blueprint v2: Morning 1.15 : 1, the workout 300 | set | 360,
   History and Done the panel beside the large month or figure). From 900 to 1199 px (the side rail takes 216 px) a three-column
   screen keeps the path list on the left and puts the right column under the middle one; History keeps a floor under its large
   month and, below 1100 px, puts the chosen day under the month. Nothing here is fixed over the page
   (owner rule 2: the rest bar is an ordinary block under the set) and the shell's side rail is never touched. */

@media (min-width:900px){
  /* nothing wider than its column: every column and every piece in it may shrink */
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13-cols>*{min-width:0}
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13-cols>*>*{max-width:100%;min-width:0}

  /* a group of pieces kept together inside one column (web/default.ts `columns`) */
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-group{display:flex;flex-direction:column;gap:var(--r13-gap);box-sizing:border-box}
  /* Morning: the week body with "Why today" beside it, wrapping under it when the column is narrow */
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-figrow{flex-direction:row;flex-wrap:wrap;align-items:flex-start;gap:16px}
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-figrow>:first-child{flex:0 1 300px;min-width:0}
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-figrow>:not(:first-child){flex:1 1 220px;min-width:0}
  /* Finish: Coach's picks, the cardio to finish and the stretches side by side, as many as the width holds */
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-touches{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));align-items:start}

  /* Morning: two columns — the plan and the week body | the fixes, the exercises, Start */
  :root[data-look='new'] .r13-frame[data-r13='plan'][data-layout='web'] .r13-cols.has-aside{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}

  /* the workout (Warm up, Lift): the path list | the step or the set (the rest bar under it) | the live body, last times */
  :root[data-look='new'] .r13-frame[data-r13='warmup'][data-layout='web'] .r13-cols.has-side.has-aside,
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-cols.has-side.has-aside{grid-template-columns:minmax(220px,23%) minmax(0,1fr) minmax(260px,28%);gap:20px}

  /* Finish: the path list | the finishing touches */
  :root[data-look='new'] .r13-frame[data-r13='finish'][data-layout='web'] .r13-cols.has-side{grid-template-columns:minmax(220px,26%) minmax(0,1fr);gap:20px}

  /* Done and Your week: the large figure | the numbers (Done) or each short muscle with Close the week (Your week) */
  :root[data-look='new'] .r13-frame[data-r13='done'][data-layout='web'] .r13-cols.has-aside,
  :root[data-look='new'] .r13-frame[data-r13='week'][data-layout='web'] .r13-cols.has-aside{grid-template-columns:minmax(0,1fr) minmax(320px,38%)}
  :root[data-look='new'] .r13-frame[data-r13='done'][data-layout='web'] .r13-main .r13-figure,
  :root[data-look='new'] .r13-frame[data-r13='week'][data-layout='web'] .r13-main .r13-figure{inline-size:min(100%,620px);margin-inline:auto}

  /* History: the large month | the chosen day's panel */
  :root[data-look='new'] .r13-frame[data-r13='history'][data-layout='web'] .r13-cols.has-aside{grid-template-columns:minmax(0,1fr) minmax(320px,36%)}

  /* ── walk 13 M7: the main action in sight at 1280 × 800 without a scroll ── */
  /* Morning: Start (with Edit and Other plans) stays at the foot of the window while the exercises run long under it — the same
     dock as the phone's, at the foot of the right column; at the column's end it sits in its own place under the exercises */
  :root[data-look='new'] .r13-frame[data-r13='plan'][data-layout='web'] .r13-aside>.r13-plan-dock{position:sticky;bottom:0;z-index:2;
    padding-block:14px 16px;background:linear-gradient(to bottom,transparent,var(--r13-paper) 14px)}
  /* Lift, the middle column made compact as the blueprint draws it ("Website · A set"): the five tools as one row of icon and word,
     kg and reps side by side (− 12 kg +), "last time" one short line, the chips one short row; the why line is said once, in the
     right column's "Why this dose" (the same words, the same source: cardWhy) */
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-main>*{margin-block:0}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-tools{justify-content:space-between;flex-wrap:nowrap;gap:4px}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-tools>.icon-action,
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-tools>.r13-tool{flex-direction:row;align-items:center;gap:6px;min-height:44px}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web']:has(.r13-aside .r13-next) .r13-exhead>.r13-why{display:none}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-steppers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-steppers:has(>:only-child){grid-template-columns:minmax(0,1fr)}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-stepper{min-width:0;padding:6px;gap:4px}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-step-num{flex-wrap:nowrap;max-width:100%}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-step-box{width:3.6ch;font-size:30px}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-step-unit{font-size:13px}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-step-last{min-height:0}
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] button.r13-step-last{min-height:44px} /* a tap target is 44 px (the page policy; the gate saw 32) */
  /* the room the 44 px 'last time' buttons take comes from the card's own spacing, so ✓ and the running rest bar stay in the window */
  /* the running rest bar keeps its own place under the set (the owner's rule: rest never covers anything; the gate saw a sticky
     bar laid over the set card on the website, so it is not pinned) */
}

/* ── RELEASE 15 ENHANCED: the one workout screen (web/live.ts, approved picture 6; spec §2 "Website") ──
   Its own three columns, keyed on the arrangement's groups (.r13w-live), whatever stop the screen is drawn for: the whole
   workout | the head line and the exercise being done (all sets, the inline rest) | This week and Short this week. EVERYTHING
   INSIDE THE 1280 x 800 WINDOW: each column is at most the window's height under the title line (--r13-live-top) and scrolls on
   its own, sticky under the title line, so the page never runs past the window and a long list or a long week never pushes the
   set, its ✓ or the rest row out of sight. Nothing is fixed over the page; the rest row is an ordinary row inside the middle
   column (owner rule 2). The head band the frame keeps empty once the bar is the middle column's head line is not drawn. */
@media (min-width:900px){
  :root[data-look='new'] .r13-frame[data-layout='web']:has(.r13w-live){--r13-live-top:106px;--r13-live-foot:34px}
  :root[data-look='new'] .r13-frame[data-layout='web']:has(.r13w-live)>.r13-head:empty{display:none}
  :root[data-look='new'] .r13-frame[data-layout='web']:has(.r13w-live):has(>.r13-head:not(:empty)){--r13-live-top:186px}
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-live{gap:var(--r13-gap)}
  /* the bar as the middle column's head line, one line: "Today · 21:54 of 48 min" between pause and ⚑ Finish (picture 6) */
  /* release 16 LIVEFIX2 (the rehearsal's web 3b): a row — the workout look's column rule (r13-workout.css) stacked it in three lines and the
     one-line bar clipped them */
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-live-main .r13-wbar-clock{display:inline-flex;flex-direction:row;align-items:baseline;gap:.35em;white-space:nowrap}
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-live-main .r13-wbar-clock::before{content:'Today ·'}
  /* one line, its own height (#23; the gate measured 68 px: the 52 px line plus 8 px padding above and below): 4 px each side = 60 */
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-live-main .r13-wbar{padding-block:4px}
  :root[data-look='new'] .r13.r13-frame[data-layout='web']:has(.r13w-live)>.r13-cols{grid-template-columns:minmax(220px,24%) minmax(0,1fr) minmax(250px,27%);gap:16px;align-items:start}
  /* her pregnancy day (her card first in the right column, every stop sign open): the right column is wider, so her whole card
     stands inside the window beside Start, as release 15 approved it */
  :root[data-look='new'] .r13.r13-frame[data-layout='web']:has(.r13w-live-aside>[data-live-piece='her'])>.r13-cols{grid-template-columns:minmax(210px,21%) minmax(0,1fr) minmax(340px,39%)}
  /* the whole workout's rows in the narrow left column: the name on its own line (words never cut), − n + or Skip under it */
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-live-side .r15e-row:not(.is-open){grid-template-columns:28px minmax(0,1fr);row-gap:2px}
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-live-side .r15e-row:not(.is-open)>:nth-child(n+3){grid-column:2;justify-self:start}
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-live-side .r15e-name b,
  :root[data-look='new'] .r13-frame[data-layout='web'] .r13w-live-side .r15e-detail{overflow-wrap:break-word}
  :root[data-look='new'] .r13.r13-frame[data-layout='web']:has(.r13w-live)>.r13-cols>*{position:sticky;top:var(--r13-live-top);max-block-size:calc(100dvh - var(--r13-live-top) - var(--r13-live-foot));
    overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
}

/* 900 to 1199 px: the side rail leaves about 630 to 930 px, too narrow for three columns — the right column goes under the middle
   one, the path list stays on the left beside both; the two-column screens give their panel a little more room */
@media (min-width:900px) and (max-width:1199px){
  :root[data-look='new'] .r13-frame[data-r13='warmup'][data-layout='web'] .r13-cols.has-side.has-aside,
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-cols.has-side.has-aside{grid-template-columns:minmax(200px,34%) minmax(0,1fr)}
  :root[data-look='new'] .r13-frame[data-r13='warmup'][data-layout='web'] .r13-cols.has-side.has-aside>.r13-side,
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-cols.has-side.has-aside>.r13-side{grid-row:1 / span 2}
  :root[data-look='new'] .r13-frame[data-r13='warmup'][data-layout='web'] .r13-cols.has-side.has-aside>.r13-aside,
  :root[data-look='new'] .r13-frame[data-r13='lift'][data-layout='web'] .r13-cols.has-side.has-aside>.r13-aside{grid-column:2}
  :root[data-look='new'] .r13-frame[data-r13='finish'][data-layout='web'] .r13-cols.has-side{grid-template-columns:minmax(200px,34%) minmax(0,1fr)}
  :root[data-look='new'] .r13-frame[data-r13='done'][data-layout='web'] .r13-cols.has-aside,
  :root[data-look='new'] .r13-frame[data-r13='week'][data-layout='web'] .r13-cols.has-aside{grid-template-columns:minmax(0,1fr) minmax(280px,42%)}
  /* History: the large month keeps a floor (readable day cells with their names); the day panel takes what is left */
  :root[data-look='new'] .r13-frame[data-r13='history'][data-layout='web'] .r13-cols.has-aside{grid-template-columns:minmax(520px,1fr) minmax(280px,1fr)}
}

/* 900 to 1199 px, the one workout screen: three columns do not fit beside the side rail — the whole workout keeps the left
   column (its own scroll, inside the window); the exercise being done with This week under it share the right column, which
   scrolls with the page */
@media (min-width:900px) and (max-width:1199px){
  :root[data-look='new'] .r13.r13-frame[data-layout='web']:has(.r13w-live)>.r13-cols{grid-template-columns:minmax(200px,34%) minmax(0,1fr)}
  :root[data-look='new'] .r13.r13-frame[data-layout='web']:has(.r13w-live)>.r13-cols>.r13-side{grid-row:1 / span 2}
  :root[data-look='new'] .r13.r13-frame[data-layout='web']:has(.r13w-live)>.r13-cols>:not(.r13-side){position:static;max-block-size:none;overflow:visible}
  :root[data-look='new'] .r13.r13-frame[data-layout='web']:has(.r13w-live)>.r13-cols>.r13-aside{grid-column:2}
}

/* 900 to 1099 px: too narrow for the large month beside the day panel — History stacks, the chosen day under the month */
@media (min-width:900px) and (max-width:1099px){
  :root[data-look='new'] .r13-frame[data-r13='history'][data-layout='web'] .r13-cols.has-aside{grid-template-columns:minmax(0,1fr)}
}
