/* ============ RESET / BASE ============ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

:root {
    --bg: #0f1020;
    --bg-elevated: #1a1b2e;
    --bg-card: #232442;
    --bg-card-hover: #2a2c4d;
    --text: #f4f4f9;
    --text-muted: #9a9bb5;
    --text-faint: #6a6b85;
    --accent: #7c5cff;
    --accent-bright: #9a82ff;
    --accent-dark: #5b3fd9;
    --success: #4ade80;
    --warn: #fbbf24;
    --danger: #f87171;
    --border: #2f314f;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.4;
    min-height: 100vh;
    min-height: 100dvh;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

/* ============ VIEWS ============ */
.view {
    padding: calc(20px + var(--safe-top)) 20px calc(100px + var(--safe-bottom));
    min-height: 100vh;
    min-height: 100dvh;
    animation: fadeIn 0.25s ease-out;
}

.view.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ TYPOGRAPHY ============ */
h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 16px;
    font-weight: 600;
}

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }
.optional { color: var(--text-faint); font-weight: 400; font-size: 13px; }

.brand {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

/* ============ HEADER ============ */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.app-header h1 {
    flex: 1;
}

.icon-btn {
    background: var(--bg-card);
    border: none;
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.icon-btn:active {
    background: var(--bg-card-hover);
}

.timer {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-bright);
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.auth-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.15s;
}

.auth-chip.authed {
    background: rgba(124, 92, 255, 0.15);
    border-color: rgba(124, 92, 255, 0.4);
    color: var(--accent-bright);
}

.auth-chip:active {
    transform: scale(0.96);
}

/* ============ ONBOARDING ============ */
.onboarding-wrap {
    padding-top: 20px;
}

.onboarding-wrap > p {
    margin-bottom: 32px;
}

.step {
    animation: slideIn 0.3s ease-out;
}

.step.hidden {
    display: none;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============ FORM ============ */
label {
    display: block;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

label.check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.15s;
}

label.check-row:has(input:checked) {
    background: rgba(124, 92, 255, 0.1);
    border-color: var(--accent);
}

label.check-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

label.check-row span {
    color: var(--text);
    font-size: 15px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 14px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239a9bb5' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 36px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.row {
    display: flex;
    gap: 10px;
}

.row > * {
    flex: 1;
}

/* ============ BUTTONS ============ */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.15s;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35);
}

.btn-primary:active {
    background: var(--accent-dark);
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--bg-card);
    color: var(--text-faint);
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:active {
    background: var(--bg-card-hover);
    transform: scale(0.98);
}

.btn-row {
    display: flex;
    gap: 12px;
}

.btn-row > * {
    flex: 1;
}

.action-row {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-row .btn-primary,
.action-row .btn-secondary {
    margin-top: 0;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.today-summary {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(124, 92, 255, 0.05));
    border-color: rgba(124, 92, 255, 0.3);
}

.day-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-bright);
    font-weight: 700;
    margin-bottom: 6px;
}

.workout-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.workout-meta {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============ EXERCISE LIST ============ */
.exercise-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.exercise-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.exercise-card h3 {
    flex: 1;
    font-size: 17px;
}

.exercise-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    background: var(--bg-elevated);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}

.exercise-tag.cardio { color: var(--warn); background: rgba(251, 191, 36, 0.1); }
.exercise-tag.core { color: var(--accent-bright); background: rgba(124, 92, 255, 0.1); }
.exercise-tag.strength { color: var(--success); background: rgba(74, 222, 128, 0.1); }
.exercise-tag.mobility { color: #60a5fa; background: rgba(96, 165, 250, 0.1); }

.exercise-target {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.exercise-target strong {
    color: var(--text);
}

.exercise-notes {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    line-height: 1.5;
}

.exercise-progression {
    font-size: 12px;
    color: var(--success);
    margin-top: 6px;
    font-weight: 500;
}

.exercise-progression.same {
    color: var(--text-faint);
}

/* Equipment chips (small pills below exercise name) */
.equipment-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 12px;
}

.equipment-chip {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.equipment-chip[data-eq="forceusa"] {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--success);
}
.equipment-chip[data-eq="pilates"] {
    background: rgba(124, 92, 255, 0.1);
    border-color: rgba(124, 92, 255, 0.3);
    color: var(--accent-bright);
}
.equipment-chip[data-eq="yogamat"] {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    color: #60a5fa;
}
.equipment-chip[data-eq="treadmill"] {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: var(--warn);
}
.equipment-chip[data-eq="dumbbells"] {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger);
}

