:root {
    --g: #00ff88;
    --g2: #00ccff;
    --g-dim: rgba(0,255,136,.12);
    --g2-dim: rgba(0,204,255,.08);
    --bg: #000;
    --card: rgba(10,10,10,.85);
    --card2: rgba(16,16,16,.9);
    --text: #fff;
    --sub: #666;
    --sub2: #444;
    --brd: rgba(255,255,255,.06);
    --brd2: rgba(0,255,136,.18);
    --r: 22px;
    --circ: 490.09px; /* 2π × 78 */
    --font-display: 'Orbitron', monospace;
    --font-body: 'Rajdhani', sans-serif;
}

/* ── RESET ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    padding-bottom: 88px;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
    min-height: 100vh;
}

/* ── FOND CANVAS ────────────────────────────────── */
#bg-canvas {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none;
    opacity: .35;
}

/* Scanlines CRT */
#scanlines {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent, transparent 2px,
        rgba(0,0,0,.18) 2px, rgba(0,0,0,.18) 4px
    );
}

/* Grille perspective */
#grid-overlay {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background-image:
        linear-gradient(rgba(0,255,136,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,136,.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ── HEADER ─────────────────────────────────────── */
#ai-status-bar {
    position: sticky; top: 0; z-index: 500;
    padding: 12px 18px;
    background: rgba(0,0,0,.92);
    border-bottom: 1px solid var(--brd);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex; align-items: center; gap: 12px;
    min-height: 56px;
}

.ai-indicator { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ai-rings {
    position: relative; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
}
.ring {
    position: absolute; border-radius: 50%;
    border: 1px solid var(--g);
    animation: ring-pulse 2.5s ease-in-out infinite;
}
.r1 { width: 22px; height: 22px; opacity: .3; }
.r2 { width: 14px; height: 14px; opacity: .5; animation-delay: .4s; }
.dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--g);
    box-shadow: 0 0 8px var(--g), 0 0 20px var(--g);
    animation: dot-breathe 2.5s ease-in-out infinite;
}
@keyframes ring-pulse {
    0%,100% { transform: scale(1); opacity: .3; }
    50% { transform: scale(1.15); opacity: .6; }
}
@keyframes dot-breathe {
    0%,100% { box-shadow: 0 0 8px var(--g); }
    50% { box-shadow: 0 0 16px var(--g), 0 0 32px var(--g); }
}

.ai-label {
    font-family: var(--font-display);
    font-size: .55rem; font-weight: 900;
    letter-spacing: .2em; color: var(--g); opacity: .8;
}

#ai-message {
    flex: 1;
    font-size: .8rem; font-weight: 400; color: var(--sub);
    font-style: italic;
    border-left: 1px solid var(--g);
    padding-left: 10px;
    line-height: 1.4;
    transition: opacity .3s;
}

#streak-badge {
    background: linear-gradient(135deg, #ff6b00, #ff9500);
    color: #000;
    font-family: var(--font-display);
    font-size: .55rem; font-weight: 900;
    padding: 4px 8px; border-radius: 50px;
    letter-spacing: .1em; white-space: nowrap;
    box-shadow: 0 0 12px rgba(255,107,0,.5);
}

/* ── CARDS ──────────────────────────────────────── */
.card {
    background: var(--card);
    border-radius: var(--r);
    border: 1px solid var(--brd);
    margin: 12px 14px; padding: 20px;
    position: relative; overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: card-in .35s cubic-bezier(.22,1,.36,1) both;
}
.card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--g-dim) 0%, transparent 60%);
    pointer-events: none; opacity: 0; transition: opacity .3s;
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1) { animation-delay: .00s; }
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .18s; }
.card:nth-child(5) { animation-delay: .24s; }
.card:nth-child(6) { animation-delay: .30s; }

.card.ex-card::after {
    content: '';
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 2px;
    background: linear-gradient(180deg, transparent, var(--g), transparent);
    border-radius: 2px; opacity: .6;
}

