/* ============================================================
   TEAM MELLO FITNESS ECOSYSTEM
   Mobile-First PWA — Dark + Light themes (switch via [data-tema])
   ============================================================ */

/* ===== Tokens compartilhados ===== */
:root {
    --primary: #2196F3;
    --primary-light: #42A5F5;
    --primary-dark: #0D47A1;
    --primary-dim: rgba(33, 150, 243, 0.15);
    --primary-border: rgba(33, 150, 243, 0.35);
    --primary-gradient: linear-gradient(135deg, #0D47A1, #42A5F5);

    /* Alias legado (compat com inline styles existentes) */
    --gold: #2196F3;
    --gold-dim: rgba(33, 150, 243, 0.15);
    --gold-border: rgba(33, 150, 243, 0.35);

    /* Status colors (iguais em ambos os temas — saturação OK nos dois) */
    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.12);
    --blue: #42A5F5;
    --blue-dim: rgba(66, 165, 245, 0.12);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.12);
    --pink: #ec4899;
    --orange: #f97316;
    --purple: #a855f7;

    --r: 12px;
    --r-sm: 8px;
    --r-full: 9999px;
    --nav-h: 60px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

/* ===== DARK THEME (default) ===== */
:root,
:root[data-tema="dark"] {
    --bg: #0a0a0a;
    --surface: #141414;
    --card: #1a1a1a;
    --card-hover: #222222;
    --border: #2a2a2a;
    --border-light: #333;
    --white: #ffffff;           /* "texto de destaque" — invertido no light pra preto */
    --text: #d1d5db;
    --muted: #9ca3af;

    --glass-bg: rgba(10, 10, 10, 0.85);
    --glass-bg-strong: rgba(10, 10, 10, 0.92);
    --modal-backdrop: rgba(0, 0, 0, 0.75);
    --shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.6);
    --shadow-med: 0 8px 32px rgba(0, 0, 0, 0.5);
    --logo-filter: brightness(1.15) drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

/* ===== LIGHT THEME ===== */
:root[data-tema="light"] {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --card: #ffffff;
    --card-hover: #f3f4f6;
    --border: #e5e7eb;
    --border-light: #d1d5db;
    --white: #0f172a;           /* "texto de destaque" vira quase-preto */
    --text: #1f2937;
    --muted: #6b7280;

    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-bg-strong: rgba(255, 255, 255, 0.96);
    --modal-backdrop: rgba(15, 23, 42, 0.55);
    --shadow-strong: 0 12px 40px rgba(15, 23, 42, 0.12);
    --shadow-med: 0 8px 32px rgba(15, 23, 42, 0.08);
    --logo-filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

/* Transição suave ao trocar tema (sem afetar navegação) */
html { transition: background-color 0.25s ease; }
body, .top-bar, .card, .section, .pmenu-item,
.input-group input, .btn-primary, .badge-card,
.login-form, .notif-btn, .bottom-nav, .xp-bar-outer,
.profile-menu, .day-chip, .modal, .sheet {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 0; height: 0; }

/* ---- CONTAINER ---- */
.container { padding: 14px 16px 0; max-width: 500px; margin: 0 auto; }

/* ---- TOP BAR ---- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    padding: 10px 16px;
    padding-top: calc(10px + var(--safe-t));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.top-bar .brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.top-bar .brand-logo {
    height: 26px;
    width: auto;
    display: block;
    filter: var(--logo-filter);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notif-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
}
.notif-btn svg { width: 22px; height: 22px; }
.notif-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    border: 1.5px solid var(--bg);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    color: #fff;
}

/* ---- BOTTOM NAV ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(14, 14, 14, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 999;
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
}
.bottom-nav a svg { width: 22px; height: 22px; stroke-width: 1.8; }
.bottom-nav a.active { color: var(--gold); }

/* ---- HERO (home) ---- */
.hero {
    padding: 20px 16px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.hero-left .greeting { font-size: 0.8rem; color: var(--muted); }
.hero-left .name { font-size: 1.5rem; font-weight: 800; color: var(--white); margin-top: 2px; }

.hero-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.streak-fire { font-size: 1.6rem; line-height: 1; }
.streak-num { font-size: 0.7rem; font-weight: 800; color: var(--orange); }
.streak-label { font-size: 0.55rem; color: var(--muted); text-transform: uppercase; }

/* ---- XP BAR ---- */
.xp-bar-wrap {
    margin: 12px 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xp-level {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--gold);
    flex-shrink: 0;
}

.xp-bar-outer {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: var(--r-full);
    overflow: hidden;
}

.xp-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--r-full);
    transition: width 0.5s ease;
}

