*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg:         #0f1115;
    --surface:    #1a1e26;
    --surface-2:  #242a35;
    --text:       #e8eaed;
    --text-dim:   #9aa0a6;
    --accent:     #4ade80;
    --accent-2:   #16a34a;
    --border:     #2d333f;
    --danger:     #f87171;
    --warn:       #fbbf24;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
}

header { margin-bottom: 1.5rem; }

h1 {
    font-size: 1.75rem;
    margin: 0.5rem 0 0.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.workout-title {
    font-size: 1.25rem;
    color: var(--text-dim);
    font-weight: 500;
    margin: 0.25rem 0 1rem;
}

.subtitle {
    color: var(--text-dim);
    margin: 0;
    font-size: 0.95rem;
}

.crumbs {
    margin-bottom: 0.5rem;
}
.crumbs a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    display: inline-block;
    min-height: 44px;
    line-height: 28px;
}
.crumbs a:active { color: var(--accent); }

.grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

.card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    text-decoration: none;
    min-height: 68px;
    transition: background 0.15s, transform 0.1s;
}
.card:active {
    background: var(--surface-2);
    transform: scale(0.99);
}
.card h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}
.card .arrow {
    color: var(--text-dim);
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.card-meta {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.progress {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.progress-bar {
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.exercise-name {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}

.round-badge {
    display: inline-block;
    background: var(--surface-2);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.previous {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.previous.empty {
    color: var(--text-dim);
    font-style: italic;
    text-align: center;
    padding: 1.25rem;
}
.previous-label {
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    font-weight: 600;
}
.previous-value {
    font-size: 1.4rem;
    font-weight: 600;
}
.delta {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    vertical-align: 0.1em;
    margin-left: 0.15rem;
    letter-spacing: 0.02em;
}
.delta-up   { color: var(--accent); background: rgba(74, 222, 128, 0.15); }
.delta-down { color: var(--danger); background: rgba(248, 113, 113, 0.15); }

.previous-diff {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.previous-diff.diff-facile    { color: var(--accent); background: rgba(74, 222, 128, 0.15); }
.previous-diff.diff-modere    { color: var(--warn);   background: rgba(251, 191, 36, 0.15); }
.previous-diff.diff-difficile { color: var(--danger); background: rgba(248, 113, 113, 0.15); }

.previous-comment {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 0.4rem;
    line-height: 1.4;
}

.target-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}
.target-input {
    width: 64px;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.45rem 0.5rem;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.target-input::-webkit-outer-spin-button,
.target-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.target-input:focus { border-color: var(--accent); }
.target-saved {
    color: var(--accent);
    font-weight: 700;
    margin-left: auto;
    transition: opacity 0.3s;
}

.diff-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}
.diff-buttons input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.diff-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s, background 0.15s, border-color 0.15s, color 0.15s;
}
.diff-btn:active { transform: scale(0.97); }

.diff-buttons input:checked + .diff-facile {
    background: rgba(74, 222, 128, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}
.diff-buttons input:checked + .diff-modere {
    background: rgba(251, 191, 36, 0.15);
    border-color: var(--warn);
    color: var(--warn);
}
.diff-buttons input:checked + .diff-difficile {
    background: rgba(248, 113, 113, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 12px;
    resize: vertical;
    min-height: 60px;
    outline: none;
    line-height: 1.4;
}
textarea:focus {
    border-color: var(--accent);
    background: var(--surface-2);
}
.previous-time {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.field { margin-bottom: 1rem; }
.field label {
    display: block;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.field input {
    width: 100%;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 0.95rem 1rem;
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 12px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
}
.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.field input:focus {
    border-color: var(--accent);
    background: var(--surface-2);
}

.action-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.75rem;
}

.btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 1.5rem;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
    font-family: inherit;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent);
    color: #0a0c10;
}
.btn-primary:active { background: var(--accent-2); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    flex: 1;
    font-size: 1rem;
    padding: 0 1rem;
}

.btn-primary {
    flex: 2;
}

.btn-disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

.done {
    text-align: center;
    padding: 2rem 1rem;
}
.done-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
}
.done h2 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}
.done p {
    color: var(--text-dim);
    margin: 0 0 2rem;
}
.done-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.done-actions .btn { flex: none; }

.empty {
    color: var(--text-dim);
    text-align: center;
    padding: 2rem 1rem;
    font-style: italic;
}

/* === Today's workout card (index.php) === */

.today-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    margin-bottom: 1.25rem;
    text-align: center;
}
.today-label {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.today-workout {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.today-hint {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    font-style: italic;
}
.today-card.empty-day {
    text-align: center;
    color: var(--text-dim);
}
.today-card.empty-day h2 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

.btn-big {
    width: 100%;
    min-height: 64px;
    font-size: 1.15rem;
}

/* === "Choose other workout" dropdown === */

.other-workouts {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.other-workouts > summary {
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    min-height: 56px;
    color: var(--text);
}
.other-workouts > summary::-webkit-details-marker { display: none; }
.other-workouts > summary::after {
    content: '▾';
    color: var(--text-dim);
    transition: transform 0.15s;
}
.other-workouts[open] > summary::after {
    transform: rotate(180deg);
}

.workout-list {
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid var(--border);
}
.program-group {
    margin-top: 0.75rem;
}
.program-group h3 {
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.4rem;
    font-weight: 700;
    padding: 0 0.25rem;
}
.workout-link {
    display: block;
    padding: 0.85rem 1rem;
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 0.4rem;
    font-weight: 500;
    transition: background 0.1s;
}
.workout-link:active {
    background: var(--border);
}

/* Program day navigation (index) */
.day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 1rem 0 0.5rem;
}
.day-nav .btn {
    flex: 0 0 auto;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
}
.day-nav button[disabled] {
    opacity: 0.35;
    pointer-events: none;
}
.day-nav-pos {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
/* "Day finished, advanced" note on the done screen */
.prog-advanced {
    background: var(--surface-2);
    border: 1px solid var(--accent-2);
    color: var(--accent);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    margin: 0 0 1rem;
}

/* Calendar page */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0.5rem 0 1rem;
}
.cal-nav .btn { flex: 0 0 auto; padding: 0.5rem 1rem; }
.cal-title { font-weight: 700; font-size: 1.1rem; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-dow {
    text-align: center;
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    padding-bottom: 2px;
}
.cal-cell {
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}
.cal-cell.cal-empty { background: transparent; }
.cal-num { font-size: 0.85rem; color: var(--text-dim); line-height: 1; }
.cal-done { background: var(--accent-2); }
.cal-done .cal-num { color: #fff; font-weight: 700; }
.cal-dot { font-size: 0.7rem; color: #fff; line-height: 1; }
.cal-today { outline: 2px solid var(--accent); outline-offset: -2px; }

.cal-empty-msg { color: var(--text-dim); text-align: center; margin: 1.5rem 0; }
.cal-list-title { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.cal-list-row {
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.cal-list-date {
    flex: 0 0 5.2rem;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 600;
    padding-top: 0.15rem;
}
.cal-list-workouts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cal-chip {
    background: var(--surface-2);
    border-radius: 6px;
    padding: 0.22rem 0.55rem;
    font-size: 0.8rem;
}
.cal-chip-sets { color: var(--accent); font-weight: 700; }

/* Link to calendar from home */
.cal-link { display: block; text-align: center; margin: 0.75rem 0 0.5rem; }

/* Rotations / progress view */
.rot {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem;
    margin-bottom: 1rem;
}
.rot-done { opacity: 0.9; }
.rot-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}
.rot-head h2 { font-size: 1.05rem; margin: 0; }
.rot-status { font-size: 0.8rem; color: var(--text-dim); font-weight: 700; }
.rot-done .rot-status { color: var(--accent); }
.rot-days { display: flex; flex-direction: column; gap: 0.4rem; }
.rot-day {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.6rem;
    border-radius: 9px;
    background: var(--surface-2);
}
.rot-day-mark { flex: 0 0 1.3rem; text-align: center; font-weight: 700; color: var(--text-dim); }
.rday-done .rot-day-mark { color: var(--accent); }
.rday-current { background: var(--accent-2); }
.rday-current .rot-day-mark,
.rday-current .rot-day-name { color: #fff; }
.rday-todo { opacity: 0.6; }
.rot-day-body { flex: 1 1 auto; min-width: 0; }
.rot-day-num {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rday-current .rot-day-num { color: rgba(255, 255, 255, 0.85); }
.rot-day-name { font-size: 0.9rem; font-weight: 600; }
.rot-day-go { flex: 0 0 auto; padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.rot-locked {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 0.8rem;
    margin-top: 0.5rem;
}

/* Section heading on the home screen (rotations) */
.rotations { margin-top: 1.25rem; }
.section-title {
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

/* Rotation day rows are tappable (choose any workout to do) */
.rot-day { text-decoration: none; color: var(--text); cursor: pointer; }
.rot-day:active { filter: brightness(1.18); }
.rot-day-go-icon { flex: 0 0 auto; color: var(--text-dim); font-size: 1.2rem; line-height: 1; }
.rday-current .rot-day-go-icon { color: #fff; }

/* Rest day in the rotation */
.rday-rest { opacity: 0.75; cursor: default; }
.rday-rest .rot-day-name { font-style: italic; color: var(--text-dim); }

/* Quick note widget (workout screen) */
.quicknote {
    margin-top: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 0.9rem;
}
.quicknote summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.35rem 0;
    list-style: none;
}
.quicknote summary::-webkit-details-marker { display: none; }
.quicknote-body { padding: 0.5rem 0 0.6rem; }
.quicknote textarea,
.note-add textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0.6rem;
    font: inherit;
    resize: vertical;
}
.quicknote-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.qn-ok { color: var(--accent); font-weight: 700; }
.qn-link { margin-left: auto; color: var(--text-dim); text-decoration: none; font-size: 0.85rem; }

/* Notes page */
.note-add { margin: 0.5rem 0 1.25rem; }
.note-add button { margin-top: 0.5rem; }
.notes-empty { color: var(--text-dim); text-align: center; margin: 1.5rem 0; }
.note-list { display: flex; flex-direction: column; gap: 0.5rem; }
.note-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
}
.note-item.note-done { opacity: 0.55; }
.note-item.note-done .note-text { text-decoration: line-through; }
.note-check-btn,
.note-del-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.note-del-btn { color: var(--text-dim); font-size: 1rem; }
.note-body { flex: 1 1 auto; min-width: 0; }
.note-text { white-space: pre-wrap; word-break: break-word; }
.note-meta { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.25rem; }
.note-context { color: var(--accent); }

/* Personal records */
.pr-banner {
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    color: #06210f;
    font-weight: 800;
    text-align: center;
    padding: 0.7rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.pr-line {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0 0.8rem;
}
.pr-box {
    background: var(--surface-2);
    border: 1px solid var(--accent-2);
    color: var(--accent);
    font-weight: 700;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
}

/* Exercise header with progress link */
.exercise-head { display: flex; align-items: center; gap: 0.5rem; }
.exercise-head .exercise-name { flex: 1 1 auto; }
.prog-link {
    flex: 0 0 auto;
    text-decoration: none;
    font-size: 1.3rem;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    background: var(--surface-2);
}

/* Rest timer */
.rest-timer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 0.7rem;
    margin-bottom: 1rem;
}
.rest-display {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 4.5rem;
    color: var(--text-dim);
}
.rest-display.running { color: var(--accent); }
.rest-presets { display: flex; gap: 0.35rem; }
.rest-btn, .rest-stop {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.rest-btn:active { background: var(--accent-2); }
.rest-stop { color: var(--text-dim); }

/* Progress charts */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
}
.chart-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}
.chart-range { color: var(--accent); font-weight: 700; }
.spark { width: 100%; height: 70px; display: block; }
.prog-list { display: flex; flex-direction: column; }
.prog-row {
    display: flex;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}
.prog-date { color: var(--text-dim); font-size: 0.85rem; }
.prog-best { font-weight: 600; }

/* Progressive-overload suggestion */
.overload {
    background: var(--surface-2);
    border-left: 3px solid var(--accent);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    margin: 0 0 0.8rem;
}

/* Repeat-last button */
.repeat-last {
    width: 100%;
    background: var(--surface-2);
    color: var(--accent);
    border: 1px dashed var(--accent-2);
    border-radius: 9px;
    padding: 0.55rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 0.8rem;
}
.repeat-last:active { background: var(--border); }

/* Session recap (done screen) */
.recap-volume {
    color: var(--accent);
    font-weight: 700;
    margin: 0.3rem 0 0.7rem;
}
.recap-list {
    text-align: left;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 0.3rem 0.7rem;
    margin: 0 0 1rem;
}
.recap-row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.recap-row:last-child { border-bottom: none; }
.recap-ex { color: var(--text-dim); min-width: 0; word-break: break-word; }
.recap-val { white-space: nowrap; font-weight: 600; }
.recap-pr .recap-val { color: var(--accent); }

/* Lifetime stats (records page) */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem;
    text-align: center;
}
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.2rem; }
.pr-list { display: flex; flex-direction: column; }
.pr-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.2rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
}
.pr-ex { min-width: 0; word-break: break-word; font-size: 0.9rem; }
.pr-val { white-space: nowrap; font-weight: 700; font-size: 0.85rem; }

/* Rest timer — giant mode while running (glanceable from a distance) */
.rest-timer.big {
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.3rem 0.7rem;
    border-color: var(--accent-2);
}
.rest-timer.big .rest-display {
    font-size: 4rem;
    line-height: 1;
    color: var(--accent);
    min-width: 0;
}
.rest-timer.big .rest-btn { display: none; }
.rest-timer.big .rest-stop {
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
}

/* Edit/delete logged sets (progress page) */
.edit-sets { margin-top: 1.5rem; }
.edit-sets summary { cursor: pointer; font-weight: 600; padding: 0.4rem 0; }
.edit-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.edit-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface-2);
    border-radius: 8px;
    padding: 0.3rem 0.45rem;
}
.edit-form { display: flex; align-items: center; gap: 0.35rem; flex: 1 1 auto; flex-wrap: wrap; }
.edit-date { color: var(--text-dim); font-size: 0.75rem; min-width: 2.6rem; }
.edit-reps, .edit-weight {
    width: 3.2rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem;
    font: inherit;
    text-align: center;
}
.edit-x { color: var(--text-dim); }
.edit-diff {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem;
    font: inherit;
}
.edit-save, .del-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    padding: 0.2rem 0.3rem;
}

/* Keep-screen-awake toggle */
.wakelock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    cursor: pointer;
}
.wakelock input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.wakelock-status { margin-left: auto; font-size: 0.7rem; }

/* Weight page */
.weight-now { text-align: center; margin: 0.5rem 0 1rem; }
.weight-big { font-size: 2.6rem; font-weight: 800; }
.weight-big small { font-size: 1rem; color: var(--text-dim); font-weight: 600; }
.weight-change { display: inline-block; margin-left: 0.5rem; font-weight: 700; font-size: 0.9rem; }
.weight-change.down { color: var(--accent); }
.weight-change.up { color: #f59e0b; }
.weight-when { color: var(--text-dim); font-size: 0.78rem; margin-top: 0.2rem; }
.weight-add { margin: 1rem 0; }
.weight-add button { margin-top: 0.5rem; width: 100%; }
.weight-add input[type=date], .weight-add input[type=number] {
    width: 100%; box-sizing: border-box;
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border); border-radius: 9px; padding: 0.7rem; font: inherit;
}
.sync-note {
    background: var(--surface-2); border-radius: 10px; padding: 0.7rem 0.9rem;
    font-size: 0.82rem; color: var(--text-dim); margin-bottom: 1rem;
}
