@media (pointer: coarse) {
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

body {
    -webkit-overflow-scrolling: touch;
}

#page-content > * {
    animation: page-enter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.empty-state-card {
    text-align: center;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.empty-state-emoji {
    font-size: 2.75rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.empty-state-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state-body {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 22rem;
    line-height: 1.45;
}

.empty-state-button {
    margin-top: 0.75rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.ptr-indicator {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
    left: 50%;
    transform: translate(-50%, -120%);
    z-index: 1025;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bg-card);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    color: var(--brand-color);
    pointer-events: none;
    margin-left: -1.25rem;
}

.ptr-indicator .ptr-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.15rem;
}

.ptr-indicator .ptr-spinner i {
    transition: transform 0.18s ease;
}

.ptr-indicator.ptr-ready .ptr-spinner i {
    transform: rotate(180deg);
}

.ptr-indicator.ptr-refreshing .ptr-spinner i {
    animation: ptr-spin 0.8s linear infinite;
    transition: none;
}

@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translate3d(0, 12px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* ----- Light theme (default) ----- */

:root {
    --brand-color: #44A1D7;
    --brand-prefix-color: #212529;
    --bg-body: #ffffff;
    --bg-surface: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-muted: #6c757d;
    --text-placeholder: #b8bec5;
    --border-color: #dee2e6;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --nav-bg: #f8f9fa;
    --shadow-sm: rgba(0, 0, 0, 0.075);
}

/* ----- Dark theme ----- */

[data-theme="dark"] {
    color-scheme: dark;
    --brand-prefix-color: #e8eaed;
    --bg-body: #111318;
    --bg-surface: #1a1d23;
    --bg-card: #1e2128;
    --text-primary: #e8eaed;
    --text-muted: #9aa0a6;
    --text-placeholder: #5f6470;
    --border-color: #2d3139;
    --input-bg: #1e2128;
    --input-border: #3a3f47;
    --nav-bg: #1a1d23;
    --shadow-sm: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
    background-color: var(--bg-body);
    color: var(--text-primary);
}

[data-theme="dark"] .navbar,
[data-theme="dark"] .mobile-bottom-nav,
[data-theme="dark"] .bg-light {
    background-color: var(--nav-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .modal-content {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .list-group-item-action:hover {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--brand-color);
}

.form-control::placeholder,
.form-select::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-placeholder) !important;
    opacity: 1; /* Firefox dims placeholders by default - keep our exact color */
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-reset {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

[data-theme="dark"] .stats-card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .calendar-day {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .calendar-day:hover {
    background-color: var(--bg-surface);
}

[data-theme="dark"] .calendar-day.empty {
    background-color: transparent;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-body {
    color: var(--text-primary);
}

/* Bootstrap's modal-dialog-scrollable only makes .modal-content > .modal-body scroll.
   Our create-program modal wraps the body inside a <form>, breaking that selector.
   Force the nested modal-body to scroll when inside a scrollable dialog. */
.modal-dialog-scrollable form > .modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 10rem);
}

[data-theme="dark"] .btn-secondary {
    background-color: #3a3f47;
    border-color: #3a3f47;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="dark"] .card-header {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
}

[data-theme="dark"] .card-footer {
    background-color: var(--bg-surface);
    border-color: var(--border-color);
}

[data-theme="dark"] .nav-link {
    color: var(--text-muted);
}

[data-theme="dark"] .nav-link:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .mobile-nav-item {
    color: var(--text-muted);
}

[data-theme="dark"] .muscle-bar-track {
    background-color: var(--bg-surface);
}

[data-theme="dark"] .auth-card .form-label {
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:-webkit-autofill,
[data-theme="dark"] .form-control:-webkit-autofill:hover,
[data-theme="dark"] .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
    border-color: var(--input-border);
    transition: background-color 5000s ease-in-out 0s;
}

[data-theme="dark"] hr {
    border-color: var(--border-color);
}

/* ----- Flatpickr dark mode ----- */

[data-theme="dark"] .flatpickr-calendar {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .flatpickr-months .flatpickr-month,
[data-theme="dark"] .flatpickr-months .flatpickr-prev-month,
[data-theme="dark"] .flatpickr-months .flatpickr-next-month {
    color: var(--text-primary);
    fill: var(--text-primary);
}

[data-theme="dark"] .flatpickr-months .flatpickr-prev-month:hover svg,
[data-theme="dark"] .flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--brand-color);
}

[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
[data-theme="dark"] .flatpickr-current-month input.cur-year {
    background: transparent;
    color: var(--text-primary);
}

[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] span.flatpickr-weekday {
    color: var(--text-muted);
}

[data-theme="dark"] .flatpickr-day {
    color: var(--text-primary);
}

[data-theme="dark"] .flatpickr-day:hover,
[data-theme="dark"] .flatpickr-day:focus {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

[data-theme="dark"] .flatpickr-day.today {
    border-color: var(--brand-color);
}

[data-theme="dark"] .flatpickr-day.today:hover {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: white;
}

[data-theme="dark"] .flatpickr-day.selected {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: white;
}

[data-theme="dark"] .flatpickr-day.flatpickr-disabled,
[data-theme="dark"] .flatpickr-day.prevMonthDay,
[data-theme="dark"] .flatpickr-day.nextMonthDay {
    color: var(--text-muted);
}

/* ----- Theme toggle button ----- */

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted, #6c757d);
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    color: var(--text-primary, #212529);
    border-color: var(--text-muted, #6c757d);
}

/* Light mode: show moon icon, hide sun */
.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: inline;
}

/* Dark mode: show sun icon, hide moon */
[data-theme="dark"] .theme-toggle .icon-sun {
    display: inline;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* ----- Shared redesign primitives ----- */

/* Page that bleeds to screen edges */
.page-bleed {
    margin: 0 -0.75rem;
    padding: 0 1rem 1.5rem;
}

/* Uppercase muted section header */
.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #6c757d);
    padding: 0 0.25rem 0.5rem;
}

/* Themed card (bg, border, radius) */
.styled-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.75rem;
}

/* About page card */
.about-card {
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Tappable card link */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.card-link:hover {
    color: inherit;
}

.program-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.program-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.program-section-rounds {
    font-size: 0.7rem;
}

.swipe-row {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    margin-bottom: 0.6rem;
}

.swipe-content {
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease;
    will-change: transform;
    touch-action: pan-y;
}

.swipe-row .swipe-content > * {
    margin-bottom: 0;
    border-radius: 0;
}

.swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    display: flex;
}

.swipe-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    border: 0;
    padding: 0 1.15rem;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
}

.swipe-action i {
    font-size: 1.15rem;
}

.swipe-action.start {
    background: var(--brand-color);
}

.swipe-action.delete {
    background: #dc3545;
}

.calendar-workout-list > .swipe-row {
    margin-bottom: 0;
}

.support-navbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0 0.75rem;
}

.support-nav-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.support-nav-title {
    font-size: 1.35rem;
    font-weight: 700;
    flex-grow: 1;
}

.support-nav-spacer {
    width: 2.25rem;
}

.support-label {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.support-textarea {
    resize: vertical;
}

.support-help {
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.support-new-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.support-new-button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.support-thread-row {
    display: block;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.support-thread-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.support-type-chip {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
    color: #ffffff;
}

.support-type-bug {
    background: #dc3545;
}

.support-type-feature {
    background: #f0883e;
}

.support-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.support-status-open {
    color: var(--brand-color);
    border-color: var(--brand-color);
}

.support-status-answered {
    color: #2e7d32;
    border-color: #2e7d32;
}

.support-thread-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--brand-color);
    margin-left: auto;
}

.support-thread-preview {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.support-thread-time {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.support-thread-page {
    display: flex;
    flex-direction: column;
}

.support-thread-messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.support-bubble {
    max-width: 80%;
    padding: 0.6rem 0.8rem;
    border-radius: 0.9rem;
}

.support-bubble-user {
    align-self: flex-end;
    background: var(--brand-color);
    color: #ffffff;
    border-bottom-right-radius: 0.2rem;
}

.support-bubble-admin {
    align-self: flex-start;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0.2rem;
}

.support-bubble-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.92rem;
    line-height: 1.4;
}

.support-bubble-time {
    margin-top: 0.25rem;
    font-size: 0.68rem;
    opacity: 0.7;
}

.support-reply-form {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    background: var(--bg-card, #fff);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 0;
    z-index: 10;
}

.support-reply-input {
    resize: none;
}

.support-reply-send {
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .support-thread-messages {
        padding-bottom: 5rem;
    }
    .support-reply-form {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0.75rem 1rem calc(0.75rem + 3.75rem + env(safe-area-inset-bottom, 0px));
        z-index: 1039;
    }
}

.support-unread-indicator {
    background: var(--brand-color);
    color: #ffffff;
    font-size: 0.65rem;
    min-width: 1.1rem;
    line-height: 1.1rem;
    padding: 0 0.35rem;
}

.mobile-nav-item .support-unread-indicator {
    position: absolute;
    top: -2px;
    right: 50%;
    transform: translateX(1.1rem);
}

/* Colored icon square (used in settings rows, quick links, etc.) */
.icon-sq {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    flex-shrink: 0;
    color: white;
}

.icon-sq-sm { width: 32px; height: 32px; font-size: 0.95rem; }
.icon-sq-md { width: 40px; height: 40px; font-size: 1.1rem; }

.icon-sq.blue    { background: var(--brand-color); }
.icon-sq.green   { background: #4caf50; }
.icon-sq.orange  { background: #ff9800; }
.icon-sq.purple  { background: #9c27b0; }
.icon-sq.red     { background: #ef5350; }
.icon-sq.teal    { background: #26a69a; }
.icon-sq.violet  { background: #7C4DFF; }

/* Stat pill: value + label, centered */
.stat-pill {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
}

.stat-pill-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brand-color);
    line-height: 1.2;
}

.stat-pill-label {
    font-size: 0.6rem;
    color: var(--text-muted, #6c757d);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-top: 0.15rem;
}

/* ----- Home page ----- */

.home-greeting {
    padding: 0 0 0.5rem;
}

.home-greeting-text {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-greeting-date {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.15rem;
}

.home-hero-card {
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    margin: 0.6rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-decoration: none;
    color: white;
}

.home-hero-card:first-of-type {
    margin-top: 1rem;
}

.home-hero-card:hover,
.home-hero-card:active {
    color: white;
}

.home-hero-start {
    background: linear-gradient(135deg, #1565C0 0%, var(--brand-color) 100%);
}

.home-hero-community {
    background: linear-gradient(135deg, #8E24AA 0%, #EC407A 100%);
}

.home-hero-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.home-hero-subtitle {
    font-size: 0.78rem;
    opacity: 0.92;
    margin-top: 0.15rem;
}

.home-hero-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.home-activity-strip {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 6px;
}

.home-activity-strip::-webkit-scrollbar {
    display: none;
}

.home-activity-day {
    flex: 0 0 calc((100% - 6 * 0.35rem) / 7);
    text-align: center;
    padding: 0.5rem 0.2rem;
    border-radius: 0.75rem;
    background: var(--bg-card, #fff);
    border: 1.5px solid transparent;
}

.home-activity-day.today {
    border-color: var(--brand-color);
}

.home-activity-day-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    color: var(--text-muted, #6c757d);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.home-activity-day-num {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.home-activity-day-dots {
    display: flex;
    gap: 2px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 14px;
    margin-top: 0.2rem;
}

.home-week-stats {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.home-week-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.625rem;
    background: var(--bg-card, #fff);
    padding: 0.5rem 0.7rem;
}

.home-week-pill-label {
    color: var(--text-muted, #6c757d);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.home-week-pill-value {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--brand-color, #44A1D7);
}

/* Last Workout card on Home reuses the shared .wkt-card primitives. */

.home-qa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.home-qa-card {
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.home-qa-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-qa-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.1rem;
}

/* ----- Workouts page ----- */

.wkt-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--brand-color);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(66, 165, 245, 0.2);
}

.wkt-card {
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.wkt-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.wkt-date {
    font-size: 0.95rem;
    font-weight: 600;
}

.wkt-relative {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    margin-left: 0.5rem;
    font-weight: 400;
}

.wkt-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 1rem;
}

.wkt-badge-done {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
}

.wkt-badge-progress {
    background: rgba(255, 183, 77, 0.15);
    color: #ffb74d;
}

.wkt-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.wkt-dots .category-dot {
    width: 8px;
    height: 8px;
}

.wkt-date-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.wkt-dots-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.wkt-dots-inline .category-dot {
    width: 8px;
    height: 8px;
}

.wkt-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-muted, #6c757d);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color, #dee2e6);
}

.wkt-stats i {
    font-size: 0.82rem;
    opacity: 0.7;
    margin-right: 0.2rem;
}

/* ----- Log workout page ----- */

.log-page .workout-header {
    background: var(--bg-surface, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #dee2e6);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 1rem;
}

/* Exercise cards */
.log-page .exercise-card {
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color, #dee2e6);
    background: var(--bg-card, #fff);
}

.log-page .exercise-card .card-header {
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--border-color, #dee2e6);
    padding: 0.3rem 1rem;
}

.log-page .exercise-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
}

.log-page .exercise-card .card-body {
    padding: 0.5rem 1rem 0;
}

/* Up/down arrow stack on each exercise card for reordering. Tight vertical
   stack keeps the column narrow without losing touch-target size. */
.log-page .exercise-reorder-buttons {
    flex-shrink: 0;
    line-height: 1;
}
.log-page .exercise-reorder-buttons button {
    padding: 0.1rem 0.35rem !important;
    font-size: 1rem;
    line-height: 1;
}
.log-page .exercise-reorder-buttons button:disabled {
    opacity: 0.25;
    pointer-events: none;
}

.log-page .last-time-hint {
    font-size: 0.75rem;
}

.log-page .sets-table .row {
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

/* Set input form - bigger inputs for gym use */
.log-page .set-form {
    background: var(--bg-surface, #f8f9fa);
    border-top: 1px solid var(--border-color, #dee2e6);
    margin: 0 -1rem;
    padding: 0.6rem 1rem 0.4rem;
    --bs-gutter-y: 0.4rem;
}

.log-page .set-form input[type="number"],
.log-page .set-form input[type="text"] {
    height: 32px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
    border-radius: 0.5rem;
    padding: 0 0.4rem;
    min-width: 0;
}

/* Hide native number input spinner arrows inside the set form.
   They steal ~18px of horizontal space and users on mobile type directly. */
.log-page .set-form input[type="number"]::-webkit-outer-spin-button,
.log-page .set-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.log-page .set-form input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.log-page .set-form input[type="number"]:focus,
.log-page .set-form input[type="text"]:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.15);
}

/* Cardio time field: two side-by-side number inputs (MM and SS) joined by a
   colon so the pair visually reads like a clock. Uses CSS grid so the two
   inputs always share the column equally and never wrap onto separate lines,
   even on narrow viewports. */
.log-page .set-form .cardio-time-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
}

.log-page .set-form .cardio-time-inputs input[type="number"] {
    width: 100%;
    min-width: 0;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
}

.log-page .set-form .cardio-time-separator {
    font-weight: 600;
    color: var(--text-muted, #888);
    line-height: 1;
    text-align: center;
}

.log-page .set-form button[type="submit"] {
    height: 32px;
    font-size: 0.9rem;
    font-weight: 400;
    border-radius: 0.5rem;
    align-self: end;
}

/* Warmup toggle - iOS-style switch. The native checkbox is visually hidden
   but kept for form submission and accessibility. The wrapper matches the
   input/button height (32px) so the toggle bottom-aligns with siblings on
   the same row. */
.log-page .warmup-switch {
    display: inline-flex;
    align-items: center;
    height: 32px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.log-page .warmup-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.log-page .warmup-switch-track {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 18px;
    background: var(--border-color, #ced4da);
    border-radius: 999px;
    transition: background-color 150ms ease;
    flex-shrink: 0;
}

.log-page .warmup-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 150ms ease;
}

.log-page .warmup-switch input:checked + .warmup-switch-track {
    background: #FFA726;
}

.log-page .warmup-switch input:checked + .warmup-switch-track .warmup-switch-knob {
    transform: translateX(22px);
}

.log-page .warmup-switch input:focus-visible + .warmup-switch-track {
    outline: 2px solid var(--brand-color, #44A1D7);
    outline-offset: 2px;
}

.log-page .warmup-switch-label {
    font-size: 0.85rem;
    color: var(--text-muted, #6c757d);
}


/* Fixed bottom action bar */
.log-bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface, #f8f9fa);
    border-top: 1px solid var(--border-color, #dee2e6);
    padding: 0.75rem 1rem;
    z-index: 90;
    display: flex;
    gap: 0.5rem;
}

.log-btn-add {
    flex: 1;
    height: 48px;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #212529);
    border: 1.5px solid var(--border-color, #dee2e6);
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.log-btn-add i {
    color: var(--brand-color);
}

.log-btn-finish {
    flex: 1;
    height: 48px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.log-btn-delete {
    width: 48px;
    height: 48px;
    background: var(--bg-card, #fff);
    color: #ef5350;
    border: 1.5px solid var(--border-color, #dee2e6);
    border-radius: 0.625rem;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Extra padding at bottom so content isn't hidden behind fixed bar */
.log-page {
    padding-bottom: 5rem;
}

@media (max-width: 767.98px) {
    .log-bottom-actions {
        padding-bottom: calc(0.75rem + 3.75rem + env(safe-area-inset-bottom, 0px));
    }

    .log-page {
        padding-bottom: calc(8rem + env(safe-area-inset-bottom, 0px));
    }
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
}

.brand-prefix {
    color: var(--brand-prefix-color);
}

.brand-suffix {
    color: var(--brand-color);
}

/* Larger brand on the home hero */
.text-center .brand-name {
    font-size: 2.5rem;
}

/* ----- Home: last 7 days activity strip ----- */

.recent-day {
    flex: 1;
    max-width: 50px;
    padding: 0.4rem 0.2rem;
    border-radius: 0.5rem;
}

.recent-day.today {
    background: var(--bg-card, #fff);
    border: 2px solid var(--brand-color);
}

.recent-day-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-muted, #6c757d);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.recent-day-num {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary, #212529);
}

.recent-day-dots {
    display: flex;
    gap: 2px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 14px;
    margin-top: 0.25rem;
}

/* Filter bar pills */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
}

.filter-bar button.active {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
    color: white;
}

/* Exercise list items */
.exercise-list .list-group-item {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Search input */
.ex-search {
    border-radius: 2rem;
    padding-left: 1rem;
}

/* Small colored dot used for category indicators */
.category-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Centered, narrow card for login/register */
.auth-card {
    max-width: 400px;
    padding: 1rem;
    padding-bottom: 3rem;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 2.8rem;
}

.password-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted, #6c757d);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--text-primary, #212529);
}

/* Live log: tighter exercise card padding for mobile */
.exercise-card .card-body {
    padding: 0.75rem;
}

/* Bigger inputs in the set form - easier to tap on a phone */
.set-form input[type="number"] {
    font-size: 1.1rem;
    padding: 0.5rem 0.6rem;
}

/* Sets table rows: subtle alternating background for readability */
.sets-table .row + .row {
    border-top-color: rgba(0, 0, 0, 0.05);
}

/* ----- Motivation toast (during training) -----
   Big, loud, and punchy - a brand-gradient card that lands with a shake or pop.
   The old subtle-dark-toast style was too easy to miss mid-workout. */

.motivation-toast {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #44A1D7 0%, #7E57C2 60%, #EF5350 120%);
    color: #fff;
    border: none;
    padding: 1.1rem 1.5rem;
    border-radius: 1rem;
    box-shadow:
        0 12px 40px rgba(66, 165, 245, 0.55),
        0 0 0 3px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.2px;
    max-width: 88vw;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    z-index: 1060;
    opacity: 0;
    pointer-events: none;
    animation-duration: 0.7s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.motivation-toast.hide {
    animation-duration: 0.45s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-in;
}

@keyframes toast-pop-in {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-6deg); }
    60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(3deg); }
    80%  {             transform: translate(-50%, -50%) scale(0.96) rotate(-1.5deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1)    rotate(0deg); }
}

@keyframes toast-shake-in {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    35%  { opacity: 1; transform: translate(-58%, -50%) scale(1.05); }
    50%  { opacity: 1; transform: translate(-42%, -50%) scale(1); }
    65%  { opacity: 1; transform: translate(-55%, -50%) scale(1); }
    80%  { opacity: 1; transform: translate(-45%, -50%) scale(1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes toast-slam-in {
    0%   { opacity: 0; transform: translate(-50%, -220%) scale(1.15) rotate(-8deg); }
    60%  { opacity: 1; transform: translate(-50%, -42%)  scale(1.05) rotate(2deg); }
    80%  { opacity: 1; transform: translate(-50%, -52%)  scale(0.98) rotate(-1deg); }
    100% { opacity: 1; transform: translate(-50%, -50%)  scale(1)    rotate(0deg); }
}

@keyframes toast-bounce-in {
    0%   { opacity: 0; transform: translate(-50%, 200%)  scale(0.8); }
    60%  { opacity: 1; transform: translate(-50%, -55%)  scale(1.1); }
    80%  { opacity: 1; transform: translate(-50%, -48%)  scale(0.97); }
    100% { opacity: 1; transform: translate(-50%, -50%)  scale(1); }
}

@keyframes toast-zoom-out {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to   { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(4deg); }
}

@keyframes toast-slide-out-up {
    from { opacity: 1; transform: translate(-50%, -50%); }
    to   { opacity: 0; transform: translate(-50%, -140%) rotate(-5deg); }
}

@keyframes toast-fade-out {
    from { opacity: 1; transform: translate(-50%, -50%); }
    to   { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}

/* ----- Motivation overlay (workout finished) ----- */

.motivation-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.motivation-overlay.show {
    opacity: 1;
}

.motivation-overlay.fade-out {
    opacity: 0;
}

.motivation-overlay-content {
    text-align: center;
    color: white;
    max-width: 85vw;
    animation: motivation-scale-in 0.5s ease-out;
}

@keyframes motivation-scale-in {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.motivation-overlay-icon {
    font-size: 3.5rem;
    color: #FFD700;
    margin-bottom: 1rem;
    animation: motivation-bounce 0.6s ease-out 0.3s both;
}

@keyframes motivation-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.motivation-overlay-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.motivation-overlay-quote {
    font-size: 1.15rem;
    font-style: italic;
    line-height: 1.5;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto;
    animation: motivation-fade-up 0.5s ease-out 0.5s both;
}

@keyframes motivation-fade-up {
    0% { transform: translateY(15px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0.9; }
}

.motivation-overlay-dismiss {
    animation: motivation-fade-up 0.5s ease-out 0.8s both;
}

/* ----- Calendar ----- */

.calendar-day-headers,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.calendar-day-headers {
    margin-bottom: 0.25rem;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.25rem 0;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid var(--border-color, #e0e0e0);
    background: var(--bg-card, white);
    border-radius: 0.375rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    position: relative;
    color: var(--text-primary, #333);
    transition: background 0.1s ease;
}

.calendar-day:hover {
    background: var(--bg-surface, #f5f5f5);
}

.calendar-day.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
    pointer-events: none;
}

.calendar-day.today {
    border-color: var(--brand-color);
    border-width: 2px;
    font-weight: 600;
}

/* Removed single-dot ::after - now using multi-colored dots via JS */

.calendar-category-dots {
    display: flex;
    gap: 2px;
    justify-content: center;
    position: absolute;
    bottom: 3px;
    left: 0;
    right: 0;
}

.calendar-cat-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-day.selected {
    background: var(--brand-color);
    color: white;
    border-color: var(--brand-color);
}

.calendar-day.selected .calendar-cat-dot {
    /* make dots more visible on the selected (solid brand-color) background */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.calendar-day-number {
    line-height: 1;
}

.calendar-workout-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-workout-card {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.1s ease;
}

.calendar-workout-card:hover {
    background: var(--bg-surface, #f5f5f5);
}

.calendar-workout-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.calendar-workout-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.calendar-workout-title-dots {
    display: inline-flex;
    gap: 0.2rem;
}

.calendar-workout-exercises {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    padding-top: 0.75rem;
}

.calendar-workout-exercise-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.calendar-set-row {
    display: grid;
    grid-template-columns: 2rem 1fr 1fr 3.5rem;
    gap: 0.5rem;
    align-items: center;
    padding: 0.2rem 0;
    font-size: 0.85rem;
}

.calendar-set-row.calendar-set-header {
    color: var(--text-muted, #888);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.calendar-set-col-index {
    color: var(--text-muted, #888);
}

.calendar-set-tag {
    font-size: 0.6rem;
    vertical-align: middle;
}

/* ----- Stats ----- */

/* stats-card replaced by shared .styled-card .stat-pill */

.pr-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-color);
    line-height: 1;
}

.muscle-bar-track {
    background: var(--bg-surface, #f0f0f0);
    border-radius: 0.25rem;
    height: 14px;
    overflow: hidden;
}

.muscle-bar-fill {
    background: var(--brand-color);
    height: 100%;
    border-radius: 0.25rem;
    transition: width 0.3s ease;
}

/* ----- Rest timer pill (LogWorkoutPage) ----- */

.rest-timer-pill {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-color);
    color: white;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    user-select: none;
}

.rest-timer-pill .rest-timer-label {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
}

.rest-timer-pill .rest-timer-time {
    font-size: 1.1rem;
}

.rest-timer-pill.done {
    background: #4caf50;
    animation: rest-timer-pulse 1.4s ease-in-out infinite;
}

@keyframes rest-timer-pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(76, 175, 80, 0.4); }
    50%      { box-shadow: 0 4px 24px rgba(76, 175, 80, 0.8); }
}

/* ----- Mobile bottom nav ----- */

.mobile-bottom-nav {
    padding: 0.4rem 0;
    z-index: 1040;
}

.mobile-nav-item {
    color: #666;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active {
    color: var(--brand-color);
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    color: var(--brand-color);
}

/* ----- Mobile polish ----- */

/* Tap-friendly "Log" button on the set form (scoped to workout log only) */
log-workout-page .set-form button[type="submit"] {
    min-height: 32px;
    font-size: 0.9rem;
    font-weight: 400;
}

/* The inline Log button shares a row with weight/reps (strength) or
   min/sec/dist (cardio) inputs. The row uses align-items-end so this button
   bottom-aligns with the inputs (whose labels sit above them). */
log-workout-page .set-form button.log-set-inline-button {
    font-size: 0.9rem;
    padding: 0 0.5rem;
    white-space: nowrap;
    min-width: 0;
    height: 32px;
    line-height: 1;
}

/* Workout date picker - styled to look like plain clickable text in the header, not a form input.
   flatpickr attaches to a hidden input and creates a visible altInput that inherits this class. */
.workout-date-input {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brand-color, #44A1D7);
    cursor: pointer;
    width: auto;
    min-width: 0;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}
.workout-date-input:focus,
.workout-date-input:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Slightly more breathing room above the bottom action buttons so the
   rest timer pill doesn't sit directly on top of them on short pages */
.exercise-card:last-of-type {
    margin-bottom: 1.5rem;
}

/* ----- Account page ----- */

.account-banner {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.15) 0%, var(--bg-card, #f8f9fa) 100%);
    padding: 2rem 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

/* Action icons in top-right of profile banner (Edit profile + Settings) */
.account-banner-actions-top {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-banner-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.5rem;
    color: var(--text-muted, #6c757d);
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 120ms ease, background-color 120ms ease;
}

.profile-banner-icon-button:hover {
    color: var(--text-primary, #212529);
    background: rgba(255, 255, 255, 0.04);
}

.account-avatar-slot {
    flex-shrink: 0;
}

.account-banner-info {
    min-width: 0;
}

.account-banner-name {
    font-size: 1.15rem;
    font-weight: 600;
}

.account-banner .account-email {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-bio {
    font-size: 0.85rem;
    color: var(--text-primary, #212529);
    margin-top: 0.35rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.account-bio:empty {
    display: none;
}

/* ----- Shared avatar component (Avatar.js) ----- */

.alpin-avatar {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    user-select: none;
}

/* ----- Emoji picker (EmojiPicker.js) ----- */

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.emoji-picker-button {
    aspect-ratio: 1 / 1;
    font-size: 1.4rem;
    line-height: 1;
    border: 1px solid var(--border-color, #dee2e6);
    background: var(--bg-card, #ffffff);
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}

.emoji-picker-button:hover {
    background: var(--bg-surface, #f8f9fa);
}

.emoji-picker-button.emoji-picker-selected {
    border-color: var(--brand-color, #44A1D7);
    background: rgba(66, 165, 245, 0.1);
    box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.25);
}

.account-edit-avatar-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

/* ----- Color picker (ColorPicker.js) ----- */

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.color-picker-swatch {
    aspect-ratio: 1 / 1;
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}

.color-picker-swatch:hover {
    transform: scale(1.08);
}

.color-picker-swatch.color-picker-selected {
    border-color: var(--text-primary, #212529);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.color-picker-default {
    width: 100%;
}

.color-picker-default-active {
    border-color: var(--brand-color, #44A1D7);
    color: var(--brand-color, #44A1D7);
}

/* ----- Social: follower/following counts, wall, user list modal ----- */

.social-stats-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 0.5rem;
}

.social-stat-button,
.social-stat-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.5rem 0.25rem;
    border-radius: 10px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #dee2e6);
    color: var(--text-primary, #212529);
}

.social-stat-button {
    cursor: pointer;
    transition: background 0.1s;
}

.social-stat-button:hover {
    background: var(--bg-surface, #f8f9fa);
}

.social-stat-value {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.2;
}

.social-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted, #6c757d);
    letter-spacing: 0.03em;
}

.user-list-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.1s;
}

.user-list-row:hover {
    background: var(--bg-surface, #f8f9fa);
}

.user-list-row + .user-list-row {
    border-top: 1px solid var(--border-color, #dee2e6);
    border-radius: 0;
}

.user-list-row-name {
    font-size: 0.9rem;
    color: var(--text-primary, #212529);
}

.wall-caption {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.35rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ----- Other user's profile page (/users/:id) hero ----- */

.up-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.up-nav-icon-button {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #dee2e6);
    color: var(--text-primary, #212529);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
}

.up-nav-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.up-nav-spacer {
    width: 2rem;
    height: 2rem;
}

.up-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem 0.75rem;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.up-hero .up-avatar-slot {
    margin-bottom: 0.25rem;
}

.up-hero .up-avatar-slot .alpin-avatar {
    width: 88px !important;
    height: 88px !important;
    font-size: 2.4rem !important;
}

.up-name {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary, #212529);
}

.up-bio {
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 20rem;
    color: var(--text-primary, #212529);
    white-space: pre-wrap;
    word-break: break-word;
}

.up-bio:empty {
    display: none;
}

.up-stats {
    display: flex;
    gap: 1.75rem;
    margin: 0.5rem 0 0.25rem;
}

.up-stat {
    background: transparent;
    border: 0;
    padding: 0;
    text-align: center;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.up-stat-button {
    cursor: pointer;
}

.up-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary, #212529);
}

.up-stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #6c757d);
}

.up-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
}

.up-btn {
    flex: 1 1 calc(50% - 0.25rem);
    height: 2.375rem;
    border-radius: 0.625rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #212529);
    border: 1px solid var(--border-color, #dee2e6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0 0.75rem;
}

.up-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.up-btn-primary {
    background: var(--brand-color, #44A1D7);
    color: #ffffff;
    border-color: transparent;
}

.up-btn-primary.is-following {
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #212529);
    border-color: var(--border-color, #dee2e6);
}

.up-wall-card {
    display: block;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.875rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.625rem;
    color: inherit;
    text-decoration: none;
}

.up-wall-title {
    font-size: 0.975rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin-bottom: 0.35rem;
}

.up-wall-meta {
    display: flex;
    gap: 0.625rem;
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
}

.up-wall-meta i {
    margin-right: 0.2rem;
}

.up-wall-caption {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.35rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.up-wall-badges {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.4rem;
}

.up-wall-badges i {
    margin-right: 0.25rem;
    font-size: 0.85rem;
}

.up-wall-badges .is-liked {
    color: var(--red, #ef5350);
}

.up-wall-badges .is-saved {
    color: var(--brand-color, #44A1D7);
}

.acct-group {
    margin: 1rem;
}

.acct-row {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    gap: 0.75rem;
    min-height: 52px;
}

.acct-row + .acct-row {
    border-top: 1px solid var(--border-color, #dee2e6);
}

/* acct-row-icon uses shared .icon-sq .icon-sq-sm + color classes */

.acct-row-label {
    font-size: 0.85rem;
    color: var(--text-primary, #212529);
    flex: 1;
}

.acct-inline-input {
    background: transparent;
    border: none;
    color: var(--text-muted, #6c757d);
    text-align: right;
    font-size: 0.85rem;
    padding: 0;
    width: auto;
    max-width: 50%;
    flex-shrink: 0;
    margin-left: auto;
}

.acct-inline-input:focus {
    outline: none;
    color: var(--text-primary, #212529);
}

.acct-inline-select {
    background: transparent;
    border: none;
    color: var(--text-muted, #6c757d);
    font-size: 0.85rem;
    padding: 0;
    text-align: right;
    flex-shrink: 0;
    margin-left: auto;
    direction: rtl;
}

.edit-times-list {
    padding: 0;
    overflow: hidden;
}

.edit-times-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    min-height: 56px;
}

.edit-times-row + .edit-times-row {
    border-top: 1px solid var(--border-color, #dee2e6);
}

.edit-times-row-label {
    font-size: 0.95rem;
    color: var(--text-primary, #212529);
    flex: 1;
}

.edit-times-row-input {
    font-size: 1rem;
    font-weight: 500;
    text-align: right;
    min-width: 110px;
}

.edit-times-row-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted, #6c757d);
}

.edit-exercise-row + .edit-exercise-row {
    border-top: 1px solid var(--border-color, #dee2e6);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.acct-inline-select:focus {
    outline: none;
    color: var(--text-primary, #212529);
}

/* Weight card - uses .styled-card for base */
.weight-card {
    padding: 1rem;
}

.weight-card-header {
    margin-bottom: 0.75rem;
}

.weight-card .last-weight-display {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.weight-card .last-weight-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.weight-card .last-weight-unit {
    font-size: 1rem;
    color: var(--text-muted, #6c757d);
}

.weight-card .last-weight-date {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-left: auto;
}

.weight-mini-chart {
    height: 48px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    margin-bottom: 0.75rem;
}

.weight-mini-bar {
    flex: 1;
    background: var(--brand-color);
    border-radius: 2px 2px 0 0;
    opacity: 0.3;
    min-height: 4px;
}

.weight-mini-bar.latest {
    opacity: 1;
}

/* Body fat mini chart - mirrors weight-mini-chart */
.bf-mini-chart {
    height: 48px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    margin-bottom: 0.75rem;
}

.body-fat-log-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.body-fat-log-form .form-control {
    font-size: 0.85rem;
    padding: 0.45rem 0.6rem;
}

.body-weight-log-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.body-weight-log-form .form-control {
    font-size: 0.85rem;
    padding: 0.45rem 0.6rem;
}

/* Motivation preview */
.motivation-preview {
    background: var(--bg-surface, #f8f9fa);
    border-left: 3px solid var(--brand-color);
    border-radius: 0 0.4rem 0.4rem 0;
    padding: 0.6rem 0.75rem;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.5rem;
    display: none; /* hidden when motivation is off */
}

/* Rest timer inline with ring */
.rest-timer-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.acct-rest-timer-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--border-color, #dee2e6);
    border-top-color: var(--brand-color);
    border-right-color: var(--brand-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-color);
    flex-shrink: 0;
}

/* Google badge */
.acct-google-badge {
    font-size: 0.8rem;
}

.acct-google-badge.linked {
    color: #81c784;
}

.acct-google-badge.not-linked {
    color: var(--text-muted, #6c757d);
}

/* Bottom actions */
.acct-bottom-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg-card, #fff);
    border-top: 1px solid var(--border-color, #dee2e6);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.75rem;
    z-index: 10;
    margin-top: 1rem;
}

.acct-bottom-actions .btn {
    flex: 1;
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.54rem;
    font-size: 0.9rem;
}

.acct-bottom-actions .btn.save-btn-inactive {
    background-color: #ced4da;
    border-color: #ced4da;
    color: #6c757d;
    opacity: 1;
    pointer-events: none;
}

[data-theme="dark"] .acct-bottom-actions .btn.save-btn-inactive {
    background-color: #2d3139;
    border-color: #2d3139;
    color: #9aa0a6;
}

.save-feedback {
    font-size: 0.8rem;
    color: #81c784;
    font-weight: 500;
    align-self: center;
    flex-shrink: 0;
}

/* ----- Onboarding ----- */

.onboarding-page {
    max-width: 420px;
    margin: 0 auto;
    padding: 1rem 0 6rem;
}

/* Hide the mobile bottom nav on auth + onboarding pages. These are full-page
   flows where the bottom nav adds no value (login/register links are already
   inline) and steals ~60px that can push content below the fold on short phones. */
body:has(login-page) .mobile-bottom-nav,
body:has(register-page) .mobile-bottom-nav,
body:has(forgot-password-page) .mobile-bottom-nav,
body:has(onboarding-page) .mobile-bottom-nav {
    display: none !important;
}

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color, #dee2e6);
    transition: background 0.3s ease, transform 0.3s ease;
}

.onboarding-dot.active {
    background: var(--brand-color);
    transform: scale(1.3);
}

.onboarding-dot.done {
    background: var(--brand-color);
    opacity: 0.5;
}

.onboarding-step {
    animation: onb-fade-in 0.35s ease;
}

@keyframes onb-fade-in {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.onb-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.onb-card-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.onb-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem 0.75rem;
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: 0.75rem;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #212529);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-size: 1.5rem;
}

.onb-card:hover {
    border-color: var(--brand-color);
}

.onb-card.active {
    border-color: var(--brand-color);
    background: rgba(66, 165, 245, 0.08);
}

.onb-card-sm {
    padding: 0.85rem 0.5rem;
    font-size: 1.25rem;
}

.onb-card-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.onb-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
}

.onboarding-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #dee2e6);
}

.onb-next-button {
    min-width: 100px;
}

.onb-skip-all {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
}

/* ----- Fireworks canvas ----- */

.fireworks-canvas {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

header {
    position: sticky;
    top: 0;
    z-index: 1020;
}

header > .navbar {
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
}

.mobile-bottom-nav {
    padding-top: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.modal {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}

/* Bottom padding on page content so the fixed mobile nav doesn't cover content.
   The !important overrides Bootstrap's py-3 utility on the <main> element,
   which would otherwise win (1rem !important) and clip the page's last buttons.
   safe-area-inset accounts for the iOS home-indicator bar. */
@media (max-width: 767.98px) {
    #page-content {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Keep sticky action bars flush above the mobile bottom nav */
    .acct-bottom-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding-bottom: calc(0.75rem + 3.75rem + env(safe-area-inset-bottom, 0px));
        z-index: 1039; /* just below mobile nav (1040) */
        border-radius: 0;
    }

    /* Reserve space at the bottom of forms so the fixed action bar doesn't cover content */
    .profile-form,
    .settings-form {
        padding-bottom: 6rem;
    }

    /* Rest timer sits above the bottom nav on mobile */
    .rest-timer-pill {
        bottom: 5rem;
    }
}

/* ----- Feed page ----- */

.feed-header {
    padding: 0.5rem 0 0.75rem;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-card {
    padding: 0.75rem 0.9rem 0.5rem;
}

.feed-card-author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: inherit;
}

.feed-card-author-meta {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}

.feed-card-author-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-card-published {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    flex-shrink: 0;
}

.feed-card-published::before {
    content: "\00b7";
    margin-right: 0.4rem;
    color: var(--text-muted, #6c757d);
}

.feed-card-body {
    cursor: pointer;
}

/* Poster-style hero block: dark base with an off-centre glow that adds depth. */
.feed-poster {
    border-radius: 0.6rem;
    padding: 2.25rem 1rem 2rem;
    margin-bottom: 0.6rem;
    text-align: center;
    color: #ffffff;
    background:
        radial-gradient(ellipse 50% 45% at 50% 80%, rgba(120, 160, 220, 0.14) 0%, rgba(120, 160, 220, 0) 65%),
        #0a0d12;
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.feed-poster-date {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.5rem;
}

.feed-poster-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    word-break: break-word;
    color: #ffffff;
}

.feed-poster-subtitle {
    margin-top: 0.55rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
}

.feed-card-caption {
    font-size: 0.85rem;
    color: var(--text-primary, #212529);
    margin: 0.1rem 0 0.6rem;
    line-height: 1.4;
}

.feed-card-caption strong {
    font-weight: 600;
    margin-right: 0.25rem;
}

.feed-card-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--border-color, #dee2e6);
    font-size: 0.85rem;
    color: var(--text-muted, #6c757d);
}

.feed-like-button {
    background: transparent;
    border: none;
    color: var(--text-muted, #6c757d);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.feed-like-button.is-liked {
    color: #ef5350;
}

/* ----- Program post page ----- */

/* Reserve space for the mobile bottom nav so the Start CTA isn't hidden. */
.post-page {
    padding-bottom: 5rem;
}

.post-page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.post-page-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.55rem;
    color: var(--text-primary, #212529);
    text-decoration: none;
    flex-shrink: 0;
}

.post-page-back:hover {
    background: var(--bg-surface, #f8f9fa);
}

.post-page-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.post-author-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    margin-bottom: 1rem;
    text-decoration: none;
    color: inherit;
}

.post-author-info {
    flex: 1;
    min-width: 0;
}

.post-author-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.post-author-published {
    font-size: 0.78rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.1rem;
}

.post-follow-button {
    flex-shrink: 0;
}

/* Poster hero (same look as the feed card poster). */
.post-poster {
    border-radius: 0.6rem;
    padding: 2.25rem 1rem 2rem;
    margin-bottom: 1.25rem;
    text-align: center;
    color: #ffffff;
    background:
        radial-gradient(ellipse 50% 45% at 50% 80%, rgba(120, 160, 220, 0.14) 0%, rgba(120, 160, 220, 0) 65%),
        #0a0d12;
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.post-poster-date {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.5rem;
}

.post-poster-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    word-break: break-word;
    color: #ffffff;
}

.post-poster-subtitle {
    margin-top: 0.55rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
}

.post-days {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-day {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-day-header {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #6c757d);
}

.post-section-header {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary, #212529);
    margin-bottom: 0.5rem;
}

.post-exercise-list {
    list-style: none;
    padding: 0 0 0 1.1rem;
    margin: 0;
}

.post-exercise-row {
    position: relative;
    padding: 0.15rem 0;
    font-size: 0.92rem;
}

.post-exercise-row::before {
    content: "\2022";
    position: absolute;
    left: -1rem;
    top: 0.15rem;
    color: var(--text-muted, #6c757d);
    font-size: 1rem;
    line-height: 1.3;
}

.post-exercise-empty::before {
    content: "";
}

.post-exercise-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.post-exercise-name {
    color: var(--text-primary, #212529);
}

.post-exercise-target {
    color: var(--text-muted, #6c757d);
    font-size: 0.82rem;
    flex-shrink: 0;
}

.post-exercise-note {
    color: var(--text-muted, #6c757d);
    font-size: 0.82rem;
    line-height: 1.35;
    margin-top: 0.1rem;
}

.post-empty {
    color: var(--text-muted, #6c757d);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem 0;
}

.post-caption-row {
    margin: 1.25rem 0 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text-primary, #212529);
}

.post-caption-author {
    font-weight: 700;
    margin-right: 0.35rem;
}

/* Inline action row: heart on the left, Save on the right (no boxed buttons). */
.post-action-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #dee2e6);
    font-size: 0.95rem;
    color: var(--text-muted, #6c757d);
}

.post-action-row .post-like-button,
.post-action-row .post-save-button {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-muted, #6c757d);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}

.post-action-row .post-like-button.is-liked {
    color: #ef5350;
}

.post-action-row .post-save-button.is-saved {
    color: var(--brand-color);
}

.post-action-row .post-save-button {
    margin-left: auto;
}

/* Primary CTA: full-width Start workout button (uses .wkt-new-btn-style sizing). */
.post-start-button {
    width: 100%;
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--brand-color);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(66, 165, 245, 0.2);
}

.post-start-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* ----- Feed card save button ----- */

.feed-save-button {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted, #6c757d);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.feed-save-button.is-saved {
    color: var(--brand-color);
}

.feed-save-label {
    line-height: 1;
}

/* ----- Feed header Find people link ----- */

.feed-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.feed-header-text {
    min-width: 0;
}

.feed-find-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--brand-color);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    white-space: nowrap;
}

.feed-find-link:hover {
    background: var(--bg-card);
}

.feed-empty-find-button {
    gap: 0.35rem;
    display: inline-flex;
    align-items: center;
}

/* ----- Find people page ----- */

.find-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0 0.75rem;
}

.find-back-link {
    color: var(--text-muted, #6c757d);
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.15rem 0.25rem;
}

.find-search {
    margin-bottom: 0.75rem;
}

.find-level-filter {
    margin-bottom: 0.75rem;
}

.find-level-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.find-search-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0.35rem;
}

.find-search-input-wrap {
    position: relative;
}

.find-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #6c757d);
    pointer-events: none;
    font-size: 0.95rem;
}

.find-search-input {
    padding-left: 2.2rem;
    padding-right: 2.5rem;
}

.find-search-spinner {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #6c757d);
}

.find-results {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.find-result-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.25rem;
    border-radius: 8px;
}

.find-result-row + .find-result-row {
    border-top: 1px solid var(--border-color, #dee2e6);
    border-radius: 0;
}

.find-result-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.find-result-name {
    font-size: 0.95rem;
    color: var(--text-primary, #212529);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.find-follow-button {
    flex: 0 0 auto;
    padding: 0.3rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    background: var(--brand-color);
    color: #fff;
    border: 1px solid var(--brand-color);
    cursor: pointer;
}

.find-follow-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.find-follow-button.is-following {
    background: transparent;
    color: var(--text-muted, #6c757d);
    border-color: var(--border-color, #dee2e6);
}

.find-empty-state {
    padding: 2rem 0.5rem;
}

/* ----- Program detail page action row ----- */

.program-action-row {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.program-action-row .btn {
    flex: 0 0 auto;
}

/* On narrow screens, let the action buttons fill the row so they don't
   squish into unreadable labels. */
@media (max-width: 420px) {
    .program-action-row {
        justify-content: stretch;
    }

    .program-action-row .btn {
        flex: 1 1 auto;
    }
}

/* ----- Programs page: header + tabs + Mine cards + Saved cards ----- */

.programs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.programs-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.programs-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.6rem;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #1d1e22);
    font-size: 1.05rem;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.programs-add-button:hover {
    background: var(--bg-surface, #f8f9fa);
}

.programs-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color, #dee2e6);
    padding: 0.25rem;
    border-radius: 0.75rem;
}

.programs-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    border-radius: 0.55rem;
    padding: 0.55rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    cursor: pointer;
}

.programs-tab.is-active {
    background: var(--bg-surface, #f1f3f5);
    color: var(--text-primary, #1d1e22);
}

.programs-tab-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    opacity: 0.85;
}

.programs-tab.is-active .programs-tab-count {
    color: var(--text-primary, #1d1e22);
    opacity: 0.6;
}

.programs-tab-count:empty {
    display: none;
}

/* Mine cards */
.program-card {
    display: block;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.program-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.program-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #1d1e22);
    line-height: 1.25;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.program-status-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.18rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid transparent;
    line-height: 1.2;
}

.program-status-published {
    color: #66bb6a;
    border-color: rgba(102, 187, 106, 0.5);
    background: rgba(102, 187, 106, 0.08);
}

.program-status-draft {
    color: var(--text-muted, #6c757d);
    border-color: var(--border-color, #dee2e6);
    background: transparent;
}

.program-card-meta,
.program-card-engagement {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
}

.program-meta-item,
.program-engage-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.program-meta-item i,
.program-engage-item i {
    font-size: 0.85rem;
    opacity: 0.8;
}

.saved-card {
    padding: 0.85rem 0.9rem;
    margin-bottom: 0.75rem;
}

.saved-card-author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.saved-card-author-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-unsave-button {
    background: transparent;
    border: none;
    color: var(--text-muted, #6c757d);
    padding: 0.25rem 0.4rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.saved-unsave-button:hover {
    color: var(--text-primary, #1d1e22);
    background: var(--bg-card-muted, #f1f3f5);
}

.saved-card-body {
    cursor: pointer;
}

.saved-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.saved-card-caption {
    font-size: 0.82rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.saved-card-meta {
    display: flex;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color, #dee2e6);
    font-size: 0.78rem;
    color: var(--text-muted, #6c757d);
}

.saved-start-button {
    margin-top: 0.65rem;
}

/* ----------------------------------------------------------------------- */
/* Activity heatmap (ProfilePage + UserProfilePage)                        */
/* ----------------------------------------------------------------------- */

.activity-heatmap {
    width: 100%;
}

.activity-heatmap-scroller {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px;
}

.activity-heatmap-grid {
    display: inline-flex;
    gap: 3px;
}

.activity-heatmap-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.activity-heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--border-color, #e9ecef);
}

.activity-heatmap-cell-tier-0 { background: var(--border-color, #e9ecef); }
.activity-heatmap-cell-tier-1 { background: #b3dbff; }
.activity-heatmap-cell-tier-2 { background: #66b5ff; }
.activity-heatmap-cell-tier-3 { background: #2196f3; }
.activity-heatmap-cell-tier-4 { background: #0d47a1; }

.activity-heatmap-cell-future {
    width: 12px;
    height: 12px;
    background: transparent;
}

.activity-section {
    margin-bottom: 1.25rem;
}

.activity-stat-pills {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* ----------------------------------------------------------------------- */
/* Personal records (Stats page + PR list page)                            */
/* ----------------------------------------------------------------------- */

.pr-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pr-section-header .section-label {
    margin-bottom: 0;
    padding-bottom: 0;
}

.pr-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pr-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
}

.pr-card-title {
    font-weight: 500;
    line-height: 1.2;
}

.pr-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
}

.pr-card-value {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.pr-card-date {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
}

.pr-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted, #6c757d);
    font-size: 0.85rem;
}

/* ----------------------------------------------------------------------- */
/* PR celebration (LogWorkoutPage)                                          */
/* ----------------------------------------------------------------------- */

.pr-toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 2rem);
    text-align: center;
    background: linear-gradient(135deg, #ffb300, #ff6f00);
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(255, 111, 0, 0.35);
    z-index: 1080;
    animation: pr-toast-in 0.35s ease-out;
}

.pr-toast.hide {
    animation: pr-toast-out 0.4s forwards;
}

@keyframes pr-toast-in {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to   { transform: translate(-50%, 0);     opacity: 1; }
}

@keyframes pr-toast-out {
    from { transform: translate(-50%, 0);     opacity: 1; }
    to   { transform: translate(-50%, -20px); opacity: 0; }
}

.pr-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1070;
}

/* ----- App toast (styled replacement for window.alert) -----
   Lives at the top of the viewport, slides in from above, auto-dismisses.
   z-index above the motivation toast so error feedback always wins. */

.app-toast {
    position: fixed;
    top: calc(1rem + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    background: rgba(33, 33, 33, 0.96);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.35;
    max-width: 90vw;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 1080;
    opacity: 0;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s;
}

.app-toast.app-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.app-toast.app-toast-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-150%);
}

.app-toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.app-toast-text {
    flex: 1;
}

.app-toast-error { border-left-color: #EF5350; }
.app-toast-error .app-toast-icon { color: #EF5350; }

.app-toast-warning { border-left-color: #FFA726; }
.app-toast-warning .app-toast-icon { color: #FFA726; }

.app-toast-success { border-left-color: #66BB6A; }
.app-toast-success .app-toast-icon { color: #66BB6A; }

.app-toast-info { border-left-color: #44A1D7; }
.app-toast-info .app-toast-icon { color: #44A1D7; }

/* ----------------------------------------------------------------------- */
/* Program editor - distinguish picker button placeholder from chosen value */
/* ----------------------------------------------------------------------- */

.edit-exercise-picker[data-exercise-id=""] {
    color: var(--text-muted);
    font-style: italic;
}

.edit-exercise-picker:not([data-exercise-id=""]) {
    color: var(--text-primary);
    font-weight: 500;
}



.start-sheet.offcanvas-bottom {
    height: auto;
    max-width: 520px;
    left: 0;
    right: 0;
    margin: 0 auto;
    background: var(--bg-surface, #f8f9fa);
    color: var(--text-primary, #212529);
    border-top-left-radius: 1.25rem;
    border-top-right-radius: 1.25rem;
    border-top: 1px solid var(--border-color, #dee2e6);
}

.start-sheet .offcanvas-body {
    padding: 0.5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.start-sheet-handle {
    width: 38px;
    height: 5px;
    border-radius: 3px;
    background: var(--border-color, #ced4da);
    margin: 0.5rem auto 0.85rem;
}

.start-sheet-title {
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0 0.25rem 0.85rem;
}

.start-opt {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.6rem;
    margin-bottom: 0.6rem;
    border-radius: 0.875rem;
    border: 1px solid var(--border-color, #dee2e6);
    background: var(--bg-card, #fff);
    color: var(--text-primary, #212529);
}

.start-opt:last-child {
    margin-bottom: 0;
}

.start-opt-text {
    flex: 1;
    min-width: 0;
}

.start-opt-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.start-opt-sub {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-opt-chev {
    color: var(--text-muted, #6c757d);
    font-size: 1rem;
}

.icon-sq.ai {
    background: linear-gradient(135deg, #26a69a, var(--brand-color, #44A1D7));
}

.start-ai-badge {
    background: rgba(38, 166, 154, 0.22);
    color: #2a9d92;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
}

.program-pick-card {
    padding: 0.8rem 0.85rem;
    margin-bottom: 0.7rem;
}

.program-pick-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.program-pick-name {
    font-size: 0.95rem;
    font-weight: 700;
}

.program-pick-type {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.1rem 0.45rem;
    border-radius: 0.375rem;
    background: rgba(68, 161, 215, 0.16);
    color: var(--brand-color, #44A1D7);
}

.program-pick-days {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.program-pick-day {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border-color, #dee2e6);
    background: var(--bg-surface, #f8f9fa);
    color: var(--text-primary, #212529);
    font-size: 0.85rem;
}

.program-pick-day-name {
    font-weight: 600;
}

.program-pick-day-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-muted, #6c757d);
}

.program-pick-day-go {
    width: 28px;
    height: 28px;
    border-radius: 0.5rem;
    background: var(--brand-color, #44A1D7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