.xp-text {
    font-size: 0.6rem;
    color: var(--muted);
    flex-shrink: 0;
}

/* ---- QUICK ACTIONS ---- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 16px 0;
}

.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}
.qa-btn:active { background: var(--card-hover); }

.qa-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.qa-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    line-height: 1.2;
}

/* ---- SECTION ---- */
.section {
    margin: 20px 16px 0;
}
.section:first-child { margin-top: 0; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 700;
    background: var(--gold-dim);
    border: 1px solid var(--gold-border);
    padding: 6px 12px;
    border-radius: var(--r-full);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, transform 0.12s;
    font-family: inherit;
    line-height: 1;
}
.section-link:hover { background: rgba(33, 150, 243, 0.22); }
.section-link:active { transform: scale(0.95); }

/* ---- CARDS ---- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    margin-bottom: 8px;
    transition: background 0.15s;
}
.card:active { background: var(--card-hover); }

.card-body { padding: 14px; }

.card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.card-row:last-child { border-bottom: none; }

/* ---- WORKOUT CARD (feed style) ---- */
.workout-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 10px;
    overflow: hidden;
}

.wc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}

.wc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
    color: #fff;
    flex-shrink: 0;
}

.wc-meta { flex: 1; }
.wc-name { font-size: 0.8rem; font-weight: 700; color: var(--white); }
.wc-time { font-size: 0.65rem; color: var(--muted); }

.wc-body { padding: 0 14px 12px; }
.wc-text { font-size: 0.82rem; color: var(--text); line-height: 1.5; }

.wc-stats {
    display: flex;
    gap: 16px;
    padding: 8px 14px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.wc-stat {
    text-align: center;
}
.wc-stat-val { font-size: 0.95rem; font-weight: 800; color: var(--gold); }
.wc-stat-lbl { font-size: 0.55rem; color: var(--muted); text-transform: uppercase; }

.wc-actions {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    gap: 20px;
}

.wc-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
}
.wc-action-btn svg { width: 18px; height: 18px; }
.wc-action-btn.liked { color: var(--red); }

/* ---- EXERCISE LIST (workout mode) ---- */
.ex-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.ex-item:last-child { border-bottom: none; }

.ex-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 1.5px solid var(--gold-border);
    color: var(--gold);
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ex-info { flex: 1; min-width: 0; }
.ex-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ex-detail { font-size: 0.65rem; color: var(--muted); margin-top: 2px; }
.ex-obs { font-size: 0.65rem; color: var(--gold); margin-top: 2px; }

.ex-right { flex-shrink: 0; text-align: right; }
.ex-sets { font-size: 1.05rem; font-weight: 800; color: var(--gold); }
.ex-sets-lbl { font-size: 0.55rem; color: var(--muted); text-transform: uppercase; }

/* ---- SET LOG TABLE (workout mode) ---- */
.set-table {
    width: 100%;
    border-collapse: collapse;
}