/* ── TYPOGRAPHIE ────────────────────────────────── */
.section-header {
    font-family: var(--font-display);
    font-size: .9rem; font-weight: 900;
    letter-spacing: .12em;
    padding: 22px 18px 8px; color: var(--text);
    position: relative; z-index: 2;
}
.section-header::after {
    content: '';
    position: absolute; bottom: 0; left: 18px;
    width: 30px; height: 1px;
    background: var(--g); box-shadow: 0 0 8px var(--g);
}

.card-title {
    font-family: var(--font-display);
    font-size: .75rem; font-weight: 900;
    letter-spacing: .1em; color: var(--text);
    margin-bottom: 14px;
}

.ex-meta {
    font-size: .68rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--g); margin-bottom: 4px;
}
.ex-name {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 900;
    line-height: 1.2; margin-bottom: 4px;
    background: linear-gradient(90deg, #fff 60%, var(--g));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ex-target { font-size: .72rem; color: var(--sub); font-weight: 300; letter-spacing: .04em; }

.pr-badge {
    display: inline-block;
    background: linear-gradient(90deg, #ff6b00, #ffbb00);
    color: #000;
    font-family: var(--font-display);
    font-size: .5rem; font-weight: 900;
    padding: 2px 6px; border-radius: 4px;
    letter-spacing: .1em; vertical-align: middle; margin-left: 6px;
    animation: badge-glow 1.5s ease-in-out infinite;
}
@keyframes badge-glow {
    0%,100% { box-shadow: 0 0 6px rgba(255,107,0,.6); }
    50% { box-shadow: 0 0 14px rgba(255,187,0,.9); }
}

/* ── INPUTS ─────────────────────────────────────── */
.input-row { display: flex; gap: 10px; margin-top: 14px; }

input[type="number"], input[type="text"] {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--brd2);
    color: var(--text);
    padding: 14px 10px;
    border-radius: 14px; flex: 1;
    text-align: center;
    font-family: var(--font-display);
    /* FIX: font-size 1.1rem évite le zoom automatique iOS (>= 16px) */
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -moz-appearance: textfield;
    width: 100%;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input::placeholder { color: var(--sub2); font-family: var(--font-body); font-size: .8rem; }
input:focus {
    border-color: var(--g);
    box-shadow: 0 0 0 2px var(--g-dim), 0 0 12px var(--g-dim);
    background: rgba(0,255,136,.04);
}

/* Animation succès validation */
.input-success { animation: success-glow 1s ease; }
@keyframes success-glow {
    0% { box-shadow: 0 0 0px var(--g); }
    50% { box-shadow: 0 0 15px var(--g); border-color: var(--g); }
    100% { box-shadow: 0 0 0px var(--g); }
}

.input-wrap { position: relative; flex: 1; }
.input-wrap label {
    position: absolute; top: -8px; left: 12px;
    font-size: .55rem; font-weight: 700; letter-spacing: .12em;
    color: var(--g); text-transform: uppercase;
    background: var(--bg); padding: 0 4px;
    pointer-events: none;
}

/* ── BOUTONS ────────────────────────────────────── */
button.primary {
    display: block; width: 100%;
    background: linear-gradient(135deg, var(--g) 0%, #00dd77 100%);
    color: #000; border: none; border-radius: 14px;
    padding: 15px; margin-top: 14px;
    font-family: var(--font-display);
    font-size: .72rem; font-weight: 900;
    letter-spacing: .15em; text-transform: uppercase;
    cursor: pointer;
    position: relative; overflow: hidden;
    transition: transform .12s, box-shadow .2s;
    box-shadow: 0 4px 24px rgba(0,255,136,.25);
}
button.primary::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.15) 0%, transparent 60%);
    pointer-events: none;
}
button.primary:active { transform: scale(.97); box-shadow: 0 2px 10px rgba(0,255,136,.2); }

button.ghost {
    display: block; width: 100%;
    background: transparent; color: var(--sub);
    border: 1px solid var(--brd); border-radius: 14px;
    padding: 12px; margin-top: 8px;
    font-family: var(--font-body);
    font-size: .8rem; font-weight: 600;
    letter-spacing: .06em; cursor: pointer;
    transition: border-color .2s, color .2s;
}
button.ghost:hover { border-color: var(--g); color: var(--g); }

/* ── TIMER OVERLAY ──────────────────────────────── */
/* FIX: empêche les clics fantômes sous l'overlay quand visible */
#timer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.97);
    z-index: 2000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 24px;
    backdrop-filter: blur(15px) saturate(150%);
    pointer-events: all;
}

