/* ============ TOKENS ============ */
:root {
    --bg:        #0F172A;
    --bg-card:   #1E293B;
    --bg-card2:  #273449;
    --bg-input:  #162032;
    --primary:   #F97316;
    --primary-d: #EA6708;
    --accent:    #22C55E;
    --accent-d:  #16A34A;
    --text:      #F1F5F9;
    --text-soft: #94A3B8;
    --text-muted:#64748B;
    --border:    #1E293B;
    --border2:   #334155;
    --danger:    #EF4444;
    --orange-dim:rgba(249,115,22,0.12);
    --green-dim: rgba(34,197,94,0.12);

    --display: 'Barlow Condensed', sans-serif;
    --body:    'Barlow', sans-serif;

    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;

    --shadow:      0 2px 12px rgba(0,0,0,0.35);
    --shadow-lift: 0 8px 32px rgba(0,0,0,0.5);

    --header-h: 56px;
    --nav-h:    64px;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-h);
    padding-bottom: var(--nav-h);
    min-height: 100dvh;
}

img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

/* ============ APP HEADER ============ */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(15,23,42,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border2);
    z-index: 200;
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 1080px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.08em;
}

.brand-home {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.15s;
}
.brand-home:hover { opacity: 0.8; }

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px; height: 40px;
    border: 1px solid var(--border2);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-soft);
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--orange-dim);
}

.avatar-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: #fff;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, transform 0.15s;
}
.avatar-btn:hover { background: var(--primary-d); transform: scale(1.06); }

.icon-btn-sm {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--text-soft);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.icon-btn-sm:hover { color: var(--text); background: var(--bg-card2); }

/* ============ HERO ============ */
.hero {
    background:
        radial-gradient(ellipse at 10% 0%, rgba(249,115,22,0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 100%, rgba(34,197,94,0.12) 0%, transparent 50%),
        var(--bg-card);
    padding: 40px 16px 36px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border2);
}

.hero-eyebrow {
    font-family: var(--display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 12px;
}

.hero-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.2rem, 8vw, 3.8rem);
    line-height: 1.0;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    color: var(--text);
}

.hero-sub {
    color: var(--text-soft);
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.82rem;
    color: var(--text-soft);
}
.hero-stat b { color: var(--text); font-weight: 600; }
.hero-stat svg { color: var(--primary); flex-shrink: 0; }

/* ============ AI GEN BANNER ============ */
.ai-gen-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card2) 100%);
    border-bottom: 1px solid var(--border2);
    padding: 12px 16px;
}

.ai-gen-text {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ai-gen-text svg {
    flex-shrink: 0;
    color: var(--primary);
}

.ai-gen-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.ai-gen-text span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-top: 1px;
}

.ai-gen-btn {
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    padding: 8px 16px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.03em;
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
}
.ai-gen-btn:hover { background: var(--primary-d); transform: translateY(-1px); }

/* ============ DAY NAV ============ */
.day-nav-wrap {
    position: sticky;
    top: var(--header-h);
    z-index: 100;
    background: rgba(15,23,42,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border2);
}

.day-nav {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    max-width: 1080px;
    margin: 0 auto;
}

/* When extra tabs exist (core/diet via JS injection), wrap them below */
.day-nav-extra {
    display: flex;
    gap: 6px;
    padding: 0 10px 8px;
    max-width: 1080px;
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
}
.day-nav-extra::-webkit-scrollbar { display: none; }
.day-nav-extra:empty { display: none; }

.day-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 4px 8px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: color 0.15s, border-color 0.15s;
    touch-action: manipulation;
    min-height: 52px;
    position: relative;
}

