/* Explore → Labs (views/labs.js): the review card of a report read. Each row is a small card on a phone (keep,
   name, value and unit on one line; the printed range and the report's flag under them), so nothing sits behind a
   sideways scroll at 390 px; from 640 px the rows line up as one table-like grid under a header. Colours come from
   the tokens in style.css only; the range reads low to high left to right in Hebrew too (dir="ltr" on .labs-lohi). */
.labs-date{max-inline-size:200px}
/* Save stays at the bottom of the screen while the review is open (a report is 55 rows, ten screens at 390 px):
   sticky, so it stops above the bottom bar (70 px, the + rising 12 px over it, as Log's Save in log.css) and returns
   to its place under the last row; from 900 px and on a phone on its side the bar is a rail at the side. */
.labs-save{position:sticky;bottom:calc(env(safe-area-inset-bottom) + 90px);z-index:2;margin-inline:-6px;padding:8px 6px;background:var(--surface);border-top:1px solid var(--line);border-radius:var(--rm)}
/* one row, Save filling it after Cancel, so the pinned bar covers one button's height of the rows, not two */
form .labs-save.actions:has(>.btn.acc){flex-direction:row;align-items:center}
.labs-save>.btn.acc{flex:1 1 auto}
@media (min-width:900px),(max-height:499px) and (min-width:560px){.labs-save{bottom:calc(env(safe-area-inset-bottom) + 12px)}}
.labs-ocr{white-space:pre-wrap}
.labs-rv{display:flex;flex-direction:column;gap:8px}
.labs-rv-head{display:none}
.labs-rv-row{display:grid;grid-template-columns:44px minmax(0,1fr) 3.5rem 4.25rem;grid-template-areas:"keep name val unit" ". rng rng rng";gap:6px;align-items:center;padding:6px;border:1px solid var(--line);border-radius:var(--rm);background:var(--surface)}
.labs-keep{grid-area:keep;display:flex;align-items:center;justify-content:center;inline-size:48px;block-size:48px;cursor:pointer}
.labs-name{grid-area:name}
.labs-val{grid-area:val}
.labs-unit{grid-area:unit}
.labs-rv-row input:not([type=checkbox]){min-block-size:48px;padding-inline:6px}
.labs-rng{grid-area:rng;display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.labs-cap{font-size:.78rem;font-weight:700;color:var(--mut)}
.labs-lohi{display:inline-flex;align-items:center;gap:6px;color:var(--mut)}
.labs-lohi input{inline-size:5rem}
@media (min-width:640px){
  .labs-rv{gap:4px}
  .labs-rv-head,.labs-rv-row{display:grid;grid-template-columns:44px minmax(9rem,1fr) 5.5rem 6rem 11.5rem 11rem;grid-template-areas:"keep name val unit rng flag";gap:8px;align-items:center}
  .labs-rv-head{padding-inline:6px;font-size:.78rem;font-weight:700;color:var(--mut)}
  .labs-rv-row{padding-block:4px;border-width:0 0 1px;border-radius:0;background:none}
  .labs-rng{display:contents}
  .labs-lohi{grid-area:rng}
  .labs-rng .badge{grid-area:flag;justify-self:start}
  .labs-cap{display:none}
}
/* The review row's category and its unit note (a value printed without a unit): under the row, the full width. */
.labs-catg{margin-inline-start:auto}
.labs-unote{grid-column:1/-1;margin:0}
.labs-unote.warn{color:var(--d)}
@media (min-width:640px){.labs-rng .labs-catg{grid-column:1/-1;margin:0}}
/* The results by category (views/lab-results.js): a marker is a line (name, value, pill; its printed range and date
   under it, the change since the report before), its spark line at the end; opened, what it is and every result. */
.lab-units{max-inline-size:280px}
.lab-item{border-block-start:1px solid var(--line);padding-block:8px}
.lab-item:first-of-type{border-block-start:0}
.lab-item>summary{display:flex;align-items:center;gap:10px;cursor:pointer;list-style:none}
.lab-item>summary::-webkit-details-marker{display:none}
.lab-item .grow{flex:1 1 auto;min-inline-size:0;display:flex;flex-direction:column;gap:2px}
.lab-item .spark{display:block;inline-size:120px;max-inline-size:100%;block-size:34px;margin-block-start:2px}
/* a result's arrow is the closed card's (fold.css draws it on every summary inside a card) and turns with its own
   result, not with the card around it, so a shut result inside an open category points down */
.lab-item>summary::after{flex:none}
.lab-item[open]>summary::after{transform:rotate(-135deg)}
[dir=rtl] .lab-item[open]>summary::after{transform:rotate(135deg)}
.lab-results details.fc .tt small{white-space:normal;overflow:visible}
/* a category's summary runs under its title and under the pill and the arrow too, so a summary such as "LDL
   cholesterol high (printed range 0 to 100); 1 more in range" keeps the card's width instead of a narrow column */
.lab-results details.fc>summary{grid-template-areas:"ic tt pill ar" "ic sub sub sub";row-gap:2px}
.lab-results details.fc>summary>.rowic{grid-area:ic}
.lab-results details.fc>summary>.tt{display:contents}
.lab-results details.fc>summary>.tt>b{grid-area:tt}
.lab-results details.fc>summary>.tt>small{grid-area:sub}
.lab-results details.fc>summary>:not(.rowic,.tt){grid-area:pill}
.lab-results details.fc>summary::after{grid-area:ar}
/* a result's history row keeps each value whole (its date, its value with the unit, its range): the cells line up
   as a wrapping row, so at 390 px a value that does not fit moves to the next line whole, with the delete button last */
.lab-item .tablewrap tr{display:flex;flex-wrap:wrap;align-items:center;border-bottom:1px solid var(--line)}
.lab-item .tablewrap td{white-space:nowrap;padding:6px;border:0}
.lab-item .tablewrap td:empty{display:none}
.lab-item .tablewrap tr:last-child{border-bottom:0}
.lab-item .tablewrap td:last-child{margin-inline-start:auto}
.lab-top{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
.lab-val{font-weight:800;font-variant-numeric:tabular-nums}
.lab-about{margin:6px 0}
.lab-ask{margin-block-end:4px}