.timer-bg-pulse {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0,255,136,.04) 0%, transparent 70%);
    animation: bg-pulse 2s ease-in-out infinite;
}
@keyframes bg-pulse {
    0%,100% { opacity: .5; }
    50% { opacity: 1; }
}

#timer-label {
    font-family: var(--font-display);
    font-size: .7rem; font-weight: 600;
    letter-spacing: .35em; color: var(--sub);
}

#timer-circle { position: relative; width: 180px; height: 180px; }
#timer-circle svg {
    position: absolute; top: 0; left: 0;
    transform: rotate(-90deg);
}
.track { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 5; }
.progress {
    fill: none;
    stroke: url(#arcGrad);
    stroke-width: 5; stroke-linecap: round;
    stroke-dasharray: 490.09; stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}
#timer-content {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
}
#timer-number {
    font-family: var(--font-display);
    font-size: 3rem; font-weight: 900; color: var(--g);
    text-shadow: 0 0 30px var(--g), 0 0 60px rgba(0,255,136,.3);
    line-height: 1;
}
#timer-unit {
    font-family: var(--font-display);
    font-size: .5rem; font-weight: 600;
    letter-spacing: .3em; color: var(--sub);
}
.timer-hint { font-size: .78rem; color: var(--sub); font-style: italic; font-weight: 300; }

#skip-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,.1); color: var(--sub);
    padding: 11px 28px; border-radius: 50px;
    font-family: var(--font-body);
    font-size: .78rem; font-weight: 700; letter-spacing: .1em;
    cursor: pointer; transition: border-color .2s, color .2s, box-shadow .2s;
}
#skip-btn:hover { border-color: var(--g); color: var(--g); box-shadow: 0 0 12px var(--g-dim); }

/* ── PR TOAST ───────────────────────────────────── */
#pr-toast {
    position: fixed; top: 70px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #1a0e00, #2a1800);
    border: 1px solid #ff9500; border-radius: 16px;
    padding: 14px 20px; z-index: 3000;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 0 30px rgba(255,149,0,.4);
    min-width: 240px;
    opacity: 0; transition: opacity .3s, transform .3s;
}
#pr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pr-icon { font-size: 1.5rem; }
.pr-title { font-family: var(--font-display); font-size: .65rem; font-weight: 900; letter-spacing: .15em; color: #ffbb00; }
.pr-sub { font-size: .8rem; color: #ff9500; margin-top: 2px; }

/* ── STATS ──────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.stat-box {
    background: var(--card2); border: 1px solid var(--brd);
    border-radius: 16px; padding: 16px; text-align: center;
    position: relative; overflow: hidden;
}
.stat-box::before {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--g), transparent); opacity: .4;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem; font-weight: 900;
    background: linear-gradient(90deg, var(--g), var(--g2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: .62rem; color: var(--sub); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }

#progress-chart { width: 100%; height: 120px; border-radius: 12px; margin-top: 10px; display: block; }

/* ── NUTRITION ──────────────────────────────────── */
.nutri-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.nutri-kcal {
    font-family: var(--font-display);
    font-size: 2.4rem; font-weight: 900;
    background: linear-gradient(90deg, #fff, var(--g));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1;
}
.nutri-goal { font-size: .75rem; color: var(--sub); font-weight: 300; }

.nutri-bar-bg {
    background: rgba(255,255,255,.05); border-radius: 8px; height: 8px;
    overflow: hidden; margin: 10px 0; border: 1px solid var(--brd);
}
.nutri-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--g), var(--g2));
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,255,136,.4);
    transition: width .6s cubic-bezier(.22,1,.36,1);
}