.set-table th {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.set-table td {
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

.set-input {
    width: 100%;
    max-width: 70px;
    padding: 8px 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    outline: none;
}
.set-input:focus { border-color: var(--gold); }
.set-input::placeholder { color: #444; }

.set-done {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--primary-border);
    background: var(--primary-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.set-done svg {
    width: 14px;
    height: 14px;
    stroke: var(--primary);
    stroke-width: 3;
    opacity: 0.5;
}
.set-done:hover { background: var(--primary-dim); border-color: var(--primary); }
.set-done:hover svg { opacity: 1; }

.set-done.checked {
    background: var(--green);
    border-color: var(--green);
}
.set-done.checked svg {
    stroke: #fff;
    opacity: 1;
}

/* ---- REST TIMER ---- */
.rest-timer {
    position: fixed;
    bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--gold-border);
    border-radius: var(--r-full);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.rest-timer .timer-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.rest-timer .timer-lbl {
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
}

.rest-timer .timer-skip {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}

/* ---- MACROS ---- */
.macros-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.macro-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 4px;
    text-align: center;
}
.macro-val { font-size: 1.1rem; font-weight: 800; }
.macro-val.kcal { color: var(--gold); }
.macro-val.prot { color: var(--blue); }
.macro-val.carb { color: var(--green); }
.macro-val.fat { color: var(--pink); }
.macro-lbl { font-size: 0.55rem; color: var(--muted); text-transform: uppercase; margin-top: 2px; }

/* ---- MEAL CARDS ---- */
.meal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 8px;
    overflow: hidden;
}

.meal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.meal-name { font-size: 0.8rem; font-weight: 700; color: var(--white); }
.meal-time { font-size: 0.7rem; color: var(--gold); font-weight: 600; }

.meal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(37, 37, 37, 0.6);
    font-size: 0.78rem;
}
.meal-item:last-child { border-bottom: none; }
.meal-food { color: var(--text); flex: 1; }
.meal-kcal { color: var(--muted); font-size: 0.68rem; text-align: right; flex-shrink: 0; margin-left: 8px; }

/* ---- WATER TRACKER ---- */
.water-track {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
}

.water-drops {
    display: flex;
    gap: 3px;
    flex: 1;
    flex-wrap: wrap;
}

.water-drop {
    width: 20px;
    height: 24px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    border: 1.5px solid var(--border);
    background: none;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.water-drop.filled {
    background: var(--blue);
    border-color: var(--blue);
}

.water-info {
    text-align: right;
    flex-shrink: 0;
}
.water-count { font-size: 1rem; font-weight: 800; color: var(--blue); }
.water-goal { font-size: 0.6rem; color: var(--muted); }

/* ---- BODY LOG ---- */
.body-chart-placeholder {
    height: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.75rem;
}

.measure-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.measure-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.measure-label { font-size: 0.72rem; color: var(--muted); }
.measure-val { font-size: 0.85rem; font-weight: 700; color: var(--white); }
.measure-diff { font-size: 0.65rem; font-weight: 600; }
.measure-diff.up { color: var(--green); }
.measure-diff.down { color: var(--red); }

/* ---- BADGES ---- */
.badges-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.badge-item {
    flex-shrink: 0;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 2px solid var(--border);
    background: var(--surface);
}
.badge-icon.earned {
    border-color: var(--gold);
    background: var(--gold-dim);
}
.badge-icon.locked { opacity: 0.35; filter: grayscale(1); }

.badge-name {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    line-height: 1.2;
}

/* ---- PR CELEBRATION ---- */
.pr-banner {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(249, 115, 22, 0.1));
    border: 1px solid var(--gold-border);
    border-radius: var(--r);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.pr-icon { font-size: 1.5rem; flex-shrink: 0; }
.pr-info { flex: 1; }
.pr-title { font-size: 0.8rem; font-weight: 700; color: var(--gold); }
.pr-detail { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }

/* ---- WEEK DOTS ---- */
.week-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 12px 0;
}

.wdot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--muted);
}
.wdot.done { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.wdot.current { border-color: var(--gold); background: var(--gold-dim); color: var(--gold); }

/* ---- DAY CHIPS ---- */
.day-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}
.day-chips::-webkit-scrollbar { display: none; }

