/* Today's workout (build step 3). Everything she reads mid-set sits on a
   solid card, never straight on the pattern. Sizes favour a glance from
   arm's length: the dose (sets x reps) is the biggest thing per row. */

.screen--today {
  gap: 10px;
}

.offline-chip {
  align-self: flex-start;
  margin: 0 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--tx2);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- Header: day, title, rotation, week ---- */

.today-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 20px;
}

.today-eyebrow {
  text-shadow: 0 0 4px var(--bg), 0 0 8px var(--bg);
}

/* Day title left, day picker right, on one row: the picker sits where
   the thumb reaches and the eyebrow keeps the full width. */
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.day-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 13vw, 60px);
  line-height: 0.88;
  text-transform: uppercase;
  margin-top: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.day-sub {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 4px var(--bg), 0 0 8px var(--bg);
}

/* Day picker: the rotation is a suggestion, so each day is a button. */
.rotation {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rot-chip {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--tx2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
}

.rot-chip--now {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* Locked while a workout is in progress: the other days fade back. */
.rot-chip:disabled:not(.rot-chip--now) {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---- The day as one compact table ---- */

.plan-card {
  padding: 4px 14px 6px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--sheet-shadow);
}

/* Fixed column widths: columns don't jump when a row opens or swaps
   (UX review, step 4). Name takes whatever is left. */
.plan-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.plan-table thead th {
  padding: 8px 4px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--tx2);
  border-bottom: 1px solid var(--border);
}

.plan-table td {
  padding: 9px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  vertical-align: top;
}

.plan-table col.col-wt { width: 4.9em; }
.plan-table col.col-dose { width: 4.6em; }
.plan-table col.col-rest { width: 3.9em; }

.plan-table tbody tr:last-child td {
  border-bottom: none;
}

/* Name column takes the slack. Short values (most of them: "15-20 lb",
   "3×10", "60-90s") never break; a long one wraps at its spaces inside a
   capped column instead of pushing the table past the card on a 360px
   phone (QA, 2026-11-17). Names and notes may break mid-word only if a
   single word is too long to fit. */
.plan-table .nw {
  white-space: nowrap;
}

.plan-table td.c-name,
.ex-note {
  overflow-wrap: anywhere;
}

/* Calm (Grace, 2026-11-17): only the exercise name is bold; weight,
   sets and rest are plain text so the table reads quietly. */
.plan-table td.c-wt {
  color: var(--tx2);
}

.plan-table td.c-dose {
  color: var(--tx);
}

.plan-table td.c-rest {
  color: var(--tx2);
}

.ex-num {
  margin-right: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--tx3);
}

.ex-name {
  font-weight: 700;
  line-height: 1.25;
}

/* Tips and swap notes live in the open row only (calm pass). */
.ex-note {
  display: block;
  margin: 0 2px 6px;
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.3;
  color: var(--tx2);
}

.row-group th {
  padding: 10px 4px 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--tx3);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.row-bookend td {
  font-style: italic;
  color: var(--tx2);
}

.bk-label {
  margin-right: 4px;
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tx);
}

.next-up {
  margin: 2px 20px 24px;
  text-shadow: 0 0 4px var(--bg), 0 0 8px var(--bg);
}

/* Loading / error / empty states share the frosted sheet. */
.sheet--message {
  margin-top: auto;
  min-height: 160px;
  justify-content: center;
}

/* ---- Logging (build step 4) ---- */

/* The exercise name is the button that opens its log row (keyboard and
   screen readers); the whole row also opens it on tap (UX review: only
   the name text was tappable). Reads as plain table text. */
.row-ex[data-action] {
  cursor: pointer;
}

.row-toggle {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.row-toggle:focus-visible {
  outline-offset: 3px;
}

/* A table cell's height acts as a minimum: every row is a 44px target. */
.row-ex .c-name {
  height: 44px;
  padding-top: 11px;
  padding-bottom: 11px;
}

/* Open row: a tint that reads in both themes (the plain raise color was
   too faint on white in light mode). */
.row-ex--open td {
  border-bottom: none;
  background: var(--open-bg);
}

/* Room above for the row she just finished, so its check and what she
   lifted stay in view as confirmation. */
.row-ex--open {
  scroll-margin-top: 56px;
}

.row-ex--open td:first-child {
  border-radius: 10px 0 0 0;
}

.row-ex--open td:last-child {
  border-radius: 0 10px 0 0;
}

.row-ex--done .ex-name,
.row-ex--skipped .ex-name {
  color: var(--tx2);
}

.row-ex--skipped .ex-name {
  text-decoration: line-through;
}

/* Done / skipped take the row number's place, so rows never grow. */
.ex-num--done {
  color: var(--accent-text);
}

.ex-status {
  margin-left: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tx2);
}

