/* Accounts and training log. Quiet by design: mono labels, hairlines, no colour unless it carries meaning.
   Token names below are fallbacks; map them to assets/css/tokens.css. */

[hidden] { display: none !important; }

:root {
  --lg-ink: var(--ink, #14110E);
  --lg-paper: var(--paper, #F2EEE6);
  --lg-hair: var(--hair, rgba(20, 17, 14, 0.18));
  --lg-mute: var(--mute, rgba(20, 17, 14, 0.6));
  --lg-accent: var(--red, #C21A12);
  --lg-mono: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  --lg-sans: var(--sans, system-ui, -apple-system, "Segoe UI", sans-serif);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lg-ink: var(--ink, #EDE8DE);
    --lg-paper: var(--paper, #0F1216);
    --lg-hair: var(--hair, rgba(237, 232, 222, 0.16));
    --lg-mute: var(--mute, rgba(237, 232, 222, 0.6));
  }
}
:root[data-theme="dark"] {
  --lg-ink: var(--ink, #EDE8DE);
  --lg-paper: var(--paper, #0F1216);
  --lg-hair: var(--hair, rgba(237, 232, 222, 0.16));
  --lg-mute: var(--mute, rgba(237, 232, 222, 0.6));
}

/* NOTE 2026-11-20: the header account button (.acct-head) went with auth.js
   mount() — the account entry point is the Settings drawer ACCOUNT row, which
   reuses .io-btn in app.css. */

.lg-btn:focus-visible, .lg-link:focus-visible,
.lg-sum:focus-visible, .acct-submit:focus-visible, .acct-switch:focus-visible,
.acct-close:focus-visible, .acct-input:focus-visible, .lg-in:focus-visible,
.lg-note-in:focus-visible, .lg-pick:focus-visible {
  outline: 2px solid var(--lg-accent);
  outline-offset: 2px;
}

/* ---------- account dialog */
.acct {
  border: 1px solid var(--lg-hair);
  background: var(--lg-paper);
  color: var(--lg-ink);
  padding: 0;
  width: min(92vw, 380px);
  font-family: var(--lg-sans);
}
.acct::backdrop { background: rgba(0, 0, 0, 0.45); }
.acct-card { padding: 24px 22px 20px; display: grid; gap: 14px; }
.acct-title { margin: 0; font: 600 20px/1.2 var(--lg-sans); letter-spacing: -0.01em; }
.acct-lede { margin: 0; font-size: 14px; color: var(--lg-mute); line-height: 1.5; }
.acct-form { display: grid; gap: 12px; }
.acct-field { display: grid; gap: 6px; }
.acct-label { font: 500 11px/1 var(--lg-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--lg-mute); }
.acct-input {
  font: 16px/1.2 var(--lg-sans); /* 16px stops iOS zooming in */
  color: var(--lg-ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--lg-hair);
  padding: 10px 0; min-height: 44px; border-radius: 0;
}
.acct-hint { font-size: 12px; color: var(--lg-mute); }
.acct-err { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--lg-accent); }
.acct-submit {
  font: 600 12px/1 var(--lg-mono); letter-spacing: 0.08em;
  min-height: 48px; color: var(--lg-paper); background: var(--lg-ink);
  border: 0; cursor: pointer;
}
.acct-submit:disabled { opacity: 0.5; cursor: progress; }
.acct-switch, .acct-close, .lg-link {
  font: 500 12px/1.2 var(--lg-sans); color: var(--lg-mute);
  background: none; border: 0; padding: 10px 0; min-height: 44px;
  text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ---------- bodyweight chip on the day hero + its sheet ---------- */
.bw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  /* owner ruling 2026-11-19: the hero chips shrink to the caption scale;
     the 44px touch floor is overridden here on purpose */
  min-height: 26px;
  padding: 0 7px;
  border: 1px dashed var(--lg-hair);
  border-radius: 999px;
  background: transparent;
  color: var(--lg-ink);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}
.bw-chip:hover { border-color: var(--lg-accent); }
.bw-chip:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: 2px; }
.bw-chip-value { font: 600 10px/1 var(--lg-mono); font-variant-numeric: tabular-nums; letter-spacing: .02em; transform: translateY(.5px); }

.bw-sheet {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  background: transparent;
  color: var(--lg-ink);
  position: fixed;
  inset: auto 0 0 0;
}
.bw-sheet::backdrop { background: rgba(20, 17, 14, 0.42); }
.bw-sheet-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--lg-paper);
  border-top: 2px solid var(--lg-ink);
  border-radius: 14px 14px 0 0;
}
.bw-sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bw-sheet-title { margin: 0; font: 700 12px/1 var(--lg-mono); letter-spacing: .12em; }
.bw-sheet-when { margin: 0; font: 500 10px/1 var(--lg-mono); letter-spacing: .06em; color: var(--lg-mute); text-transform: uppercase; }
.bw-sheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.bw-step {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--lg-hair);
  background: transparent;
  color: var(--lg-ink);
  font: 600 18px/1 var(--lg-mono);
  cursor: pointer;
}
.bw-step:focus-visible, .bw-sheet-save:focus-visible, .bw-sheet-cancel:focus-visible {
  outline: 2px solid var(--lg-accent);
  outline-offset: 2px;
}
.bw-sheet-in {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid var(--lg-ink);
  border-radius: 0;
  background: transparent;
  color: var(--lg-ink);
  font: 600 30px/1 var(--lg-mono);
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}
.bw-sheet-in::-webkit-inner-spin-button,
.bw-sheet-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bw-sheet-unit { font: 500 11px/1 var(--lg-mono); letter-spacing: .1em; color: var(--lg-mute); }
.bw-sheet-note { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: var(--lg-mute); }
.bw-sheet-status { margin: 6px 0 0; min-height: 1.2em; font-size: 12px; color: var(--lg-accent); }
.bw-sheet-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.bw-sheet-save {
  flex: 1 1 auto;
  min-height: 48px;
  border: 0;
  background: var(--lg-ink);
  color: var(--lg-paper);
  font: 600 12px/1 var(--lg-mono);
  letter-spacing: .08em;
  cursor: pointer;
}
.bw-sheet-cancel {
  min-height: 48px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--lg-mute);
  font: 500 11px/1 var(--lg-mono);
  letter-spacing: .08em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.move.loggable { cursor: pointer; }
.move.loggable:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.move.log-open { border-color: var(--ink-2); }
/* logged: the card keeps its own tier hue (red main, blue variants, yellow /
   green accessories), matching the RRX card treatment rather than a fixed
   green-blue badge. */
.move.is-logged {
  background-image: linear-gradient(160deg, color-mix(in srgb, var(--seg) 7%, var(--card)) 0%, var(--card) 62%);
}
.move.is-logged::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--seg) 0%, color-mix(in srgb, var(--seg) 35%, transparent) 100%);
  opacity: .8;
  pointer-events: none;
}
.lg-panel {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--lg-hair);
}
.lg-panel[hidden] { display: none; }
.lg-head {
  display: flex; align-items: baseline; gap: 8px;
  min-height: 18px;
  font: 500 10px/1 var(--lg-mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--lg-mute);
}
.lg-head .lg-label { color: var(--lg-ink); }
.lg-head .lg-state { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lg-form { display: grid; gap: 8px; }
.lg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lg-meta { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, .9fr); gap: 6px 8px; }
.lg-sets .lg-step { min-height: 40px; }
.lg-ex-row { flex-wrap: wrap; }
.lg-ex-row .lg-link { min-height: 44px; padding: 0; flex: 0 0 auto; font-size: 11px; }
.lg-ex { flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--lg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-measures { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .8fr); gap: 6px 8px; }
/* the RPE leaves the row when a top set and a back-off run each need one: two
   columns keep the weight column as wide as it was with three */