.day-chip {
    flex-shrink: 0;
    min-width: 72px;
    padding: 10px 18px;
    background: var(--surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--r);
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
    box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.day-chip:hover { border-color: var(--border-light); background: var(--card-hover); }
.day-chip:active { transform: scale(0.97); }
.day-chip.active {
    border-color: var(--gold);
    background: var(--gold-dim);
    box-shadow: 0 0 0 1px var(--gold-border) inset, 0 2px 8px rgba(33,150,243,0.15);
}
.day-chip .d-num { font-size: 1rem; font-weight: 800; color: var(--white); line-height: 1.1; }
.day-chip.active .d-num { color: var(--gold); }
.day-chip .d-name { font-size: 0.55rem; color: var(--muted); text-transform: uppercase; margin-top: 3px; letter-spacing: 0.5px; }
.day-chip.active .d-name { color: var(--gold); opacity: 0.9; }

/* ---- CTA BUTTON ---- */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--r);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.99); }

.btn-success {
    background: var(--green-dim);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--green);
}

.btn-outline {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
}

/* ---- LOGIN ---- */
.login-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.login-logo { text-align: center; margin-bottom: 40px; }
.login-logo-icon { width: 72px; height: auto; display: block; margin: 0 auto 16px; }
.login-logo h1 { font-size: 1.6rem; font-weight: 900; color: var(--white); letter-spacing: 0.5px; }
.login-logo h1 span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.login-logo p { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }

.login-form { width: 100%; max-width: 340px; }

.input-group { margin-bottom: 14px; }
.input-group-compact { margin-bottom: 10px; }
.input-group-compact label { font-size: 0.62rem; margin-bottom: 4px; }
.input-group-compact input { padding: 10px 12px; font-size: 0.85rem; }

.medidas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
    padding-bottom: 4px;
}
@media (max-width: 360px) { .medidas-grid { grid-template-columns: 1fr; } }
.input-group label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.input-group input {
    width: 100%;
    padding: 13px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--white);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.input-group input:focus { border-color: var(--gold); }
.input-group input::placeholder { color: #444; }

.login-error {
    background: var(--red-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    font-size: 0.78rem;
    margin-bottom: 14px;
    text-align: center;
}

/* ---- EMPTY STATE ---- */
.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty p { font-size: 0.82rem; line-height: 1.5; }

/* ---- HISTORY ---- */
.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.h-date { font-size: 0.68rem; color: var(--muted); width: 40px; flex-shrink: 0; }
.h-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.h-text { font-size: 0.78rem; color: var(--text); }

/* ---- ORIENT CARDS ---- */
.orient-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    margin-bottom: 6px;
}
.orient-title { font-size: 0.75rem; font-weight: 700; color: var(--gold); }
.orient-text { font-size: 0.72rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* ---- COMPOSE BOX (feed) ---- */
.compose-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}

.compose-top {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    align-items: flex-start;
}

.compose-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 1.5;
}
.compose-input::placeholder { color: var(--muted); }

.compose-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
}

.compose-chars { font-size: 0.6rem; color: var(--muted); }

.compose-btn {
    background: var(--gold);
    color: #fff;
    border: none;
    border-radius: var(--r-full);
    padding: 6px 16px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.compose-btn:disabled { opacity: 0.5; }

/* ---- POST BADGE ---- */
.post-badge {
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: var(--r-full);
    background: var(--gold-dim);
    color: var(--gold);
    font-weight: 600;
}

/* ---- COMMENTS (feed) ---- */
.comments-section {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.comment-item {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    align-items: flex-start;
}

.comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
}

.comment-body { font-size: 0.75rem; color: var(--text); line-height: 1.4; }
.comment-name { font-weight: 700; color: var(--white); margin-right: 4px; }
.comment-text { color: var(--text); }

.comment-input-row {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    align-items: center;
    border-top: 1px solid var(--border);
}

.comment-input {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 7px 12px;
    color: var(--white);
    font-size: 0.75rem;
    font-family: inherit;
    outline: none;
}
.comment-input:focus { border-color: var(--gold-border); }
.comment-input::placeholder { color: #444; }

.comment-send {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gold);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #fff;
}

/* ---- PESO/BODY TRACKING ---- */
.peso-hero {
    text-align: center;
    padding: 16px 0;
}

.peso-current {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1;
}
.peso-unit { font-size: 1rem; color: var(--muted); font-weight: 600; }

.peso-diff {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 4px;
}
.peso-diff.up { color: var(--green); }
.peso-diff.down { color: var(--red); }
.peso-diff span { color: var(--muted); font-weight: 400; margin-left: 4px; }

.peso-chart {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px;
    margin: 8px 0;
}

.period-tabs {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 8px 0;
}

.period-tab {
    padding: 6px 14px;
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
}
.period-tab.active {
    background: var(--gold-dim);
    border-color: var(--gold-border);
    color: var(--gold);
}

.fotos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.foto-thumb { position: relative; }

.foto-img {
    width: 100%;
    padding-bottom: 130%;
    background-size: cover;
    background-position: center;
    border-radius: var(--r-sm);
    background-color: var(--surface);
}

.foto-date {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 0.55rem;
    color: #fff;
    background: rgba(0,0,0,0.7);
    padding: 1px 5px;
    border-radius: 4px;
}

/* ---- COMPOSIÇÃO CORPORAL ---- */
.comp-grid {
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
}

.comp-item { text-align: center; }

.comp-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    position: relative;
    background: conic-gradient(var(--clr) calc(var(--pct) * 1%), var(--border) 0%);
}