.row-ex--skipped td.c-wt,
.row-ex--skipped td.c-dose {
  font-style: italic;
}

.row-log td {
  padding: 4px 6px 10px;
  background: var(--open-bg);
  border-radius: 0 0 10px 10px;
}

.set-lines {
  display: flex;
  flex-direction: column;
}

/* One set: weight stepper, reps stepper, log check. Sized to fit a 360px
   phone with 40px+ tap targets. */
.set-line {
  display: grid;
  grid-template-columns: 1fr 1fr 54px;
  align-items: center;
  gap: 4px 6px;
  padding: 3px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.set-line:last-child {
  border-bottom: none;
}

/* Extra room before the check so a sweaty thumb doesn't hit "+". */
.set-check {
  margin-left: 6px;
}

.stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 44px;
}

.stepper--static {
  grid-template-columns: 1fr;
}

.step-btn {
  height: 100%;
  border: none;
  background: none;
  color: var(--tx2);
  font-size: 1.4rem;
  font-weight: 400;
}

.step-btn:disabled {
  color: var(--tx3);
  opacity: 0.4;
}

.step-val {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  white-space: nowrap;
}

.step-val small {
  margin-left: 2px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--tx2);
}

.set-check {
  height: 44px;
  border-radius: 12px;
  /* --border was about 1.2:1 on the open-row tint; a control edge needs 3:1. */
  border: 1.5px solid var(--input-border);
  background: transparent;
  color: var(--tx2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
}

.set-check[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* The next set to log: outlined in the accent, so a glance says which
   set she's on. */
.set-check--next {
  border: 2px solid var(--accent);
  color: var(--accent-text);
}

.set-line--logged .stepper {
  opacity: 0.75;
}

.log-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.skip-reasons {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

.chip-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--tx);
  font-size: 0.9rem;
  font-weight: 700;
}

.chip-btn--quiet {
  color: var(--tx2);
  font-weight: 600;
}

.finish-btn {
  margin: 4px 0 0;
}

/* Where Finish was: says the workout is saved and what's next. */
.saved-line {
  margin: 4px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--tx);
  font-weight: 700;
  text-align: center;
}

.saved-line .ex-num--done {
  margin-right: 6px;
}

/* "N to upload" while sets wait for signal. */
.sync-chip {
  margin-left: auto;
  white-space: nowrap;
  margin-right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--tx2);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Tip under a plan exercise (e.g. what it can be swapped for), and the
   "swapped" notes. One quiet line, two at most. */
.ex-tip {
  margin: 3px 0 0;
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.3;
  color: var(--tx2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-ex--swapped .ex-name {
  color: var(--tx3);
  text-decoration: line-through;
}

.row-ex--swapped td.c-dose {
  color: var(--tx3);
  font-style: italic;
}

.ex-num--added {
  color: var(--accent-text);
}

.row-group--added th {
  color: var(--accent-text);
}

/* ---- Parking lot: alternatives and extras, collapsed to a count until
   she opens it, so the day's table stays the focus. */
.parking {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--sheet-shadow);
  overflow: hidden;
}

.pk-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: none;
  background: none;
  text-align: left;
}

.pk-count {
  color: var(--tx2);
  font-size: 0.9rem;
}

.pk-chev {
  margin-left: auto;
  font-size: 1.3rem;
  color: var(--tx2);
}

.pk-body {
  padding: 0 12px 12px;
}

.pk-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.pk-main {
  flex: 1;
  min-width: 0;
}

.pk-name {
  font-weight: 700;
}

.pk-meta {
  font-size: 0.8rem;
  color: var(--tx2);
  line-height: 1.3;
}

.pk-actions {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
}

.chip-btn--strong {
  color: var(--accent-text);
}

.pk-empty {
  padding: 8px 4px;
}

.pk-new {
  margin-top: 4px;
}

.pk-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--raise);
}

.pk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tx2);
}

.pk-field--name {
  grid-column: 1 / -1;
}

.pk-field input,
.pk-field select {
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--surface);
  color: var(--tx);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.pk-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 0.9rem;
}

.pk-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.pk-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

/* Small phones: keep names on one line where possible so the day stays
   one compact table (UX review: most names wrapped at 360). */
@media (max-width: 370px) {
  .plan-table {
    font-size: 0.9rem;
  }

  .plan-table col.col-rest {
    width: 3.3em;
  }

  .plan-card {
    padding-inline: 10px;
  }
}