.nutri-macros { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 16px; }
.macro-box {
    background: var(--card2); border: 1px solid var(--brd);
    border-radius: 14px; padding: 12px 8px; text-align: center;
}
.macro-val { font-family: var(--font-display); font-size: 1rem; font-weight: 900; }
.macro-name { font-size: .58rem; color: var(--sub); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

/* ── VISION ─────────────────────────────────────── */
.vision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.v-slot { display: flex; flex-direction: column; gap: 6px; }
.v-label { font-size: .58rem; text-transform: uppercase; letter-spacing: .14em; color: var(--sub); }
.v-img { width: 100%; height: 200px; object-fit: cover; border-radius: 14px; border: 1px solid var(--brd); display: block; }
.v-placeholder {
    width: 100%; height: 200px; border-radius: 14px; border: 1px dashed var(--brd);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--sub2); font-size: .72rem; gap: 8px; letter-spacing: .04em;
}
.v-weight { text-align: center; font-size: .72rem; color: var(--g); font-weight: 600; }

/* ── CHARGES TABLE ──────────────────────────────── */
.weight-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 0; border-bottom: 1px solid var(--brd);
}
.weight-row:last-child { border-bottom: none; }
.weight-name { font-weight: 600; font-size: .88rem; }
.weight-muscle { font-size: .62rem; color: var(--sub); margin-top: 2px; }
.weight-val {
    font-family: var(--font-display); font-size: .95rem; font-weight: 900;
    background: linear-gradient(90deg, var(--g), var(--g2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── NAV ────────────────────────────────────────── */
#bottom-nav {
    position: fixed; bottom: 0; width: 100%; height: 80px;
    background: rgba(0,0,0,.96); border-top: 1px solid var(--brd);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 500;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--sub2); padding: 8px 14px; border-radius: 14px;
    cursor: pointer; transition: color .2s, background .2s;
    position: relative;
}
.nav-item:hover { background: var(--g-dim); color: var(--sub); }
.nav-item.active { color: var(--g); }
.nav-item.active::before {
    content: '';
    position: absolute; top: -1px; left: 20%; right: 20%;
    height: 1px; background: var(--g); box-shadow: 0 0 8px var(--g); border-radius: 1px;
}
.nav-svg { width: 20px; height: 20px; }
.nav-item span { font-family: var(--font-display); font-size: .48rem; font-weight: 900; letter-spacing: .14em; }

/* ── UTILS ──────────────────────────────────────── */
/* FIX CRITIQUE: .hidden doit être défini pour masquer le timer au démarrage */
.hidden { display: none !important; }

#view-port { position: relative; z-index: 2; }

/* Ripple bouton */
.ripple {
    position: absolute; border-radius: 50%;
    background: rgba(0,0,0,.3);
    transform: scale(0);
    animation: ripple-anim .5s linear;
    pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }
/* ── HERO COACH ──────────────────────────────────────── */
.coach-hero {
    position: relative; overflow: hidden;
    min-height: 180px;
    display: flex; align-items: center;
    padding: 30px 20px 20px;
    margin-bottom: -10px;
}
.coach-orb {
    position: absolute; top: -60px; right: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,255,136,.12) 0%, rgba(0,204,255,.06) 50%, transparent 70%);
    animation: orb-rotate 8s linear infinite;
}
@keyframes orb-rotate {
    from { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    to { transform: rotate(360deg) scale(1); }
}
.coach-hero-text { position: relative; z-index: 1; }
.coach-tag {
    font-family: var(--font-display); font-size: .5rem;
    letter-spacing: .25em; color: var(--g); margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
}
.coach-tag::before {
    content: ''; width: 20px; height: 1px;
    background: var(--g); box-shadow: 0 0 6px var(--g);
}
.coach-title {
    font-family: var(--font-display); font-size: 1.8rem; font-weight: 900;
    line-height: 1.1; letter-spacing: .04em; color: var(--text);
}
.coach-title-accent {
    background: linear-gradient(90deg, var(--g), var(--g2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.coach-subtitle { font-size: .78rem; color: var(--sub); margin-top: 8px; letter-spacing: .06em; }

/* ── FORMULAIRE ──────────────────────────────────────── */
.coach-form-header {
    display: flex; align-items: center; gap: 0; margin-bottom: 4px;
}
.coach-step-dot {
    width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid var(--sub2); flex-shrink: 0;
    transition: border-color .3s, background .3s, box-shadow .3s;
}
.coach-step-dot.active {
    border-color: var(--g); background: var(--g);
    box-shadow: 0 0 10px var(--g);
}
.coach-step-line { flex: 1; height: 1px; background: var(--brd); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-family: var(--font-display); font-size: .55rem;
    font-weight: 900; letter-spacing: .14em; color: var(--g);
    text-transform: uppercase;
}
.form-input {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--brd2); color: var(--text);
    padding: 13px 14px; border-radius: 14px;
    font-family: var(--font-display); font-size: 1rem; font-weight: 600;
    outline: none; width: 100%;
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance: textfield;
}
.form-input:focus {
    border-color: var(--g);
    box-shadow: 0 0 0 2px var(--g-dim);
}
.form-input::-webkit-outer-spin-button,
.form-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.radio-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.radio-btn {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--brd);
    color: var(--sub); padding: 9px 14px;
    border-radius: 50px; font-size: .75rem; font-weight: 600;
    cursor: pointer; letter-spacing: .04em;
    transition: all .2s; white-space: nowrap;
}
.radio-btn.active {
    background: var(--g-dim); border-color: var(--g); color: var(--g);
    box-shadow: 0 0 10px var(--g-dim);
}

.coach-generate-btn { position: relative; overflow: hidden; }
.coach-generate-btn .btn-icon { margin-right: 8px; }

.form-error {
    margin-top: 10px; padding: 10px 14px;
    background: rgba(255,50,50,.1); border: 1px solid rgba(255,50,50,.3);
    border-radius: 10px; color: #ff6b6b; font-size: .8rem;
    transition: opacity .3s;
}

/* ── ÉCRAN GÉNÉRATION ────────────────────────────────── */
.coach-generating {
    min-height: 70vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 28px; padding: 40px 20px;
}
.gen-orb {
    position: relative; width: 100px; height: 100px;
    display: flex; align-items: center; justify-content: center;
}
.gen-ring {
    position: absolute; border-radius: 50%;
    border: 1px solid var(--g); opacity: .4;
    animation: gen-spin linear infinite;
}
.g1 { width: 100px; height: 100px; animation-duration: 3s; }
.g2 { width: 72px; height: 72px; animation-duration: 2s; border-color: var(--g2); animation-direction: reverse; }
.g3 { width: 48px; height: 48px; animation-duration: 1.5s; opacity: .6; }
@keyframes gen-spin { to { transform: rotate(360deg); } }
.gen-core {
    font-family: var(--font-display); font-size: .8rem; font-weight: 900;
    color: var(--g); text-shadow: 0 0 20px var(--g);
    letter-spacing: .1em; z-index: 1;
}
.gen-title {
    font-family: var(--font-display); font-size: .9rem; font-weight: 900;
    letter-spacing: .2em; color: var(--text);
}
.gen-steps { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 280px; }
.gen-step {
    font-size: .8rem; color: var(--sub2); padding: 8px 14px;
    border-left: 2px solid var(--sub2); transition: all .4s;
}
.gen-step.active { color: var(--g); border-left-color: var(--g); padding-left: 18px; }

.gen-progress-bar {
    width: 80%; max-width: 280px; height: 4px;
    background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden;
}
.gen-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--g), var(--g2));
    border-radius: 4px;
    transition: width .6s ease;
    box-shadow: 0 0 10px var(--g);
}

