/* All my learning (life.js). Uses the app's own colors (app.css tokens), so every look,
 * light and dark, solid and glass, and every chosen color applies here too.
 * How many times something was learned is five shades: not yet, 1, 2, 3, and 4 or more, named
 * --times1 to --times4 (audit 11-21, F13: as --t1 to --t4 they took the place of the app's type
 * sizes of the same names, so every size here written with them was lost) */
.life { --times1: color-mix(in srgb, var(--accent) 22%, var(--surface)); --times2: color-mix(in srgb, var(--accent) 48%, var(--surface));
  --times3: var(--accent); --times4: color-mix(in srgb, var(--accent) 45%, var(--ink)); --times4-ink: var(--surface); --times4-edge: var(--accent); }
:root[data-theme="dark"] .life { --times1: color-mix(in srgb, var(--accent) 25%, var(--surface)); --times2: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
:root:not([data-theme="dark"]) .life { --times4-ink: #fff8ea; }
:root:not([data-theme="dark"]) .life .t3 { color: #fff8ea; }   /* the light looks' surface can be see-through: the darkest shade keeps solid light words */
.life h1 { margin: 0; }
.life .note { margin: -5px 0 0; }
.life .t0 { background: transparent; color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
.life .t1 { background: var(--times1); color: var(--ink); border: 1px solid transparent; }
.life .t2 { background: var(--times2); color: var(--ink); border: 1px solid transparent; }
.life .t3 { background: var(--times3); color: var(--accent-ink); border: 1px solid transparent; }
.life .t4 { background: var(--times4); color: var(--times4-ink); border: 1.5px solid var(--times4-edge); }
.life .now { outline: 2px dashed var(--accent); outline-offset: -2px; }
.life-he { font-family: var(--book); font-weight: 700; direction: rtl; }
.life-loading { padding: 34px 0; text-align: center; }

/* rings */
.life { container-type: inline-size; }
.life-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* large text: the six boxes go two or one to a row, always even, and the rings grow with the text */
@container (max-width: 21rem) { .life-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 13rem) { .life-rings { grid-template-columns: minmax(0, 1fr); } }
.life-ringbox { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 13px 5px 13px;
  color: var(--ink); font: inherit; cursor: pointer; text-align: center; }
.life-ringbox small { font-size: var(--t_2); color: var(--muted); line-height: 1.25; }
.life-ringwrap { position: relative; width: 4.75rem; height: 4.75rem; }
.life-ring { width: 4.75rem; height: 4.75rem; display: block; }
.life-ring circle { fill: none; stroke-width: 8; }
.life-ring .track { stroke: color-mix(in srgb, var(--accent) 16%, transparent); }
.life-ring .fill { stroke: var(--accent); stroke-linecap: round; }
.life-ringtext { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.life-ringtext b { font-size: var(--t0); }
.life-ringtext small { font-size: var(--t_3); }
.life-ringname { font-size: var(--t_1); line-height: 1.2; overflow-wrap: anywhere; max-width: 100%; }
.life-add { justify-content: center; gap: 8px; color: var(--accent); border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); }
.life-add b { font-size: var(--t_1); font-weight: 600; }
.life-plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; }
/* hold a ring and drag it to a new place (Hudi 11-23, F38), as the cards on the home screen */
.life-rings > [data-ring] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; transition: transform .18s ease; }
.life-rings.life-dragging > [data-ring] { touch-action: none; }
.life-rings > .life-lifted { position: relative; z-index: 30; transition: none; box-shadow: 0 21px 34px rgba(0,0,0,.28), 0 0 0 2px var(--accent) !important; }
@media (prefers-reduced-motion: reduce) { .life-rings > [data-ring] { transition: none; } }
/* a ring's own page ends with Remove this ring, in the gold of a text button */
.life-ringremove { display: block; margin: 13px auto 0; }
.life-plus svg, .life-addhere svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* lists */
.life-list { display: flex; flex-direction: column; padding: 13px 21px 8px; }
.life-h { font-size: var(--t0); margin-bottom: 5px; }
.life-row { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: none;
  color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.life-h + .life-row, .life-rowtop + .life-row, .life-grouptitle + .life-row { border-top: 0; }
.life-row:disabled { cursor: default; opacity: 1; }
.life-rowtop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.life-name { font-weight: 600; }
.life-bar { display: block; height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 16%, transparent); overflow: hidden; }
.life-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.life-grouptitle { margin-top: 8px; font-size: var(--t_2); font-weight: 600; color: var(--muted); }
.life-other { flex-direction: row; align-items: center; gap: 13px; }
.life-otherbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.life-otherbody .life-he { font-size: var(--t0); }
.life-chip { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: var(--t_2); }
.life-chip.big { width: 46px; height: 46px; font-size: var(--t0); }
.life-round { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
.life-round > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.life-round small { font-size: var(--t_1); line-height: 1.35; overflow-wrap: anywhere; }
.life-edit { color: var(--accent); font-weight: 600; font-size: var(--t_1); }
.life-addhere { margin: 5px 0 8px; gap: 8px; justify-content: center; }
/* Same gold as the "Add a ring" tile (Hudi 11-10) */
#life .life-addhere { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

/* hours each year */
.life-years { display: flex; justify-content: center; align-items: flex-end; gap: 8px; height: 92px; padding-bottom: 5px; }
.life-years span { flex: 1; max-width: 44px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; font-size: var(--t_3); }
.life-years i { width: 100%; border-radius: 5px 5px 2px 2px; background: var(--accent); }

/* a collection's map and a sefer's squares */
.life-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 5px 8px; }
.life-title h1 { min-width: 0; overflow-wrap: anywhere; }
.life-title .life-he { font-size: var(--t3); }
.life-sum { display: flex; flex-direction: column; gap: 5px; padding: 13px 21px; }
.life-sum > b { font-size: var(--t1); }
.life-sum > span { font-size: var(--t_1); color: var(--muted); }
.life-legend { display: flex; flex-wrap: wrap; gap: 5px 13px; font-size: var(--t_2); color: var(--muted); }
.life-legend span { display: inline-flex; align-items: center; gap: 5px; }
.life-legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; box-sizing: border-box; }
.life-legend i.now { outline: none; border: 2px dashed var(--accent); }
/* a collection's seforim: the app's neat list with its checks (Hudi 11-11, 11-12) */
.life-maplist .life-maptimes { flex: none; margin-inline-start: auto; font-weight: 600; }
.life-itemhead { display: flex; justify-content: space-between; align-items: center; gap: 13px; }
.life-itemhead h1 { font-size: var(--t6); text-align: end; }
.life-summary { margin: -5px 0 0 !important; font-size: var(--t0); }
.life-grids { padding: 13px; display: flex; flex-direction: column; gap: 13px; }
.life-sec { display: flex; flex-direction: column; gap: 5px; }
.life-sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.life-sechead .life-he { font-size: var(--t0); text-align: end; }
/* every square is a button at least 48px across (audit 11-21, F14: ten to a row left them 29px on a
   phone), as many to a row as fit: six on most phones, ten on an iPad; larger text, larger squares */
.life-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(48px, 3rem), 1fr)); gap: 5px; direction: rtl; }
.life-cell { appearance: none; margin: 0; padding: 0; aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font: inherit; font-family: var(--book);
  font-size: var(--t_1); font-weight: 700; box-sizing: border-box; cursor: pointer; }
