:root {
    --bg: #050006;
    --bg-2: #130817;
    --panel: rgba(18, 8, 22, 0.88);
    --panel-solid: #160b1f;
    --panel-soft: rgba(35, 12, 39, 0.76);
    --border: rgba(190, 87, 255, 0.2);
    --border-strong: rgba(255, 46, 92, 0.52);
    --text: #fff5fb;
    --muted: #c8aebe;
    --cyan: #b94cff;
    --cyan-2: #ff2d58;
    --blue: #7a1dff;
    --danger: #ff2d58;
    --success: #38e887;
    --warning: #ffd166;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
    --glow: 0 0 30px rgba(255, 45, 88, 0.28);
    --radius: 22px;
    --radius-sm: 14px;
    --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 15%, rgba(36, 107, 255, 0.22), transparent 35%),
        radial-gradient(circle at 85% 20%, rgba(34, 240, 255, 0.16), transparent 30%),
        linear-gradient(145deg, var(--bg), #070b12 55%, #020308);
    overflow-x: hidden;
}

body::selection { background: rgba(34, 240, 255, 0.25); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.character-bg,
.site-overlay {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: -2;
}
.character-bg {
    background-image: var(--character-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.09;
    filter: saturate(0.7) contrast(1.15);
}
.site-overlay {
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(2, 4, 10, 0.96), rgba(2, 4, 10, 0.78), rgba(2, 4, 10, 0.96)),
        radial-gradient(circle at center, rgba(0, 196, 255, 0.08), transparent 52%);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px clamp(16px, 4vw, 36px);
    border-bottom: 1px solid var(--border);
    background: rgba(3, 7, 15, 0.78);
    backdrop-filter: blur(18px);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    box-shadow: var(--glow);
}
.brand strong { display: block; font-size: 1rem; letter-spacing: 0; }
.brand small { color: var(--cyan); font-size: .78rem; }
.topnav {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.topnav a,
.admin-tabs a {
    border: 1px solid transparent;
    padding: 10px 12px;
    border-radius: 999px;
    color: var(--muted);
    transition: .18s ease;
}
.topnav a:hover,
.topnav a.is-active,
.admin-tabs a:hover,
.admin-tabs a.is-active {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(34, 240, 255, 0.08);
    box-shadow: 0 0 18px rgba(34, 240, 255, 0.12);
}
.btn-mini,
.admin-pill { color: var(--text) !important; border-color: var(--cyan) !important; }
.mobile-admin-link {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 45, 88, .68);
    border-radius: 10px;
    background: rgba(255, 45, 88, .12);
    color: #fff;
    font-size: .82rem;
    font-weight: 900;
}
.mobile-admin-link.is-active {
    border-color: rgba(190, 87, 255, .78);
    background: rgba(122, 29, 255, .24);
}

.page-shell {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 86px;
}
.footer {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 110px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    align-items: center;
    gap: 26px;
    min-height: calc(100vh - 140px);
    padding: 36px 0;
}
.eyebrow {
    margin: 0 0 10px;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0;
    font-weight: 800;
    font-size: .74rem;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
    font-size: clamp(2.3rem, 8vw, 5.8rem);
    line-height: .92;
    letter-spacing: 0;
    margin-bottom: 18px;
}
h2 { font-size: clamp(1.55rem, 4vw, 2.6rem); line-height: 1.05; letter-spacing: 0; }
h3 { font-size: 1.16rem; }
p { color: var(--muted); line-height: 1.65; }
.hero-phrase {
    color: var(--text);
    font-size: clamp(1.2rem, 3.5vw, 2rem);
    font-weight: 800;
    text-shadow: 0 0 22px rgba(34, 240, 255, 0.26);
}
.hero-phrase.small { font-size: clamp(1.05rem, 3vw, 1.55rem); margin-bottom: 0; }
.hero-text { font-size: 1.08rem; max-width: 680px; }
.hero-actions,
.card-actions,
.form-actions,
.detail-actions,
.share-actions,
.history-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(34, 240, 255, 0.07);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    box-shadow: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--glow); }
.btn-primary {
    border-color: rgba(34, 240, 255, .72);
    color: #001015;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 34px rgba(0, 196, 255, .22);
}
.btn-ghost { background: rgba(255,255,255,.035); }
.btn-danger { border-color: rgba(255, 79, 109, .65); background: rgba(255, 79, 109, .12); color: #ffdbe2; }
.full { width: 100%; }
.text-link { color: var(--cyan); font-weight: 800; }
.text-link:hover { text-decoration: underline; }

.glass-card,
.routine-card,
.stat-card,
.quick-card,
.history-card,
.exercise-card,
.chart-card,
.social-card,
.compare-card {
    background: linear-gradient(180deg, rgba(16, 24, 39, .88), rgba(7, 12, 22, .76));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.hero-panel { padding: 28px; position: relative; overflow: hidden; }
.hero-panel::before,
.routine-card::before,
.share-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, rgba(34, 240, 255, .18), transparent 38%, rgba(36, 107, 255, .12));
    pointer-events: none;
}
.hero-panel > * { position: relative; }
.panel-kicker,
.badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--cyan);
    background: rgba(34, 240, 255, 0.08);
    font-size: .78rem;
    font-weight: 900;
}
.badge.good { color: var(--success); border-color: rgba(57,255,182,.35); background: rgba(57,255,182,.08); }
.badge.bad { color: var(--danger); border-color: rgba(255,79,109,.35); background: rgba(255,79,109,.08); }
.badge.warn { color: #ffd166; border-color: rgba(255,209,102,.38); background: rgba(255,209,102,.10); }
.check-list { padding-left: 18px; color: var(--muted); line-height: 1.85; }
.check-list li::marker { color: var(--cyan); }

.section { padding: 38px 0; }
.section.compact { padding-top: 12px; }
.section-head { text-align: center; max-width: 780px; margin: 0 auto 22px; }
.section-head.align-left { text-align: left; margin-left: 0; }
.section-head.with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    max-width: none;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.routine-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
}
.routine-card > * { position: relative; }
.routine-number {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    color: #001015;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-weight: 950;
    margin-bottom: 14px;
}
.routine-card ol { color: var(--muted); padding-left: 18px; line-height: 1.7; }
.routine-card li::marker { color: var(--cyan); font-weight: 800; }

.split-section {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 24px;
    align-items: start;
}
.steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.step {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.035);
}
.step span {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(34, 240, 255, .12);
    color: var(--cyan);
    font-weight: 900;
    margin-bottom: 10px;
}
.step strong { display: block; margin-bottom: 4px; }
.step p { margin: 0; }
.feature-band,
.social-section {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: linear-gradient(135deg, rgba(34, 240, 255, .10), rgba(36,107,255,.08));
}
.social-section { grid-template-columns: repeat(2, minmax(0,1fr)); background: transparent; border: 0; padding-left: 0; padding-right: 0; }
.social-card { padding: 24px; }