/* ── ERREUR COACH ────────────────────────────────────── */
.coach-error-screen {
    min-height: 60vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px; padding: 40px 20px; text-align: center;
}
.coach-err-title {
    font-family: var(--font-display); font-size: .9rem;
    font-weight: 900; letter-spacing: .1em; color: #ff6b6b;
}
.coach-err-msg {
    font-size: .82rem; color: var(--sub); line-height: 1.7; max-width: 300px;
}
.coach-err-msg code {
    font-family: monospace; color: var(--g); background: var(--g-dim);
    padding: 1px 5px; border-radius: 4px;
}
.coach-err-detail {
    font-size: .7rem; color: var(--sub2); font-style: italic;
    border: 1px solid var(--brd); padding: 8px 14px; border-radius: 10px;
    max-width: 300px; word-break: break-word;
}

/* ── PROFIL BAR ──────────────────────────────────────── */
.coach-profile-bar {
    display: flex; align-items: center; gap: 14px;
    margin: 12px 14px; padding: 16px;
    background: var(--card); border: 1px solid var(--brd2);
    border-radius: 20px; position: relative; overflow: hidden;
}
.coach-profile-bar::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--g-dim), transparent);
    pointer-events: none;
}
.cpb-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--g-dim); border: 1px solid var(--brd2);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 1rem; font-weight: 900; color: var(--g);
    flex-shrink: 0;
}
.cpb-avatar span { font-size: .45rem; color: var(--sub); letter-spacing: .05em; }
.cpb-info { flex: 1; min-width: 0; }
.cpb-name { font-size: .78rem; font-weight: 700; margin-bottom: 4px; }
.cpb-goal { font-size: .68rem; color: var(--sub); line-height: 1.4; }
.cpb-edit {
    background: transparent; border: 1px solid var(--brd);
    color: var(--sub); padding: 8px; border-radius: 10px;
    cursor: pointer; font-size: 1rem; transition: all .2s;
    flex-shrink: 0;
}
.cpb-edit:hover { border-color: var(--g); color: var(--g); }