.lg-measures.is-2 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.lg-rpe2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; margin-top: 6px; }
.lg-rpe2 .lg-field .lg-in { min-height: 40px; }
.lg-field { display: grid; gap: 3px; min-width: 0; }
.lg-field .lg-in { width: 100%; min-width: 0; min-height: 40px; padding: 4px 2px; }
.lg-in[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.lg-in[type="number"]::-webkit-inner-spin-button,
.lg-in[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lg-k { font: 500 11px/1 var(--lg-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--lg-mute); }
.lg-hint { font-size: 12px; color: var(--lg-mute); }
.lg-in, .lg-pick {
  font: 16px/1.2 var(--lg-sans); color: var(--lg-ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--lg-hair); min-height: 40px;
  padding: 4px 2px; width: 7.5em; border-radius: 0;
}
.lg-pick { width: 100%; flex: 1 1 100%; }
/* our own suggestion list: the native datalist popup was unreliable on a
   phone, so the list is a real panel that can be tapped and scrolled */
.lg-pick-box { position: relative; flex: 1 1 100%; min-width: 0; }
.lg-sug {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  margin: 0;
  padding: 2px 0;
  max-height: 216px;
  overflow-y: auto;
  list-style: none;
  background: var(--lg-card, var(--card));
  border: 1px solid var(--lg-hair);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--lg-ink) 12%, transparent);
}
.lg-sug[hidden] { display: none; }
.lg-sug-item { margin: 0; }
.lg-sug-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  text-align: left;
  font: 13px/1.25 var(--lg-sans);
  color: var(--lg-ink);
  cursor: pointer;
}
.lg-sug-btn:hover,
.lg-sug-btn.is-on { background: color-mix(in srgb, var(--lg-ink) 7%, transparent); }
.lg-status { margin: 0 0 0 auto; min-height: 0; font-size: 11px; color: var(--lg-mute); }
.lg-status:empty { display: none; }
.lg-actions { align-items: center; }
.lg-actions .lg-btn { min-height: 44px; padding: 0 12px; }
.lg-btn {
  font: 600 11px/1 var(--lg-mono); letter-spacing: 0.08em;
  min-height: 44px; padding: 0 14px; cursor: pointer;
  color: var(--lg-paper); background: var(--lg-ink); border: 0;
}
.lg-icon { min-width: 32px; width: 32px; min-height: 44px; padding: 0; font-size: 18px; color: var(--lg-ink); background: transparent; border: 1px solid var(--lg-hair); }
.lg-step { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.lg-num { min-width: 2ch; text-align: center; font: 600 14px/1 var(--lg-mono); color: var(--lg-ink); }

/* ---------- export */
.lg-export { border-top: 1px solid var(--lg-hair); padding: 14px 0 6px; display: grid; gap: 4px; }
.lg-export .lg-hint { margin: 0; }
.lg-links { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.lg-export .lg-link { color: var(--lg-ink); font: 600 11px/1 var(--lg-mono); letter-spacing: 0.08em; text-decoration: none; border-bottom: 1px solid var(--lg-hair); }


/* ---------------------------------------------------------------- gear */
.lg-gear { display: grid; gap: 5px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair-2); }
.lg-gear-list { display: grid; gap: 3px; }
.lg-gear-item { display: flex; align-items: center; gap: 8px; }
.lg-gear-tick { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; width: 118px; }
.lg-gear-check { appearance: none; -webkit-appearance: none; margin: 0; flex: 0 0 auto; width: 12px; height: 12px; border: 1px solid var(--hair); background: transparent; }
.lg-gear-check:checked { border-color: var(--ink); background: var(--ink); }
.lg-gear-name { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-2); }
.lg-gear-item:has(.lg-gear-check:checked) .lg-gear-name { color: var(--ink); }
.lg-gear-model { flex: 1 1 auto; min-width: 0; border: 0; border-bottom: 1px solid var(--hair-2); background: transparent; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--ink); padding: 3px 0; min-height: 22px; }
.lg-gear-model:disabled { opacity: .3; }
.lg-gear-model::placeholder { color: var(--ink-3); letter-spacing: .06em; }