.auth-wrap {
    min-height: calc(100vh - 230px);
    display: grid;
    place-items: center;
    padding: 24px 0;
}
.auth-card { width: min(100%, 460px); padding: 28px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.alert,
.flash {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    background: rgba(255,255,255,.05);
}
.alert p { margin: 0 0 6px; }
.alert p:last-child { margin-bottom: 0; }
.alert-error,
.flash-error { border-color: rgba(255,79,109,.45); background: rgba(255,79,109,.10); color: #ffdce3; }
.flash-success { border-color: rgba(57,255,182,.42); background: rgba(57,255,182,.10); color: #d9fff1; }
.flash-record { border-color: rgba(34,240,255,.55); background: rgba(34,240,255,.12); color: var(--cyan); box-shadow: var(--glow); }
.flash-warning { border-color: rgba(255,209,102,.45); background: rgba(255,209,102,.10); color: #fff2c9; }
.login-notice {
    border-color: rgba(255, 209, 102, .48);
    background: rgba(255, 209, 102, .10);
    color: #fff6d6;
}
.login-notice .eyebrow { color: #ffd166; margin-bottom: 5px; }
.login-notice h2 { font-size: 1.1rem; margin: 0 0 6px; }
.login-notice > p:last-child { margin: 0; color: #fff6d6; line-height: 1.5; }

.form-card,
.filters,
.session-meta {
    display: grid;
    gap: 14px;
}
.login-notice-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 209, 102, .28);
    border-radius: var(--radius-sm);
    background: rgba(255, 209, 102, .06);
}
.login-notice-settings > p,
.login-notice-settings > h2,
.login-notice-settings > .switch { grid-column: 1 / -1; }
.login-notice-settings > p { margin: 0; }
.login-notice-settings h2 { margin: -8px 0 0; font-size: 1.25rem; }
.login-notice-settings .switch { margin-top: 2px; }
.form-card.two-col,
.session-meta,
.filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
input, select, textarea {
    width: 100%;
    color: var(--text);
    background: rgba(0, 0, 0, .28);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}
input::placeholder,
textarea::placeholder {
    color: rgba(200, 174, 190, .5);
    opacity: 1;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(34, 240, 255, .10);
}
select option { color: #07101b; }
textarea { resize: vertical; }
.full-row { grid-column: 1 / -1; }
.bot-field {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}
.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row;
}
.switch input { width: auto; }

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 26px;
    margin-bottom: 26px;
}
.mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
}
.mini-stats.one { grid-template-columns: 1fr; }
.mini-stats div,
.stat-card.inner {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.04);
}
.mini-stats strong {
    display: block;
    color: var(--cyan);
    font-size: 1.45rem;
}
.mini-stats span { color: var(--muted); font-size: .86rem; }
.workout-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.workout-button {
    min-height: 130px;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: linear-gradient(135deg, rgba(34,240,255,.14), rgba(36,107,255,.10));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow);
}
.workout-button span { font-size: 1.45rem; font-weight: 950; }
.workout-button small { color: var(--cyan); font-weight: 800; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.stat-card { padding: 22px; }
.stat-card > span { color: var(--cyan); text-transform: uppercase; font-size: .74rem; letter-spacing: 0; font-weight: 900; }
.stat-card h3 { margin: 10px 0 8px; font-size: 1.55rem; }
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.quick-card { padding: 20px; }
.quick-card strong { display: block; font-size: 1.25rem; }
.quick-card span { color: var(--muted); }

.workout-form { display: grid; gap: 18px; }
.session-meta { padding: 18px; }
.exercise-list { display: grid; gap: 16px; }
.exercise-card { padding: 18px; }
.exercise-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.exercise-head h2 { margin-bottom: 0; }
.sets-list { display: grid; gap: 10px; }
.set-row {
    display: grid;
    grid-template-columns: 72px 1fr 1fr 1.2fr 42px;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(0,0,0,.18);
}
.set-number {
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(34,240,255,.09);
    border: 1px solid var(--border);
    color: var(--cyan);
    font-weight: 950;
}
.set-number small { display: block; color: var(--muted); font-size: .64rem; text-transform: uppercase; }
.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: rgba(255,255,255,.05);
    cursor: pointer;
    font-size: 1.4rem;
}
.icon-button.danger { color: #ffdce3; border-color: rgba(255,79,109,.35); }
.add-set { margin-top: 12px; }
.sticky-actions {
    position: sticky;
    bottom: 14px;
    z-index: 12;
    justify-content: flex-end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(4,8,16,.74);
    backdrop-filter: blur(14px);
}
.floating-save { display: none; }

.filters { padding: 16px; margin-bottom: 18px; align-items: end; }
.history-list { display: grid; gap: 12px; }
.history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
}
.history-card.is-selected { border-color: var(--cyan); box-shadow: var(--glow); }
.detail-card { padding: 22px; margin-bottom: 18px; }
.detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.inline-form { display: inline; }
.message-list {
    display: grid;
    gap: 14px;
}
.user-message-card {
    display: grid;
    gap: 14px;
    padding: 20px;
}
.message-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}
.message-card-head h2 {
    margin-bottom: 4px;
}
.message-card-head h2 small {
    color: var(--muted);
    font-size: .9rem;
}
.message-body {
    white-space: normal;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,.18);
}
.notes-box {
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255,255,255,.04);
}
.detail-sets { display: grid; gap: 14px; }
.set-group { padding-top: 10px; border-top: 1px solid var(--border); }
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(6, 10, 18, .72);
}
.table-wrap.mini { border-radius: var(--radius-sm); }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}
th, td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(87, 228, 255, 0.11);
    vertical-align: top;
}
th { color: var(--cyan); font-size: .82rem; text-transform: uppercase; letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }
.empty-state { padding: 30px; text-align: center; }

.progress-grid,
.chart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.compare-card { padding: 18px; border-left: 4px solid var(--border-strong); }
.compare-card.subio { border-left-color: var(--success); }
.compare-card.bajo { border-left-color: var(--danger); }
.compare-card.igual { border-left-color: var(--cyan); }
.compare-card h3 { font-size: 1.8rem; margin: 8px 0; color: var(--cyan); }
.subsection { margin-top: 30px; }
.simple-list { color: var(--muted); line-height: 1.8; padding-left: 20px; }
.chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card { padding: 18px; min-height: 280px; }
.chart-fallback { display: none; }
body.chart-missing .chart-fallback { display: block; }
.inline-filter { min-width: 240px; }

.profile-layout,
.admin-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.profile-summary,
.profile-form,
.preview-settings { padding: 22px; }
.avatar-xl {
    width: 116px;
    height: 116px;
    border-radius: 32px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    background: linear-gradient(135deg, rgba(34,240,255,.14), rgba(36,107,255,.12));
    box-shadow: var(--glow);
    margin-bottom: 16px;
}
.avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xl span { font-size: 3rem; font-weight: 950; color: var(--cyan); }
.export-actions { display: grid; gap: 10px; margin-top: 14px; }
.personal-backup-section {
    display: grid;
    gap: 10px;
    margin: 22px 0;
    padding: 22px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.personal-backup-section h2,
.personal-backup-section p { margin: 0; }
.personal-backup-section .btn { width: fit-content; }
.personal-backup-import {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.personal-backup-import label { display: grid; gap: 7px; color: var(--muted); font-size: .92rem; }
.personal-backup-import input[type="file"] { max-width: 100%; }
.backup-privacy-note { font-size: .88rem; color: var(--muted); }
.public-card { max-width: 640px; margin: 0 auto; padding: 34px; text-align: center; }
.public-card .avatar-xl { margin: 0 auto 18px; }

.share-card {
    position: relative;
    isolation: isolate;
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 34px;
    min-height: 620px;
    border: 1px solid var(--border-strong);
    border-radius: 34px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(3,7,15,.88), rgba(5,10,22,.94)),
        radial-gradient(circle at 50% 10%, rgba(34,240,255,.2), transparent 40%);
    box-shadow: 0 30px 90px rgba(0,0,0,.48), var(--glow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}
.share-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--character-image);
    background-size: cover;
    background-position: center;
    opacity: .10;
}
.share-big { font-size: 2.1rem; font-weight: 950; letter-spacing: 0; }
.share-meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.share-meta span { border: 1px solid var(--border); border-radius: 999px; padding: 7px 10px; }
.share-volume strong { display: block; font-size: 3rem; color: var(--cyan); text-shadow: 0 0 24px rgba(34,240,255,.32); }
.share-volume span { color: var(--muted); }
.share-phrase { color: var(--text); font-weight: 800; font-size: 1.25rem; }
.share-actions { justify-content: center; margin-top: 20px; }

.sheet-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: rgba(3, 7, 15, .84);
    box-shadow: var(--shadow), var(--glow);
}
.sheet-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--character-image);
    background-size: cover;
    background-position: center;
    opacity: .08;
    pointer-events: none;
}
.sheet-title,
.sheet-table-wrap { position: relative; }
.sheet-title { padding: 22px; text-align: center; }
.sheet-title span { color: var(--cyan); text-transform: uppercase; font-weight: 950; letter-spacing: 0; }
.sheet-title h2 { margin: 8px 0; }
.sheet-table-wrap { overflow-x: auto; }
.sheet-table { min-width: 980px; background: rgba(0,0,0,.16); }
.sheet-table th,
.sheet-table td {
    border: 1px solid rgba(34, 240, 255, .18);
    min-width: 150px;
}
.sheet-table thead th { background: rgba(34,240,255,.09); text-align: center; }
.sheet-table tbody th { color: var(--text); width: 230px; position: sticky; left: 0; background: rgba(6,10,18,.94); z-index: 2; }
.sheet-set { padding: 4px 0; color: var(--text); }

.admin-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 8px 0 20px;
}
.preview-settings .image-preview {
    height: 230px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    margin-bottom: 18px;
    opacity: .85;
}
.logo-preview { width: 120px; height: 120px; object-fit: cover; border-radius: 24px; border: 1px solid var(--border-strong); box-shadow: var(--glow); }