/* Footer row on exercise card: progression + last-status side by side */
.card-footer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.progress-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.progress-tag.up   { color: var(--success); background: rgba(74, 222, 128, 0.1); }
.progress-tag.same { color: var(--text-faint); background: var(--bg-elevated); }
.progress-tag.new  { color: var(--accent-bright); background: rgba(124, 92, 255, 0.1); }

.status-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.status-badge.done    { color: var(--success); background: rgba(74, 222, 128, 0.1); }
.status-badge.partial { color: var(--warn);    background: rgba(251, 191, 36, 0.1); }
.status-badge.skipped { color: var(--text-faint); background: var(--bg-elevated); }

/* "How to do this exercise" tutorial link (fallback when no image) */
.tutorial-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    color: var(--accent-bright);
    border: 1px solid rgba(124, 92, 255, 0.25);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

.tutorial-link:active {
    background: rgba(124, 92, 255, 0.15);
    transform: scale(0.99);
}

/* Inline tutorial image (preferred): shown directly on the card */
.tutorial-image-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 0;
    background: var(--bg-elevated);
    border: 1px solid rgba(124, 92, 255, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s;
}

.tutorial-image-btn:active {
    transform: scale(0.99);
    border-color: var(--accent);
}

.tutorial-thumb {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #fff;
}

.tutorial-label {
    display: block;
    padding: 8px 12px;
    color: var(--accent-bright);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* Modal with both start + end position images */
.tutorial-modal-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.tutorial-modal-images img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #fff;
    border-radius: var(--radius-sm);
    display: block;
}

@media (max-width: 480px) {
    .tutorial-modal-images img {
        height: 140px;
    }
}

/* ============ LOG WORKOUT ============ */
.log-exercise {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    transition: all 0.2s;
}

.log-exercise.completed {
    background: rgba(74, 222, 128, 0.05);
    border-color: rgba(74, 222, 128, 0.3);
}

.log-exercise.partial {
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.3);
}

.log-exercise.skipped {
    opacity: 0.5;
}

.log-exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.log-exercise h3 {
    flex: 1;
    font-size: 16px;
}

