/* Sized for a thumb mid-set, not for a desktop review. Every control that
   logs something is at least 56px tall; nothing important needs two hands. */

:root {
  --bg: #0f1115;
  --card: #171a21;
  --line: #262b36;
  --text: #e8ebf0;
  --muted: #98a1b3;
  --accent: #4ade80;
  --accent-ink: #05240f;
  --warn: #fbbf24;
  --tap: 56px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main { max-width: 620px; margin: 0 auto; padding: 16px; }

h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }

.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; }
.error { color: #f87171; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.actions { display: grid; gap: 12px; margin-bottom: 20px; }

button {
  font: inherit;
  color: inherit;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
}

.big {
  width: 100%;
  min-height: var(--tap);
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--line);
}

.big.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.ghost {
  background: none;
  border: 1px solid var(--line);
  padding: 10px 14px;
  min-height: 44px;
  color: var(--muted);
}

input {
  font: inherit;
  color: var(--text);
  background: #0b0d11;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  width: 100%;
  min-height: var(--tap);
}

form { display: grid; gap: 12px; }
.inline { display: flex; gap: 10px; margin-bottom: 16px; }
.inline input { flex: 1; }

/* Exercise tap targets. Two columns so a 12-exercise session fits one screen. */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.grid button {
  min-height: 84px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
  display: grid;
  align-content: center;
  gap: 4px;
}

.grid button strong { font-size: 1rem; text-transform: capitalize; }
.grid button span { font-size: 0.8rem; color: var(--muted); }

/* The steppers do the real work: +/- means no keyboard for the common case. */
.stepper { margin-bottom: 22px; }
.stepper-label { display: block; color: var(--muted); margin-bottom: 8px; font-size: 0.9rem; }
.stepper-row { display: grid; grid-template-columns: 72px 1fr 72px; gap: 10px; }

.step {
  min-height: 72px;
  font-size: 1.8rem;
  background: var(--card);
  border: 1px solid var(--line);
}

.stepper-row input { text-align: center; font-size: 1.5rem; font-weight: 600; }

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

.rows li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rows li:last-child { border-bottom: 0; }
.rows .when { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

ul#reco-exercises { list-style: none; margin: 0 0 12px; padding: 0; }
ul#reco-exercises li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul#reco-exercises li:last-child { border-bottom: 0; }
ul#reco-exercises .name { text-transform: capitalize; font-weight: 600; }

.offline {
  background: var(--warn);
  color: #241a00;
  text-align: center;
  padding: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.screen[hidden] { display: none; }

/* Backdating: three quick picks cover almost every case, the date input is
   there for the rest. */
.past-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.past-quick button.on {
  border-color: var(--accent);
  color: var(--accent);
}

#past input { margin-bottom: 4px; }
#past .big { margin-bottom: 10px; }