.bottom-nav {
    position: fixed;
    z-index: 40;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: none;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background: rgba(5, 9, 18, .88);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.bottom-nav a {
    display: grid;
    gap: 2px;
    justify-items: center;
    color: var(--muted);
    font-size: .68rem;
    padding: 7px 4px;
    border-radius: 16px;
}
.bottom-nav a span { font-size: 1rem; }
.bottom-nav a.is-active { color: var(--cyan); background: rgba(34,240,255,.10); }

@media (max-width: 980px) {
    .topnav { display: none; }
    .mobile-admin-link { display: inline-flex; }
    .page-shell { width: min(100% - 24px, var(--max)); padding-top: 22px; padding-bottom: 112px; }
    .bottom-nav { display: grid; }
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .card-grid.three,
    .workout-buttons,
    .stats-grid,
    .quick-actions,
    .progress-grid,
    .chart-grid,
    .social-section { grid-template-columns: 1fr; }
    .split-section { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .feature-band { grid-template-columns: 1fr; }
    .dashboard-hero { flex-direction: column; align-items: stretch; }
    .profile-layout,
    .admin-layout { grid-template-columns: 1fr; }
    .section-head.with-actions { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 700px) {
    .personal-backup-import { grid-template-columns: 1fr; }
    .personal-backup-import .btn { width: 100%; }
    h1 { font-size: clamp(2rem, 14vw, 3.6rem); }
    .brand strong { font-size: .9rem; }
    .brand-logo { width: 42px; height: 42px; }
    .hero-actions .btn,
    .card-actions .btn,
    .detail-actions .btn,
    .history-actions .btn { width: 100%; }
    .hero-panel,
    .auth-card,
    .stat-card,
    .routine-card,
    .exercise-card,
    .detail-card { padding: 18px; }
    .form-card.two-col,
    .session-meta,
    .filters,
    .login-notice-settings { grid-template-columns: 1fr; }
    .set-row {
        grid-template-columns: 56px 1fr 1fr 42px;
        align-items: end;
    }
    .set-row label:nth-of-type(3) { grid-column: 2 / -1; }
    .set-number { height: 50px; }
    .sticky-actions { display: none; }
    .floating-save {
        display: inline-flex;
        position: fixed;
        right: 18px;
        bottom: 96px;
        z-index: 38;
        border: 1px solid rgba(34,240,255,.72);
        border-radius: 999px;
        padding: 14px 18px;
        color: #001015;
        font-weight: 950;
        background: linear-gradient(135deg, var(--cyan), var(--blue));
        box-shadow: 0 18px 50px rgba(0,196,255,.28);
        cursor: pointer;
    }
    .history-card,
    .detail-head { flex-direction: column; align-items: stretch; }
    .mini-stats { grid-template-columns: 1fr; }
    .share-card { min-height: 560px; padding: 26px 18px; }
    .share-volume strong { font-size: 2.35rem; }
}

@media print {
    body { background: #fff !important; color: #111 !important; }
    .character-bg, .site-overlay, .topbar, .footer, .bottom-nav, .no-print, .floating-save, .share-actions { display: none !important; }
    .page-shell { width: 100%; padding: 0; margin: 0; }
    .sheet-card, .share-card { box-shadow: none; border: 1px solid #222; color: #111; background: #fff; }
    .sheet-card::before, .share-card::after { opacity: .06; }
    .sheet-table { min-width: 100%; color: #111; }
    .sheet-table th, .sheet-table td { color: #111; border-color: #333; }
    .sheet-table tbody th { position: static; background: #f3f3f3; }
    a { color: #111; }
}

/* Cambios v2: flujo obligatorio, historial visual, progreso inteligente e imágenes de referencia */
.next-workout-card{display:grid;gap:12px;align-items:start}.next-workout-card h3{font-size:clamp(1.8rem,6vw,3rem);margin:0}.flow-progress{margin-bottom:18px}.progress-bar{height:12px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden;border:1px solid rgba(37,245,255,.18)}.progress-bar span{display:block;height:100%;background:linear-gradient(90deg,var(--blue),var(--cyan));box-shadow:var(--glow)}.exercise-step-list{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.step-pill{padding:8px 11px;border-radius:999px;border:1px solid rgba(255,255,255,.12);font-size:.78rem;font-weight:800;color:var(--muted);background:rgba(255,255,255,.04)}.step-pill.done{border-color:rgba(40,232,154,.35);color:#bfffe4;background:rgba(40,232,154,.12)}.step-pill.active{border-color:rgba(37,245,255,.5);color:#fff;background:rgba(37,245,255,.14);box-shadow:var(--glow)}.step-pill.locked{opacity:.62}.current-exercise-layout{display:grid;gap:16px}.current-exercise{position:relative}.exercise-reference{margin:14px 0;border-radius:22px;overflow:hidden;border:1px solid rgba(37,245,255,.22);background:rgba(0,0,0,.2)}.exercise-reference img{width:100%;max-width:100%;height:auto;object-fit:contain;display:block}.locked-sets{display:grid;gap:12px}.fixed-set-row{grid-template-columns:64px 1fr;align-items:end}.autosave-status{grid-column:1/-1;color:var(--muted);font-weight:800;min-height:18px}.autosave-status.is-error{color:#ffd166}.previous-marks{align-self:start}.previous-marks h3{margin:.3rem 0}.recommendation{font-size:1.05rem;color:#fff;font-weight:900}.mark-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}.mark-grid div{padding:12px;border:1px solid rgba(37,245,255,.18);border-radius:16px;background:rgba(255,255,255,.04)}.mark-grid span{display:block;color:var(--muted);font-size:.72rem;text-transform:uppercase;font-weight:900}.mark-grid strong{display:block;margin-top:4px}.recent-marks{display:grid;gap:8px}.recent-mark-row{padding:10px;border-radius:14px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08)}.recent-mark-row strong,.recent-mark-row span{display:block}.recent-mark-row span{color:var(--muted);margin-top:2px}.final-card{max-width:760px;margin:0 auto}.history-legend{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.status-dot{display:inline-flex;align-items:center;gap:6px;padding:8px 11px;border-radius:999px;border:1px solid rgba(255,255,255,.12);font-weight:900;font-size:.8rem}.status-dot:before{content:"";width:10px;height:10px;border-radius:50%;background:currentColor}.status-dot.mejoro{color:#28e89a}.status-dot.igual{color:#ffd166}.status-dot.bajo{color:#ff4d6d}.status-dot.incompleto{color:#9bb0c5}.calendar-grid{display:grid;gap:12px;grid-template-columns:1fr}.calendar-card{border-radius:22px;overflow:hidden;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.05)}.calendar-card a{display:grid;gap:6px;padding:16px;color:var(--text)}.calendar-card.mejoro{border-color:rgba(40,232,154,.45);background:linear-gradient(145deg,rgba(40,232,154,.12),rgba(255,255,255,.04))}.calendar-card.igual{border-color:rgba(255,209,102,.4)}.calendar-card.bajo{border-color:rgba(255,77,109,.45);background:linear-gradient(145deg,rgba(255,77,109,.12),rgba(255,255,255,.04))}.calendar-card.incompleto{border-style:dashed;opacity:.9}.calendar-card.is-selected{box-shadow:var(--glow)}.calendar-date{color:var(--cyan);font-weight:900}.calendar-volume{color:var(--muted)}.calendar-status{justify-self:start;border-radius:999px;padding:6px 10px;background:rgba(0,0,0,.22);font-weight:900}.visual-sets{display:grid;gap:12px}.visual-set-group{padding:14px;border-radius:18px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}.set-chip-row{display:flex;flex-wrap:wrap;gap:8px}.set-chip{display:inline-flex;padding:7px 10px;border-radius:999px;background:rgba(37,245,255,.1);border:1px solid rgba(37,245,255,.2);font-weight:850}.set-chip.zero{background:rgba(255,209,102,.11);border-color:rgba(255,209,102,.35);color:#ffe7a3}.smart-grid,.trend-grid{display:grid;gap:14px}.stat-card.highlight{border-color:rgba(37,245,255,.32)}.recommendations{margin:18px 0}.recommendation-list p{margin:.45rem 0;color:#eaf6ff}.trend-card{padding:16px;border-radius:20px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.05)}.trend-card span{color:var(--muted);font-size:.75rem;text-transform:uppercase;font-weight:900}.trend-card h3{margin:.25rem 0}.trend-card.subiendo{border-color:rgba(40,232,154,.4)}.trend-card.bajando,.trend-card.incompleto{border-color:rgba(255,77,109,.4)}.trend-card.estancado{border-color:rgba(255,209,102,.4)}.admin-thumb{width:74px;height:54px;object-fit:contain;background:rgba(0,0,0,.24);border-radius:12px;border:1px solid rgba(37,245,255,.22)}.exercise-admin-preview img{width:100%;max-width:360px;height:auto;border-radius:16px;border:1px solid rgba(37,245,255,.22);object-fit:contain;background:rgba(0,0,0,.24)}.alert-warning{border-color:rgba(255,209,102,.45);background:rgba(255,209,102,.12);color:#fff2bf}
@media (min-width:760px){.fixed-set-row{grid-template-columns:64px 1fr 1fr 1.2fr}.current-exercise-layout{grid-template-columns:minmax(0,1fr) 360px}.calendar-grid{grid-template-columns:repeat(2,1fr)}.smart-grid{grid-template-columns:repeat(2,1fr)}.trend-grid{grid-template-columns:repeat(2,1fr)}}
@media (min-width:1080px){.calendar-grid{grid-template-columns:repeat(3,1fr)}.smart-grid{grid-template-columns:repeat(4,1fr)}.trend-grid{grid-template-columns:repeat(3,1fr)}}
@media (max-width:520px){.mark-grid{grid-template-columns:1fr}.fixed-set-row label{grid-column:1/-1}}

/* Vista de inicio simple y previews estáticas */
.simple-hero {
    grid-template-columns: minmax(0, 820px);
    justify-content: center;
    text-align: center;
    min-height: auto;
    padding: clamp(52px, 12vh, 110px) 0 38px;
}
.simple-hero .hero-text { margin-left: auto; margin-right: auto; }
.simple-hero .hero-actions { justify-content: center; }
.preview-topnav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.preview-topnav a {
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 9px 11px;
    color: var(--muted);
    font-weight: 800;
    font-size: .86rem;
}
.preview-topnav a:hover,
.preview-topnav a.is-active {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(34, 240, 255, .08);
}
.preview-note {
    margin-bottom: 16px;
}
.preview-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width:980px) {
    .preview-menu-grid { grid-template-columns: 1fr; }
    .topbar.preview-bar {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .topbar.preview-bar .preview-topnav {
        display: flex;
        width: 100%;
        padding-top: 8px;
    }
}
@media (max-width:700px) {
    .preview-topnav a {
        padding: 8px 9px;
        font-size: .78rem;
    }
}

/* Tema Giren: negro, morado y rojo */
body {
    background:
        radial-gradient(circle at 22% 12%, rgba(122, 29, 255, .30), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(255, 45, 88, .22), transparent 32%),
        linear-gradient(145deg, #050006, #120514 48%, #030003);
}
.character-bg {
    opacity: .2;
    filter: saturate(.85) contrast(1.12) brightness(.7);
}
.site-overlay {
    background:
        linear-gradient(90deg, rgba(3, 0, 6, .98), rgba(12, 3, 17, .76), rgba(3, 0, 6, .96)),
        radial-gradient(circle at center, rgba(255, 45, 88, .12), transparent 56%);
}
.topbar {
    background: rgba(6, 0, 9, .86);
    border-bottom-color: rgba(255, 45, 88, .24);
}
.glass-card,
.routine-card,
.stat-card,
.quick-card,
.history-card,
.exercise-card,
.chart-card,
.social-card,
.compare-card,
.auth-card,
.profile-summary,
.profile-form,
.preview-settings {
    background: linear-gradient(180deg, rgba(31, 10, 38, .92), rgba(7, 0, 11, .82));
    border-color: rgba(190, 87, 255, .2);
}
.btn-primary {
    background: linear-gradient(135deg, #ff2d58, #7a1dff);
    border-color: rgba(255, 88, 124, .82);
    color: #fff;
    box-shadow: 0 0 34px rgba(255, 45, 88, .24);
}
.btn-ghost {
    background: rgba(255, 255, 255, .045);
    border-color: rgba(190, 87, 255, .26);
}
.routine-number,
.workout-button {
    background: linear-gradient(135deg, rgba(255, 45, 88, .22), rgba(122, 29, 255, .18));
}
.routine-number {
    color: #fff;
}
.previous-set-hint {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    width: min(100%, 520px);
    border: 1px solid rgba(255, 45, 88, .28);
    border-radius: 12px;
    padding: 10px 12px;
    color: #f4d7e5;
    background: rgba(255, 45, 88, .09);
    font-weight: 800;
}
.previous-set-title {
    color: var(--cyan);
    font-size: .78rem;
    font-weight: 950;
    text-transform: uppercase;
}
.previous-set-list {
    display: grid;
    gap: 8px;
}
.previous-set-mark {
    display: grid;
    gap: 2px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .88rem;
}
.previous-set-mark:first-child {
    padding-top: 0;
    border-top: 0;
}
.previous-set-mark > span:first-child {
    color: #d6afc6;
    font-size: .76rem;
}
.previous-set-hint strong {
    color: #fff;
}
.previous-set-note {
    color: #f4d7e5;
    font-size: .82rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.previous-set-empty {
    color: #d6afc6;
    font-size: .88rem;
}
.current-exercise-layout.no-side-panel {
    grid-template-columns: minmax(0, 1fr);
}
.exercise-focus-note {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 45, 88, .26);
    border-radius: 18px;
    background: rgba(255, 45, 88, .08);
}
.exercise-focus-note strong {
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: .78rem;
    font-weight: 950;
}
.exercise-focus-note p {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.05rem, 3vw, 1.45rem);
    font-weight: 900;
    line-height: 1.25;
}
.start-workout-card {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(22px, 5vw, 34px);
}
.start-workout-card h2 {
    margin-bottom: 10px;
}
.start-workout-card .form-card {
    margin-top: 18px;
}
.start-before-sets {
    margin-top: 14px;
}
.start-set-panel {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(56, 232, 135, .32);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56, 232, 135, .12), rgba(190, 87, 255, .08));
}
.start-set-panel h3,
.start-set-panel p {
    margin: 0;
}
.start-set-panel .eyebrow {
    margin-bottom: 4px;
}
.training-timer-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(56, 232, 135, .24);
    border-radius: 14px;
    background: rgba(56, 232, 135, .08);
    color: #d9ffe9;
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.35;
}
@media (max-width:620px) {
    .start-set-panel {
        grid-template-columns: 64px minmax(0, 1fr);
    }
    .start-set-panel .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}
.dashboard-social-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.dashboard-social-actions .btn {
    min-width: min(220px, 100%);
}
.calendar-page .section-head.with-actions {
    margin-bottom: 18px;
}
.history-month-shell {
    padding: clamp(16px, 3vw, 24px);
}
.calendar-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}
.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(6px, 1.4vw, 12px);
}
.calendar-weekday {
    color: var(--muted);
    text-align: center;
    font-size: .76rem;
    font-weight: 950;
    text-transform: uppercase;
}
.calendar-day {
    position: relative;
    display: grid;
    align-content: space-between;
    overflow: hidden;
    min-height: clamp(62px, 11vw, 112px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    padding: clamp(8px, 1.5vw, 12px);
    color: var(--text);
    background: rgba(255,255,255,.05);
    cursor: pointer;
    text-align: left;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.calendar-day:hover {
    transform: translateY(-1px);
    box-shadow: var(--glow);
}
.calendar-day.is-spacer {
    visibility: hidden;
    pointer-events: none;
}
.calendar-day.is-completed {
    border-color: rgba(56, 232, 135, .58);
    background: linear-gradient(145deg, rgba(56, 232, 135, .24), rgba(255,255,255,.045));
}
.calendar-day.is-missed {
    border-color: rgba(255, 45, 88, .54);
    background: linear-gradient(145deg, rgba(255, 45, 88, .24), rgba(255,255,255,.035));
}
.calendar-day.is-rest {
    border-color: rgba(255, 209, 102, .56);
    background: linear-gradient(145deg, rgba(255, 209, 102, .24), rgba(255,255,255,.04));
}
.calendar-day.is-blank {
    border-color: rgba(255,255,255,.14);
    background: rgba(255,255,255,.025);
    color: rgba(255,255,255,.52);
}
.calendar-day.is-today::after {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255,255,255,.54);
    border-radius: 12px;
    pointer-events: none;
}
.day-number {
    position: relative;
    z-index: 1;
    font-size: clamp(1.05rem, 2.4vw, 1.65rem);
    font-weight: 950;
    line-height: 1;
}
.day-label {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 100%;
    color: currentColor;
    font-size: clamp(.66rem, 1.4vw, .82rem);
    font-weight: 900;
    line-height: 1.08;
    opacity: .88;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.status-dot.completed { color: var(--success); }
.status-dot.missed { color: var(--danger); }
.status-dot.rest { color: var(--warning); }
.status-dot.blank { color: rgba(255,255,255,.62); }
.day-modal[hidden] {
    display: none;
}
.day-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(10px);
}
.day-modal-card {
    position: relative;
    width: min(720px, 100%);
    max-height: min(760px, 88vh);
    overflow: auto;
    padding: clamp(20px, 4vw, 30px);
}
.day-modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
}
.modal-session {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.12);
}
.modal-marks {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}
.modal-mark-row {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(190, 87, 255, .18);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
}
.modal-mark-row span {
    color: var(--muted);
}
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.auto-duration-note {
    display: grid;
    gap: 4px;
    margin: 16px 0 18px;
    padding: 14px 16px;
    border: 1px solid rgba(56,232,135,.28);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56,232,135,.13), rgba(190,87,255,.08));
}
.auto-duration-note span {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 950;
    text-transform: uppercase;
}
.auto-duration-note strong {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1;
}
.rest-timer-modal[hidden] {
    display: none;
}
.rest-timer-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(12px);
}
.rest-timer-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
}
.rest-timer-modal.is-finished {
    animation: rest-alert-backdrop 1.8s steps(1, end) both;
}
.rest-timer-modal.is-finished::before {
    animation: rest-alert-flash 1.8s steps(1, end) both;
}
.rest-timer-card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    padding: clamp(22px, 5vw, 34px);
    text-align: center;
}
.rest-timer-modal.is-finished .rest-timer-card {
    border-color: rgba(255, 45, 88, .95);
    box-shadow: 0 0 0 2px rgba(255,255,255,.72), 0 0 44px rgba(255,45,88,.9), 0 0 84px rgba(190,87,255,.68);
}
.rest-timer-card h3 {
    margin: 6px 0 12px;
    color: #fff;
    font-size: clamp(4rem, 20vw, 6.4rem);
    line-height: .95;
}
.rest-timer-card p:not(.eyebrow) {
    color: var(--muted);
}
.rest-timer-bar {
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}
.rest-timer-bar span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan-2), var(--cyan));
    box-shadow: var(--glow);
    transition: width .25s linear;
}
@keyframes rest-alert-backdrop {
    0%, 18%, 42%, 66%, 90%, 100% { background: rgba(0,0,0,.72); }
    9%, 30%, 54%, 78% { background: rgba(255,45,88,.86); }
}
@keyframes rest-alert-flash {
    0%, 18%, 42%, 66%, 90%, 100% { opacity: 0; }
    9%, 30%, 54%, 78% { opacity: .72; background: #fff; }
}
.audio-setting-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(190, 87, 255, .32);
    border-radius: 16px;
    background: rgba(255,255,255,.035);
}
.audio-setting-panel h2,
.audio-setting-panel p { margin: 0; }
.audio-setting-panel > p:not(.eyebrow) { color: var(--muted); }
.audio-current {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(56,232,135,.25);
    border-radius: 12px;
    background: rgba(56,232,135,.06);
}
.audio-current audio { width: 100%; }
@media (prefers-reduced-motion: reduce) {
    .rest-timer-modal.is-finished,
    .rest-timer-modal.is-finished::before { animation: none; }
    .rest-timer-modal.is-finished { background: rgba(255,45,88,.72); }
    .rest-timer-modal.is-finished::before { opacity: .22; background: #fff; }
}
.modal-steps {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.12);
}
.steps-summary-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(56,232,135,.24);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(56,232,135,.11), rgba(190,87,255,.06));
}
.steps-detail-grid,
.steps-metrics-grid {
    display: grid;
    gap: 10px;
}
.steps-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.steps-detail-grid span {
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--text);
    font-weight: 850;
    background: rgba(255,255,255,.06);
}
.steps-entry-page .steps-form {
    display: grid;
    gap: 16px;
    max-width: 860px;
    margin: 0 auto;
}
.steps-form-head {
    display: grid;
    gap: 12px;
}
.steps-note {
    margin: 0;
}
.steps-note strong {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
}
.steps-metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.steps-metrics-grid .full-row {
    grid-column: 1 / -1;
}
.month-ring-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}
.month-ring-card {
    padding: 14px;
    border: 1px solid rgba(190, 87, 255, .18);
    border-radius: 18px;
    background: rgba(255,255,255,.045);
    text-align: center;
}
.month-ring-card.is-best {
    border-color: rgba(56, 232, 135, .5);
    box-shadow: 0 0 22px rgba(56, 232, 135, .12);
}
.month-ring {
    --percent: 0;
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, #120514 0 52%, transparent 53%),
        conic-gradient(var(--success) calc(var(--percent) * 1%), rgba(255,255,255,.12) 0);
}
.month-ring span {
    color: var(--text);
    font-weight: 950;
}
.month-ring-card p {
    margin: 4px 0 0;
    font-size: .82rem;
}
@media (max-width:980px) {
    .calendar-title {
        align-items: flex-start;
        flex-direction: column;
    }
    .month-ring-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width:620px) {
    .month-calendar {
        gap: 5px;
    }
    .calendar-day {
        min-height: 54px;
        border-radius: 11px;
        padding: 7px 5px;
    }
    .calendar-weekday {
        font-size: .62rem;
    }
    .day-label {
        font-size: .48rem;
        line-height: 1.02;
        max-height: 2.12em;
    }
    .month-ring-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Términos, privacidad y optimización móvil */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}