.log-target {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.set-row {
    display: grid;
    grid-template-columns: 36px 1fr 1fr 44px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.set-row.no-weight {
    grid-template-columns: 36px 1fr 44px;
}

.set-row.time-based {
    grid-template-columns: 36px 1fr 44px;
}

.set-num {
    font-size: 13px;
    color: var(--text-faint);
    font-weight: 600;
    text-align: center;
}

.set-row input {
    margin: 0;
    padding: 10px 8px;
    text-align: center;
    font-size: 15px;
    -moz-appearance: textfield;
}

.set-row input::-webkit-outer-spin-button,
.set-row input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.set-check {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.set-check.done {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.set-row-labels {
    display: grid;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.set-row-labels.weight-reps {
    grid-template-columns: 36px 1fr 1fr 44px;
}

.set-row-labels.no-weight {
    grid-template-columns: 36px 1fr 44px;
}

.set-row-labels span {
    text-align: center;
}

.set-row-labels span:first-child,
.set-row-labels span:last-child {
    text-align: center;
}

/* RIR (Reps In Reserve) feedback buttons */
.rir-row {
    margin: 14px 0 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.rir-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.rir-hint {
    font-weight: 400;
    color: var(--text-faint);
    font-size: 11px;
}

.rir-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.rir-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    transition: all 0.15s;
    cursor: pointer;
}

.rir-btn .rir-sub {
    display: block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
    opacity: 0.7;
}

.rir-btn:active {
    transform: scale(0.96);
}

.rir-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.rir-btn.active.failure {
    background: var(--danger);
    border-color: var(--danger);
}

.rir-btn.active.easy {
    background: var(--success);
    border-color: var(--success);
    color: #0f1020;
}

.log-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.log-actions button {
    flex: 1;
    background: var(--bg-elevated);
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
}

.log-actions button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.log-actions button.skip-active {
    background: var(--text-faint);
    color: white;
    border-color: var(--text-faint);
}

/* ============ HISTORY ============ */
.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
}

.history-item:active {
    background: var(--bg-card-hover);
}

.history-item-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.history-item-info .date {
    font-size: 12px;
    color: var(--text-muted);
}

.history-item-stats {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
}

.history-item-stats .duration {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

/* ============ PROGRESS ============ */
.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
}

.progress-card h3 {
    margin-bottom: 12px;
    color: var(--accent-bright);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-box {
    background: var(--bg-elevated);
    padding: 14px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-box .num {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    display: block;
}

.stat-box .lbl {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pr-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pr-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.pr-row:last-child {
    border-bottom: none;
}

.pr-row .pr-val {
    color: var(--accent-bright);
    font-weight: 600;
}

/* ============ SESSION MODIFIERS (Today view) ============ */
.modifier-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-top: 16px;
    margin-bottom: 12px;
}

.modifier-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.modifier-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.modifier-btn {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.modifier-btn:active {
    transform: scale(0.98);
}

.modifier-btn.active {
    background: rgba(124, 92, 255, 0.18);
    border-color: var(--accent);
    color: var(--accent-bright);
}

.modifier-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.mod-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 8px;
    vertical-align: middle;
}

.mod-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
}

.mod-tag.short { background: rgba(251, 191, 36, 0.18); color: var(--warn); }
.mod-tag.easy  { background: rgba(96, 165, 250, 0.18); color: #60a5fa; }

/* Swap button on exercise card */
.exercise-card-header .swap-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.exercise-card-header .swap-btn:active {
    background: rgba(124, 92, 255, 0.15);
    border-color: var(--accent);
    color: var(--accent-bright);
}

.swap-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    max-height: 50vh;
    overflow-y: auto;
}

.swap-option {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    transition: all 0.15s;
}

.swap-option:active {
    transform: scale(0.99);
    border-color: var(--accent);
}

.swap-option-name {
    font-weight: 600;
    margin-bottom: 6px;
}

/* ============ WEIGHT TRACKING (Progress page) ============ */
.weight-card {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.08), rgba(124, 92, 255, 0.02));
}

.weight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.weight-card-header h3 {
    margin-bottom: 0;
}

.weight-log-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.weight-log-btn:active {
    transform: scale(0.97);
    background: var(--accent-dark);
}

.weight-empty {
    text-align: center;
    padding: 20px 8px 8px;
    color: var(--text-muted);
}

.weight-empty p {
    margin-bottom: 4px;
}

.weight-stats {
    margin-bottom: 12px;
}

.weight-latest {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.weight-meta {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 13px;
}

.weight-delta {
    font-weight: 600;
}

.weight-delta.good    { color: var(--success); }
.weight-delta.warn    { color: var(--warn); }
.weight-delta.neutral { color: var(--text-muted); }

.weight-goal-status {
    color: var(--text-muted);
}

.weight-goal-status.hit {
    color: var(--success);
    font-weight: 700;
}

.weight-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    margin: 8px 0 8px;
    background: rgba(15, 16, 32, 0.4);
    border-radius: var(--radius-sm);
}

.weight-footer {
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
    margin-top: 6px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent-bright);
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.link-btn:active {
    background: rgba(124, 92, 255, 0.15);
}

.link-btn.danger {
    color: var(--danger);
}

.weight-history-row {
    display: grid;
    grid-template-columns: 1fr 80px 70px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.weight-history-row .weight-history-val {
    color: var(--accent-bright);
    font-weight: 600;
    text-align: right;
}

/* ============ NUDGE BANNER (top of Today view) ============ */
.nudge-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 14px;
    animation: slideInTop 0.3s ease-out;
}

@keyframes slideInTop {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nudge-banner.warm    { background: rgba(124, 92, 255, 0.1); border-color: rgba(124, 92, 255, 0.3); }
.nudge-banner.gentle  { background: rgba(96, 165, 250, 0.08); border-color: rgba(96, 165, 250, 0.25); }
.nudge-banner.warn    { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.35); }
.nudge-banner.success { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.3); }
.nudge-banner.info    { background: var(--bg-card); }

.nudge-banner .nudge-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.nudge-banner .nudge-text {
    flex: 1;
    min-width: 0;
}

.nudge-banner .nudge-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.nudge-banner .nudge-message {
    font-size: 13px;
    color: var(--text-muted);
}

.nudge-banner .nudge-action {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.nudge-banner .nudge-dismiss {
    background: transparent;
    color: var(--text-faint);
    border: none;
    font-size: 18px;
    line-height: 1;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
}

.nudge-banner .nudge-dismiss:active {
    background: rgba(255, 255, 255, 0.08);
}

/* ============ CONFETTI ============ */
.confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 300;
}

/* ============ PR CELEBRATION (in workout summary) ============ */
.pr-celebration {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.06));
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}