/* ---------------------------------------------------------------- note */
/* one free line per session, sized to the gear rows it sits under:
   9px label in the same 118px column, 10px mono value, one hairline.
   A brand, a bar, a feeling — not a second data model. */
.lg-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--hair-2);
}
.lg-note .lg-k { flex: 0 0 auto; width: 118px; font-size: 9px; letter-spacing: .1em; color: var(--ink-2); }
.lg-note-in {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 22px;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid var(--hair-2);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--ink);
}
.lg-note-in::placeholder { color: var(--ink-3); letter-spacing: .06em; }

/* --------------------------------------------------------- the commit */
/* not a slab: the gesture is a small ink plate held centred, with a hair
   line standing off it on all sides — a stamp with room around it */
.lg-commit {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--hair-2);
}
.lg-save {
  width: auto;
  min-width: 152px;
  max-width: 100%;
  min-height: 38px;
  padding: 0 26px;
  border: 0;
  background: var(--lg-ink);
  color: var(--lg-paper);
  font: 600 10px/1 var(--lg-mono);
  letter-spacing: .42em;
  /* the trailing letter-space would push the word left of centre */
  text-indent: .42em;
  text-align: center;
  cursor: pointer;
  outline: 1px solid var(--hair-2);
  outline-offset: 4px;
}
.lg-save:active { transform: translateY(1px); }
.lg-commit-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 12px;
  min-height: 0;
  margin-top: 2px;
}
.lg-commit-foot .lg-undo {
  min-height: 36px;
  padding: 0;
  font: 500 9px/1 var(--lg-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lg-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lg-commit-foot .lg-status { margin: 0; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

/* VBT: one optional speed field under the work sheet. A label and a narrow
   number box, so the row never pushes the three-column measure grid wider than
   a 361 px card. */
.lg-vbt {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 92px);
  align-items: center; gap: 6px 8px; margin-top: 6px; min-width: 0;
}
.lg-vbt .lg-in { min-height: 40px; }