body {
    -webkit-text-size-adjust: 100%;
}
.page-shell,
.footer,
.topbar,
.glass-card,
.stat-card,
.quick-card,
.exercise-card,
.history-card,
.profile-form,
.profile-summary,
.admin-layout,
.profile-layout,
.message-list,
.user-message-card,
.terms-section {
    min-width: 0;
}
h1,
h2,
h3,
p,
a,
button,
label,
input,
select,
textarea,
td,
th {
    overflow-wrap: break-word;
}
.footer {
    display: grid;
    gap: 18px;
}
.terms-section {
    display: grid;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid rgba(190, 87, 255, .16);
    max-width: 920px;
}
.terms-section h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}
.terms-section p {
    margin: 0;
    font-size: .86rem;
    line-height: 1.55;
}
.manual-entry-filter {
    margin-bottom: 18px;
}
.manual-entry-summary {
    display: grid;
    gap: 18px;
    padding: clamp(18px, 3vw, 24px);
    margin-bottom: 18px;
}
.compact-meta {
    padding: 0;
}
.manual-session-form,
.manual-exercise-list {
    display: grid;
    gap: 16px;
}
.manual-exercise-card {
    overflow: hidden;
}
.manual-set-row {
    grid-template-columns: 64px 1fr 1fr 1.2fr;
}
.manual-entry-actions {
    margin-top: 4px;
}
.delete-session-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}
.topbar,
.admin-tabs,
.preview-topnav,
.exercise-step-list,
.history-legend {
    scrollbar-width: thin;
}
@media (max-width: 980px) {
    .topbar {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .admin-tabs,
    .preview-topnav {
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .table-wrap {
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .footer {
        width: min(100% - 24px, var(--max));
        padding-bottom: calc(126px + env(safe-area-inset-bottom));
    }
}
@media (max-width: 700px) {
    .page-shell {
        width: min(100% - 20px, var(--max));
        padding-top: 18px;
    }
    .brand {
        max-width: 100%;
    }
    .brand span {
        min-width: 0;
    }
    .brand strong,
    .brand small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar {
        gap: 10px;
    }
    .mobile-admin-link {
        min-height: 40px;
        padding: 8px 10px;
        font-size: .78rem;
    }
    .dashboard-social-actions,
    .form-actions,
    .hero-actions,
    .card-actions,
    .detail-actions,
    .history-actions {
        align-items: stretch;
    }
    .dashboard-social-actions .btn,
    .form-actions .btn,
    .form-actions form,
    .modal-actions .btn,
    .filters .btn,
    .filters a,
    .hero-actions .btn,
    .card-actions .btn,
    .detail-actions .btn,
    .history-actions .btn {
        width: 100%;
    }
    .message-card-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .user-message-card,
    .profile-summary,
    .profile-form,
    .preview-settings {
        padding: 18px;
    }
    .bottom-nav {
        left: max(8px, env(safe-area-inset-left));
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        border-radius: 20px;
    }
    .bottom-nav a {
        min-width: 0;
        overflow: hidden;
        font-size: .64rem;
    }
    .terms-section p {
        font-size: .82rem;
    }
    .delete-session-form {
        justify-content: stretch;
    }
    .delete-session-form .btn {
        width: 100%;
    }
}
@media (max-width: 520px) {
    h1 {
        font-size: clamp(2rem, 12vw, 3rem);
        line-height: 1;
    }
    h2 {
        font-size: clamp(1.35rem, 8vw, 2rem);
    }
    .fixed-set-row,
    .set-row {
        grid-template-columns: 1fr !important;
    }
    .fixed-set-row label,
    .fixed-set-row .previous-set-hint,
    .set-row label,
    .set-row small,
    .autosave-status {
        grid-column: 1 / -1 !important;
    }
    .set-number {
        width: 64px;
        justify-self: start;
    }
    input,
    select,
    textarea {
        min-height: 46px;
    }
    .calendar-day {
        min-width: 0;
    }
    .month-ring {
        width: 64px;
        height: 64px;
    }
}

/* Evolución corporal */
.body-evolution-page-shell {
    padding-bottom: 56px;
}
.body-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    max-width: none;
}
.body-page-heading > div { min-width: 0; }
.body-page-heading h1 { margin-bottom: 10px; }
.body-page-heading p:last-child { margin-bottom: 0; }
.body-viewing-date,
.body-history-lock {
    flex: 0 0 auto;
    padding: 8px 10px;
    border: 1px solid rgba(196, 119, 255, .38);
    border-radius: 999px;
    color: #e5c8fa;
    background: rgba(196, 119, 255, .1);
    font-size: .78rem;
    font-weight: 900;
}
.body-schema-alert { margin-bottom: 18px; }
.body-evolution-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(390px, .96fr);
    align-items: start;
    gap: 18px;
}
.body-figure-card,
.body-status-card,
.body-summary-card,
.body-form-card {
    min-width: 0;
    padding: 22px;
}
.body-figure-card {
    --body-avatar-stroke: rgba(255, 235, 253, .18);
    --body-avatar-glow: transparent;
    position: sticky;
    top: 92px;
    overflow: hidden;
}
.body-figure-card[data-body-change-trend="increase"] {
    --body-avatar-stroke: #39ffb6;
    --body-avatar-glow: rgba(57, 255, 182, .72);
}
.body-figure-card[data-body-change-trend="decrease"] {
    --body-avatar-stroke: #ff476c;
    --body-avatar-glow: rgba(255, 71, 108, .72);
}
.body-figure-card[data-body-change-trend="mixed"] {
    --body-avatar-stroke: #ffd166;
    --body-avatar-glow: rgba(255, 209, 102, .68);
}
.body-figure-card[data-body-change-trend="stable"] {
    --body-avatar-stroke: #c477ff;
    --body-avatar-glow: rgba(196, 119, 255, .58);
}
.body-figure-head,
.body-status-heading,
.body-summary-heading,
.body-form-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.body-figure-head h2,
.body-status-heading h2,
.body-summary-heading h2,
.body-form-heading h2 { margin: 0; }
.body-figure-head .eyebrow,
.body-status-heading .eyebrow,
.body-summary-heading .eyebrow,
.body-form-heading .eyebrow { margin-bottom: 5px; }
.body-figure-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.body-avatar-trend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 31px;
    padding: 6px 9px;
    border: 1px solid rgba(196, 119, 255, .36);
    border-radius: 8px;
    color: #e7d5ed;
    background: rgba(255, 255, 255, .035);
    font-size: .69rem;
    font-weight: 900;
    line-height: 1.15;
    text-align: right;
}
.body-avatar-trend::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
    content: '';
}
.body-avatar-trend--increase { border-color: rgba(57, 255, 182, .56); color: #54ffbf; }
.body-avatar-trend--decrease { border-color: rgba(255, 71, 108, .58); color: #ff8099; }
.body-avatar-trend--mixed { border-color: rgba(255, 209, 102, .54); color: #ffe093; }
.body-avatar-trend--stable { border-color: rgba(196, 119, 255, .55); color: #d7a4ff; }
.body-avatar-base-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(214, 177, 238, .28);
    border-radius: 999px;
    color: #dbc7e6;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}
.body-view-toggle {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid rgba(196, 119, 255, .34);
    border-radius: 8px;
    background: rgba(0, 0, 0, .2);
}
.body-view-toggle button {
    min-height: 38px;
    padding: 7px 10px;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: .8rem;
    font-weight: 900;
}
.body-view-toggle button.is-active {
    color: #fff;
    background: rgba(255, 45, 88, .23);
    box-shadow: inset 0 0 0 1px rgba(255, 45, 88, .32);
}
.body-figure-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 630px;
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid rgba(196, 119, 255, .22);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0)),
        rgba(5, 0, 9, .3);
}
.body-figure-stage::before,
.body-figure-stage::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 50%;
    width: 1px;
    background: rgba(196, 119, 255, .22);
    pointer-events: none;
}
.body-figure-stage::before { top: 22px; bottom: 22px; }
.body-figure-stage::after {
    top: 50%;
    width: min(74%, 360px);
    height: 1px;
    transform: translateX(-50%);
}
.body-figure-svg {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.body-avatar-photo-shell {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: center;
    justify-items: center;
    width: min(100%, 320px);
    height: 590px;
    pointer-events: none;
}
.body-avatar-photo {
    --body-avatar-source: none;
    --body-avatar-position: 33.333% center;
    --body-avatar-width: 1;
    --body-avatar-height: 1;
    --body-avatar-saturation: 1.05;
    --body-avatar-contrast: 1.05;
    --body-avatar-brightness: 1;
    width: 278px;
    max-width: 100%;
    height: 554px;
    background-color: transparent;
    background-image: var(--body-avatar-source);
    background-repeat: no-repeat;
    background-size: 400% auto;
    background-position: var(--body-avatar-position);
    filter: saturate(var(--body-avatar-saturation)) contrast(var(--body-avatar-contrast)) brightness(var(--body-avatar-brightness));
    mix-blend-mode: lighten;
    -webkit-mask-image: radial-gradient(ellipse 48% 62% at 50% 48%, #000 57%, rgba(0, 0, 0, .78) 76%, transparent 100%);
    mask-image: radial-gradient(ellipse 48% 62% at 50% 48%, #000 57%, rgba(0, 0, 0, .78) 76%, transparent 100%);
    transform: scaleX(var(--body-avatar-width)) scaleY(var(--body-avatar-height));
    transform-origin: center bottom;
    transition: background-position .25s ease, transform .28s ease, filter .25s ease;
}
.body-avatar-photo-caption {
    display: grid;
    gap: 2px;
    width: min(100%, 230px);
    margin: -8px 0 0;
    padding: 7px 10px;
    border: 1px solid rgba(213, 176, 237, .26);
    border-radius: 8px;
    background: rgba(13, 4, 20, .72);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
    text-align: center;
}
.body-avatar-photo-caption span {
    color: #c678ff;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.body-avatar-photo-caption strong { color: #fff; font-size: .85rem; }
.body-avatar-photo-caption small { color: #d9bed7; font-size: .72rem; font-weight: 800; }
.body-figure-card[data-body-change-trend="increase"] .body-avatar-photo { filter: saturate(var(--body-avatar-saturation)) contrast(var(--body-avatar-contrast)) brightness(var(--body-avatar-brightness)) drop-shadow(0 0 10px rgba(57, 255, 182, .4)); }
.body-figure-card[data-body-change-trend="decrease"] .body-avatar-photo { filter: saturate(var(--body-avatar-saturation)) contrast(var(--body-avatar-contrast)) brightness(var(--body-avatar-brightness)) drop-shadow(0 0 10px rgba(255, 71, 108, .38)); }
.body-figure-card[data-body-change-trend="mixed"] .body-avatar-photo { filter: saturate(var(--body-avatar-saturation)) contrast(var(--body-avatar-contrast)) brightness(var(--body-avatar-brightness)) drop-shadow(0 0 10px rgba(255, 209, 102, .34)); }
.body-figure-svg [data-body-figure-view][hidden] { display: none; }
.body-figure-svg [data-body-scale-root] { display: none; }
.body-sculpt { transform-box: fill-box; transform-origin: center bottom; }
.body-sculpt-silhouette,
.body-sculpt-neck,
.body-sculpt-arm,
.body-sculpt-head {
    fill: url(#body-sculpt-front);
    stroke: var(--body-avatar-stroke);
    stroke-width: 1.1;
    stroke-linejoin: round;
    transition: filter .2s ease, stroke .2s ease, stroke-width .2s ease;
}
.body-figure-card[data-body-change-trend="increase"] .body-sculpt-silhouette,
.body-figure-card[data-body-change-trend="increase"] .body-sculpt-neck,
.body-figure-card[data-body-change-trend="increase"] .body-sculpt-arm,
.body-figure-card[data-body-change-trend="increase"] .body-sculpt-head,
.body-figure-card[data-body-change-trend="decrease"] .body-sculpt-silhouette,
.body-figure-card[data-body-change-trend="decrease"] .body-sculpt-neck,
.body-figure-card[data-body-change-trend="decrease"] .body-sculpt-arm,
.body-figure-card[data-body-change-trend="decrease"] .body-sculpt-head {
    stroke-width: 2.15;
    filter: drop-shadow(0 0 6px var(--body-avatar-glow));
}
.body-figure-view--profile .body-sculpt-silhouette,
.body-figure-view--profile .body-sculpt-neck,
.body-figure-view--profile .body-sculpt-arm,
.body-figure-view--profile .body-sculpt-head {
    fill: url(#body-sculpt-profile);
}
.body-sculpt-arm { opacity: .96; }
.body-sculpt-arm--profile { opacity: .9; }
.body-sculpt-highlight {
    fill: url(#body-sculpt-highlight);
    opacity: var(--body-highlight-opacity, .72);
    pointer-events: none;
}
.body-sculpt-contour {
    fill: none;
    stroke: rgba(78, 29, 92, .52);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
    opacity: var(--body-contour-tone, .82);
    pointer-events: none;
}
.body-sculpt-contour--subtle { opacity: var(--body-subtle-contour-tone, .62); stroke-width: 1.35; }
.body-figure-label {
    position: absolute;
    z-index: 3;
    display: grid;
    gap: 2px;
    min-width: 95px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 45, 88, .4);
    border-radius: 8px;
    color: #e4c8d8;
    background: rgba(15, 2, 22, .88);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    font-size: .67rem;
    font-weight: 800;
    line-height: 1.15;
}
.body-figure-label strong { color: #fff; font-size: .76rem; }
.body-figure-label::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 28px;
    height: 1px;
    background: rgba(255, 72, 122, .72);
}
.body-figure-label::after {
    content: "";
    position: absolute;
    top: calc(50% - 3px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4d77;
    box-shadow: 0 0 10px rgba(255, 45, 88, .9);
}
.body-figure-label--neck { top: 15%; right: 4%; }
.body-figure-label--neck::before { right: 100%; }
.body-figure-label--neck::after { right: calc(100% + 24px); }
.body-figure-label--chest { top: 28%; right: 2%; }
.body-figure-label--chest::before,
.body-figure-label--waist::before,
.body-figure-label--abdomen::before,
.body-figure-label--hips::before,
.body-figure-label--right-arm::before,
.body-figure-label--right-thigh::before,
.body-figure-label--right-calf::before { right: 100%; }
.body-figure-label--chest::after,
.body-figure-label--waist::after,
.body-figure-label--abdomen::after,
.body-figure-label--hips::after,
.body-figure-label--right-arm::after,
.body-figure-label--right-thigh::after,
.body-figure-label--right-calf::after { right: calc(100% + 24px); }
.body-figure-label--waist { top: 43%; right: 1%; }
.body-figure-label--abdomen { top: 53%; right: 2%; }
.body-figure-label--hips { top: 63%; right: 4%; }
.body-figure-label--left-arm { top: 35%; left: 1%; }
.body-figure-label--left-thigh { top: 71%; left: 2%; }
.body-figure-label--left-calf { top: 84%; left: 5%; }
.body-figure-label--right-arm { top: 37%; right: 2%; }
.body-figure-label--right-thigh { top: 72%; right: 1%; }
.body-figure-label--right-calf { top: 84%; right: 5%; }
.body-figure-label--left-arm::before,
.body-figure-label--left-thigh::before,
.body-figure-label--left-calf::before { left: 100%; }
.body-figure-label--left-arm::after,
.body-figure-label--left-thigh::after,
.body-figure-label--left-calf::after { left: calc(100% + 24px); }
.body-mobile-labels {
    display: none;
    gap: 7px;
    margin-top: 12px;
}
.body-mobile-labels span {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid rgba(255, 45, 88, .28);
    border-radius: 8px;
    color: #e8d0dd;
    background: rgba(255, 45, 88, .08);
    font-size: .72rem;
    font-weight: 800;
}
.body-mobile-labels strong { color: #fff; }
.body-figure-disclaimer {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
}
.body-evolution-details {
    display: grid;
    gap: 18px;
}
.body-visual-profile-card,
.body-status-card,
.body-summary-card,
.body-form-card { display: grid; gap: 16px; }
.body-visual-profile-card--locked { align-content: start; }
.body-visual-profile-heading h2 { margin: 0; }
.body-visual-profile-intro,
.body-visual-profile-note {
    margin: 0;
    color: #e6d2e1;
    font-size: .86rem;
    line-height: 1.5;
}
.body-visual-profile-note {
    padding: 10px 12px;
    border-left: 3px solid rgba(34, 240, 255, .72);
    color: var(--muted);
    background: rgba(34, 240, 255, .06);
}
.body-visual-profile-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}
.body-visual-profile-summary div {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}
.body-visual-profile-summary dt {
    color: var(--muted);
    font-size: .66rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}
.body-visual-profile-summary dd {
    margin: 5px 0 0;
    color: #fff;
    font-size: .8rem;
    font-weight: 900;
    line-height: 1.28;
}
.body-visual-profile-form { display: grid; gap: 15px; }
.body-visual-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.body-visual-fieldset legend {
    width: 100%;
    margin-bottom: 9px;
    color: #f1dbea;
    font-size: .86rem;
    font-weight: 950;
}
.body-visual-choice-grid {
    display: grid;
    gap: 8px;
}
.body-visual-choice-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.body-visual-choice-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.body-visual-choice-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.body-fitness-control {
    --fitness-progress: 40%;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(196, 119, 255, .3);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}
.body-fitness-control-head,
.body-fitness-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.body-fitness-control-head label {
    color: #f1dbea;
    font-size: .8rem;
    font-weight: 850;
}
.body-fitness-control output {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid rgba(45, 219, 204, .34);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(45, 219, 204, .08);
    font-size: .68rem;
    font-weight: 900;
}
.body-fitness-range {
    width: 100%;
    height: 9px;
    margin: 2px 0 0;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 999px;
    outline: 0;
    background:
        linear-gradient(90deg, #ff4f6d 0%, #b14cff 52%, #2df0cc 100%) 0 / var(--fitness-progress) 100% no-repeat,
        rgba(255, 255, 255, .1);
    cursor: pointer;
}
.body-fitness-range::-webkit-slider-thumb {
    width: 21px;
    height: 21px;
    appearance: none;
    -webkit-appearance: none;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #ff4f6d;
    box-shadow: 0 0 0 4px rgba(255, 79, 109, .16), 0 4px 10px rgba(0, 0, 0, .45);
}
.body-fitness-range::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #ff4f6d;
    box-shadow: 0 0 0 4px rgba(255, 79, 109, .16), 0 4px 10px rgba(0, 0, 0, .45);
}
.body-fitness-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(45, 219, 204, .36), 0 4px 10px rgba(0, 0, 0, .45); }
.body-fitness-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px rgba(45, 219, 204, .36), 0 4px 10px rgba(0, 0, 0, .45); }
.body-fitness-scale {
    color: var(--muted);
    font-size: .66rem;
    font-weight: 800;
}
.body-fitness-error { display: block; margin-top: 7px; color: #ff8097; font-size: .73rem; }
.body-visual-choice {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}
.body-visual-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.body-visual-choice > span {
    display: grid;
    min-height: 74px;
    align-content: center;
    gap: 4px;
    padding: 10px;
    border: 1px solid rgba(196, 119, 255, .28);
    border-radius: 8px;
    color: #e7d3e3;
    background: rgba(255, 255, 255, .025);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.body-visual-choice strong { color: #fff; font-size: .78rem; line-height: 1.2; }
.body-visual-choice small { color: #cbb9c7; font-size: .66rem; line-height: 1.32; }
.body-visual-choice:hover > span {
    border-color: rgba(255, 79, 109, .58);
    background: rgba(255, 45, 88, .09);
}
.body-visual-choice input:checked + span {
    border-color: rgba(34, 240, 255, .68);
    color: #fff;
    background: rgba(34, 240, 255, .1);
    box-shadow: inset 0 0 0 1px rgba(34, 240, 255, .17), 0 0 16px rgba(34, 240, 255, .08);
}
.body-visual-choice input:focus-visible + span {
    outline: 3px solid rgba(255, 79, 109, .3);
    outline-offset: 2px;
}
.body-base-reference {
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(196, 119, 255, .24);
    border-radius: 8px;
    background: #08040d;
}
.body-base-reference img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 8.25;
    object-fit: cover;
    object-position: center;
}
.body-base-reference figcaption {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 7px 9px 8px;
    color: #d9bed7;
    font-size: .68rem;
    font-weight: 900;
    text-align: center;
}
.body-status-dot {
    width: 12px;
    height: 12px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(57, 255, 182, .1), 0 0 18px rgba(57, 255, 182, .5);
}
.body-status-dot.is-due {
    background: #ffd166;
    box-shadow: 0 0 0 5px rgba(255, 209, 102, .1), 0 0 18px rgba(255, 209, 102, .4);
}
.body-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}
.body-status-grid div,
.body-summary-metrics > div {
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}
.body-status-grid dt,
.body-status-grid dd,
.body-summary-metrics span,
.body-summary-metrics strong,
.body-summary-metrics small { display: block; }
.body-status-grid dt,
.body-summary-metrics span {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}
.body-status-grid dd {
    margin: 5px 0 0;
    color: #fff;
    font-size: .86rem;
    font-weight: 900;
    line-height: 1.25;
}
.body-required-update {
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid rgba(255, 209, 102, .42);
    border-radius: 8px;
    color: #fff2c9;
    background: rgba(255, 209, 102, .1);
}
.body-required-update p { margin: 0; font-size: .86rem; }
.body-required-update div { display: flex; gap: 12px; flex-wrap: wrap; }
.body-required-update a { color: #fff; font-size: .8rem; font-weight: 900; text-decoration: underline; }
.body-summary-heading > span {
    color: #d9bced;
    font-size: .78rem;
    font-weight: 900;
}
.body-summary-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.body-summary-metrics strong { margin-top: 6px; color: #fff; font-size: 1.16rem; }
.body-summary-metrics small { margin-top: 4px; font-size: .73rem; font-weight: 900; line-height: 1.25; }
.body-summary-baseline { color: #e8d7ee; }
.body-summary-week { color: var(--muted); }
.body-summary-baseline.is-increase,
.body-summary-week.is-increase,
.body-field-change-chip.is-increase { color: #54ffbf; }
.body-summary-baseline.is-decrease,
.body-summary-week.is-decrease,
.body-field-change-chip.is-decrease { color: #ff8099; }
.body-summary-baseline.is-stable,
.body-summary-week.is-stable,
.body-field-change-chip.is-stable { color: #cbb8cf; }
.body-summary-copy,
.body-empty-copy { margin: 0; color: #f0dce9; line-height: 1.52; }
.body-field-change-list {
    display: grid;
    gap: 8px;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 8px;
    background: rgba(0, 0, 0, .12);
}
.body-field-change-list > p {
    margin: 0;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}
.body-field-change-list > div { display: flex; flex-wrap: wrap; gap: 7px; }
.body-field-change-chip {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
    padding: 6px 8px;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
    font-size: .72rem;
    font-weight: 900;
    line-height: 1.2;
}
.body-field-change-chip b { color: #f5eaf3; }
.body-zone-changes { display: grid; gap: 6px; }
.body-zone-changes p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.42;
}
.body-zone-changes strong { color: #fff; }
.body-form-heading { align-items: center; }
.body-form-locked {
    margin: 0;
    color: #ffe09a;
    font-size: .86rem;
    font-weight: 800;
}
.body-measurement-form { display: grid; gap: 15px; }
.body-form-section {
    min-width: 0;
    margin: 0;
    padding: 14px 0 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
.body-form-section:first-child { padding-top: 0; border-top: 0; }
.body-form-section legend {
    width: 100%;
    margin-bottom: 10px;
    color: #f1dbea;
    font-size: .92rem;
    font-weight: 950;
}
.body-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}
.body-input { display: grid; min-width: 0; }
.body-input > span:first-child {
    min-height: 32px;
    color: #ddc4d8;
    font-size: .8rem;
    line-height: 1.25;
}
.body-input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.body-input-label label { min-width: 0; }
.body-measurement-help {
    display: inline-grid;
    flex: 0 0 23px;
    width: 23px;
    height: 23px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(196, 119, 255, .52);
    border-radius: 50%;
    color: #f8eafa;
    background: rgba(196, 119, 255, .13);
    box-shadow: 0 0 0 0 rgba(196, 119, 255, 0);
    cursor: pointer;
    font: inherit;
    font-size: .78rem;
    font-weight: 950;
    line-height: 1;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.body-measurement-help:hover,
.body-measurement-help:focus-visible {
    border-color: rgba(255, 79, 109, .95);
    background: rgba(255, 45, 88, .22);
    box-shadow: 0 0 0 3px rgba(255, 45, 88, .13);
    outline: 0;
    transform: translateY(-1px);
}
.body-input-unit { position: relative; display: block; }
.body-input-unit input { padding-right: 42px; }
.body-input-unit b {
    position: absolute;
    top: 50%;
    right: 12px;
    color: var(--cyan);
    font-size: .78rem;
    pointer-events: none;
    transform: translateY(-50%);
}
.body-input.has-error input { border-color: rgba(255, 79, 109, .78); }
.body-input small { color: #ffb2c0; font-size: .72rem; line-height: 1.3; }
.body-input .body-input-delta {
    min-height: 17px;
    margin-top: 5px;
    font-weight: 900;
}
.body-input .body-input-delta.is-increase { color: #54ffbf; }
.body-input .body-input-delta.is-decrease { color: #ff8099; }
.body-input .body-input-delta.is-stable { color: #cbb8cf; }
.body-notes-input textarea { min-height: 104px; }
.body-measurement-form input:disabled,
.body-measurement-form textarea:disabled {
    color: #bcaabd;
    cursor: not-allowed;
    opacity: .72;
}
.body-measurement-guide-modal[hidden] { display: none; }
.body-measurement-guide-modal {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
}
.body-measurement-guide-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(2, 0, 6, .8);
    cursor: default;
}
.body-measurement-guide-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(250px, .82fr) minmax(260px, 1fr);
    width: min(100%, 790px);
    max-height: calc(100vh - 44px);
    overflow: auto;
    border: 1px solid rgba(196, 119, 255, .52);
    border-radius: 8px;
    color: var(--text);
    background: #12071c;
    box-shadow: 0 28px 72px rgba(0, 0, 0, .64);
}
.body-measurement-guide-media {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    padding: 12px;
    background: radial-gradient(circle at 50% 35%, rgba(196, 119, 255, .17), transparent 60%), #08040d;
}
.body-measurement-guide-visual {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 6px;
}
.body-measurement-guide-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: cover;
    object-position: center;
}
.body-measurement-guide-marker {
    position: absolute;
    top: var(--guide-y);
    left: var(--guide-x);
    z-index: 1;
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 50%;
    color: #fff;
    background: rgba(35, 5, 37, .86);
    box-shadow: 0 0 0 2px rgba(255, 45, 139, .34), 0 3px 8px rgba(0, 0, 0, .5);
    font-size: .63rem;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    transform: translate(-50%, -50%);
}
.body-measurement-guide-marker.is-active {
    border-color: #fff;
    color: #07121b;
    background: var(--cyan);
    box-shadow: 0 0 0 3px rgba(45, 219, 204, .32), 0 0 18px rgba(45, 219, 204, .88);
}
.body-measurement-guide-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.body-measurement-guide-legend li {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 4px 5px;
    border: 1px solid rgba(222, 203, 217, .16);
    border-radius: 5px;
    color: #d8c4d4;
    background: rgba(20, 6, 29, .72);
    font-size: .62rem;
    font-weight: 750;
    line-height: 1.15;
}
.body-measurement-guide-legend li b {
    display: grid;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    place-items: center;
    border-radius: 50%;
    color: #17091e;
    background: #ef6fb1;
    font-size: .57rem;
}
.body-measurement-guide-legend li span { min-width: 0; }
.body-measurement-guide-legend li.is-active {
    border-color: rgba(45, 219, 204, .86);
    color: #fff;
    background: rgba(45, 219, 204, .17);
    box-shadow: inset 0 0 0 1px rgba(45, 219, 204, .14);
}
.body-measurement-guide-legend li.is-active b { background: var(--cyan); }
.body-measurement-guide-copy {
    align-self: center;
    padding: 30px 32px;
}
.body-measurement-guide-copy h2 { margin: 0 0 12px; font-size: clamp(1.45rem, 3vw, 2rem); }
.body-measurement-guide-copy > p:not(.eyebrow) { margin: 0; color: #decbd9; line-height: 1.58; }
.body-measurement-guide-tip {
    margin-top: 16px !important;
    padding: 12px 13px;
    border-left: 3px solid var(--cyan);
    color: #f8eafa !important;
    background: rgba(45, 219, 204, .08);
    font-size: .88rem;
    font-weight: 750;
}
.body-measurement-guide-close {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 50%;
    color: #fff;
    background: rgba(9, 3, 15, .74);
    cursor: pointer;
    font: inherit;
    font-size: 1.4rem;
    line-height: 1;
}
.body-measurement-guide-close:hover,
.body-measurement-guide-close:focus-visible {
    border-color: rgba(255, 79, 109, .9);
    background: rgba(255, 45, 88, .26);
    outline: 0;
}
body.is-measurement-guide-open { overflow: hidden; }
.body-history-section { margin-top: 30px; }
.body-history-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    max-width: none;
}
.body-history-heading h2 { margin-bottom: 0; }
.body-history-switches { display: flex; flex-wrap: wrap; gap: 8px; }
.body-history-switches .btn { min-height: 42px; }
.body-history-list { display: grid; gap: 10px; }
.body-history-item {
    display: grid;
    grid-template-columns: minmax(96px, .62fr) minmax(105px, .72fr) minmax(160px, 1.1fr) minmax(175px, 1.15fr) minmax(86px, .48fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(196, 119, 255, .2);
    border-radius: 8px;
    color: var(--text);
    background: rgba(14, 3, 20, .6);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.body-history-item:hover,
.body-history-item.is-selected {
    border-color: rgba(34, 240, 255, .45);
    background: rgba(34, 240, 255, .08);
    transform: translateY(-1px);
}
.body-history-item > div { min-width: 0; }
.body-history-item span,
.body-history-item strong { display: block; }
.body-history-item span {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    line-height: 1.22;
}
.body-history-item strong {
    margin-top: 3px;
    color: #fff;
    font-size: .86rem;
    line-height: 1.3;
}
.body-history-empty { padding: 18px; color: var(--muted); }
@media (max-width: 1120px) {
    .body-evolution-layout { grid-template-columns: 1fr; }
    .body-figure-card { position: static; }
    .body-evolution-details { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .body-visual-profile-card { grid-column: 1 / -1; }
    .body-form-card { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .body-page-heading,
    .body-history-heading { align-items: flex-start; flex-direction: column; }
    .body-evolution-details { grid-template-columns: 1fr; }
    .body-form-card { grid-column: auto; }
    .body-status-grid { grid-template-columns: 1fr; }
    .body-figure-stage { min-height: 540px; }
    .body-figure-svg { width: min(100%, 390px); height: 500px; }
    .body-avatar-photo-shell { height: 500px; }
    .body-avatar-photo { width: 245px; height: 462px; }
    .body-figure-label { display: none !important; }
    .body-mobile-labels { display: flex; flex-wrap: wrap; }
    .body-history-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .body-measurement-guide-modal { padding: 14px; }
    .body-measurement-guide-panel { grid-template-columns: 1fr; max-width: 460px; }
    .body-measurement-guide-media { min-height: 0; padding: 9px; }
    .body-measurement-guide-visual { width: min(100%, 350px); margin: 0 auto; }
    .body-measurement-guide-media img { min-height: 0; height: 100%; max-height: none; object-fit: cover; }
    .body-measurement-guide-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .body-measurement-guide-copy { padding: 20px; }
}
@media (max-width: 520px) {
    .body-evolution-page-shell { padding-bottom: 36px; }
    .body-figure-card,
    .body-status-card,
    .body-summary-card,
    .body-form-card { padding: 16px; }
    .body-figure-head { align-items: flex-start; flex-direction: column; }
    .body-figure-actions { width: 100%; justify-content: space-between; }
    .body-figure-stage { min-height: 470px; margin-top: 14px; }
    .body-figure-svg { width: 100%; height: 430px; }
    .body-avatar-photo-shell { height: 430px; }
    .body-avatar-photo { width: 214px; height: 402px; }
    .body-avatar-photo-caption { margin-top: -5px; }
    .body-field-grid,
    .body-summary-metrics,
    .body-history-item { grid-template-columns: 1fr; }
    .body-visual-choice-grid--three { grid-template-columns: 1fr; }
    .body-visual-profile-summary { grid-template-columns: 1fr; }
    .body-visual-choice > span { min-height: 63px; }
    .body-base-reference img { aspect-ratio: 16 / 9; }
    .body-input > span:first-child { min-height: auto; }
    .body-history-switches { width: 100%; }
    .body-history-switches .btn { flex: 1 1 145px; }
    .bottom-nav a { font-size: .56rem; padding-left: 1px; padding-right: 1px; }
}

.diet-grid,
.diet-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.diet-card,
.diet-admin-editor {
    --diet-accent: var(--cyan);
    display: grid;
    gap: 18px;
    min-width: 0;
    padding: clamp(18px, 3vw, 26px);
    border-color: rgba(34,240,255,.28);
}
.diet-card--breakfast { --diet-accent: #ffd166; border-color: rgba(255,209,102,.34); }
.diet-card--lunch { --diet-accent: var(--cyan); border-color: rgba(34,240,255,.34); }
.diet-card--dinner { --diet-accent: #c477ff; border-color: rgba(196,119,255,.38); }
.diet-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.diet-card-head h2,
.diet-card-head p { margin: 0; }
.diet-card-head span {
    max-width: 130px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: right;
}
.diet-food-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.diet-food-list li {
    min-width: 0;
    padding: 11px 12px;
    border-left: 3px solid var(--diet-accent);
    border-radius: 8px;
    color: var(--text);
    font-weight: 800;
    overflow-wrap: anywhere;
    background: rgba(255,255,255,.055);
}
.diet-empty {
    margin: 0;
    color: var(--muted);
}
.diet-admin-form {
    display: grid;
    gap: 18px;
}
.diet-admin-editor textarea {
    min-height: 220px;
}
.diet-admin-actions {
    justify-content: flex-end;
    margin-top: 0;
}
@media (max-width: 980px) {
    .diet-grid,
    .diet-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .diet-card-head { flex-direction: column; }
    .diet-card-head span {
        max-width: none;
        text-align: left;
    }
}