/* ── MACROS CARD ─────────────────────────────────────── */
.macro-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; margin-bottom: 18px;
}
.macro-kcal-badge {
    font-family: var(--font-display); font-size: 1.6rem; font-weight: 900;
    background: linear-gradient(135deg, var(--g), var(--g2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; line-height: 1; text-align: right;
}
.macro-kcal-badge span { display: block; font-size: .5rem; color: var(--sub); -webkit-text-fill-color: var(--sub); }

.macro-bars { display: flex; flex-direction: column; gap: 12px; }
.macro-bar-row { display: flex; align-items: center; gap: 10px; }
.mbr-label {
    font-family: var(--font-display); font-size: .52rem;
    font-weight: 900; letter-spacing: .1em; color: var(--sub);
    width: 72px; flex-shrink: 0;
}
.mbr-bar-bg {
    flex: 1; height: 6px; background: rgba(255,255,255,.06);
    border-radius: 6px; overflow: hidden;
}
.mbr-bar-fill {
    height: 100%; border-radius: 6px;
    transition: width 1s cubic-bezier(.22,1,.36,1);
}
.mbr-value {
    font-family: var(--font-display); font-size: .75rem;
    font-weight: 900; width: 42px; text-align: right; flex-shrink: 0;
}

/* ── WORKOUT DAY CARD ────────────────────────────────── */
.workout-day-card { padding: 18px; }
.wdc-header {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--brd);
}
.wdc-day {
    font-family: var(--font-display); font-size: .75rem; font-weight: 900;
    color: var(--g); letter-spacing: .1em;
}
.wdc-focus { font-size: .72rem; color: var(--sub); }
.wdc-exercises { display: flex; flex-direction: column; gap: 10px; }
.wdc-ex { padding: 10px 12px; background: rgba(255,255,255,.02); border-radius: 12px; border: 1px solid var(--brd); }
.wdc-ex-name { font-weight: 700; font-size: .88rem; margin-bottom: 5px; }
.wdc-ex-meta { display: flex; align-items: center; gap: 10px; }
.wdc-badge {
    background: var(--g-dim); border: 1px solid var(--brd2);
    color: var(--g); padding: 2px 10px; border-radius: 50px;
    font-family: var(--font-display); font-size: .62rem; font-weight: 900;
    letter-spacing: .06em;
}
.wdc-rest { font-size: .68rem; color: var(--sub); }
.wdc-tip {
    margin-top: 6px; font-size: .7rem; color: var(--sub);
    font-style: italic; line-height: 1.4;
}

/* ── MEAL CARD ───────────────────────────────────────── */
.meal-card { padding: 16px; }
.meal-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 10px;
}
.meal-name { font-weight: 700; font-size: .92rem; margin-bottom: 3px; }
.meal-time { font-size: .68rem; color: var(--sub); }
.meal-kcal {
    font-family: var(--font-display); font-size: 1.1rem; font-weight: 900; color: var(--g);
    text-align: right; line-height: 1;
}
.meal-kcal span { display: block; font-size: .45rem; color: var(--sub); font-family: var(--font-body); font-weight: 400; }
.meal-foods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.meal-food-tag {
    background: rgba(255,255,255,.04); border: 1px solid var(--brd);
    padding: 4px 10px; border-radius: 50px; font-size: .7rem; color: var(--sub);
}
.meal-macros-mini { display: flex; gap: 14px; font-size: .68rem; font-weight: 700; }

