/*
 * SportPlus shared presentation system
 * Mobile-first, dependency-free and WCAG 2.2 AA oriented.
 */

:root {
    color-scheme: light;
    --color-bg: #f6f8fb;
    --color-surface: #ffffff;
    --color-surface-soft: #f0f4f9;
    --color-surface-strong: #e7edf5;
    --color-text: #0f172a;
    --color-text-soft: #475569;
    --color-text-faint: #64748b;
    --color-border: #dbe3ed;
    --color-border-strong: #c7d2e0;
    --color-primary: #1d4ed8;
    --color-primary-hover: #1e40af;
    --color-primary-dark: #172554;
    --color-primary-soft: #dbeafe;
    --color-success: #157f3d;
    --color-success-soft: #dcfce7;
    --color-warning: #9a4b0b;
    --color-warning-soft: #ffedd5;
    --color-danger: #b42318;
    --color-danger-soft: #fee4e2;
    --color-focus: #2563eb;
    --shadow-xs: 0 1px 2px rgb(15 23 42 / 0.05);
    --shadow-sm: 0 8px 24px rgb(15 23 42 / 0.07);
    --shadow-md: 0 18px 50px rgb(15 23 42 / 0.13);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;
    --content-width: 1280px;
    --sidebar-width: 256px;
    --mobile-header-height: 64px;
    --bottom-nav-height: 74px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
    min-width: 320px;
    background: var(--color-bg);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-sans);
}

img,
picture,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: var(--color-primary);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

a:hover {
    color: var(--color-primary-hover);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
[type="button"],
[type="submit"] {
    min-height: 44px;
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--color-text);
    font-weight: 760;
    line-height: 1.16;
    letter-spacing: -0.025em;
}

h1 {
    margin-bottom: 0.65rem;
    font-size: clamp(1.85rem, 7vw, 3rem);
}

h2 {
    margin-bottom: 0.65rem;
    font-size: clamp(1.35rem, 4vw, 1.85rem);
}

h3 {
    margin-bottom: 0.5rem;
    font-size: 1.08rem;
}

p {
    margin-bottom: 1rem;
}

ul,
ol {
    padding-left: 1.35rem;
}

hr {
    height: 1px;
    margin: 1.5rem 0;
    border: 0;
    background: var(--color-border);
}

::selection {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 0.75rem;
    left: 0.75rem;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--color-text);
    color: #fff;
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

/* Brand */

.brand {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand:hover {
    color: var(--color-text);
}

.brand__mark {
    display: inline-grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(145deg, #2563eb, #1e40af);
    box-shadow: 0 8px 20px rgb(37 99 235 / 0.25);
    color: #fff;
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: -0.08em;
}

.brand__mark span {
    color: #bfdbfe;
}

.brand__name {
    font-size: 1.22rem;
}

.brand--compact .brand__mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}

.brand--on-dark,
.brand--on-dark:hover {
    color: #fff;
}

/* Authenticated application shell */

.app-body {
    overflow-x: hidden;
}

.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

.app-column {
    min-width: 0;
}

.sidebar {
    display: none;
}

.mobile-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: var(--mobile-header-height);
    padding: 0.5rem 1rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgb(219 227 237 / 0.88);
    background: rgb(246 248 251 / 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.avatar {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 1px solid #bfdbfe;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.avatar--link:hover {
    border-color: #93c5fd;
    color: var(--color-primary-hover);
}

.page-content {
    min-width: 0;
    padding: 1.5rem 1rem calc(var(--bottom-nav-height) + var(--safe-bottom) + 2rem);
}

.has-active-workout .page-content {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8.5rem);
}

.content-container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
}

