[hidden] { display: none !important; }
:root {
  --bg: #111418;
  --card: #1b2027;
  --card2: #232a33;
  --line: #2e3742;
  --text: #eef1f4;
  --muted: #8d98a5;
  --accent: #ff7a1a;
  --accent2: #ffb27a;
  --ok: #3ccf7a;
  --danger: #ff5d5d;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + var(--safe-b));
  min-height: 100vh;
}
header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(17, 20, 24, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header h1 { font-size: 20px; margin: 0; }
#who { color: var(--muted); font-size: 14px; }
main { padding: 14px 16px; max-width: 640px; margin: 0 auto; }
h2 { font-size: 18px; margin: 20px 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.card.tap { cursor: pointer; }
.card.tap:active { background: var(--card2); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; color: var(--accent2); }
.stat span { font-size: 12px; color: var(--muted); }

button, .btn {
  font: inherit; border: 0; border-radius: 12px; padding: 12px 16px;
  background: var(--card2); color: var(--text); cursor: pointer; min-height: 44px;
}
button.primary { background: var(--accent); color: #111; font-weight: 600; }
button.ok { background: var(--ok); color: #111; font-weight: 600; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.ghost { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
button.block { width: 100%; }
button.icon { padding: 6px 10px; min-height: 36px; background: transparent; color: var(--muted); }
button:disabled { opacity: .5; }

input, select, textarea {
  font: inherit; width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-size: 16px; /* evită zoom-ul pe iOS */
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.users { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.users button { padding: 18px 10px; font-size: 17px; }
.users button.sel { outline: 2px solid var(--accent); }

/* Tabelul de serii la antrenament */
.sets { width: 100%; border-collapse: collapse; margin-top: 6px; }
.sets th { font-size: 12px; color: var(--muted); font-weight: 500; text-align: left; padding: 2px 4px; }
.sets td { padding: 3px 4px; }
.sets td:first-child { width: 32px; color: var(--muted); text-align: center; }
.sets td:last-child { width: 48px; text-align: right; }
.sets input { padding: 9px 8px; text-align: center; }
.sets tr.done input { border-color: var(--ok); background: rgba(60, 207, 122, .08); }
.check { width: 40px; height: 40px; padding: 0; min-height: 0; border-radius: 10px; background: var(--card2); color: var(--muted); }
tr.done .check { background: var(--ok); color: #111; }
.hint { font-size: 12px; color: var(--muted); }

.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--card2); color: var(--muted); margin-right: 4px; }
.pill.hot { background: rgba(255, 122, 26, .18); color: var(--accent2); }

nav#tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(17, 20, 24, .96); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
nav#tabs button {
  background: none; border-radius: 0; padding: 8px 0 6px; font-size: 11px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 58px;
}
nav#tabs button span { font-size: 20px; filter: grayscale(1); opacity: .7; }
nav#tabs button.on { color: var(--accent); }
nav#tabs button.on span { filter: none; opacity: 1; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + var(--safe-b)); z-index: 20;
  background: #fff; color: #111; padding: 10px 16px; border-radius: 99px; font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4); max-width: 90vw;
}
#toast.err { background: var(--danger); color: #fff; }

#timer {
  position: fixed; right: 16px; bottom: calc(84px + var(--safe-b)); z-index: 15;
  background: var(--accent); color: #111; border-radius: 99px; padding: 6px 6px 6px 16px;
  font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4); font-variant-numeric: tabular-nums;
}
#timer button { min-height: 0; padding: 6px 10px; border-radius: 99px; background: rgba(0,0,0,.15); color: #111; }
#timer.zero { background: var(--ok); }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list td, table.list th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
table.list th { color: var(--muted); font-weight: 500; font-size: 12px; }

details { margin-top: 8px; }
details summary { cursor: pointer; color: var(--accent2); }
.help li { margin-bottom: 8px; }