/* ── COACH TIPS ──────────────────────────────────────── */
.coach-tips-card { background: rgba(0,255,136,.04); border-color: var(--brd2); }
.coach-tip-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--brd);
}
.coach-tip-item:last-child { border-bottom: none; }
.tip-bullet {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--g); box-shadow: 0 0 8px var(--g);
    flex-shrink: 0; margin-top: 6px;
}
.coach-tip-item p { font-size: .82rem; color: var(--sub); line-height: 1.6; }

/* ── CHAT ────────────────────────────────────────────── */
.chat-card { padding: 0; overflow: hidden; }
.chat-messages {
    padding: 16px; max-height: 340px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--brd2); border-radius: 3px; }

.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }

.chat-bubble {
    max-width: 82%; padding: 11px 15px;
    border-radius: 18px; font-size: .82rem; line-height: 1.6;
    word-break: break-word;
}
.chat-msg.user .chat-bubble {
    background: linear-gradient(135deg, var(--g), #00dd77);
    color: #000; font-weight: 600;
    border-bottom-right-radius: 4px;
}
.chat-msg.assistant .chat-bubble {
    background: var(--card2); border: 1px solid var(--brd);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.chat-h3 { font-family: var(--font-display); font-size: .72rem; font-weight: 900; color: var(--g); margin: 8px 0 4px; letter-spacing: .06em; }
.chat-li { padding: 2px 0 2px 8px; border-left: 2px solid var(--brd2); margin: 3px 0; color: var(--sub); font-size: .78rem; }

.cursor-blink {
    display: inline-block; color: var(--g);
    animation: blink .7s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.chat-input-row {
    display: flex; align-items: center; gap: 0;
    border-top: 1px solid var(--brd);
    padding: 10px 12px; gap: 8px;
}
.chat-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); font-family: var(--font-body);
    font-size: .88rem; font-weight: 400; padding: 8px 4px;
    text-align: left !important;
}
.chat-input::placeholder { color: var(--sub2); }
.chat-input:disabled { opacity: .5; }

.chat-send-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--g); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #000;
    transition: transform .15s, box-shadow .2s;
    box-shadow: 0 0 14px rgba(0,255,136,.3);
}
.chat-send-btn:hover { transform: scale(1.08); }
.chat-send-btn:active { transform: scale(.95); }
.chat-send-btn:disabled { opacity: .4; cursor: not-allowed; }