.bottom-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding: 0.4rem max(0.35rem, env(safe-area-inset-right)) var(--safe-bottom) max(0.35rem, env(safe-area-inset-left));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid rgb(199 210 224 / 0.85);
    background: rgb(255 255 255 / 0.96);
    box-shadow: 0 -10px 32px rgb(15 23 42 / 0.07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.bottom-nav__link {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 58px;
    padding: 0.35rem 0.15rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.18rem;
    border-radius: 12px;
    color: var(--color-text-faint);
    font-size: clamp(0.62rem, 2.6vw, 0.72rem);
    font-weight: 650;
    line-height: 1.1;
    text-decoration: none;
}

.bottom-nav__icon {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.bottom-nav__link::before {
    position: absolute;
    top: 0;
    width: 22px;
    height: 3px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    content: "";
    opacity: 0;
    transform: scaleX(0.3);
    transition: opacity 160ms ease, transform 160ms ease;
}

.bottom-nav__link:hover,
.bottom-nav__link.is-active {
    background: #eff6ff;
    color: var(--color-primary);
}

.bottom-nav__link.is-active::before {
    opacity: 1;
    transform: scaleX(1);
}

/* Desktop sidebar */

.sidebar__nav {
    display: grid;
    gap: 0.35rem;
}

.nav-link {
    display: flex;
    min-height: 48px;
    padding: 0.7rem 0.85rem;
    align-items: center;
    gap: 0.85rem;
    border-radius: 12px;
    color: var(--color-text-soft);
    font-size: 0.94rem;
    font-weight: 660;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-link:hover {
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.nav-link.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.nav-link__icon {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    font-size: 1.03rem;
    font-weight: 820;
    line-height: 1;
}

.sidebar__footer {
    display: grid;
    margin-top: auto;
    gap: 0.5rem;
}

.user-summary {
    display: flex;
    min-height: 64px;
    padding: 0.6rem;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
}

.user-summary:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.user-summary__copy {
    display: grid;
    min-width: 0;
    gap: 0.05rem;
}

.user-summary__copy strong,
.user-summary__copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-summary__copy strong {
    font-size: 0.88rem;
}

.user-summary__copy span {
    color: var(--color-text-faint);
    font-size: 0.72rem;
}

.logout-form {
    margin: 0;
}

.sidebar-action {
    display: flex;
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    align-items: center;
    gap: 0.75rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text-soft);
    font-size: 0.84rem;
    font-weight: 650;
    text-align: left;
}

.sidebar-action:hover {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.sidebar-action__icon {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

/* Floating active workout */

.active-workout-bar {
    position: fixed;
    z-index: 45;
    right: 0.75rem;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 0.7rem);
    left: 0.75rem;
    display: grid;
    min-height: 80px;
    padding: 0.75rem;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.65rem;
    border: 1px solid rgb(147 197 253 / 0.4);
    border-radius: 20px;
    background: linear-gradient(120deg, #172554 0%, #1e3a8a 55%, #1d4ed8 100%);
    box-shadow: 0 16px 42px rgb(23 37 84 / 0.3);
    color: #fff;
}

.active-workout-bar__pulse {
    width: 12px;
    height: 12px;
    border: 3px solid rgb(255 255 255 / 0.42);
    border-radius: 50%;
    background: #86efac;
    box-shadow: 0 0 0 5px rgb(134 239 172 / 0.13);
    animation: workout-pulse 2s ease-out infinite;
}

.active-workout-bar__copy {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.active-workout-bar__copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 0.92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-workout-bar__eyebrow {
    margin-bottom: 0.2rem;
    color: #bfdbfe;
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.active-workout-bar__timer {
    color: #fff;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.active-workout-bar__button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    grid-column: auto;
}

.active-workout-bar__button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.active-workout-bar__button-arrow {
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1;
}

@keyframes workout-pulse {
    0%, 55% { box-shadow: 0 0 0 4px rgb(134 239 172 / 0.16); }
    80%, 100% { box-shadow: 0 0 0 13px rgb(134 239 172 / 0); }
}

/* Guest and authentication shell */

.guest-body {
    background: var(--color-surface);
}

.guest-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

.guest-showcase {
    display: none;
}

.guest-panel {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    flex-direction: column;
    background:
        radial-gradient(circle at 100% 0%, rgb(219 234 254 / 0.58), transparent 34%),
        var(--color-surface);
}

.guest-header {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.guest-header__home {
    display: inline-flex;
    min-height: 44px;
    padding: 0.5rem 0.2rem;
    align-items: center;
    color: var(--color-text-soft);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.guest-content {
    display: flex;
    width: 100%;
    max-width: 480px;
    margin: auto;
    padding: 2rem 0;
    flex: 1;
    justify-content: center;
    flex-direction: column;
}

.guest-footer {
    display: flex;
    padding-top: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    color: var(--color-text-faint);
    font-size: 0.72rem;
    text-align: center;
}

.guest-kicker {
    display: inline-flex;
    margin-bottom: 1.25rem;
    padding: 0.42rem 0.75rem;
    align-self: flex-start;
    border: 1px solid rgb(191 219 254 / 0.42);
    border-radius: var(--radius-pill);
    background: rgb(219 234 254 / 0.12);
    color: #bfdbfe;
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.feature-list {
    display: grid;
    margin: 2rem 0 0;
    padding: 0;
    gap: 1rem;
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #dbeafe;
    font-weight: 600;
}

.feature-list li span {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 50%;
    background: rgb(134 239 172 / 0.16);
    color: #86efac;
    font-size: 0.78rem;
}

.guest-showcase__quote {
    position: relative;
    z-index: 1;
    max-width: 34rem;
    margin: 2rem 0 0;
    color: #bfdbfe;
    font-size: 0.82rem;
}

/* Page headings and reusable layout */

.page-header {
    display: flex;
    margin-bottom: 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: column;
    gap: 1rem;
}

.page-header h1,
.page-header p {
    margin-bottom: 0;
}

.page-header__copy {
    max-width: 46rem;
}

.page-header__actions,
.page-actions {
    display: flex;
    width: 100%;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.page-header__actions > *,
.page-actions > * {
    flex: 1 1 auto;
}

.eyebrow {
    margin-bottom: 0.45rem;
    color: var(--color-primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lead {
    color: var(--color-text-soft);
    font-size: 1.05rem;
}

.muted,
.text-muted {
    color: var(--color-text-soft);
}

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

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.stack {
    display: grid;
    gap: 1rem;
}

.stack--sm {
    gap: 0.5rem;
}

.stack--lg {
    gap: 1.5rem;
}

.cluster {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-header h2,
.section-header h3,
.section-header p {
    margin-bottom: 0;
}

/* Buttons and interactive controls */

.button,
.btn {
    display: inline-flex;
    min-height: 46px;
    padding: 0.68rem 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 740;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 120ms ease;
}

.button svg,
.btn svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button:active:not(:disabled),
.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.button--primary,
.btn-primary {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: 0 7px 18px rgb(29 78 216 / 0.2);
    color: #fff;
}

.button--primary:hover,
.btn-primary:hover {
    border-color: var(--color-primary-hover);
    background: var(--color-primary-hover);
    color: #fff;
}

.button--secondary,
.btn-secondary {
    border-color: var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
}

.button--secondary:hover,
.btn-secondary:hover {
    border-color: #94a3b8;
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.button--ghost,
.btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--color-primary);
}

.button--ghost:hover,
.btn-ghost:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.button--danger,
.btn-danger {
    border-color: #fda29b;
    background: var(--color-surface);
    color: var(--color-danger);
}

.button--danger:hover,
.btn-danger:hover {
    background: var(--color-danger-soft);
    color: #912018;
}

.button--light {
    border-color: #fff;
    background: #fff;
    color: var(--color-primary-hover);
}

.button--light:hover {
    border-color: #dbeafe;
    background: #eff6ff;
    color: var(--color-primary-dark);
}

.button--small,
.btn-sm {
    min-height: 44px;
    padding: 0.52rem 0.75rem;
    font-size: 0.82rem;
}

.button--wide,
.button--full,
.btn-block {
    width: 100%;
}

.button--large {
    min-height: 52px;
    padding: 0.82rem 1.2rem;
    font-size: 0.98rem;
}

.button--quiet {
    border-color: var(--color-border);
    background: var(--color-surface-soft);
    color: var(--color-text-soft);
}

.button--quiet:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-strong);
    color: var(--color-text);
}

.button--danger-quiet {
    border-color: transparent;
    background: transparent;
    color: var(--color-danger);
}

.button--danger-quiet:hover {
    border-color: #fecaca;
    background: var(--color-danger-soft);
    color: #912018;
}

.button-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.icon-button,
.btn-icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-text-soft);
}

.icon-button:hover,
.btn-icon:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.icon-button svg,
.btn-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.text-link {
    display: inline-flex;
    min-height: 44px;
    padding: 0.4rem 0;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

/* Cards */

.card {
    min-width: 0;
    padding: 1.1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

.card--soft {
    background: var(--color-surface-soft);
    box-shadow: none;
}

.card--interactive {
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.card--interactive:hover {
    border-color: #b9c7d8;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.card--hero,
.hero-card {
    position: relative;
    overflow: hidden;
    padding: 1.35rem;
    border: 0;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 93% 8%, rgb(147 197 253 / 0.35), transparent 30%),
        linear-gradient(135deg, #172554 0%, #1e3a8a 58%, #1d4ed8 100%);
    box-shadow: 0 18px 40px rgb(30 58 138 / 0.2);
    color: #fff;
}

.card--hero h1,
.card--hero h2,
.card--hero h3,
.hero-card h1,
.hero-card h2,
.hero-card h3 {
    color: #fff;
}

.card--hero p,
.hero-card p {
    color: #dbeafe;
}

.card__header,
.card-header {
    display: flex;
    margin-bottom: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.card__header h2,
.card__header h3,
.card__header p,
.card-header h2,
.card-header h3,
.card-header p {
    margin-bottom: 0;
}

.card__body:last-child > :last-child,
.card-body:last-child > :last-child {
    margin-bottom: 0;
}

.card__footer,
.card-footer {
    display: flex;
    margin-top: 1rem;
    padding-top: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.card-grid,
.dashboard-grid,
.stats-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
}

/* Status and metadata */

.badge,
.status-badge,
.chip,
.pill {
    display: inline-flex;
    min-height: 28px;
    padding: 0.28rem 0.62rem;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-soft);
    color: var(--color-text-soft);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.15;
}

.badge--primary,
.status-badge--planned,
.chip.is-active {
    border-color: #bfdbfe;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.badge--success,
.status-badge--completed,
.pill--success {
    border-color: #bbf7d0;
    background: var(--color-success-soft);
    color: var(--color-success);
}

.badge--warning,
.status-badge--active {
    border-color: #fed7aa;
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.badge--danger {
    border-color: #fecaca;
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.pill--inverse {
    border-color: rgb(255 255 255 / 0.38);
    background: rgb(255 255 255 / 0.15);
    color: #fff;
}

.meta-list,
.exercise-meta,
.workout-meta {
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    color: var(--color-text-faint);
    font-size: 0.8rem;
    list-style: none;
}

.meta-list li,
.exercise-meta > span,
.workout-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.meta-list li + li::before,
.exercise-meta > span + span::before,
.workout-meta > span + span::before {
    width: 3px;
    height: 3px;
    margin-right: 0.5rem;
    border-radius: 50%;
    background: var(--color-border-strong);
    content: "";
}

/* Flash messages */

.flash-stack {
    display: grid;
    margin-bottom: 1.25rem;
    gap: 0.65rem;
}

.flash {
    display: grid;
    min-height: 52px;
    padding: 0.78rem 0.9rem;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 13px;
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-xs);
}

.flash p {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 620;
}

.flash__icon {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1;
}

.flash--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.flash--error {
    border-color: #fecaca;
    background: #fff7f7;
    color: #991b1b;
}

.flash--warning {
    border-color: #fed7aa;
    background: #fffaf0;
    color: #854d0e;
}

.flash--info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

/* Forms */

.auth-card {
    width: 100%;
}

.auth-page {
    width: 100%;
}

.auth-card.card {
    padding: clamp(1.2rem, 4vw, 2rem);
    box-shadow: var(--shadow-sm);
}

.auth-card__heading {
    margin-bottom: 1.5rem;
}

.auth-card__heading h1 {
    margin-bottom: 0.65rem;
    font-size: clamp(1.75rem, 6vw, 2.45rem);
}

.auth-card__heading > p:last-child {
    margin-bottom: 0;
    color: var(--color-text-soft);
}

.auth-card__privacy {
    margin: 1rem 0 0;
    color: var(--color-text-faint);
    font-size: 0.72rem;
    text-align: center;
}

.auth-card__switch {
    margin: 1.25rem 0 0;
    color: var(--color-text-soft);
    font-size: 0.86rem;
    text-align: center;
}

.auth-card__switch a {
    font-weight: 750;
}

.field small {
    color: var(--color-text-faint);
    font-size: 0.76rem;
}

.auth-intro {
    margin-bottom: 1.6rem;
}

.auth-intro p {
    margin-bottom: 0;
    color: var(--color-text-soft);
}

.form,
.form-stack {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid--2,
.form-grid--3 {
    grid-template-columns: minmax(0, 1fr);
}

.field,
.form-group {
    display: grid;
    min-width: 0;
    gap: 0.38rem;
}

.field label,
.field__label,
.form-label,
.form-group label,
fieldset legend {
    color: var(--color-text);
    font-size: 0.84rem;
    font-weight: 720;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea,
.form-control,
.form-select,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 11px;
    outline: 0;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.35;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.field textarea,
.form-control[type="textarea"],
.form-group textarea {
    min-height: 112px;
    resize: vertical;
}

.field select,
.form-select,
.form-group select {
    padding-right: 2.5rem;
}

.field input::placeholder,
.field textarea::placeholder,
.form-control::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.field textarea:focus,
.form-control:focus,
.form-select:focus,
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 4px rgb(37 99 235 / 0.14);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.field:has(.field-error) input,
.field:has(.field-error) select,
.field:has(.field-error) textarea,
.form-control.is-invalid,
[aria-invalid="true"] {
    border-color: var(--color-danger) !important;
}

.field.has-error input:focus,
.field.has-error select:focus,
.field.has-error textarea:focus,
.field:has(.field-error) input:focus,
.field:has(.field-error) select:focus,
.field:has(.field-error) textarea:focus,
.form-control.is-invalid:focus,
[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 4px rgb(180 35 24 / 0.13) !important;
}

.field__hint,
.form-hint,
.help-text {
    color: var(--color-text-faint);
    font-size: 0.76rem;
}

.field__error,
.field-error,
.invalid-feedback {
    color: var(--color-danger);
    font-size: 0.78rem;
    font-weight: 650;
}

.form-errors,
.error-summary {
    padding: 0.9rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff7f7;
    color: #991b1b;
}

.form-errors p,
.error-summary p {
    margin-bottom: 0.45rem;
    font-weight: 750;
}

.form-errors ul,
.error-summary ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.86rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-group > input {
    min-width: 0;
    flex: 1;
}

.input-group__suffix,
.input-suffix {
    display: inline-flex;
    min-width: 50px;
    margin-left: -1px;
    padding: 0 0.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-strong);
    border-radius: 0 11px 11px 0;
    background: var(--color-surface-soft);
    color: var(--color-text-soft);
    font-size: 0.8rem;
    font-weight: 700;
}

.input-group:has(.input-group__suffix) input,
.input-group:has(.input-suffix) input {
    border-radius: 11px 0 0 11px;
}

.checkbox,
.check-field,
.radio-field {
    display: flex;
    min-height: 44px;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--color-text-soft);
    font-size: 0.86rem;
}

.checkbox input,
.check-field input,
.radio-field input {
    width: 19px;
    height: 19px;
    margin: 0.15rem 0 0;
    flex: 0 0 19px;
    accent-color: var(--color-primary);
}

.form-actions {
    display: flex;
    margin-top: 0.5rem;
    align-items: center;
    flex-direction: column;
    gap: 0.65rem;
}

.form-actions > * {
    width: 100%;
}

.auth-switch {
    margin: 1.35rem 0 0;
    color: var(--color-text-soft);
    font-size: 0.88rem;
    text-align: center;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Metrics and progress */

.metric-grid,
.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.metric-card,
.stat-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

.metric-card__label,
.stat-card__label {
    display: block;
    margin-bottom: 0.38rem;
    color: var(--color-text-faint);
    font-size: 0.72rem;
    font-weight: 720;
    letter-spacing: 0.01em;
}

.metric-card__value,
.stat-card__value,
.metric-value {
    display: block;
    color: var(--color-text);
    font-size: clamp(1.25rem, 5.5vw, 1.8rem);
    font-variant-numeric: tabular-nums;
    font-weight: 820;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.metric-card__change,
.stat-card__change {
    display: block;
    margin-top: 0.45rem;
    color: var(--color-text-faint);
    font-size: 0.7rem;
}

.progress,
.progress-track {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--color-surface-strong);
}

.progress__bar,
.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), #60a5fa);
}

/* Week planner and plans */

.week-strip,
.week-picker,
.filter-chips,
.tabs {
    display: flex;
    margin: 0 -1rem 1.25rem;
    padding: 0.25rem 1rem 0.55rem;
    overflow-x: auto;
    gap: 0.5rem;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.day-chip,
.day-tab,
.filter-chip,
.tab {
    display: inline-flex;
    min-width: 46px;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-text-soft);
    font-size: 0.8rem;
    font-weight: 720;
    text-decoration: none;
    scroll-snap-align: start;
}

.day-chip:hover,
.day-tab:hover,
.filter-chip:hover,
.tab:hover {
    border-color: #93c5fd;
    color: var(--color-primary-hover);
}

.day-chip.is-active,
.day-tab.is-active,
.filter-chip.is-active,
.tab.is-active,
.day-chip[aria-current="date"],
.day-tab[aria-selected="true"],
.tab[aria-selected="true"] {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.plan-list,
.workout-list,
.exercise-list,
.session-exercises {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 0.85rem;
    list-style: none;
}

.plan-card,
.workout-card,
.exercise-card {
    position: relative;
    display: flex;
    min-width: 0;
    padding: 1rem;
    align-items: flex-start;
    gap: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

a.plan-card,
a.workout-card,
a.exercise-card {
    color: var(--color-text);
    text-decoration: none;
}

a.plan-card:hover,
a.workout-card:hover,
a.exercise-card:hover {
    border-color: #b9c7d8;
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
}

.plan-card__main,
.workout-card__main,
.exercise-card__main {
    min-width: 0;
    flex: 1;
}

.plan-card__main h3,
.workout-card__main h3,
.exercise-card__main h3,
.plan-card__main p,
.workout-card__main p,
.exercise-card__main p {
    margin-bottom: 0.35rem;
}

.exercise-icon,
.workout-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border-radius: 13px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-size: 0.82rem;
    font-weight: 800;
}

.plan-card__actions,
.workout-card__actions,
.exercise-card__actions,
.reorder-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.drag-handle {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text-faint);
    cursor: grab;
    touch-action: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.plan-editor {
    display: grid;
    gap: 1rem;
}

.sticky-actions {
    position: sticky;
    z-index: 20;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 0.5rem);
    display: flex;
    margin: 1.5rem -0.25rem 0;
    padding: 0.65rem;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgb(255 255 255 / 0.94);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* Active workout cards */

.session-header,
.workout-session-header {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 100% 0, rgb(96 165 250 / 0.32), transparent 32%),
        linear-gradient(135deg, #172554, #1e3a8a 66%, #1d4ed8);
    color: #fff;
}

.session-header h1,
.session-header h2,
.workout-session-header h1,
.workout-session-header h2 {
    color: #fff;
}

.session-header p,
.workout-session-header p {
    color: #dbeafe;
}

.session-timer,
.timer-display {
    font-size: clamp(2rem, 12vw, 4.3rem);
    font-variant-numeric: tabular-nums;
    font-weight: 830;
    line-height: 1;
    letter-spacing: -0.055em;
}

.workout-item,
.session-exercise {
    position: relative;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.workout-item[data-workout-item],
.session-exercise[data-workout-item] {
    cursor: pointer;
}

.workout-item::before,
.session-exercise::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: transparent;
    content: "";
}

.workout-item.is-active,
.session-exercise.is-active,
.workout-item[data-state="active"] {
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1), var(--shadow-sm);
}

.workout-item.is-active::before,
.session-exercise.is-active::before,
.workout-item[data-state="active"]::before {
    background: var(--color-primary);
}

.workout-item.is-complete,
.session-exercise.is-complete,
.workout-item[data-state="completed"] {
    border-color: #bbf7d0;
    background: #f7fff9;
}

.workout-item.is-complete::before,
.session-exercise.is-complete::before,
.workout-item[data-state="completed"]::before {
    background: var(--color-success);
}

.workout-item__header,
.session-exercise__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.workout-item__header h3,
.session-exercise__header h3,
.workout-item__header p,
.session-exercise__header p {
    margin-bottom: 0.25rem;
}

.exercise-timer,
.workout-item__timer {
    color: var(--color-primary-hover);
    font-size: 1.4rem;
    font-variant-numeric: tabular-nums;
    font-weight: 820;
    letter-spacing: -0.025em;
}

.tap-hint,
.workout-item__hint {
    margin: 0.75rem 0 0;
    color: var(--color-text-faint);
    font-size: 0.76rem;
    font-weight: 650;
}

.workout-item.is-active .tap-hint,
.session-exercise.is-active .tap-hint,
.workout-item[data-state="active"] .workout-item__hint {
    color: var(--color-primary-hover);
}

.set-list,
.result-grid {
    display: grid;
    margin-top: 1rem;
    gap: 0.55rem;
}

.set-row {
    display: grid;
    padding: 0.55rem;
    align-items: center;
    grid-template-columns: minmax(2.5rem, auto) repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    border-radius: 10px;
    background: var(--color-surface-soft);
}

.set-row input {
    min-width: 0;
    min-height: 44px;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    background: #fff;
    text-align: center;
}

.rest-timer {
    display: flex;
    margin-top: 0.85rem;
    padding: 0.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-radius: 12px;
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

/* Tables and charts */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

th,
td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--color-surface-soft);
    color: var(--color-text-soft);
    font-size: 0.72rem;
    font-weight: 780;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.chart-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.chart-card__header {
    display: flex;
    margin-bottom: 1.25rem;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.chart-card__header h2,
.chart-card__header h3,
.chart-card__header p {
    margin-bottom: 0;
}

.bar-chart,
.chart-bars {
    display: grid;
    min-height: 210px;
    padding-top: 1rem;
    align-items: end;
    grid-auto-flow: column;
    grid-auto-columns: minmax(34px, 1fr);
    gap: 0.6rem;
    border-bottom: 1px solid var(--color-border);
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, var(--color-surface-soft) 50px);
}

.bar-chart__item,
.chart-bar {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: flex-end;
    flex-direction: column;
    gap: 0.45rem;
}

.bar-chart__bar,
.chart-bar__fill {
    width: min(28px, 75%);
    min-height: 3px;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, #60a5fa, var(--color-primary));
}

.bar-chart__label,
.chart-bar__label {
    color: var(--color-text-faint);
    font-size: 0.66rem;
    font-weight: 700;
}

/* Profile */

.profile-header {
    display: flex;
    margin-bottom: 1.5rem;
    padding: 1.1rem;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.profile-header .avatar {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    font-size: 1rem;
}

.profile-header h1,
.profile-header h2,
.profile-header p {
    margin-bottom: 0.2rem;
}

.profile-grid {
    display: grid;
    gap: 1rem;
}

/* Landing page */

.guest-body--landing .guest-shell {
    display: block;
}

.guest-body--landing .guest-showcase {
    display: none;
}

.guest-body--landing .guest-panel {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 90% 8%, rgb(219 234 254 / 0.75), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f8faff 68%, #f1f5f9 100%);
}

.guest-body--landing .guest-header,
.guest-body--landing .guest-content,
.guest-body--landing .guest-footer {
    width: 100%;
    max-width: var(--content-width);
    margin-right: auto;
    margin-left: auto;
}

.guest-body--landing .guest-header__home {
    display: none;
}

.guest-body--landing .guest-content {
    max-width: var(--content-width);
    padding: 2.5rem 0 3.5rem;
}

.landing {
    width: 100%;
}

.landing__hero {
    display: grid;
    align-items: center;
    gap: 2.5rem;
}

.landing__copy {
    min-width: 0;
}

.landing__copy h1 {
    max-width: 13ch;
    margin-bottom: 1.1rem;
    font-size: clamp(2.55rem, 12vw, 5.4rem);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.landing__copy h1 span {
    color: var(--color-primary);
}

.landing__lead {
    max-width: 42rem;
    color: var(--color-text-soft);
    font-size: clamp(1rem, 2.5vw, 1.16rem);
}

.landing__copy .button-row {
    margin-top: 1.5rem;
}

.landing__copy .button-row .button {
    flex: 1 1 auto;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 0.35rem;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 0 4px rgb(21 127 61 / 0.12);
}

.privacy-note {
    margin: 1rem 0 0;
    color: var(--color-text-faint);
    font-size: 0.76rem;
}

.privacy-note span {
    color: var(--color-success);
}

.phone-preview {
    position: relative;
    width: min(100%, 390px);
    margin: 0 auto;
    padding: 1rem;
    overflow: hidden;
    border: 8px solid #172554;
    border-radius: 38px;
    background:
        radial-gradient(circle at 100% 0%, rgb(96 165 250 / 0.25), transparent 34%),
        #f8fafc;
    box-shadow: 0 30px 80px rgb(30 58 138 / 0.24), 0 8px 24px rgb(15 23 42 / 0.15);
}

.phone-preview::before {
    position: absolute;
    z-index: 2;
    top: 0.4rem;
    left: 50%;
    width: 76px;
    height: 18px;
    border-radius: var(--radius-pill);
    background: #172554;
    content: "";
    transform: translateX(-50%);
}

.phone-preview__top {
    display: flex;
    padding-top: 0.45rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.phone-preview__top .brand__mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 11px;
    font-size: 0.8rem;
}

.phone-preview__timer {
    display: grid;
    padding: 1.35rem 0 1rem;
    justify-items: center;
    color: var(--color-text-soft);
    text-align: center;
}

.phone-preview__timer > span,
.phone-preview__timer small {
    font-size: 0.72rem;
    font-weight: 680;
}

.phone-preview__timer strong {
    margin: 0.15rem 0;
    color: var(--color-text);
    font-size: 2.65rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.055em;
}

.mini-workout-card {
    display: grid;
    min-height: 66px;
    margin-top: 0.65rem;
    padding: 0.72rem;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-xs);
}

.mini-workout-card__index {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--color-surface-soft);
    color: var(--color-text-faint);
    font-size: 0.68rem;
    font-weight: 800;
}

.mini-workout-card > div {
    display: grid;
    min-width: 0;
}

.mini-workout-card strong,
.mini-workout-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-workout-card strong {
    font-size: 0.82rem;
}

.mini-workout-card small {
    color: var(--color-text-faint);
    font-size: 0.65rem;
}

.mini-workout-card time {
    color: var(--color-primary-hover);
    font-size: 0.86rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.mini-workout-card--done {
    border-color: #bbf7d0;
    background: #f7fff9;
}

.mini-workout-card--done > span:last-child {
    color: var(--color-success);
    font-weight: 850;
}

.mini-workout-card--active {
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.feature-strip {
    display: grid;
    margin-top: 4rem;
    padding-top: 2rem;
    gap: 0;
    border-top: 1px solid var(--color-border);
}

.feature-strip article {
    padding: 1.1rem 0;
}

.feature-strip h2 {
    margin: 0.45rem 0 0.35rem;
    font-size: 1.02rem;
}

.feature-strip p {
    margin: 0;
    color: var(--color-text-soft);
    font-size: 0.84rem;
}

.feature-number {
    color: var(--color-primary);
    font-size: 0.7rem;
    font-weight: 820;
    letter-spacing: 0.06em;
}

/* Dashboard page aliases */

.dashboard-main,
.history-list {
    display: grid;
    gap: 1rem;
}

.today-card {
    display: flex;
    min-height: 240px;
    justify-content: space-between;
    flex-direction: column;
    gap: 1.2rem;
}

.today-card--primary {
    border: 0;
    background:
        radial-gradient(circle at 96% 4%, rgb(147 197 253 / 0.35), transparent 30%),
        linear-gradient(135deg, #172554, #1e3a8a 62%, #1d4ed8);
    box-shadow: 0 18px 40px rgb(30 58 138 / 0.22);
    color: #fff;
}

.today-card--primary h2 {
    color: #fff;
}

.today-card--primary p,
.today-card--primary .today-card__top,
.today-card--primary .inline-link {
    color: #dbeafe;
}

.today-card__top,
.today-card__footer,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.today-card__top {
    color: var(--color-text-faint);
    font-size: 0.76rem;
    font-weight: 700;
}

.today-card__footer {
    align-items: flex-end;
    flex-wrap: wrap;
}

.today-card__footer form {
    margin: 0;
}

.today-card__estimate {
    display: grid;
    color: inherit;
    font-size: 0.72rem;
}

.today-card__estimate strong {
    font-size: 1.45rem;
    line-height: 1;
}

.inline-link {
    display: inline-flex;
    min-height: 44px;
    padding: 0.35rem 0;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-primary);
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
}

.inline-link:hover {
    text-decoration: underline;
}

.progress-card {
    align-self: start;
}

.progress-card__percent {
    color: var(--color-primary);
    font-size: 1.55rem;
    font-variant-numeric: tabular-nums;
}

.progress-card progress {
    width: 100%;
    height: 10px;
    margin: 1.1rem 0 0.85rem;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-surface-strong);
    appearance: none;
}

.progress-card progress::-webkit-progress-bar {
    border-radius: inherit;
    background: var(--color-surface-strong);
}

.progress-card progress::-webkit-progress-value {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), #60a5fa);
}

.progress-card progress::-moz-progress-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), #60a5fa);
}

.section-heading {
    margin: 2rem 0 1rem;
    align-items: flex-end;
}

.card .section-heading:first-child,
.editor-section > .section-heading:first-child,
.add-exercise-card > .section-heading:first-child {
    margin-top: 0;
}

.section-heading h2,
.section-heading h3,
.section-heading p {
    margin-bottom: 0;
}

.section-heading--actions {
    align-items: center;
}

.metric-card__icon {
    display: grid;
    width: 38px;
    height: 38px;
    margin-bottom: 0.85rem;
    place-items: center;
    border-radius: 11px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-weight: 800;
}

.metric-card > strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: clamp(1.15rem, 5vw, 1.65rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.12;
}

.metric-card > strong + span {
    display: block;
    margin-top: 0.35rem;
    color: var(--color-text-faint);
    font-size: 0.72rem;
}

.history-row {
    display: grid;
    min-height: 72px;
    padding: 0.8rem 1rem;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    color: var(--color-text);
    text-decoration: none;
}

.history-row:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
}

.history-row__mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: var(--color-success-soft);
    color: var(--color-success);
    font-weight: 850;
}

.history-row__content {
    display: grid;
    min-width: 0;
}

.history-row__content strong,
.history-row__content small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-row__content small {
    color: var(--color-text-faint);
    font-size: 0.7rem;
}

.history-row__duration {
    color: var(--color-text-soft);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* Weekly plan and plan editor aliases */

.day-jump {
    position: sticky;
    z-index: 20;
    top: calc(var(--mobile-header-height) + 0.25rem);
    display: flex;
    margin: 0 -0.3rem 1.5rem;
    padding: 0.45rem;
    overflow-x: auto;
    gap: 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgb(255 255 255 / 0.94);
    box-shadow: var(--shadow-xs);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.day-jump a {
    display: grid;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 9px;
    color: var(--color-text-soft);
    font-size: 0.72rem;
    font-weight: 750;
    text-decoration: none;
}

.day-jump a:hover,
.day-jump a:focus-visible {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.week-stack,
.exercise-order {
    display: grid;
    gap: 1.5rem;
}

.exercise-order.is-saving {
    cursor: progress;
    opacity: 0.72;
}

.exercise-order.is-saving > * {
    pointer-events: none;
}

.day-section {
    scroll-margin-top: calc(var(--mobile-header-height) + 5rem);
}

.day-section__heading {
    display: flex;
    margin-bottom: 0.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.day-section__heading > div {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.day-section__heading h2 {
    margin: 0;
    font-size: 1.12rem;
}

.day-number,
.plan-exercise__number {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 11px;
    background: var(--color-surface-strong);
    color: var(--color-text-faint);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.plan-grid {
    display: grid;
    gap: 0.75rem;
}

.plan-grid .plan-card {
    min-height: 184px;
    justify-content: space-between;
    flex-direction: column;
}

.plan-card__header {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--color-text-faint);
    font-size: 0.76rem;
    font-weight: 680;
}

.plan-grid .plan-card__actions {
    width: 100%;
    margin-top: auto;
    justify-content: space-between;
}

.plan-grid .plan-card__actions form {
    margin: 0;
}

.empty-day {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 0.85rem;
    border-style: dashed;
    color: var(--color-text-soft);
    text-decoration: none;
}

.empty-day:hover {
    border-color: #93c5fd;
    background: #f8fbff;
    color: var(--color-primary-hover);
}

.empty-day > span:first-child {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 12px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-size: 1.2rem;
}

.empty-day > span:last-child {
    display: grid;
}

.empty-day small {
    color: var(--color-text-faint);
    font-size: 0.72rem;
}

.editor-section,
.editor-layout,
.editor-footer {
    margin-top: 1rem;
}

.editor-layout {
    display: grid;
    gap: 1.25rem;
}

.plan-exercise {
    position: relative;
}

.plan-exercise.is-dragging {
    border-color: #60a5fa;
    box-shadow: 0 14px 32px rgb(37 99 235 / 0.18);
    opacity: 0.72;
}

.plan-exercise__heading {
    display: grid;
    margin-bottom: 1rem;
    align-items: center;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 0.65rem;
}

.plan-exercise__heading h3,
.plan-exercise__heading span {
    margin: 0;
}

.plan-exercise__heading > div {
    min-width: 0;
}

.plan-exercise__heading > div > span {
    display: block;
    color: var(--color-text-faint);
    font-size: 0.72rem;
}

.compact-targets {
    display: grid;
    align-items: end;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.compact-targets .field label {
    font-size: 0.7rem;
}

.compact-targets .field input {
    min-height: 44px;
    padding: 0.55rem 0.6rem;
    font-size: 0.88rem;
}

.compact-targets__note,
.compact-targets > .button {
    grid-column: 1 / -1;
}

.plan-exercise__actions {
    display: flex;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
    border-top: 1px solid var(--color-border);
}

.plan-exercise__actions form {
    margin: 0;
}

.add-exercise-card {
    align-self: start;
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    gap: 1rem;
}

.editor-footer p {
    margin: 0.2rem 0 0;
    color: var(--color-text-soft);
    font-size: 0.82rem;
}

/* Exercise library aliases */

.filter-card {
    margin-bottom: 1rem;
}

.filter-form {
    display: grid;
    align-items: end;
    gap: 0.65rem;
}

.field--search input {
    background-image: linear-gradient(transparent, transparent);
}

.disclosure-card {
    margin-bottom: 1rem;
    padding: 0;
    overflow: clip;
}

.disclosure-card > summary,
.inline-editor > summary,
.data-table-details > summary {
    display: flex;
    min-height: 52px;
    padding: 0.8rem 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--color-text);
    font-size: 0.86rem;
    font-weight: 720;
    list-style: none;
    cursor: pointer;
}

.disclosure-card > summary::-webkit-details-marker,
.inline-editor > summary::-webkit-details-marker,
.data-table-details > summary::-webkit-details-marker {
    display: none;
}

.disclosure-card > summary:focus-visible,
.inline-editor > summary:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 3px var(--color-focus);
}

.disclosure-card > summary > span:last-child,
.inline-editor > summary > span:last-child {
    transition: transform 150ms ease;
}

.disclosure-card[open] > summary > span:last-child,
.inline-editor[open] > summary > span:last-child {
    transform: rotate(180deg);
}

.disclosure-card > summary > span:first-child {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.disclosure-card > summary > span:first-child > span:last-child {
    display: grid;
    min-width: 0;
}

.disclosure-card summary small {
    color: var(--color-text-faint);
    font-size: 0.7rem;
    font-weight: 550;
}

.disclosure-card__icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 12px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-size: 1.1rem;
}

.disclosure-card__content {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    background: #fbfdff;
}

.form-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.exercise-library {
    display: grid;
    gap: 0.85rem;
}

.exercise-library-card {
    display: flex;
    min-width: 0;
    min-height: 245px;
    flex-direction: column;
}

.exercise-library-card--own {
    border-color: #bfdbfe;
}

.exercise-library-card__top,
.exercise-library-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.exercise-glyph {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 13px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-size: 1rem;
    font-weight: 850;
}

.exercise-library-card__badges {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pill--brand {
    border-color: #bfdbfe;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.exercise-library-card__body {
    margin-top: 1rem;
}

.exercise-library-card__body h3,
.exercise-library-card__body > p {
    margin-bottom: 0.25rem;
}

.exercise-library-card__body > p {
    color: var(--color-text-faint);
    font-size: 0.78rem;
}

.exercise-prescription {
    display: grid;
    margin-top: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.exercise-prescription > span {
    display: grid;
    min-width: 0;
    padding: 0.6rem 0.45rem;
    border-radius: 10px;
    background: var(--color-surface-soft);
    text-align: center;
}

.exercise-prescription strong {
    overflow-wrap: anywhere;
    font-size: 0.84rem;
}

.exercise-prescription small {
    color: var(--color-text-faint);
    font-size: 0.62rem;
}

.exercise-library-card__description {
    display: -webkit-box;
    margin-top: 0.8rem !important;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.exercise-library-card__footer {
    min-height: 46px;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-faint);
    font-size: 0.72rem;
}

.exercise-library-card__footer a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.25rem;
    font-weight: 750;
    text-decoration: none;
}

.inline-editor {
    margin-top: auto;
    border-top: 1px solid var(--color-border);
}

.inline-editor > summary {
    padding-right: 0;
    padding-left: 0;
    color: var(--color-primary);
}

.inline-editor > .form-stack {
    padding: 0.85rem 0;
}

.inline-editor .form-grid--2,
.inline-editor .form-grid--5 {
    grid-template-columns: minmax(0, 1fr);
}

.inline-editor > form:last-child {
    display: flex;
    margin: 0;
    padding-top: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid var(--color-border);
}

.legend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text-faint);
    font-size: 0.74rem;
}

.legend__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Profile page aliases */

.profile-badge {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
}

.profile-badge > span {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-weight: 850;
}

.profile-badge > div {
    display: grid;
    min-width: 0;
}

.profile-badge strong,
.profile-badge small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-badge small {
    color: var(--color-text-faint);
    font-size: 0.72rem;
}

.profile-layout,
.profile-content {
    display: grid;
    gap: 1rem;
}

.profile-nav {
    display: flex;
    padding: 0.45rem;
    overflow-x: auto;
    gap: 0.25rem;
    scrollbar-width: thin;
}

.profile-nav a {
    display: inline-flex;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    align-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    color: var(--color-text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
}

.profile-nav a:hover,
.profile-nav a:focus-visible {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.profile-section {
    scroll-margin-top: calc(var(--mobile-header-height) + 1rem);
}

.profile-content > .form-stack {
    gap: 1rem;
}

.profile-section > .field + .field,
.profile-section .form-grid + .field,
.profile-section .form-grid + .button {
    margin-top: 1rem;
}

.current-weight {
    display: grid;
    text-align: right;
}

.current-weight strong {
    color: var(--color-primary-hover);
    font-size: 1.1rem;
}

.current-weight small {
    color: var(--color-text-faint);
    font-size: 0.65rem;
}

.measurement-form {
    display: grid;
    margin-bottom: 1.25rem;
    align-items: end;
    gap: 0.75rem;
}

.profile-section--data {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: column;
    gap: 1rem;
}

.profile-section--data h2,
.profile-section--data p {
    margin-bottom: 0.35rem;
}

/* Statistics page aliases */

.period-tabs {
    display: flex;
    width: 100%;
    padding: 0.3rem;
    overflow-x: auto;
    gap: 0.2rem;
    border: 1px solid var(--color-border);
    border-radius: 13px;
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

.period-tabs a {
    display: inline-flex;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    align-items: center;
    justify-content: center;
    flex: 1 0 auto;
    border-radius: 9px;
    color: var(--color-text-soft);
    font-size: 0.76rem;
    font-weight: 720;
    text-decoration: none;
}

.period-tabs a:hover,
.period-tabs a.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.stats-grid {
    margin-top: 1rem;
}

.trend {
    display: inline-flex;
    min-height: 30px;
    padding: 0.3rem 0.55rem;
    align-items: center;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    font-weight: 780;
}

.trend--up {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.trend--down {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.bar-chart {
    min-height: 230px;
    padding: 1rem 0 0.25rem;
    overflow-x: auto;
    align-items: stretch;
    grid-auto-columns: minmax(40px, 1fr);
    scrollbar-width: thin;
}

.bar-chart__column {
    display: grid;
    min-height: 210px;
    align-items: end;
    justify-items: center;
    grid-template-rows: 1.1rem minmax(150px, 1fr) auto;
    gap: 0.35rem;
}

.bar-chart__column meter {
    width: 24px;
    height: 150px;
    border: 0;
    background: transparent;
    writing-mode: vertical-lr;
    direction: rtl;
    appearance: none;
}

.bar-chart__column meter::-webkit-meter-bar {
    border: 0;
    border-radius: 8px 8px 3px 3px;
    background: var(--color-surface-strong);
}

.bar-chart__column meter::-webkit-meter-optimum-value,
.bar-chart__column meter::-webkit-meter-suboptimum-value,
.bar-chart__column meter::-webkit-meter-even-less-good-value {
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, #60a5fa, var(--color-primary));
}

.bar-chart__column meter::-moz-meter-bar {
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, #60a5fa, var(--color-primary));
}

.bar-chart__column small,
.bar-chart__value {
    color: var(--color-text-faint);
    font-size: 0.63rem;
    font-variant-numeric: tabular-nums;
    font-weight: 680;
}

.chart-insight {
    margin: 1rem 0 0;
    padding: 0.75rem;
    border-radius: 11px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-size: 0.8rem;
    font-weight: 620;
}

.data-table-details {
    margin-top: 0.75rem;
}

.data-table-details > summary {
    padding-right: 0;
    padding-left: 0;
    color: var(--color-primary);
}

.empty-chart {
    display: flex;
    min-height: 190px;
    padding: 1.25rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    border-radius: 12px;
    background: var(--color-surface-soft);
    color: var(--color-text-faint);
    text-align: center;
}

.empty-chart > span {
    font-size: 1.8rem;
}

.empty-chart p {
    max-width: 24rem;
    margin: 0;
}

.donut-progress {
    display: grid;
    width: 146px;
    height: 146px;
    margin: 1rem auto;
    padding: 0;
    place-content: center;
    border: 15px solid var(--color-primary-soft);
    border-radius: 50%;
    background: transparent;
    box-shadow: inset 0 0 0 1px #bfdbfe;
    text-align: center;
}

.donut-progress > * {
    transform: none;
}

.donut-progress strong {
    color: var(--color-text);
    font-size: 1.7rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.donut-progress span {
    color: var(--color-text-faint);
    font-size: 0.66rem;
}

.chart-card > progress {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-surface-strong);
    appearance: none;
}

.chart-card > progress::-webkit-progress-bar {
    border-radius: inherit;
    background: var(--color-surface-strong);
}

.chart-card > progress::-webkit-progress-value,
.chart-card > progress::-moz-progress-bar {
    border-radius: inherit;
    background: var(--color-primary);
}

.distribution-list,
.ranking-list,
.measurement-timeline {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 0.7rem;
}

.distribution-row {
    display: grid;
    gap: 0.35rem;
}

.distribution-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.78rem;
}

.distribution-row meter {
    width: 100%;
    height: 9px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-surface-strong);
    appearance: none;
}

.distribution-row meter::-webkit-meter-bar {
    border: 0;
    border-radius: inherit;
    background: var(--color-surface-strong);
}

.distribution-row meter::-webkit-meter-optimum-value,
.distribution-row meter::-moz-meter-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), #60a5fa);
}

.ranking-list {
    list-style: none;
}

.ranking-list li {
    display: grid;
    min-height: 54px;
    padding-bottom: 0.7rem;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    border-bottom: 1px solid var(--color-border);
}

.ranking-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ranking-list__number {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    background: var(--color-surface-soft);
    color: var(--color-text-faint);
    font-size: 0.68rem;
    font-weight: 800;
}

.ranking-list li > span:nth-child(2) {
    display: grid;
    min-width: 0;
}

.ranking-list small {
    overflow: hidden;
    color: var(--color-text-faint);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-list li > span:last-child {
    color: var(--color-text-soft);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.measurement-timeline {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.measurement-timeline > div {
    display: grid;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 11px;
    background: var(--color-surface-soft);
}

.measurement-timeline span {
    color: var(--color-text-faint);
    font-size: 0.68rem;
}

.measurement-timeline strong {
    font-size: 0.98rem;
    font-variant-numeric: tabular-nums;
}

/* Active workout page aliases */

.session-header__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: column;
    gap: 1rem;
}

.session-header__top h1,
.session-header__top p {
    margin-bottom: 0.3rem;
}

.session-header--complete {
    background:
        radial-gradient(circle at 100% 0, rgb(134 239 172 / 0.22), transparent 32%),
        linear-gradient(135deg, #14532d, #166534 68%, #15803d);
}

.session-header__metrics {
    display: grid;
    margin-top: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.session-header__metrics > div {
    display: grid;
    min-width: 0;
    padding: 0.7rem;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 12px;
    background: rgb(255 255 255 / 0.08);
}

.session-header__metrics span {
    color: #bfdbfe;
    font-size: 0.65rem;
}

.session-header--complete .session-header__metrics span {
    color: #bbf7d0;
}

.session-header__metrics strong {
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(0.88rem, 4vw, 1.35rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.session-header > progress {
    width: 100%;
    height: 8px;
    margin-top: 1rem;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 0.16);
    appearance: none;
}

.session-header > progress::-webkit-progress-bar {
    border-radius: inherit;
    background: rgb(255 255 255 / 0.16);
}

.session-header > progress::-webkit-progress-value,
.session-header > progress::-moz-progress-bar {
    border-radius: inherit;
    background: #86efac;
}

.session-clock {
    font-size: clamp(1rem, 5vw, 1.55rem) !important;
}

.workout-tip {
    display: grid;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.workout-tip > span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 850;
}

.workout-tip p {
    margin: 0;
    font-size: 0.8rem;
}

.completion-message {
    display: grid;
    margin-bottom: 1rem;
    align-items: center;
    gap: 1rem;
    border-color: #bbf7d0;
    background: #f7fff9;
}

.completion-message__mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 50%;
    background: var(--color-success-soft);
    color: var(--color-success);
    font-size: 1.4rem;
    font-weight: 850;
}

.completion-message h2,
.completion-message p {
    margin-bottom: 0.25rem;
}

.active-workout-list {
    display: grid;
    gap: 0.85rem;
}

.workout-item {
    padding: 0;
}

.workout-item.is-skipped {
    background: var(--color-surface-soft);
}

.workout-item.is-skipped::before {
    background: var(--color-text-faint);
}

.workout-item__trigger {
    display: grid;
    width: 100%;
    min-height: 88px;
    padding: 1rem;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    border: 0;
    background: transparent;
    color: var(--color-text);
    text-align: left;
}

.workout-item__trigger:disabled {
    cursor: default;
    opacity: 1;
}

.workout-item__trigger:focus-visible {
    outline: 0;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 3px var(--color-focus);
}

.workout-item.is-busy .workout-item__trigger {
    cursor: wait;
    opacity: 0.68;
}

.workout-item__number {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
    background: var(--color-surface-strong);
    color: var(--color-text-faint);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    font-weight: 820;
}

.is-active .workout-item__number {
    background: var(--color-primary);
    color: #fff;
}

.is-complete .workout-item__number {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.workout-item__identity,
.workout-item__state {
    display: grid;
    min-width: 0;
}

.workout-item__identity strong,
.workout-item__identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workout-item__identity small,
.workout-item__state small {
    color: var(--color-text-faint);
    font-size: 0.68rem;
}

.workout-item__state {
    justify-items: end;
    color: var(--color-text-soft);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.workout-item__state time {
    color: var(--color-primary-hover);
    font-size: 1.05rem;
    font-weight: 820;
}

.live-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--color-primary-hover);
    font-size: 0.65rem;
    font-weight: 750;
}

.complete-mark {
    color: var(--color-success);
    font-size: 1.15rem;
    font-weight: 850;
}

.start-arrow {
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: 850;
}

.workout-item__result {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--color-border);
}

.workout-item__result.is-visible {
    display: block;
}

.result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-note-row {
    display: grid;
    margin-top: 0.75rem;
    align-items: end;
    gap: 0.65rem;
}

.workout-finish {
    display: flex;
    margin-top: 1.25rem;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    gap: 1rem;
}

.workout-finish p {
    margin: 0.2rem 0 0;
    color: var(--color-text-soft);
    font-size: 0.8rem;
}

.toast-region {
    position: fixed;
    z-index: 100;
    right: 1rem;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1rem);
    left: 1rem;
    display: grid;
    pointer-events: none;
    gap: 0.5rem;
}

.has-active-workout .toast-region {
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 80px + 1.4rem);
}

.toast-region > * {
    max-width: 420px;
    margin-left: auto;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: var(--color-text);
    box-shadow: var(--shadow-md);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 650;
    pointer-events: auto;
}

.toast-region > .toast--success {
    background: #166534;
}

.toast-region > .toast--error {
    background: #991b1b;
}

/* Fatal-error fallback */

.error-page {
    display: flex;
    width: min(100% - 2rem, 640px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 2rem 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
}

.brand--center {
    justify-content: center;
}

.error-card {
    width: 100%;
    padding: clamp(1.4rem, 5vw, 2.5rem);
    text-align: center;
}

.error-card p:not(.eyebrow) {
    color: var(--color-text-soft);
}

.definition-list {
    display: grid;
    margin: 0;
    gap: 0;
}

.definition-list > div {
    display: flex;
    padding: 0.8rem 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.definition-list > div:last-child {
    border-bottom: 0;
}

.definition-list dt {
    color: var(--color-text-faint);
    font-size: 0.8rem;
}

.definition-list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

/* Empty and error states */

.empty-state,
.error-state {
    display: flex;
    max-width: 620px;
    margin: 1rem auto;
    padding: 2.5rem 1.25rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    text-align: center;
}

.empty-state--large {
    width: 100%;
    max-width: none;
    min-height: 240px;
}

.empty-state__icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 20px;
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.empty-state h2,
.empty-state h3,
.error-state h1 {
    margin-bottom: 0.55rem;
}

.empty-state > p,
.error-state > p:not(.eyebrow) {
    max-width: 32rem;
    margin-bottom: 1.25rem;
    color: var(--color-text-soft);
}

.error-state {
    border-style: solid;
}

.error-state__visual {
    position: relative;
    display: grid;
    width: 126px;
    height: 96px;
    margin-bottom: 1rem;
    place-items: center;
}

.error-state__visual > span:first-child {
    position: relative;
    z-index: 2;
    color: var(--color-primary-hover);
    font-size: 3rem;
    font-weight: 860;
    letter-spacing: -0.065em;
}

.error-state__pulse {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    box-shadow: 0 0 0 14px rgb(219 234 254 / 0.42);
}

.error-state__actions {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.65rem;
}

.error-state__actions > * {
    width: 100%;
}

/* Small utilities */

.nowrap {
    white-space: nowrap;
}

.numeric {
    font-variant-numeric: tabular-nums;
}

.w-full {
    width: 100%;
}

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }

/* Tablet */

@media (min-width: 640px) {
    .metric-grid,
    .stats-summary {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .page-content {
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }

    .card,
    .metric-card,
    .stat-card,
    .chart-card {
        padding: 1.25rem;
    }

    .page-header {
        align-items: center;
        flex-direction: row;
    }

    .page-header__actions,
    .page-actions {
        width: auto;
        justify-content: flex-end;
    }

    .page-header__actions > *,
    .page-actions > * {
        flex: 0 0 auto;
    }

    .card-grid,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-grid,
    .stats-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .form-grid .field--full,
    .form-grid .form-group--full,
    .form-grid .full-span {
        grid-column: 1 / -1;
    }

    .form-actions {
        justify-content: flex-end;
        flex-direction: row;
    }

    .form-actions > * {
        width: auto;
    }

    .active-workout-bar {
        min-height: 72px;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
    }

    .active-workout-bar__button {
        display: inline-flex;
        width: auto;
        height: auto;
        padding: 0.68rem 1rem;
    }

    .active-workout-bar__button-label {
        position: static;
        width: auto;
        height: auto;
        padding: initial;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .error-state,
    .empty-state {
        padding: 3.25rem 2rem;
    }

    .error-state__actions {
        width: auto;
        flex-direction: row;
    }

    .error-state__actions > * {
        width: auto;
    }

    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Desktop application */

@media (min-width: 900px) {
    .app-shell {
        display: grid;
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        z-index: 40;
        top: 0;
        display: flex;
        height: 100vh;
        height: 100dvh;
        padding: 1.4rem 1rem 1rem;
        flex-direction: column;
        gap: 2rem;
        border-right: 1px solid var(--color-border);
        background: rgb(255 255 255 / 0.9);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .sidebar > .brand {
        padding: 0 0.45rem;
    }

    .mobile-header,
    .bottom-nav {
        display: none;
    }

    .page-content {
        padding: 2.5rem 2rem 4rem;
    }

    .has-active-workout .page-content {
        padding-bottom: 8rem;
    }

    .active-workout-bar {
        right: 2rem;
        bottom: 1.5rem;
        left: calc(var(--sidebar-width) + 2rem);
        max-width: 820px;
        min-height: 72px;
        margin: 0 auto;
        padding: 0.75rem 0.9rem;
    }

    .sticky-actions {
        bottom: 1.25rem;
    }

    .week-strip,
    .week-picker,
    .filter-chips,
    .tabs {
        margin-right: 0;
        margin-left: 0;
        padding-right: 0;
        padding-left: 0;
    }

    .guest-shell {
        display: grid;
        grid-template-columns: minmax(390px, 46%) minmax(0, 1fr);
    }

    .guest-showcase {
        position: relative;
        display: flex;
        min-height: 100vh;
        min-height: 100dvh;
        padding: clamp(2rem, 5vw, 4.5rem);
        overflow: hidden;
        justify-content: space-between;
        flex-direction: column;
        background:
            radial-gradient(circle at 75% 17%, rgb(96 165 250 / 0.35), transparent 30%),
            radial-gradient(circle at 8% 80%, rgb(29 78 216 / 0.42), transparent 35%),
            linear-gradient(150deg, #0f172a 0%, #172554 50%, #1e3a8a 100%);
        color: #fff;
    }

    .guest-showcase::after {
        position: absolute;
        right: -90px;
        bottom: 8%;
        width: 330px;
        height: 330px;
        border: 1px solid rgb(191 219 254 / 0.18);
        border-radius: 50%;
        box-shadow: 0 0 0 55px rgb(191 219 254 / 0.04), 0 0 0 110px rgb(191 219 254 / 0.025);
        content: "";
    }

    .guest-showcase__content {
        position: relative;
        z-index: 1;
        max-width: 37rem;
        margin: auto 0;
        padding: 3rem 0;
    }

    .guest-showcase__content h1 {
        max-width: 34rem;
        margin-bottom: 1.1rem;
        color: #fff;
        font-size: clamp(2.45rem, 4.5vw, 4.4rem);
    }

    .guest-showcase__content > p {
        max-width: 35rem;
        color: #bfdbfe;
        font-size: 1.08rem;
    }

    .guest-panel {
        padding: 1.25rem clamp(2rem, 6vw, 5.5rem) 1.5rem;
    }

    .guest-header .brand {
        display: none;
    }

    .guest-header {
        justify-content: flex-end;
    }

    .guest-content {
        padding: 3rem 0;
    }

    .guest-body--error .guest-shell {
        display: block;
    }

    .guest-body--error .guest-showcase {
        display: none;
    }

    .guest-body--error .guest-panel {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .guest-body--error .guest-header {
        justify-content: space-between;
    }

    .guest-body--error .guest-header .brand {
        display: inline-flex;
    }
}

@media (min-width: 1200px) {
    :root {
        --sidebar-width: 272px;
    }

    .sidebar {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }

    .page-content {
        padding: 3rem clamp(2.5rem, 4vw, 4.5rem) 5rem;
    }

    .card-grid--three,
    .stats-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .dashboard-grid > * {
        grid-column: span 6;
    }

    .dashboard-grid > .span-8 {
        grid-column: span 8;
    }

    .dashboard-grid > .span-4 {
        grid-column: span 4;
    }

    .dashboard-grid > .span-full,
    .dashboard-grid > .full-span {
        grid-column: 1 / -1;
    }
}

/* Page-level responsive refinements (kept after the generic grids). */

@media (min-width: 640px) {
    .landing__copy .button-row .button {
        flex: 0 0 auto;
    }

    .feature-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-strip article {
        padding: 1.25rem;
        border-left: 1px solid var(--color-border);
    }

    .feature-strip article:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }

    .plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-targets {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .compact-targets__note {
        grid-column: span 2;
    }

    .compact-targets > .button {
        grid-column: auto;
    }

    .editor-footer {
        flex-direction: row;
    }

    .day-jump {
        display: grid;
        overflow: visible;
        grid-template-columns: repeat(7, minmax(44px, 1fr));
    }

    .day-jump a {
        min-width: 0;
        flex: initial;
    }

    .filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-form > .field--search,
    .filter-form > .field:nth-child(2) {
        grid-column: 1 / -1;
    }

    .exercise-library {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .measurement-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .measurement-form__note {
        grid-column: span 2;
    }

    .profile-section--data,
    .workout-finish {
        align-items: center;
        flex-direction: row;
    }

    .period-tabs {
        width: auto;
    }

    .stats-grid .chart-card--wide {
        grid-column: 1 / -1;
    }

    .stats-grid:has(> .chart-card--wide) > .chart-card:not(.chart-card--wide) {
        grid-column: 1 / -1;
    }

    .completion-message {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .session-header__top {
        align-items: center;
        flex-direction: row;
    }

    .result-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .result-note-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

@media (min-width: 900px) {
    .guest-body--landing .guest-panel {
        padding: 1.25rem clamp(2rem, 5vw, 4.5rem) 1.5rem;
    }

    .guest-body--landing .guest-header {
        justify-content: flex-start;
    }

    .guest-body--landing .guest-header .brand {
        display: inline-flex;
    }

    .guest-body--landing .guest-content {
        padding: clamp(3rem, 6vw, 5.5rem) 0 4.5rem;
    }

    .landing__hero {
        grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
        gap: clamp(3rem, 7vw, 7rem);
    }

    .phone-preview {
        transform: rotate(1.3deg);
    }

    .feature-strip {
        margin-top: 6rem;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .feature-strip article,
    .feature-strip article:nth-child(odd) {
        padding: 1.25rem;
        border-left: 1px solid var(--color-border);
    }

    .feature-strip article:first-child {
        padding-left: 0;
        border-left: 0;
    }

    .dashboard-grid.dashboard-grid--hero {
        grid-template-columns: minmax(0, 1.7fr) minmax(270px, 0.8fr);
    }

    .dashboard-grid.dashboard-grid--hero > * {
        grid-column: auto;
    }

    .progress-card {
        position: sticky;
        top: 2rem;
    }

    .day-jump {
        top: 1rem;
    }

    .day-section {
        scroll-margin-top: 5.5rem;
    }

    .editor-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .add-exercise-card {
        position: static;
    }

    .exercise-library {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid--5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .profile-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-nav {
        position: static;
        overflow-x: auto;
        flex-direction: row;
    }

    .profile-nav a {
        width: auto;
    }

    .profile-section {
        scroll-margin-top: 2rem;
    }

    .toast-region {
        right: 2rem;
        bottom: 2rem;
        left: auto;
        width: min(420px, calc(100vw - var(--sidebar-width) - 4rem));
    }

    .has-active-workout .toast-region {
        bottom: calc(72px + 2.5rem);
    }
}

@media (min-width: 1180px) {
    .filter-form {
        grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.65fr) auto auto;
    }

    .filter-form > .field--search,
    .filter-form > .field:nth-child(2) {
        grid-column: auto;
    }

    .exercise-library {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inline-editor .form-grid--2,
    .inline-editor .form-grid--5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-layout {
        grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
        align-items: start;
    }

    .profile-nav {
        position: sticky;
        top: 2rem;
        overflow: visible;
        flex-direction: column;
    }

    .profile-nav a {
        width: 100%;
    }

    .editor-layout {
        grid-template-columns: minmax(0, 1fr) minmax(290px, 350px);
        align-items: start;
        gap: 1.5rem;
    }

    .add-exercise-card {
        position: sticky;
        top: 2rem;
    }

    .stats-grid:has(> .chart-card--wide) {
        grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
    }

    .stats-grid:has(> .chart-card--wide) > .chart-card {
        grid-column: auto;
    }

    .stats-grid:has(> .chart-card--wide) > .chart-card:not(.chart-card--wide) {
        grid-column: auto;
    }

    .plan-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .compact-targets {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .compact-targets__note {
        grid-column: span 2;
    }

    .compact-targets > .button {
        grid-column: span 1;
    }
}

@media (max-width: 380px) {
    .session-header__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .session-header__metrics > div:first-child {
        grid-column: 1 / -1;
    }

    .session-header__metrics span {
        overflow-wrap: anywhere;
    }

    .workout-item__trigger {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .workout-item__state {
        display: flex;
        grid-column: 1 / -1;
        min-width: 0;
        margin-left: 52px;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        text-align: left;
    }

    .workout-item__state small {
        overflow-wrap: anywhere;
    }
}

.goal-progress-value {
    margin: 0.5rem 0 1rem;
    color: var(--color-text-soft);
    text-align: center;
}

.goal-progress-value strong {
    color: var(--color-primary-hover);
    font-size: clamp(2rem, 7vw, 3rem);
    font-variant-numeric: tabular-nums;
}

/* Accessibility preferences */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    .brand__mark,
    .active-workout-bar,
    .card--hero,
    .hero-card,
    .session-header,
    .workout-session-header {
        border: 1px solid CanvasText;
        background: Canvas;
        color: CanvasText;
    }

    .bottom-nav__link.is-active,
    .nav-link.is-active,
    .day-chip.is-active,
    .day-tab.is-active,
    .tab.is-active {
        outline: 2px solid Highlight;
    }
}

@media print {
    .sidebar,
    .mobile-header,
    .bottom-nav,
    .active-workout-bar,
    .page-actions,
    .page-header__actions,
    .sticky-actions,
    .guest-showcase,
    .guest-header,
    .guest-footer {
        display: none !important;
    }

    .app-shell,
    .guest-shell {
        display: block;
    }

    .page-content,
    .guest-panel,
    .guest-content {
        max-width: none;
        padding: 0;
    }

    .card,
    .metric-card,
    .stat-card,
    .chart-card {
        break-inside: avoid;
        box-shadow: none;
    }
}