.comp-ring::after {
    content: '';
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg);
    position: absolute;
}

.comp-val {
    position: relative;
    z-index: 1;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--white);
}

.comp-lbl {
    font-size: 0.6rem;
    color: var(--muted);
}

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--r) var(--r) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: calc(16px + var(--safe-b));
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-body { padding: 16px; }

/* ---- WORKOUT SESSION (fullscreen mode) ---- */
.ws-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    padding: 10px 14px;
    padding-top: calc(10px + var(--safe-t));
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.ws-back {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    -webkit-tap-highlight-color: transparent;
}

.ws-title { flex: 1; }
.ws-day { font-size: 0.78rem; font-weight: 700; color: var(--white); }
.ws-clock { font-size: 0.65rem; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }

.ws-finish {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--r-full);
    padding: 6px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ws-finish:disabled { opacity: 0.5; }

.ws-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 12px;
}

.ws-progress-bar {
    height: 3px;
    background: var(--border);
    border-radius: var(--r-full);
    margin: 12px 0;
    overflow: hidden;
}

.ws-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--green));
    border-radius: var(--r-full);
    transition: width 0.5s ease;
}

.ws-exercise {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.ws-exercise.ws-ex-done { border-color: rgba(34,197,94,0.3); }

.ws-ex-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ws-ex-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 1.5px solid var(--gold-border);
    color: var(--gold);
    font-weight: 800;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ws-ex-done .ws-ex-num {
    background: var(--green-dim);
    border-color: rgba(34,197,94,0.3);
    color: var(--green);
}

.ws-ex-info { flex: 1; min-width: 0; }
.ws-ex-name { font-size: 0.8rem; font-weight: 600; color: var(--white); }
.ws-ex-target { font-size: 0.65rem; color: var(--muted); margin-top: 1px; }

.ws-ex-status { flex-shrink: 0; color: var(--muted); }

.ws-ex-body { padding: 0 14px 14px; }

.ws-obs {
    font-size: 0.7rem;
    color: var(--gold);
    padding: 6px 10px;
    background: var(--gold-dim);
    border-radius: var(--r-sm);
    margin-bottom: 10px;
}

.set-select {
    -webkit-appearance: none;
    appearance: none;
    max-width: 50px;
}

.ws-add-set {
    display: block;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--r-sm);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    -webkit-tap-highlight-color: transparent;
}
.ws-add-set:active { background: var(--surface); }

.ws-pr-hint {
    font-size: 0.65rem;
    color: var(--muted);
    text-align: center;
    margin-top: 8px;
    padding: 4px;
}
.ws-pr-hint strong { color: var(--gold); }

/* ---- WORKOUT COMPLETE ---- */
.ws-complete {
    text-align: center;
    padding: 60px 24px;
}