.life-cell:active { transform: scale(.92); }

/* adding a time */
.life-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.life-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.life-two > * { min-width: 0; }
/* From and Until, one above the other, so each shows its whole place (perek and hilchos) */
.life-range { display: flex; flex-direction: column; gap: 8px; }
.life-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 13px; border-radius: 13px; font: inherit;
  font-size: var(--t0); font-weight: 600; color: var(--ink); background: var(--raised); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); cursor: pointer; }
.life-pill.on { background: var(--accent-soft); border: 1.5px solid var(--accent); }
.life-formname { font-size: var(--t4); }
.life-details { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 8px 13px; border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); background: var(--raised); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.life-details > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.life-details small { font-size: var(--t_1); }
.life-fielderr { color: var(--danger); font-weight: 600; }   /* a finish year still to come (audit 11-21, F39) */
.life-arrow { color: var(--accent); }
.life select { width: 100%; min-height: 46px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--raised); color: var(--ink); font-size: var(--t0); padding: 0 8px; }

/* the way in, on the home screen (Hudi 11-09, option C): three rings, and My statistics under them */
.home-life { display: block; width: 100%; margin-top: 13px; padding: 21px 21px 13px; color: var(--ink); font: inherit; text-align: start; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--accent) 90%, transparent); }
.home-life-top { display: flex; align-items: center; gap: 8px; }
.home-life-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-life-text b { font-family: var(--book); font-size: var(--t2); color: var(--accent); }
.home-life-text small { color: var(--muted); font-size: var(--t_1); }
.home-life-top > svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.home-life-rings { display: flex; justify-content: space-around; gap: 5px; margin-top: 13px; }
.home-life-rings:empty { display: none; }
/* a tap anywhere on the card is a tap on the card, even while the rings are redrawn */
.home-life > * { pointer-events: none; }
.home-life-ring { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.home-life-ringwrap { position: relative; width: 4.1rem; height: 4.1rem; }
.home-life-ringwrap .life-ring { width: 100%; height: 100%; }
.home-life-ringwrap b { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--t_1); }
.home-life-ring small { font-size: var(--t_2); text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.home-life-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 13px; padding-top: 8px; text-align: center;
  border-top: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.home-life-stats[hidden] { display: none; }
.home-life-stats b { display: block; color: var(--accent); font-size: var(--t1); }
.home-life-stats small { display: block; font-size: var(--t_3); color: var(--muted); line-height: 1.25; overflow-wrap: anywhere; }
.add-siyum { margin-top: 8px; }
.life-more summary { display: flex; justify-content: space-between; align-items: center; min-height: 32px; cursor: pointer; list-style: none; }
.life-more summary::-webkit-details-marker { display: none; }
.life-more[open] summary { margin-bottom: 8px; }
/* the same drawn arrow as the app's list boxes (Hudi 11-10: one look everywhere) */
.life-arrow { flex: none; width: 8px; height: 8px; margin: 0 5px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-3px) rotate(45deg); font-size: 0; }
.life-arrow.up { transform: translateY(2px) rotate(-135deg); }