.day-tab .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.day-tab .tab-day-abbr {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.day-tab:hover {
    color: var(--text-soft);
}
.day-tab:hover .dot { background: var(--text-soft); }

.day-tab[aria-selected="true"] {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.day-tab[aria-selected="true"] .dot {
    background: var(--primary);
    transform: scale(1.3);
}

/* Today indicator */
.tab-today-label {
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    line-height: 1;
}
.day-tab[data-today="true"] .dot {
    background: var(--accent);
}
.day-tab[data-today="true"][aria-selected="true"] .dot {
    background: var(--primary);
}
.day-tab[data-today="true"][aria-selected="true"] .tab-today-label {
    color: var(--primary);
}

.day-tab[data-accent="sage"][aria-selected="true"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.day-tab[data-accent="sage"][aria-selected="true"] .dot { background: var(--accent); }

.day-tab[data-accent="ochre"][aria-selected="true"] {
    color: #F59E0B;
    border-bottom-color: #F59E0B;
}
.day-tab[data-accent="ochre"][aria-selected="true"] .dot { background: #F59E0B; }

/* Extra tabs (core safety, etc.) rendered below the grid */
.day-tab-extra {
    flex: 0 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: 999px;
    padding: 6px 14px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    touch-action: manipulation;
    white-space: nowrap;
}
.day-tab-extra:hover { background: var(--bg-card2); color: var(--text); }
.day-tab-extra[aria-selected="true"] {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============ MAIN CONTENT ============ */
.main-content {
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 12px 32px;
}

/* ============ DAY PANEL ============ */
.day-panel {
    display: none;
    animation: fadeSlide 0.22s ease both;
}
.day-panel.active { display: block; }

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

/* ============ DAY HEADER CARD ============ */
.day-head {
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.day-head::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--accent, var(--primary));
}

.day-head .eyebrow {
    font-family: var(--display);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 6px;
}

.day-head h2 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.5rem, 5vw, 2rem);
    line-height: 1.1;
    margin-bottom: 12px;
    color: var(--text);
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card2);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    padding: 6px 10px;
    font-size: 0.78rem;
    color: var(--text-soft);
}
.stat-chip b {
    color: var(--text);
    font-weight: 600;
}

/* ============ SECTION BLOCKS ============ */
.block {
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.block h3 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============ EXERCISE CARDS ============ */
.ex-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 540px) {
    .ex-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .ex-grid { grid-template-columns: repeat(3, 1fr); }
}

.ex-card {
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}
.ex-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Image area */
.ex-img-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-card2);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ex-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.ex-img-wrap:hover img { transform: scale(1.04); }

.ex-img-wrap.loading {
    animation: shimmer 1.6s ease-in-out infinite;
}

.ex-img-wrap.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}
.ex-img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}
.ex-img-placeholder svg { opacity: 0.4; }
.ex-img-placeholder span { font-size: 0.72rem; }

.ex-expand-hint {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.6);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.ex-img-wrap:hover .ex-expand-hint { opacity: 1; }

@keyframes shimmer {
    0%, 100% { background: var(--bg-card2); }
    50% { background: var(--bg-card); }
}

/* Card Body */
.ex-card-body {
    padding: 14px;
}

.ex-card-name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.2;
}

.ex-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ex-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg-card2);
    color: var(--text-soft);
    border: 1px solid var(--border2);
}
.ex-tag.primary {
    background: var(--orange-dim);
    color: var(--primary);
    border-color: rgba(249,115,22,0.3);
}
.ex-tag.accent {
    background: var(--green-dim);
    color: var(--accent);
    border-color: rgba(34,197,94,0.3);
}

/* Instructions accordion */
.ex-instructions {
    border-top: 1px solid var(--border2);
    padding-top: 10px;
    margin-bottom: 10px;
}
.ex-instructions summary {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    user-select: none;
}
.ex-instructions summary::-webkit-details-marker { display: none; }
.ex-instructions summary::after {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: auto;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.ex-instructions[open] summary::after { transform: rotate(-135deg); }
.ex-instructions[open] summary { color: var(--text); }

.ex-how-list {
    list-style: none;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ex-how-list li {
    font-size: 0.82rem;
    color: var(--text-soft);
    padding-left: 14px;
    position: relative;
    line-height: 1.5;
}
.ex-how-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 8px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

/* Log row */
.ex-log-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border2);
    padding-top: 10px;
    margin-top: 2px;
}

.log-field {
    flex: 1;
    min-width: 0;
    padding: 7px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    font-family: var(--body);
    font-size: 0.8rem;
    color: var(--text);
    text-align: center;
    transition: border-color 0.15s;
}
.log-field:focus {
    outline: none;
    border-color: var(--primary);
}
.log-field::placeholder { color: var(--text-muted); }

.log-checkbox {
    width: 20px; height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

/* ============ CHECKLIST (warmup / cooldown) ============ */
.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.check-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    font-size: 0.88rem;
    color: var(--text-soft);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.check-list li:last-child { border-bottom: none; }
.check-list li::before {
    content: '';
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ SIDE BLOCK (form tips, step tracker) ============ */
.side-block {
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    padding: 18px;
    margin-bottom: 14px;
}
.side-block h3 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 10px;
}
.side-block ul { list-style: none; }
.side-block li {
    padding: 6px 0;
    font-size: 0.84rem;
    color: var(--text-soft);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.side-block li:last-child { border-bottom: none; }
.side-block li::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 7px;
    flex-shrink: 0;
}
.side-block p {
    font-size: 0.84rem;
    color: var(--text-soft);
    margin-top: 4px;
}

.log-inputs-wrap {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

/* ============ PAGE TITLE (diet / core) ============ */
.page-title {
    margin-bottom: 20px;
}
.page-title .eyebrow {
    font-family: var(--display);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 6px;
    display: block;
}
.page-title h2 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    color: var(--text);
    margin-bottom: 6px;
}
.page-title p {
    color: var(--text-soft);
    font-size: 0.9rem;
}

/* ============ DIET MACROS ============ */
.macro-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 10px;
}
@media (min-width: 640px) {
    .macro-grid { grid-template-columns: repeat(4, 1fr); }
}