.ws-complete-icon { font-size: 3rem; margin-bottom: 12px; }
.ws-complete-title { font-size: 1.4rem; font-weight: 900; color: var(--white); }

.ws-complete-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
}

.ws-cstat { text-align: center; }
.ws-cstat-val { font-size: 1.3rem; font-weight: 800; color: var(--gold); }
.ws-cstat-lbl { font-size: 0.6rem; color: var(--muted); text-transform: uppercase; }

/* ---- PR CELEBRATION OVERLAY ---- */
.pr-celebration {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: prFadeIn 0.3s ease;
}

.pr-cel-content { text-align: center; }
.pr-cel-icon { font-size: 4rem; animation: prBounce 0.5s ease; }
.pr-cel-title { font-size: 1.6rem; font-weight: 900; color: var(--gold); margin-top: 8px; }
.pr-cel-detail { font-size: 0.85rem; color: var(--text); margin-top: 4px; }
.pr-cel-xp { font-size: 0.9rem; font-weight: 700; color: var(--green); margin-top: 8px; }

@keyframes prFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes prBounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }

/* ---- PROFILE ---- */
.profile-header {
    text-align: center;
    padding: 20px 0 16px;
}

.profile-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.6rem;
    color: #fff;
    margin: 0 auto 10px;
}

.profile-name { font-size: 1.2rem; font-weight: 800; color: var(--white); }
.profile-user { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.profile-obj {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    background: var(--gold-dim);
    border: 1px solid var(--gold-border);
    color: var(--gold);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: capitalize;
}

.profile-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px 0;
}

.ps-item { flex: 1; text-align: center; }
.ps-val { font-size: 1.1rem; font-weight: 800; color: var(--white); }
.ps-lbl { font-size: 0.55rem; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.ps-divider { width: 1px; height: 28px; background: var(--border); }

.badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.badge-card {
    text-align: center;
    padding: 10px 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.badge-desc {
    font-size: 0.5rem;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.2;
}

.profile-menu {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}

.pmenu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
}
.pmenu-item:last-child { border-bottom: none; }
.pmenu-item:active { background: var(--card-hover); }

.pmenu-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pmenu-text { flex: 1; font-size: 0.82rem; font-weight: 600; color: var(--white); }

/* ---- CHECKOUT ---- */
.checkout-page {
    max-width: 520px;
    margin: 0 auto;
    padding: 28px 20px calc(40px + env(safe-area-inset-bottom, 0px));
    min-height: 100dvh;
    background: var(--bg);
}

.checkout-header {
    text-align: center;
    margin-bottom: 28px;
}

.checkout-logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.checkout-logo span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.checkout-sub {
    color: var(--muted);
    font-size: 0.82rem;
}

.checkout-form .section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Produtos como cards de rádio */
.produto-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.produto-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.produto-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.produto-inner {
    padding: 14px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--r);
    transition: all 0.15s;
}
.produto-card:hover .produto-inner { border-color: var(--primary-border); }
.produto-card input:checked + .produto-inner {
    border-color: var(--primary);
    background: var(--primary-dim);
}

.produto-nome {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
}
.produto-desc {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 2px 0 6px;
    line-height: 1.4;
}
.produto-valor {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

select.set-input, .input-group select {
    width: 100%;
    padding: 13px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--white);
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 38px;
}
.input-group select:focus { border-color: var(--primary); }

.checkout-terms {
    text-align: center;
    font-size: 0.68rem;
    color: var(--muted);
    line-height: 1.6;
    margin-top: 14px;
}
.checkout-terms a { color: var(--primary); }

/* ---- NOTIFICAÇÕES ---- */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:active { background: var(--card-hover); }
.notif-unread { background: rgba(33, 150, 243, 0.04); }