/* the add list: the app's own neat rows with a check (Hudi 11-11) */
.life-pickframe { margin-top: 5px; }
.life-picklist { overflow: visible; }   /* the page scrolls, as in the app's chooser (Hudi 11-12: one design) */
.life-pickhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 13px 21px 5px; border-top: 1px solid var(--line); color: var(--accent); font-size: var(--t_1); letter-spacing: .02em; }
.life-pickhead:first-child { border-top: 0; }
.life-picklist .part-pick small { margin-inline-start: auto; }
.life-picklist .part-pick { padding-inline-end: 0; }
.life-groupgo svg { transition: transform .15s ease; }
.life-groupgo.open svg { transform: rotate(90deg); }
:root[dir="rtl"] .life-groupgo svg { transform: scaleX(-1); }
:root[dir="rtl"] .life-groupgo.open svg { transform: rotate(90deg); }
.life-groupkids { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.life-groupkids .pick-row { padding-inline: 34px 55px; }   /* its checks under the group's check */
.life-picknext { margin-top: 0; }

.life-times { margin-top: 5px; }
.life-timesval { font-size: var(--t3); font-weight: 700; color: var(--ink); }
.life-times .step-btn:disabled { opacity: .35; cursor: default; }
.life-nowrap { white-space: nowrap; }
.life-itemhead :is(.text-btn, .small-btn) { white-space: nowrap; flex: none; }
/* what a time was learned with: small gold tags (Hudi 11-11) */
.life-withtags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 5px 0 2px; }
.life-withtags small { font-size: var(--t_2); }
.life-withtags i { font-style: normal; font-family: var(--book); font-size: var(--t_1); line-height: 1; padding: 5px 8px 5px; border-radius: 99px; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* Next and Save float at the bottom like the app's other pinned buttons (Hudi 11-09 rule, audit 11-11):
   no strip across the screen, and the page ends below them so they never cover the last row */
.life-foot { position: sticky; bottom: 0; z-index: 2; margin-top: 13px; padding: 21px 0 calc(13px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.life-foot > * { pointer-events: auto; }
.life-foot .btn { margin: 0 auto; max-width: 588px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .22)); }
.life-foot .btn:disabled { opacity: 1; filter: saturate(.3) brightness(1.08) drop-shadow(0 8px 14px rgba(0, 0, 0, .16)); color: color-mix(in srgb, var(--accent-ink) 55%, transparent); }
.life .btn.danger-text { margin-top: 21px; }
.life-gospace { flex: none; width: 48px; }
.life-kidsnote { padding: 8px 34px; }
.life-maplist .part-pick { padding-inline-end: 0; }

/* every list here is the app's own list (setup.js g-list, Hudi 11-12) */
#life .g-list .life-pickhead { padding: 13px 0 5px; }
#life .g-list .life-pickhead + .g-li { border-top: 0; }
#life .life-kid { padding-inline-start: 21px; }
#life .life-subrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#life .life-subrow small { color: var(--muted); font-size: var(--t_2); font-weight: 600; }
#life .g-seder-open { margin: -13px 0 -13px; }
#life .g-seder-open.open .g-li-end { transform: rotate(90deg); }
html[dir="rtl"] #life .g-seder-open.open .g-li-end { transform: scaleX(-1) rotate(90deg); }
#life .g-li-tick > * { grid-area: 1 / 1; }
#life .g-li-check.some .g-li-tick { border-color: var(--accent); }
#life .g-li-check.some .g-li-tick::after { content: ""; grid-area: 1 / 1; width: 10px; height: 2px; border-radius: 1px; background: var(--accent); }
#life .life-gfoot { margin-bottom: 0; }
#life .life-with .g-list { padding: 0 2px; }
#life .life-secrow .g-li-en b { color: var(--accent); }   /* a whole section, like "All of Seder ..." (Hudi 11-12) */
/* a collection's seforim as tiles shaded by times learned (Hudi 11-06, brought back 11-15) */
.life-group { padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.life-grouphe { font-size: var(--t0); }
.life-tiles { display: flex; flex-wrap: wrap; gap: 5px; direction: rtl; }
.life-tile { font-family: var(--book); font-size: var(--t0); padding: 5px 8px; min-height: 44px; border-radius: var(--r-sm); display: inline-flex; gap: 5px;
  align-items: center; cursor: pointer; }
.life-tile small { font-family: var(--ui); font-size: var(--t_3); font-weight: 700; }

/* proportions, bolder (Hudi 11-16): the All my learning card on the home page */
.home-life { margin-top: 21px; padding: 21px; }
.home-life-text b { font-size: var(--t4); }
.home-life-text { gap: 5px; }
.home-life-rings { margin-top: 21px; }

/* marking what was learned (Hudi 11-19): Edit, then each tap is one more time; Undo and Done */
.life-editbar { position: sticky; top: 8px; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 13px; margin: 8px 0 13px; border: 1.5px solid var(--accent); }
.life-editbar p { margin: 0; font-size: var(--t_1); line-height: 1.45; }
.life-editbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.life-editbtns .btn { min-height: 44px; }
.life-tiles.editing .life-tile:active { transform: scale(.92); }
.life-tiles.editing .life-tile { outline: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
.life-grids.editing .life-cell { outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
/* a section's name is a framed button in edit mode: one tap marks the whole section once (Hudi 11-19) */
.life-secbtn { appearance: none; font: inherit; color: var(--ink); width: 100%; min-height: 44px; padding: 8px 13px; margin: 0; border-radius: 8px; cursor: pointer; align-items: center;
  background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent); }
.life-secbtn:active { transform: scale(.98); }
/* every square names its own perek, daf or siman (Hudi 11-19) */
.life-lbl { line-height: 1; white-space: nowrap; }

/* a square's record: the app's sheet, with the list of each time in it (audit 11-21, F17; Hudi 11-22) */
.life-sheet .life-list { padding: 5px 21px; }
.life-sheet .life-list > .life-row:first-child { border-top: 0; }
.life-sheet .life-list[hidden] { display: none; }
/* one time learned, alike in the sefer's list and in a square's record: which time, when, where it
   came from, a framed button at its end */
.life-timerow { min-height: 52px; }
.life-timerow > span:first-child { flex: 1; }
.life-timerow small.muted { text-align: start; margin: 0; }
.life-timerow .small-btn { flex: none; }
.life-timerow.removed b { color: var(--muted); font-weight: 600; }
.life-timerow .pill.cal-tag { padding: 1px 8px; margin-inline-start: 3px; line-height: 1.5; color: color-mix(in srgb, var(--accent) 60%, var(--ink)); }
.life-nw { white-space: nowrap; }