.pr-celebration .pr-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--warn);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.pr-celebration ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pr-celebration li {
    color: var(--text);
    font-size: 14px;
    padding: 4px 0;
    font-weight: 500;
}

.pr-celebration li .pr-name {
    color: var(--text-muted);
    font-weight: 400;
}

/* ============ REST TIMER BANNER ============ */
.rest-timer-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(72px + var(--safe-bottom));
    z-index: 90;
    width: calc(100% - 32px);
    max-width: 560px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: white;
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(124, 92, 255, 0.4);
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to   { transform: translate(-50%, 0);    opacity: 1; }
}

.rest-timer-banner.done {
    background: linear-gradient(135deg, #2db960, var(--success));
    animation: pulseDone 0.45s ease-out;
}

@keyframes pulseDone {
    0%   { transform: translate(-50%, 0) scale(1); }
    50%  { transform: translate(-50%, 0) scale(1.04); }
    100% { transform: translate(-50%, 0) scale(1); }
}

.rest-timer-banner .rest-info {
    flex: 1;
    min-width: 0;
}

.rest-timer-banner .rest-status {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.rest-timer-banner .rest-time {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 18px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    opacity: 1;
}

.rest-timer-banner .rest-name {
    font-size: 13px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rest-timer-banner .rest-action {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.rest-timer-banner .rest-action:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.96);
}

.rest-timer-banner .rest-close {
    padding: 6px 12px;
    font-size: 18px;
    line-height: 1;
}

/* ============ BOTTOM NAV ============ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    display: flex;
    padding: 8px 12px calc(8px + var(--safe-bottom));
    z-index: 100;
}

.nav-btn {
    flex: 1;
    background: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.nav-btn.active {
    color: var(--accent-bright);
    background: rgba(124, 92, 255, 0.1);
}

/* ============ RECAP ============ */
.recap-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.recap-card h3 {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.recap-card .recap-meta {
    font-size: 14px;
    color: var(--text);
}

/* ============ SETTINGS ============ */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}

.settings-section h3 {
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--accent-bright);
}

.danger-zone button {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    width: 100%;
    margin-top: 8px;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--border);
    animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal h2 {
    margin-bottom: 12px;
}

.modal p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 14px;
}

.modal .btn-row {
    margin-top: 16px;
}

/* ============ EMPTY STATES ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text);
}

.empty-state p {
    font-size: 14px;
}

/* ============ UTILITIES ============ */
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ============ DESKTOP TWEAKS ============ */
@media (min-width: 700px) {
    .view {
        padding: 32px 32px calc(120px + var(--safe-bottom));
    }
    h1 { font-size: 32px; }
    .brand { font-size: 44px; }
}