.macro-card {
    background: var(--bg-card2);
    border: 1px solid var(--border2);
    border-radius: var(--r-md);
    padding: 16px;
    text-align: center;
}
.macro-card .val {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}
.macro-card .lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============ CORE SAFETY GATE ============ */
.gate {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card2) 100%);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.gate::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,115,22,0.15), transparent 70%);
    pointer-events: none;
}
.gate .eyebrow {
    font-family: var(--display);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
}
.gate h2 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    margin-bottom: 10px;
    color: var(--text);
}
.gate p {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-bottom: 20px;
    max-width: 560px;
}
.gate-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.gate-btn {
    background: var(--bg-card2);
    border: 1px solid var(--border2);
    color: var(--text-soft);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.gate-btn:hover { background: var(--bg-card); color: var(--text); }
.gate-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.gate-question { margin-top: 16px; }
.gate-question p.q {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text);
}

/* ============ PROFILE SCREEN ============ */
.profile-screen {
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 12px 32px;
    animation: fadeSlide 0.22s ease both;
}

.profile-hero-card {
    background: linear-gradient(135deg,
        rgba(249,115,22,0.15) 0%,
        var(--bg-card) 50%,
        rgba(34,197,94,0.08) 100%);
    border: 1px solid var(--border2);
    border-radius: var(--r-xl);
    padding: 28px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.profile-avatar-lg {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--display);
    font-weight: 800;
    font-size: 2rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(249,115,22,0.25);
}

.profile-info { min-width: 0; }
.profile-email {
    font-size: 0.85rem;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--orange-dim);
    color: var(--primary);
    border: 1px solid rgba(249,115,22,0.3);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.profile-name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 4px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
@media (min-width: 480px) {
    .profile-stats-grid { grid-template-columns: repeat(6, 1fr); }
}

.profile-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-md);
    padding: 14px 8px;
    text-align: center;
}
.profile-stat-val {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}
.profile-stat-lbl {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-section-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 0 4px;
}

.profile-action-row {
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    width: 100%;
    text-align: left;
    color: var(--text);
}
.profile-action-row:hover {
    border-color: var(--primary);
    background: var(--orange-dim);
}
.profile-action-row.danger:hover {
    border-color: var(--danger);
    background: rgba(239,68,68,0.08);
    color: var(--danger);
}
.profile-action-icon {
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    background: var(--bg-card2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--text-soft);
}
.profile-action-row:hover .profile-action-icon {
    background: var(--orange-dim);
    color: var(--primary);
}
.profile-action-row.danger:hover .profile-action-icon {
    background: rgba(239,68,68,0.12);
    color: var(--danger);
}
.profile-action-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}
.profile-action-text span {
    font-size: 0.78rem;
    color: var(--text-soft);
}
.profile-action-row.danger:hover .profile-action-text span {
    color: rgba(239,68,68,0.7);
}
.profile-action-chevron {
    margin-left: auto;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============ BOTTOM NAV ============ */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(15,23,42,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
}

.bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 20px;
    border-radius: var(--r-md);
    transition: color 0.15s;
    min-width: 64px;
    touch-action: manipulation;
}
.bn-item:hover { color: var(--text-soft); }
.bn-item.active { color: var(--primary); }
.bn-item.active svg { stroke: var(--primary); }

/* Watch Demo button */
.ex-watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 30, 30, 0.1);
    color: #FF4545;
    border: 1px solid rgba(255, 30, 30, 0.25);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--body);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    margin-top: 8px;
    touch-action: manipulation;
    min-height: 32px;
    width: 100%;
    justify-content: center;
}
.ex-watch-btn:hover {
    background: rgba(255, 30, 30, 0.2);
    border-color: rgba(255, 30, 30, 0.45);
    color: #FF2222;
}
.ex-watch-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}
.ex-watch-btn svg { flex-shrink: 0; }

/* ============ LIGHTBOX ============ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox.show { display: flex; }

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    cursor: pointer;
}

.lightbox-close {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 10;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-content {
    position: relative;
    z-index: 5;
    max-width: min(90vw, 900px);
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lightbox-content img {
    max-width: 100%;
    max-height: calc(85dvh - 60px);
    object-fit: contain;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lift);
}

.lightbox-caption {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
}

.lightbox-video-wrap {
    width: min(90vw, 900px);
    aspect-ratio: 16/9;
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lift);
}
.lightbox-video-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ============ AUTH OVERLAY ============ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.auth-overlay.show { opacity: 1; pointer-events: auto; }

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 400px;
    padding: 28px 24px;
    box-shadow: var(--shadow-lift);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
}

.auth-card h2 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 4px;
}
.auth-card > p {
    font-size: 0.88rem;
    color: var(--text-soft);
    margin-bottom: 20px;
}

/* ============ FORMS ============ */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-family: var(--display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    font-family: var(--body);
    font-size: 0.9rem;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
    min-height: 44px;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input option { background: var(--bg-card2); }

.form-textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    font-family: var(--body);
    font-size: 0.9rem;
    color: var(--text);
    resize: vertical;
    min-height: 90px;
    transition: border-color 0.15s;
}
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.form-textarea::placeholder { color: var(--text-muted); }

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrap .form-input { padding-right: 44px; }
.pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    padding: 4px;
    transition: color 0.15s;
}
.pw-toggle:hover { color: var(--text-soft); }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-soft);
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