.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.82rem; font-weight: 700; color: var(--white); }
.notif-msg { font-size: 0.72rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.notif-time { font-size: 0.62rem; color: var(--muted); margin-top: 4px; }

.notif-dot-red {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}

/* ---- RESPONSIVE ---- */

/* Tablet: 640px — 1023px */
@media (min-width: 640px) {
    .container { max-width: 560px; padding: 14px 20px 0; }
    .hero { padding: 24px 20px 0; }
    .xp-bar-wrap { margin: 16px 20px 0; }
    .quick-actions { margin: 20px 20px 0; gap: 10px; }
    .section { margin: 24px 20px 0; }
    .badges-grid { grid-template-columns: repeat(5, 1fr); }
}

/* Desktop: 1024px+ — "phone in frame" SEM cortes: só .container tem o frame */
@media (min-width: 1024px) {
    body {
        background:
            radial-gradient(ellipse at top, rgba(33, 150, 243, 0.06) 0%, transparent 50%),
            radial-gradient(ellipse at bottom, rgba(13, 71, 161, 0.04) 0%, transparent 50%),
            #050505;
        padding-bottom: 100px;
    }

    /* Topbar: topo do frame */
    .top-bar {
        max-width: 480px;
        margin: 32px auto 0;
        border: 1px solid var(--border);
        border-bottom: none;
        border-radius: var(--r) var(--r) 0 0;
        padding: 14px 18px;
        background: var(--bg);
    }

    /* CONTAINER é o único frame — engloba todas as seções internas */
    .container {
        max-width: 480px;
        margin: 0 auto;
        padding: 14px 0 24px;
        background: var(--bg);
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        border-radius: 0 0 var(--r) var(--r);
    }

    /* Seções internas: SEM bordas próprias, só padding horizontal */
    .hero,
    .xp-bar-wrap,
    .quick-actions,
    .section {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding-left: 18px;
        padding-right: 18px;
        border: none;
        background: transparent;
    }

    .hero { padding-top: 22px; padding-bottom: 0; }
    .xp-bar-wrap { padding-top: 14px; padding-bottom: 0; margin-top: 14px; }
    .quick-actions { padding-top: 0; padding-bottom: 0; margin-top: 16px; }
    .section { padding-top: 0; padding-bottom: 0; margin-top: 20px; }

    /* Bottom nav flutuante */
    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        border: 1px solid var(--border);
        border-radius: var(--r-full);
        bottom: 24px;
        height: 60px;
        padding-bottom: 0;
        background: rgba(14, 14, 14, 0.95);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    }

    /* Modais flutuantes */
    .modal-content {
        border-radius: var(--r);
        max-width: 420px;
        margin-bottom: 48px;
    }

    /* Workout session fullscreen — já tem o próprio frame */
    .ws-topbar {
        max-width: 480px;
        margin: 32px auto 0;
        border: 1px solid var(--border);
        border-bottom: none;
        border-radius: var(--r) var(--r) 0 0;
    }

    .ws-container {
        max-width: 480px;
        margin: 0 auto;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        border-radius: 0 0 var(--r) var(--r);
        padding: 12px 18px 24px;
        background: var(--bg);
    }

    /* Login centralizado */
    .login-page {
        max-width: 420px;
        margin: 80px auto 0;
        padding: 48px 28px;
        border: 1px solid var(--border);
        border-radius: var(--r);
        background: linear-gradient(180deg, var(--card) 0%, var(--bg) 100%);
    }
}

/* Desktop large: 1280px+ — opcionalmente colocamos um hint dos lados */
@media (min-width: 1280px) {
    body::before {
        content: '';
        position: fixed;
        top: 0; bottom: 0; left: 0;
        width: 33%;
        background: linear-gradient(90deg, rgba(201, 168, 76, 0.02), transparent);
        pointer-events: none;
        z-index: -1;
    }
    body::after {
        content: '';
        position: fixed;
        top: 0; bottom: 0; right: 0;
        width: 33%;
        background: linear-gradient(-90deg, rgba(59, 130, 246, 0.02), transparent);
        pointer-events: none;
        z-index: -1;
    }
}

/* ============================================================
   tmAlert / tmConfirm / tmToast  (modal system custom)
   ============================================================ */
.tm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: tm-fade-in 0.18s ease;
}
.tm-modal-overlay.tm-closing { animation: tm-fade-out 0.15s ease forwards; }
@keyframes tm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tm-fade-out { from { opacity: 1; } to { opacity: 0; } }