/* ============ BUTTONS ============ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    padding: 12px 20px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    transition: background 0.15s, transform 0.15s;
    cursor: pointer;
    min-height: 44px;
}
.btn-primary:hover { background: var(--primary-d); transform: translateY(-1px); }
.btn-primary.full-w { width: 100%; margin-top: 8px; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-soft);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    padding: 11px 18px;
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    min-height: 44px;
}
.btn-ghost:hover { background: var(--bg-card2); color: var(--text); }
.btn-ghost:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

/* ============ WIZARD ============ */
.wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.wizard-overlay.show { opacity: 1; pointer-events: auto; }

.wizard-card {
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: var(--shadow-lift);
    color: var(--text);
}

.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.wizard-progress { display: flex; align-items: center; gap: 8px; }
.progress-dots { display: flex; gap: 5px; }

.pd {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--border2);
    transition: background 0.2s, transform 0.2s;
}
.pd.active { background: var(--primary); transform: scale(1.25); }

.progress-label {
    font-family: var(--display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.wizard-card h3 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 6px;
}
.step-desc {
    font-size: 0.88rem;
    color: var(--text-soft);
    margin-bottom: 20px;
}

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.wizard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 400px) {
    .wizard-grid { grid-template-columns: 1fr; }
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border2);
}

/* ============ LOADING ============ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1600;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text);
}
.loading-overlay.show { display: flex; }

.spinner {
    width: 48px; height: 48px;
    border: 3px solid rgba(249,115,22,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay h3 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.2rem;
}
.loading-overlay p {
    font-size: 0.82rem;
    color: var(--text-soft);
}

/* ============ CHAT DRAWER ============ */
.chat-drawer {
    position: fixed;
    bottom: calc(var(--nav-h) + 8px);
    right: 12px;
    width: min(360px, calc(100vw - 24px));
    height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lift);
    z-index: 300;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(16px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.chat-drawer.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
@media (max-width: 480px) {
    .chat-drawer {
        right: 0; left: 0;
        bottom: var(--nav-h);
        width: 100%;
        height: 65dvh;
        border-radius: var(--r-lg) var(--r-lg) 0 0;
    }
}

.chat-header {
    background: var(--bg-card2);
    border-bottom: 1px solid var(--border2);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.chat-header h4 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}
.chat-status {
    font-size: 0.72rem;
    color: var(--accent);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg);
}

.msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: var(--r-md);
    font-size: 0.84rem;
    line-height: 1.45;
}
.msg.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.msg.coach {
    background: var(--bg-card2);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0;
    border-top: 1px solid var(--border2);
    background: var(--bg-card);
}
.chat-input-bar input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-family: var(--body);
    font-size: 0.85rem;
    background: transparent;
    color: var(--text);
    outline: none;
}
.chat-input-bar input::placeholder { color: var(--text-muted); }
.chat-input-bar button {
    background: transparent;
    border: none;
    padding: 0 16px;
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    height: 52px;
    transition: color 0.15s;
}
.chat-input-bar button:hover { color: var(--primary-d); }

/* ============ FOOTER ============ */
.app-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border2);
    padding: 24px 16px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.app-footer p { margin-bottom: 4px; }
.app-footer p:last-child { margin-bottom: 0; }
.app-footer a { color: var(--primary); text-decoration: none; }
.footer-disclaimer { font-size: 0.72rem; opacity: 0.7; max-width: 500px; margin: 0 auto; }

/* ============ DESKTOP ADJUSTMENTS ============ */
@media (min-width: 1024px) {
    .bottom-nav { display: none !important; }
    body { padding-bottom: 0; }

    .app-header-inner {
        padding: 0 24px;
    }

    .main-content,
    .profile-screen {
        padding: 28px 24px 48px;
    }

    .day-grid {
        display: grid;
        grid-template-columns: 1fr 280px;
        gap: 20px;
        align-items: start;
    }

    .hero { padding: 56px 24px 48px; }
}

/* Day grid wrapper for layout */
.day-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (min-width: 1024px) {
    .day-grid {
        display: grid;
        grid-template-columns: 1fr 280px;
        gap: 20px;
        align-items: start;
    }
}