.tm-modal-card {
    background: var(--surface, #141414);
    border: 1px solid var(--border, #262626);
    border-radius: var(--r, 16px);
    padding: 22px 22px 18px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: tm-pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tm-pop-in {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.tm-modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white, #fff);
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}
.tm-modal-body {
    font-size: 0.85rem;
    color: var(--text, #e5e5e5);
    line-height: 1.5;
    margin-bottom: 18px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.tm-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.tm-btn {
    min-width: 90px;
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: var(--r-sm, 10px);
    cursor: pointer;
    border: none;
    outline: none;
    transition: opacity 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.tm-btn:active { transform: scale(0.97); }
.tm-btn-primary {
    background: var(--primary-gradient, linear-gradient(135deg, #3b82f6, #2563eb));
    color: #fff;
}
.tm-btn-primary:hover { opacity: 0.92; }
.tm-btn-ghost {
    background: transparent;
    color: var(--muted, #9ca3af);
    border: 1px solid var(--border, #262626);
}
.tm-btn-ghost:hover { color: var(--white, #fff); border-color: var(--muted, #555); }

.tm-variant-danger .tm-btn-primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.tm-variant-success .tm-btn-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}
.tm-variant-warning .tm-modal-title { color: #fbbf24; }
.tm-variant-danger .tm-modal-title { color: #f87171; }
.tm-variant-success .tm-modal-title { color: #34d399; }

/* Toast ----------------------------- */
.tm-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-h, 64px) + var(--safe-b, 0px) + 20px);
    transform: translate(-50%, 20px);
    max-width: 85vw;
    padding: 12px 18px;
    background: rgba(20, 20, 20, 0.96);
    border: 1px solid var(--border, #262626);
    border-radius: var(--r-full, 999px);
    color: var(--white, #fff);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.22s, transform 0.22s;
    z-index: 10001;
    pointer-events: none;
}
.tm-toast-show { opacity: 1; transform: translate(-50%, 0); }
.tm-toast.tm-variant-success { border-color: rgba(34, 197, 94, 0.5); color: #86efac; }
.tm-toast.tm-variant-danger { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }

/* ============================================================
   Galeria de fotos de progresso (modal + compare before/after)
   ============================================================ */
.gallery-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    animation: tm-fade-in 0.18s ease;
}
.gallery-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    padding-top: calc(14px + var(--safe-t, 0px));
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    z-index: 2;
}
.gallery-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
    -webkit-tap-highlight-color: transparent;
}
.gallery-counter {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted, #999);
    text-align: center;
    flex: 1;
}
.gallery-compare {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 7px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: var(--r-full, 999px);
    cursor: pointer;
    min-width: 72px;
    -webkit-tap-highlight-color: transparent;
}
.gallery-compare.active {
    background: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
}
.gallery-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
    touch-action: pan-y;
}
.gallery-single {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 12px;
}
.gallery-img {
    flex: 1;
    width: 100%;
    max-width: 600px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: var(--r, 16px);
}
.gallery-img.compare {
    max-width: none;
}
.gallery-date {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.85;
    padding-bottom: 8px;
}
.gallery-compare-wrap {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 8px;
}
.gallery-compare-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    gap: 8px;
}
.gallery-compare-lbl {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--primary, #3b82f6);
    opacity: 0.9;
}
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    z-index: 3;
}
.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }
.gallery-arrow:hover { background: rgba(255, 255, 255, 0.15); }
.gallery-arrow:active { transform: translateY(-50%) scale(0.92); }

@media (max-width: 500px) {
    .gallery-arrow { width: 40px; height: 40px; font-size: 1.5rem; }
    .gallery-compare-wrap { flex-direction: column; gap: 12px; }
}

/* Thumb cursor */
.foto-thumb { cursor: pointer; transition: transform 0.15s; }
.foto-thumb:hover { transform: translateY(-2px); }
.foto-thumb:active { transform: scale(0.97); }
