@charset "UTF-8";
/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ========== CSS VARIABLES ========== */
:root {
    --primary: #7A5C10;
    --primary-light: #FFF3D0;
    --primary-dark: #5A4000;
    --primary-bg: #F0EBE0;
    --accent: #B07A15;
    --bg: #F2F0EC;
    --card-bg: #FFFFFF;
    --text-primary: #111111;
    --text-secondary: #333333;
    --text-muted: #666666;
    --border: #AAAAAA;
    --border-hover: #888888;
    --border-selected: #7A5C10;
    --selected-bg: #FFF8E8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.10);
    --shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: 0.2s ease;
    --max-width: 1060px;
    --carbs-accent: #8B6914;
    --protein-accent: #A03050;
    --fat-accent: #3070A0;

    /* Component-specific */
    --header-bg: linear-gradient(145deg, #2A2015 0%, #1E1810 50%, #151008 100%);
    --header-shadow: 0 4px 20px rgba(0,0,0,0.25);
    --tabs-bg: #E8E5E0;
    --tab-active-bg: var(--card-bg);
    --row-border: #CCCCCC;
    --row-hover: #F8F6F2;
    --carbs-header-bg: linear-gradient(135deg, #F0E0A8 0%, #E5D090 100%);
    --carbs-header-color: #4A3500;
    --protein-header-bg: linear-gradient(135deg, #F0C0D0 0%, #E8A8B8 100%);
    --protein-header-color: #4A1020;
    --extras-bg: linear-gradient(135deg, #D8ECD8 0%, #C8E0C0 100%);
    --extras-color: #1E4A18;
    --extras-border: #90C080;
    --supplement-bg: #F5F3EF;
    --supplement-hover: #EDEAE4;
    --disclaimer-bg: #F0EBD8;
    --disclaimer-border: #C8B870;
    --input-bg: #FAFAFA;
    --training-bg: #FAFAFA;
    --tooltip-bg: #E0DCD0;
    --tooltip-modal-bg: #FFFFFF;
    --macro-bar-bg: #E0DDD5;
    --scrollbar-color: #AAAAAA;
    --onboarding-bg: linear-gradient(145deg, #F2F0EC 0%, #EAE8E2 100%);
    --ob-result-bg: #F8F6F2;
    --ob-highlight-bg: #E0F0D8;
    --ob-highlight-border: #80C060;
    --footer-bg: #1E2430;
    --footer-color: #8A93A6;
    --footer-author: #B8C0D0;
    --footer-author-strong: #E2E8F0;
    --footer-copy: #5A6275;
    --footer-social-bg: rgba(255,255,255,0.08);
    --footer-social-hover: rgba(255,255,255,0.15);
    --footer-social-color: #8A93A6;
    --footer-social-hover-color: #E2E8F0;
    --bmr-bg: #FFF5F5;
    --bmr-border: #D0A0A0;
    --neat-bg: #FFF8E8;
    --neat-border: #D0B870;
    --tdee-bg: #EFF8EC;
    --tdee-border: #A0CC90;
    --balance-bg: #F8F6F2;
    --deficit-color: #1B5E20;
    --deficit-bg: #E8F5E9;
    --maintenance-color: #BF360C;
    --maintenance-bg: #FFF3E0;
    --surplus-color: #B71C1C;
    --surplus-bg: #FFEBEE;
    --back-btn-hover: #F0EDE8;
}

[data-theme="dark"] {
    --primary: #F0B840;
    --primary-light: #2D2A40;
    --primary-dark: #F5CC60;
    --primary-bg: #282440;
    --accent: #F0B840;
    --bg: #1B1F2E;
    --card-bg: #242838;
    --text-primary: #ECEEF4;
    --text-secondary: #A8B0C0;
    --text-muted: #6B7590;
    --border: #333850;
    --border-hover: #444A65;
    --border-selected: #F0B840;
    --selected-bg: #2A2845;
    --shadow-sm: 0 1px 3px rgba(10,12,30,0.3);
    --shadow: 0 2px 8px rgba(10,12,30,0.3), 0 1px 2px rgba(10,12,30,0.2);
    --shadow-md: 0 4px 12px rgba(10,12,30,0.35), 0 2px 4px rgba(10,12,30,0.2);
    --shadow-lg: 0 8px 24px rgba(10,12,30,0.4), 0 2px 8px rgba(10,12,30,0.2);
    --carbs-accent: #F0C040;
    --protein-accent: #F08AA8;
    --fat-accent: #80BCF0;

    --header-bg: linear-gradient(145deg, #10132A 0%, #141830 50%, #161B38 100%);
    --header-shadow: 0 4px 20px rgba(10,12,30,0.5);
    --tabs-bg: #1E2232;
    --tab-active-bg: var(--card-bg);
    --row-border: #2E3348;
    --row-hover: #2A2F42;
    --carbs-header-bg: linear-gradient(135deg, #2A2830 0%, #322E38 100%);
    --carbs-header-color: #F0C040;
    --protein-header-bg: linear-gradient(135deg, #2E2238 0%, #352440 100%);
    --protein-header-color: #F08AA8;
    --extras-bg: linear-gradient(135deg, #1E2A30 0%, #223035 100%);
    --extras-color: #7AD070;
    --extras-border: #2A3E45;
    --supplement-bg: #202436;
    --supplement-hover: #282C40;
    --disclaimer-bg: #282440;
    --disclaimer-border: #3A3550;
    --input-bg: #202436;
    --training-bg: #202436;
    --tooltip-bg: #2A2E42;
    --tooltip-modal-bg: #242838;
    --macro-bar-bg: #2E3348;
    --scrollbar-color: #404860;
    --onboarding-bg: linear-gradient(145deg, #1B1F2E 0%, #202436 100%);
    --ob-result-bg: #202436;
    --ob-highlight-bg: #1E2A35;
    --ob-highlight-border: #2A4050;
    --footer-bg: #161A28;
    --footer-color: #607088;
    --footer-author: #8895B0;
    --footer-author-strong: #B8C4D8;
    --footer-copy: #3A4560;
    --footer-social-bg: rgba(180,200,255,0.06);
    --footer-social-hover: rgba(180,200,255,0.12);
    --footer-social-color: #607088;
    --footer-social-hover-color: #B8C4D8;
    --bmr-bg: #2A2238;
    --bmr-border: #3A3048;
    --neat-bg: #282840;
    --neat-border: #383850;
    --tdee-bg: #1E2A38;
    --tdee-border: #2A3C4A;
    --balance-bg: #202436;
    --deficit-color: #66CC7A;
    --deficit-bg: #1E2E30;
    --maintenance-color: #FFC060;
    --maintenance-bg: #2A2835;
    --surplus-color: #F06060;
    --surplus-bg: #2E2235;
    --back-btn-hover: #2A2F42;
}

/* ========== HEADER ========== */
.header {
    background: var(--header-bg);
    color: white;
    padding: 6px 16px 4px;
    z-index: 100;
    box-shadow: var(--header-shadow);
    border-bottom: 2px solid var(--accent);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/cabecera.png') center/cover no-repeat;
    opacity: 0.10;
    filter: blur(2px);
    pointer-events: none;
}

[data-theme="dark"] .header::before {
    opacity: 0.08;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.header-row h1 {
    flex: 1;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
    opacity: 0.95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.header-row h1 .user-name {
    font-style: italic;
    font-weight: 800;
}

.header-kcal {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 2px 0 0;
}

.kcal-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: gap 0.3s ease;
}

.kcal-fixed {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 2px;
}

.kcal-inline {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.85;
    letter-spacing: -0.01em;
}

.kcal-inline #kcal-display {
    font-weight: 800;
    font-size: 1.05rem;
}

.kcal-selector label {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.3s ease;
    max-height: 20px;
    overflow: hidden;
}

.kcal-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kcal-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
    backdrop-filter: blur(4px);
}

.kcal-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.7);
    transform: scale(1.05);
}

.kcal-btn:active {
    transform: scale(0.93);
}

.kcal-value {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.kcal-number {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    min-width: 95px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: font-size 0.3s ease;
}

.kcal-unit {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.75;
}

/* Range slider */
.kcal-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 340px;
    margin-top: 4px;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    max-height: 50px;
    overflow: hidden;
}

.kcal-range-label {
    font-size: 0.65rem;
    opacity: 0.5;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.kcal-slider-track {
    position: relative;
    flex: 1;
}

#kcal-range {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    outline: none;
}

.kcal-rec-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 16px;
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
    pointer-events: none;
    transition: left 0.3s ease;
}

.kcal-rec-label {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 2px;
    font-weight: 500;
    transition: all 0.3s ease;
    max-height: 20px;
    overflow: hidden;
}

#kcal-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.1s ease;
}

#kcal-range::-webkit-slider-thumb:active {
    transform: scale(1.18);
}

#kcal-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ========== MAIN ========== */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 16px 16px;
}

/* ========== MAIN TABS NAV ========== */
.main-tabs-nav {
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 12px 0 0;
    margin-bottom: 16px;
    background: var(--bg);
    transition: top 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.main-tabs {
    display: flex;
    background: var(--tabs-bg);
    padding: 4px;
    gap: 3px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.main-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
    border-radius: var(--radius-xs);
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.main-tab:hover {
    color: var(--text-secondary);
    background: rgba(200,148,26,0.06);
}

.main-tab.active {
    color: var(--primary-dark);
    background: var(--tab-active-bg);
    box-shadow: var(--shadow);
}

.tab-icon {
    font-size: 1.05rem;
}

.tab-label {
    font-size: 0.82rem;
}

/* ========== TAB PANELS ========== */
.tab-panel {
    display: none;
    animation: tabFadeIn 0.25s ease;
}

.tab-panel.active {
    display: block;
}

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

/* ========== HOW IT WORKS ========== */
.how-it-works {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.how-it-works-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.how-it-works-header:hover {
    background: var(--row-hover);
}

.how-icon {
    font-size: 0.95rem;
}

.how-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.how-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.how-it-works.collapsed .how-chevron {
    transform: rotate(-90deg);
}

.how-it-works-body {
    padding: 0 14px 12px;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s;
    max-height: 260px;
    opacity: 1;
    overflow: hidden;
}

.how-it-works.collapsed .how-it-works-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Body timeline needs more room (variable item count per goal) */
#body-timeline .how-it-works-body {
    max-height: none;
    overflow: visible;
    transition: padding 0.3s ease, opacity 0.3s ease;
}

#body-timeline.collapsed .how-it-works-body {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.how-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.how-steps li {
    counter-increment: step;
    position: relative;
    padding-left: 26px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.how-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.how-steps li strong {
    color: var(--text-primary);
}

.how-steps li em {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

/* Body timeline */
.body-timeline-list {
    display: grid;
    gap: 12px;
}

.bt-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.bt-period {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.bt-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.bt-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ========== INFO BANNER ========== */
.info-banner {
    margin-bottom: 16px;
}



.info-banner-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}



.info-banner-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.info-metric {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: var(--radius-xs);
    background: var(--bg);
    border: 1px solid var(--border);
}

.info-metric-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.info-metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.info-metric-sub {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.info-metric-highlight {
    border-color: var(--accent);
    background: rgba(212, 160, 23, 0.06);
    position: relative;
}

.info-metric-highlight .info-metric-value {
    color: var(--accent);
}

.info-metric-why {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.info-metric-why:hover {
    opacity: 1;
    transform: scale(1.15);
}

.tooltip-refs {
    margin-top: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.info-metric-arrow {
    font-size: 1.2rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.info-diff {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
}

.info-diff-pct {
    font-weight: 500;
    opacity: 0.8;
}

.info-diff.deficit {
    color: #e8a735;
    background: rgba(232, 167, 53, 0.1);
}

.info-diff.surplus {
    color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.info-diff.maintain {
    color: var(--text-secondary);
    background: rgba(128, 128, 128, 0.08);
}

.info-banner-explain {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    padding: 0 4px;
}

.info-whatis-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
    align-self: center;
    font-weight: 600;
}

.info-whatis-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(212, 160, 23, 0.05);
}

/* Goal Picker in tooltip */


/* ========== CALC PANEL ========== */
.calc-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.calc-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 16px 20px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-panel-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 4px 20px 0;
    font-weight: 400;
}

/* ========== MEAL CARD ========== */
.meal-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* ========== MEAL SECTIONS (supplements) ========== */
.meal-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.section-header {
    padding: 16px 20px;
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
    -webkit-user-select: none;
    user-select: none;
}

.section-header:hover {
    background: var(--primary-bg);
}

.section-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-icon {
    font-size: 1.2rem;
}

.toggle-icon {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.section-body.open {
    max-height: 3000px;
}

.section-header:has(+ .section-body:not(.open)) .toggle-icon {
    transform: rotate(-90deg);
}

/* ========== EXTRAS BANNER ========== */
.extras-banner {
    background: var(--extras-bg);
    padding: 10px 20px;
    font-size: 0.82rem;
    color: var(--extras-color);
    font-weight: 600;
    border-bottom: 1px solid var(--extras-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.extras-banner::before {
    display: none;
}

/* ========== TAB SUBTITLE ========== */
.tab-subtitle {
    padding: 14px 20px 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== BREAKFAST GRID ========== */
.breakfast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    padding: 12px 16px 16px;
}

.breakfast-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    background: var(--card-bg);
}

.breakfast-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.breakfast-card.selected {
    border-color: var(--border-selected);
    background: var(--selected-bg);
    box-shadow: 0 0 0 1px var(--border-selected);
}

.breakfast-card.selected::after {
    content: '\2713';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.breakfast-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    padding-right: 28px;
    line-height: 1.3;
}

.breakfast-card-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.breakfast-card-items li {
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding-left: 14px;
    position: relative;
    line-height: 1.4;
}

.breakfast-card-items li::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 7px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.breakfast-card-items li.alt-item {
    padding-left: 24px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.breakfast-card-items li.alt-item::before {
    content: '\21B3';
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    left: 12px;
    top: 0;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.amount {
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== MEAL TABLES ========== */
.meal-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
}

.meal-table-wrapper {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg);
}

.meal-table-wrapper:last-child {
    border-right: none;
}

.meal-table-header {
    padding: 10px 16px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.meal-table-header.carbs {
    background: var(--carbs-header-bg);
    color: var(--carbs-header-color);
}

.meal-table-header.protein {
    background: var(--protein-header-bg);
    color: var(--protein-header-color);
}

.meal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.meal-table thead {
    display: none;
}

.meal-table tbody tr {
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 1px solid var(--row-border);
    position: relative;
}

.meal-table tbody tr:last-child {
    border-bottom: none;
}

.meal-table tbody tr:hover {
    background: var(--row-hover);
}

.meal-table tbody tr.selected {
    background: var(--selected-bg);
}

.meal-table td {
    padding: 11px 14px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

.meal-table td:first-child {
    font-weight: 500;
}

.meal-table td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

/* Selection indicator */
.meal-table tbody tr td:first-child {
    padding-left: 36px;
    position: relative;
}

.meal-table tbody tr td:first-child::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.meal-table tbody tr.selected td:first-child::before {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 3px var(--card-bg);
}

.meal-table tbody tr.selected td:first-child {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Sub-rows */
.meal-table .sub-row td {
    padding-top: 0;
    padding-bottom: 11px;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-style: italic;
    border-bottom: 1px solid var(--row-border);
}

.meal-table .sub-row td:first-child {
    padding-left: 48px;
}

.meal-table .sub-row td:first-child::before {
    content: '\21B3';
    position: absolute;
    left: 38px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-style: italic;
}

.meal-table .sub-row.selected td:first-child::before {
    border: none;
    background: none;
    box-shadow: none;
    color: var(--primary-dark);
}

/* Note row */
.meal-table .note-row td {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 14px;
    cursor: default;
    text-align: center;
}

.meal-table .note-row td::before {
    display: none;
}

.meal-table .note-row:hover {
    background: transparent;
}

/* Food state tags (seco/cocido/crudo) */
.food-tag {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.4;
}

.food-tag-seco {
    color: #c49a2a;
    background: rgba(196, 154, 42, 0.12);
    border: 1px solid rgba(196, 154, 42, 0.25);
}

.food-tag-cocido {
    color: #5ba85b;
    background: rgba(91, 168, 91, 0.12);
    border: 1px solid rgba(91, 168, 91, 0.25);
}

.food-tag-crudo {
    color: #b07040;
    background: rgba(176, 112, 64, 0.12);
    border: 1px solid rgba(176, 112, 64, 0.25);
}

.dinner-rec-badge {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-size: 0.6rem;
}

.dinner-rec-row {
    background: rgba(245, 158, 11, 0.06) !important;
}

.dinner-rec-row td {
    color: var(--text-primary);
}

.meal-table tbody tr.dinner-rec-row:hover {
    background: rgba(245, 158, 11, 0.12) !important;
}

/* ========== NUTRITION SUMMARY ========== */
.nutrition-summary {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 16px 0;
    overflow: hidden;
    animation: tabFadeIn 0.3s ease;
}

.nutrition-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 6px;
}

.nutrition-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 4px;
}

.nutrition-info-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--text-muted);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: auto;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.nutrition-info-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Macro tooltip styles */
.macro-tip-heading {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 20px 0 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    letter-spacing: 0.01em;
}

.macro-tip-rec {
    font-size: 1.3rem;
    color: var(--accent);
    margin: 4px 0 10px;
    line-height: 1.3;
}

.macro-tip-source {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 16px;
    margin-bottom: 4px;
}

.macro-tip-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.macro-tip-links li {
    padding: 4px 0;
    font-size: 0.73rem;
}

.macro-tip-links a {
    color: var(--accent);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.macro-tip-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.macro-tip-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.85rem;
}

.macro-tip-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}

.macro-tip-table tr:last-child td {
    border-bottom: none;
}

.macro-tip-dot {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nutrition-meals {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nutrition-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nutrition-kcal-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.nutrition-kcal-number {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.nutrition-kcal-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Stacked horizontal bar */
.nutrition-stacked-bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--macro-bar-bg);
    gap: 2px;
}

.stacked-seg {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

.stacked-protein { background: var(--protein-accent); border-radius: 6px 0 0 6px; }
.stacked-carbs { background: var(--carbs-accent); }
.stacked-fat { background: var(--fat-accent); border-radius: 0 6px 6px 0; }

/* Macro cards grid */
.nutrition-macro-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.macro-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px 12px;
    border-radius: var(--radius-xs);
    background: var(--bg);
    border: 1px solid var(--border);
}

/* Ring using conic-gradient */
.macro-card-ring {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: conic-gradient(
        var(--ring-color) calc(var(--ring-pct) * 3.6deg),
        var(--macro-bar-bg) calc(var(--ring-pct) * 3.6deg)
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.macro-card-ring::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--bg);
}

.macro-card-ring-value {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.macro-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.macro-card-grams {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.macro-card-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.macro-card-perkg {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}

/* Color accents on card borders */
.macro-card-protein { border-bottom: 3px solid var(--protein-accent); }
.macro-card-carbs { border-bottom: 3px solid var(--carbs-accent); }
.macro-card-fat { border-bottom: 3px solid var(--fat-accent); }

/* Clickable macro cards */
.macro-card[data-macro] {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.macro-card[data-macro]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.macro-card[data-macro]:active {
    transform: translateY(0);
}

.macro-tap-hint {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.75;
    letter-spacing: 0.01em;
}

.nutrition-ring {
    display: none;
}

.nutrition-macros {
    display: none;
}

/* Legacy macro styles (kept for compatibility) */
.macro-bar-group { display: none; }

.protein-dot { background: var(--protein-accent); }
.carbs-dot { background: var(--carbs-accent); }
.fat-dot { background: var(--fat-accent); }

/* ========== SUPPLEMENTS ========== */
.supplements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    padding: 14px 16px 16px;
}

.supplement-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--supplement-bg);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    transition: background var(--transition);
}

.supplement-card:hover {
    background: var(--supplement-hover);
}

.supplement-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.supplement-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.supplement-text strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.8rem;
    margin-bottom: 1px;
}

.supp-note {
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 10px 14px;
    margin-top: 8px;
    background: rgba(240, 184, 64, 0.06);
    border-radius: var(--radius-xs);
    border: 1px dashed var(--border);
    line-height: 1.45;
}

/* ========== DIET SUMMARY ========== */
.diet-summary-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    animation: fadeSlideIn 0.4s ease;
}

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

.diet-summary-card > h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
    color: var(--accent);
}

.summary-meal {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px 14px 10px;
    margin-bottom: 12px;
    border-left: 3px solid var(--accent);
}

.summary-meal:last-child {
    margin-bottom: 0;
}

.summary-meal-header {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-meal-kcal {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    opacity: 0.9;
}

.summary-meal-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
}

.summary-meal-items {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
}

.summary-meal-items li {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 2px 0 2px 16px;
    position: relative;
}

.summary-meal-items li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: var(--accent);
}

.summary-meal-items li strong {
    color: var(--text);
}

.summary-extra {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.summary-supps {
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-supp {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 3px 8px;
    background: rgba(240, 184, 64, 0.08);
    border-radius: 6px;
    display: inline-block;
}

.summary-meal-sleep {
    border-left-color: #7C6CDB;
    background: rgba(124, 108, 219, 0.06);
}

.summary-meal-sleep .summary-supps {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* ========== EXPORT BUTTON ========== */
/* ========== RANDOM DIET BUTTON ========== */
.random-diet-section {
    text-align: center;
    margin: 8px 0 4px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
}

.diet-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.random-diet-btn[data-info]::after {
    content: attr(data-info);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    white-space: normal;
    width: max-content;
    max-width: 220px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
    display: none;
}

.btn-info-floating {
    position: fixed;
    transform: translateX(-50%) scale(0.95);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    white-space: normal;
    width: max-content;
    max-width: 220px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
}

.btn-info-floating.visible {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.random-diet-btn[data-info]:hover::after {
    display: none;
}

.random-diet-btn[data-info].show-info::after {
    display: none;
}

/* Mobile info button (visible only on touch devices) */
.info-btn-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all var(--transition);
    flex-shrink: 0;
}

.info-btn-mobile:active {
    transform: scale(0.9);
    background: var(--primary-light);
}

@media (hover: none) and (pointer: coarse) {
    .info-btn-mobile {
        display: flex;
    }
    .random-diet-btn[data-info]:hover::after {
        display: none;
    }
}

.random-diet-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.random-diet-btn:hover {
    background: var(--accent);
    color: #1A1510;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(240, 184, 64, 0.25);
}

.random-diet-btn:active {
    transform: translateY(0);
}

.random-diet-btn.animating {
    animation: randomSpin 0.5s ease;
}

@keyframes randomSpin {
    0% { transform: scale(1); }
    30% { transform: scale(0.92); }
    60% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.export-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent), #D4920A);
    color: #1A1510;
    font-size: 0.92rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(240, 184, 64, 0.25);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 184, 64, 0.35);
}

.export-btn:active {
    transform: translateY(0);
}

.export-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.share-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: #25D366;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
    flex-shrink: 0;
}

.share-whatsapp-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.share-whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.share-whatsapp-btn:active {
    transform: translateY(0);
}

.share-whatsapp-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

/* ========== EXPORT MODAL ========== */
.export-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tabFadeIn 0.2s ease;
}

.export-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px 20px;
    width: 90%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.export-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.export-modal-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.export-modal-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.export-option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--primary-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.export-option-btn:hover {
    border-color: var(--accent);
    background: rgba(240,184,64,0.08);
}

.export-option-btn:active {
    transform: scale(0.98);
}

.export-modal-cancel {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 8px 16px;
    font-family: inherit;
}

.export-modal-cancel:hover {
    color: var(--text-primary);
}

/* ========== DISCLAIMER ========== */
.disclaimer {
    padding: 0;
    background: var(--disclaimer-bg);
    border: 1px solid var(--disclaimer-border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.disclaimer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    cursor: pointer;
    user-select: none;
}

.disclaimer-header:hover {
    background: rgba(0,0,0,0.03);
}

.disclaimer-header strong {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.disclaimer-toggle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.disclaimer-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.disclaimer-body {
    padding: 0 16px 16px;
    transition: max-height 0.3s ease;
}

.disclaimer-body.collapsed {
    display: none;
}

.disclaimer-block {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--disclaimer-border);
}

.disclaimer-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.disclaimer-block h4 {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.disclaimer-block p {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 6px;
}

.disclaimer-block em {
    font-size: 0.68rem;
    color: var(--text-muted, var(--text-secondary));
    opacity: 0.8;
}

.disclaimer-refs {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}

.disclaimer-refs li {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 3px 0 3px 14px;
    position: relative;
}

.disclaimer-refs li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.disclaimer-refs li em {
    font-size: 0.66rem;
}

.disclaimer a,
.disclaimer-block a,
.ob-tip-text a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.disclaimer a:hover,
.disclaimer-block a:hover,
.ob-tip-text a:hover {
    text-decoration-style: solid;
}

.disclaimer-warning {
    background: rgba(255, 152, 0, 0.06);
    border-radius: var(--radius-sm);
    padding: 10px 12px !important;
    border: 1px solid rgba(255, 152, 0, 0.15) !important;
    border-bottom: 1px solid rgba(255, 152, 0, 0.15) !important;
}

.disclaimer p {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.disclaimer strong {
    color: var(--text-primary);
}

.disclaimer .disclaimer-highlight {
    color: var(--accent);
    font-size: 0.85rem;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--footer-bg);
    color: var(--footer-color);
    padding: 32px 16px 28px;
    margin-top: 8px;
    position: relative;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.footer-author {
    font-size: 0.88rem;
    color: var(--footer-author);
    letter-spacing: -0.01em;
}

.footer-author strong {
    color: var(--footer-author-strong);
    font-weight: 700;
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--footer-social-bg);
    color: var(--footer-social-color);
    transition: all 0.25s ease;
}

.footer-social-link svg {
    width: 18px;
    height: 18px;
}

.footer-social-link:hover {
    background: var(--footer-social-hover);
    color: var(--footer-social-hover-color);
    transform: translateY(-2px);
}

.footer-copy {
    font-size: 0.72rem;
    color: var(--footer-copy);
}

.footer-visits {
    margin-top: 2px;
}

.footer-visits img {
    height: 20px;
    opacity: 0.6;
    transition: opacity 0.25s ease;
}

.footer-visits img:hover {
    opacity: 1;
}

/* Footer about button */
.footer-about-btn {
    display: inline-block;
    margin: 8px 0;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition);
}

.footer-about-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

/* About modal */
.about-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.about-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.about-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
}

.about-modal-header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

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

.about-close:hover {
    color: var(--text-primary);
}

.about-modal-body {
    padding: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.about-modal-body h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 18px 0 8px;
}

.about-modal-body h3:first-child {
    margin-top: 0;
}

.about-modal-body p {
    margin: 0 0 10px;
}

.about-modal-body ul {
    padding-left: 20px;
    margin: 6px 0 12px;
}

.about-modal-body li {
    margin-bottom: 4px;
}

.about-modal-body code {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.about-modal-body a {
    color: var(--accent);
    text-decoration: none;
}

.about-modal-body a:hover {
    text-decoration: underline;
}

/* ========== CALCULATOR ========== */
.calc-container {
    padding: 16px 20px 20px;
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calc-row {
    display: flex;
    gap: 12px;
}

.calc-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calc-field.full-width {
    flex: 1 1 100%;
}

.calc-field label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.calc-field select,
.calc-field input {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.86rem;
    color: var(--text-primary);
    background: var(--input-bg);
    outline: none;
    transition: all var(--transition);
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    width: 100%;
}

.calc-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.calc-field select:focus,
.calc-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200,148,26,0.1);
}

/* Validation error highlight */
.calc-field select.field-error,
.calc-field input.field-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.15);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.calc-field input::placeholder {
    color: var(--text-muted);
}

.label-optional {
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.bf-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bf-input-wrapper input {
    flex: 1;
}

.bf-unit {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Silhouette grid for body fat estimation */
.silhouette-hint {
    margin-bottom: 8px;
}

.silhouette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.silhouette-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px 8px;
    border-radius: var(--radius-xs);
    border: 2px solid var(--border);
    background: var(--primary-bg);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
    text-align: center;
}

.silhouette-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.silhouette-card.selected {
    border-color: var(--accent);
    background: var(--accent-bg, rgba(212, 160, 23, 0.08));
    box-shadow: 0 0 0 2px var(--accent-shadow, rgba(212, 160, 23, 0.15));
}

.silhouette-card.suggested {
    border-style: dashed;
}

.silhouette-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 4px;
}

.silhouette-bar {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin-bottom: 4px;
    overflow: hidden;
}

.silhouette-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.2s;
}

.silhouette-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.silhouette-pct {
    font-size: 0.58rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.pref-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.pref-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    font-size: 0.82rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    font-family: inherit;
}

.pref-chip:hover {
    border-color: var(--border-hover);
    background: var(--row-hover);
}

.pref-chip.active {
    border-color: var(--accent);
    background: rgba(212, 160, 23, 0.12);
    color: var(--text-primary);
    font-weight: 600;
}

.pref-chip-all {
    font-style: italic;
}

.calc-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--accent);
    margin-top: 4px;
    line-height: 1.4;
    min-height: 1em;
}

.calc-hint.age-warning {
    color: #c0392b;
    font-size: 0.7rem;
    padding: 8px 10px;
    background: rgba(192, 57, 43, 0.06);
    border-radius: 6px;
    border-left: 3px solid #c0392b;
    margin-top: 8px;
}

.calc-hint.age-elder {
    color: #1e8449;
    font-size: 0.7rem;
    padding: 8px 10px;
    background: rgba(30, 132, 73, 0.06);
    border-radius: 6px;
    border-left: 3px solid #1e8449;
    margin-top: 8px;
}

.calc-hint.steps-joke {
    color: #7c3aed;
    font-size: 0.72rem;
    padding: 8px 10px;
    background: rgba(124, 58, 237, 0.08);
    border-radius: 6px;
    border-left: 3px solid #7c3aed;
    margin-top: 8px;
}

[data-theme="dark"] .calc-hint.steps-joke {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.12);
    border-left-color: #a78bfa;
}

.steps-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.steps-input-wrapper input[type="number"] {
    flex: 1;
}

.steps-unknown-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.steps-unknown-label input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.calc-training-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: var(--training-bg);
    border-radius: var(--radius-sm);
    border: 1.5px dashed var(--border);
}

.calc-training-details.hidden {
    display: none;
}

/* Tooltip trigger */
.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--tooltip-bg);
    color: var(--primary-dark);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    line-height: 1;
}

.tooltip-trigger:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Tooltip overlay */
.tooltip-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.tooltip-modal {
    background: var(--tooltip-modal-bg);
    border-radius: var(--radius);
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

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

.tooltip-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #B8860B 0%, #8A6500 100%);
    color: white;
    font-weight: 700;
    font-size: 0.92rem;
}

.tooltip-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background var(--transition);
}

.tooltip-close:hover {
    background: rgba(255,255,255,0.3);
}

.tooltip-modal-body {
    padding: 16px 18px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-height: 65vh;
    overflow-y: auto;
}

.tooltip-modal-body strong {
    color: var(--text-primary);
}

.tooltip-modal-body code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    color: var(--primary-dark);
}

.tooltip-modal-body ul {
    margin: 8px 0;
    padding-left: 18px;
}

.tooltip-modal-body ul li {
    margin-bottom: 4px;
}

.tooltip-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tooltip-list li {
    position: relative;
    padding: 10px 12px 10px 22px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent);
    background: rgba(212, 160, 23, 0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    line-height: 1.5;
}

.tooltip-list li:last-child {
    margin-bottom: 0;
}

/* Tooltip TDEE breakdown */
.tooltip-breakdown {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 10px 0;
    display: grid;
    gap: 6px;
}

.tooltip-bk-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 3px 0;
}

.tooltip-bk-row strong {
    color: var(--text-primary);
}

.tooltip-bk-row.tooltip-bk-total {
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 2px;
    color: var(--accent);
    font-weight: 600;
}

.tooltip-bk-row.tooltip-bk-total strong {
    color: var(--accent);
}

/* ========== SITE GATE (under construction) ========== */
body.site-gate-active {
    overflow: hidden;
}

.site-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary, #0f0f14);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.site-gate.site-gate-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-gate-card {
    position: relative;
    max-width: 400px;
    width: 100%;
    text-align: center;
    padding: 36px 28px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.site-gate-admin-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    opacity: 0.18;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.site-gate-admin-btn::after {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    margin: 18px auto 0;
    border-radius: 50%;
    background: var(--text-muted);
    pointer-events: none;
}

.site-gate-admin-btn:hover,
.site-gate-admin-btn:focus-visible {
    opacity: 0.45;
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.site-gate-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 16px;
    user-select: none;
    -webkit-user-select: none;
}

.site-gate-title {
    font-size: 1.45rem;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.site-gate-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
}

.site-gate-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

.site-gate-pin-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.site-gate-pin-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    text-align: center;
}

.site-gate-pin-input:focus {
    outline: none;
    border-color: var(--accent);
}

.site-gate-pin-error {
    min-height: 1.2em;
    margin: 10px 0 0;
    font-size: 0.78rem;
    color: #e57373;
}

.site-gate-pin-shake {
    animation: siteGateShake 0.45s ease;
}

@keyframes siteGateShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.app-modal-btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.app-modal-btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
}

/* App Modal (replaces browser alerts) */
.app-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 16px;
    backdrop-filter: blur(3px);
}

/* Site gate PIN — must override .app-modal-overlay z-index/display */
.app-modal-overlay.site-gate-pin-overlay {
    z-index: 100000 !important;
    display: none !important;
}

.app-modal-overlay.site-gate-pin-overlay.is-open {
    display: flex !important;
}

.app-modal-overlay.site-gate-pin-overlay[hidden] {
    display: none !important;
}

.app-modal {
    background: var(--tooltip-modal-bg);
    border-radius: var(--radius);
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

.app-modal-body {
    padding: 22px 20px 16px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

.app-modal-body strong {
    color: var(--text-primary);
}

.app-modal-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px 18px;
    justify-content: flex-end;
}

.app-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.app-modal-btn-primary {
    background: var(--accent);
    color: #1a1a2e;
}

.app-modal-btn-primary:hover {
    background: var(--accent-hover);
}

.welcome-modal {
    max-width: 520px;
}

.welcome-modal .how-steps {
    line-height: 1.8;
}

.welcome-modal .how-steps li {
    margin-bottom: 6px;
}

.app-modal-btn-secondary {
    background: var(--border);
    color: var(--text-primary);
}

.app-modal-btn-secondary:hover {
    background: var(--text-muted);
    color: white;
}

/* Calculator results */
.calc-results {
    margin-top: 20px;
    animation: tabFadeIn 0.3s ease;
}

.calc-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.calc-result-card {
    text-align: center;
    padding: 14px 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid;
}

.bmr-card {
    background: var(--bmr-bg);
    border-color: var(--bmr-border);
}

.neat-card {
    background: var(--neat-bg);
    border-color: var(--neat-border);
}

.tdee-card {
    background: var(--tdee-bg);
    border-color: var(--tdee-border);
}

.calc-result-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.calc-result-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.calc-result-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Balance bar */
.calc-balance {
    background: var(--balance-bg);
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--border);
}

.balance-bar-container {
    margin-bottom: 10px;
}

.balance-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.balance-bar {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #4CAF50 0%, #81C784 30%, #FFC107 45%, #FFC107 55%, #EF5350 70%, #F44336 100%);
    position: relative;
    overflow: visible;
}

.balance-bar-fill {
    display: none;
}

.balance-bar-marker {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.balance-verdict {
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    margin-top: 2px;
}

.balance-verdict.deficit {
    color: var(--deficit-color);
    background: var(--deficit-bg);
}

.balance-verdict.maintenance {
    color: var(--maintenance-color);
    background: var(--maintenance-bg);
}

.balance-verdict.surplus {
    color: var(--surplus-color);
    background: var(--surplus-bg);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
    .header {
        padding: 6px 10px 4px;
        text-align: center;
    }

    .header-row {
        gap: 6px;
    }

    .header-row .btn-label {
        display: none;
    }

    .header-row .trainer-toggle,
    .header-row .reconfigure-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        padding: 0;
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .header-row .theme-toggle {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .header-row h1 {
        font-size: 0.95rem;
        white-space: normal;
        line-height: 1.2;
    }

    .header-kcal {
        padding: 1px 0 0;
    }

    .kcal-number {
        font-size: 2rem;
    }

    .main {
        padding: 16px 10px 12px;
    }

    .main-tabs-nav {
        padding: 10px 0 0;
        margin-bottom: 12px;
    }

    .main-tabs {
        padding: 3px;
        gap: 2px;
    }

    .main-tab {
        padding: 8px 4px;
        font-size: 0.78rem;
        gap: 6px;
    }

    .tab-icon {
        font-size: 0.95rem;
    }

    .tab-label {
        font-size: 0.72rem;
    }

    .meal-tables {
        grid-template-columns: 1fr;
    }

    .meal-table-wrapper {
        border-right: none;
    }

    .meal-table-wrapper:last-child {
        border-bottom: none;
    }

    .breakfast-grid {
        grid-template-columns: 1fr;
        padding: 10px 12px 14px;
    }

    .section-header {
        padding: 14px 16px;
    }

    .supplements-grid {
        grid-template-columns: 1fr;
        padding: 10px 12px 14px;
    }

    .info-banner {
        margin-bottom: 12px;
    }

    .info-banner-card {
        padding: 14px 12px;
        gap: 12px;
    }

    .info-banner-metrics {
        gap: 6px;
    }

    .info-metric {
        padding: 8px 6px;
    }

    .info-metric-value {
        font-size: 1.3rem;
    }

    .info-metric-label {
        font-size: 0.6rem;
    }

    .info-metric-sub {
        font-size: 0.58rem;
    }

    .info-banner-explain {
        font-size: 0.74rem;
    }

    .extras-banner {
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    .meal-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .meal-table tbody tr td:first-child {
        padding-left: 34px;
    }

    .meal-table tbody tr td:first-child::before {
        left: 10px;
        width: 15px;
        height: 15px;
    }

    .meal-table .sub-row td:first-child {
        padding-left: 44px;
    }

    .meal-table .sub-row td:first-child::before {
        left: 34px;
    }

    .calc-row {
        flex-direction: column;
        gap: 10px;
    }

    .calc-results-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .calc-result-value {
        font-size: 1.15rem;
    }

    .calc-result-label {
        font-size: 0.62rem;
    }

    .calc-result-sub {
        font-size: 0.62rem;
    }

    .calc-container {
        padding: 12px 14px 16px;
    }

    .tooltip-modal {
        max-width: 100%;
    }

    .tab-subtitle {
        padding: 10px 14px 4px;
        font-size: 0.78rem;
    }

    .nutrition-body {
        padding: 16px 12px;
        gap: 14px;
    }

    .nutrition-kcal-row {
        gap: 5px;
    }

    .nutrition-kcal-number {
        font-size: 2rem;
    }

    .macro-card {
        padding: 10px 6px;
        gap: 6px;
    }

    .macro-card-ring {
        width: 48px;
        height: 48px;
    }

    .macro-card-ring-value {
        font-size: 0.7rem;
    }

    .macro-card-grams {
        font-size: 0.88rem;
    }

    .footer-visits {
        margin-top: 2px;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .breakfast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 901px) {
    .breakfast-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.meal-section {
    animation: fadeIn 0.35s ease both;
}

.nutrition-summary {
    animation: fadeIn 0.35s ease both;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-color);
    border-radius: 3px;
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
    z-index: 10;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.trainer-toggle {
    height: 36px;
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 14px;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
    z-index: 10;
    line-height: 1;
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}

.theme-toggle:hover,
.trainer-toggle:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.08);
}

.theme-toggle:active,
.trainer-toggle:active {
    transform: scale(0.93);
}

/* Onboarding toggle */
.onboarding .theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    border-color: var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    box-shadow: var(--shadow);
    backdrop-filter: none;
}

.onboarding .theme-toggle:hover {
    background: var(--row-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* ========== ONBOARDING ========== */
.onboarding {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: var(--onboarding-bg);
}

.onboarding-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    max-width: 540px;
    width: 100%;
    padding: 32px 28px 24px;
    position: relative;
}

@media (min-width: 768px) {
    .onboarding-card {
        max-width: 860px;
        padding: 36px 36px 28px;
    }
}

.onboarding-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
}

.onboarding-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
    animation: tabFadeIn 0.25s ease;
}

.step-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.step-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

.onboarding-next, .onboarding-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.onboarding-next {
    background: linear-gradient(135deg, #B8860B, #8A6500);
    color: white;
    width: 100%;
    margin-top: 20px;
}

.onboarding-next:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.onboarding-next:active {
    transform: scale(0.98);
}

.onboarding-next.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.onboarding-next.cta {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    font-size: 1rem;
    padding: 14px 24px;
}

.onboarding-back {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    padding: 10px 18px;
    font-size: 0.84rem;
}

.onboarding-back:hover {
    background: var(--back-btn-hover);
    color: var(--text-secondary);
}

.step-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.step-buttons .onboarding-next {
    flex: 1;
    margin-top: 0;
}

.step-buttons .onboarding-back {
    flex-shrink: 0;
}

/* Path selector */
.path-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.path-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 16px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.path-card:hover {
    border-color: var(--border-hover);
    background: var(--row-hover);
}

.path-card.selected {
    border-color: var(--accent);
    background: rgba(212, 160, 23, 0.08);
    box-shadow: 0 0 0 2px var(--accent);
}

.path-icon {
    font-size: 1.5rem;
}

.path-card strong {
    font-size: 0.82rem;
    color: var(--text-primary);
}

.path-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

@media (max-width: 640px) {
    .path-selector {
        grid-template-columns: 1fr;
    }
}

/* Deadline fields */
.deadline-fields {
    margin-top: 14px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.deadline-summary {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.deadline-summary:empty {
    display: none;
}

.deadline-summary strong {
    color: var(--text-primary);
}

.deadline-warning {
    color: #e67e22;
    font-weight: 600;
}

/* Goal cards */
.goal-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.goal-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--card-bg);
    position: relative;
}

.goal-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.goal-card.selected {
    border-color: var(--primary);
    background: var(--selected-bg);
    box-shadow: 0 0 0 2px var(--primary);
    transform: translateY(-1px);
}

.goal-card.recommended {
    border-color: var(--accent);
    animation: rec-pulse 2s ease-in-out infinite;
}

@keyframes rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0); border-color: var(--accent); }
    50% { box-shadow: 0 0 12px 6px rgba(212, 160, 23, 0.25); border-color: var(--primary); }
}

.goal-card.recommended::before {
    content: '★ RECOMENDADO';
    position: absolute;
    top: -9px;
    left: 14px;
    background: var(--accent);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.goal-card.recommended.selected::before {
    background: var(--accent);
    color: #000;
    opacity: 1;
}

.goal-card.recommended.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
    animation: none;
}

.goal-recommendation {
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.5;
    text-align: center;
}

.goal-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.goal-card strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.goal-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Onboarding results */
.onboarding-results {
    margin-bottom: 4px;
}

.ob-result-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.ob-result-card {
    text-align: center;
    padding: 16px 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--ob-result-bg);
}

.ob-result-card.highlight {
    background: var(--ob-highlight-bg);
    border-color: var(--ob-highlight-border);
}

.ob-result-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ob-result-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.ob-result-sub {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* TDEE info button & popup */
.tdee-info-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0 2px;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.tdee-info-btn:hover {
    opacity: 1;
}

.ob-result-card {
    position: relative;
}

.tdee-info-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    text-align: left;
    animation: modalIn 0.15s ease;
}

.tdee-info-popup h4 {
    margin: 0 0 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.tdee-info-popup p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 10px;
}

.tdee-info-close {
    position: absolute;
    top: 8px;
    right: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1;
}

.tdee-breakdown {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.tdee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

.tdee-row strong {
    color: var(--text-primary);
    font-size: 0.78rem;
}

.tdee-row.tdee-total {
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 2px;
    color: var(--accent);
}

.tdee-row.tdee-total strong {
    color: var(--accent);
}

.tdee-info-note {
    font-size: 0.68rem !important;
    color: var(--text-muted) !important;
    font-style: italic;
    margin-bottom: 0 !important;
}

.ob-explanation {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 12px 14px;
    background: var(--primary-bg);
    border-radius: var(--radius-xs);
    border: 1px solid var(--disclaimer-border);
}

.ob-explanation em {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ob-explanation a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.ob-explanation a:hover {
    text-decoration-style: solid;
}

/* Onboarding tips */
.ob-tips {
    margin-top: 14px;
}

.ob-tips-heading {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

@media (min-width: 768px) {
    .ob-tips-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

.ob-tip-card {
    display: flex;
    gap: 10px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-xs);
    background: var(--ob-result-bg);
    border: 1px solid var(--border);
}

.ob-tip-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.ob-tip-content {
    flex: 1;
    min-width: 0;
}

.ob-tip-title {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.ob-tip-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.ob-tip-text em {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Progress dots */
.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: var(--accent);
}

.progress-dot.current {
    width: 24px;
    border-radius: 4px;
    background: var(--primary);
}

.dev-skip-btn {
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(212, 160, 23, 0.15);
    color: var(--accent);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 999;
    opacity: 0.4;
    transition: opacity 0.2s;
    line-height: 1;
}

.dev-skip-btn:hover {
    opacity: 1;
}

/* ========== KCAL WARNING ========== */
.kcal-warning {
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    animation: tabFadeIn 0.2s ease;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    max-height: 200px;
    overflow: hidden;
}

.kcal-warning.warn-danger {
    background: rgba(239,83,80,0.2);
    color: #FFCDD2;
    border: 1px solid rgba(239,83,80,0.4);
    padding: 12px 16px;
    font-size: 0.82rem;
}

.kcal-warning.warn-info {
    background: rgba(255,193,7,0.15);
    color: #FFE082;
}

.kcal-warning strong {
    font-weight: 700;
}

.kcal-warning-reset {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-xs);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.kcal-warning-reset:hover {
    background: rgba(255,255,255,0.25);
}

/* ========== RECONFIGURE BUTTON ========== */
.reconfigure-btn {
    height: 36px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 14px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
    z-index: 10;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.reconfigure-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.08);
}

.reconfigure-btn:active {
    transform: scale(0.93);
}

/* ========== TRAINER MODE (hidden) ========== */
.trainer-mode {
    padding: 20px 16px 60px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.trainer-header {
    text-align: center;
    margin-bottom: 24px;
}

.trainer-header h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 10px 0 6px;
}

.trainer-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.trainer-activity-panel {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trainer-workout-day-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    border-left: 3px solid var(--accent);
}

.trainer-planned-workout {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trainer-planned-workout.trainer-planned-done {
    border-color: rgba(76, 175, 80, 0.45);
    background: rgba(76, 175, 80, 0.08);
}

.trainer-planned-workout.trainer-planned-skipped {
    border-color: rgba(255, 152, 0, 0.35);
    background: rgba(255, 152, 0, 0.06);
    opacity: 0.85;
}

.trainer-planned-workout.trainer-planned-skipped .trainer-planned-name {
    text-decoration: line-through;
    opacity: 0.7;
}

.trainer-planned-workout.trainer-planned-rest {
    border-color: var(--border);
    opacity: 0.9;
}

.trainer-planned-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.trainer-planned-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.trainer-planned-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.trainer-workout-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.trainer-workout-status-btn {
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.trainer-workout-status-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(240,184,64,0.35);
}

.trainer-workout-status-btn.trainer-status-selected {
    border-color: var(--accent);
    background: rgba(240,184,64,0.12);
    color: var(--text-primary);
}

.trainer-workout-picker {
    margin-top: 4px;
}

.trainer-workout-picker.hidden {
    display: none;
}

.trainer-workout-picker-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.trainer-workout-day-note {
    margin: 10px 0 0;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
}

.trainer-activity-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.trainer-activity-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.trainer-activity-head h3 {
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
}

.trainer-activity-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.trainer-activity-profile {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.trainer-activity-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.trainer-activity-field label,
.trainer-activity-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.trainer-activity-hint {
    font-weight: 400;
    color: var(--text-muted);
}

.trainer-activity-field input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

.trainer-activity-gym {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.trainer-activity-gym input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.trainer-workout-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trainer-workout-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.trainer-workout-chip:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(240,184,64,0.35);
}

.trainer-workout-chip.trainer-workout-selected {
    border-color: var(--accent);
    background: rgba(240,184,64,0.1);
}

.trainer-workout-chip-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trainer-workout-chip-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.trainer-workout-rest.trainer-workout-selected {
    border-color: var(--border);
    background: rgba(255,255,255,0.05);
}

.trainer-tdee-sub {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 4px 0 8px 12px;
    margin-bottom: 4px;
    font-size: 0.68rem;
    color: var(--text-muted);
    border-left: 2px solid rgba(240,184,64,0.25);
}

.trainer-tdee-sub span:nth-child(even) {
    text-align: right;
    color: var(--text-secondary);
}

.trainer-tdee-breakdown {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.trainer-tdee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    padding: 5px 0;
    color: var(--text-secondary);
}

.trainer-tdee-row strong {
    color: var(--accent);
    font-weight: 700;
}

.trainer-tdee-row.trainer-tdee-muted strong {
    color: var(--text-muted);
    font-weight: 500;
}

.trainer-tdee-row.trainer-tdee-total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-weight: 600;
    color: var(--text-primary);
}

.trainer-tdee-row.trainer-tdee-target {
    margin-top: 4px;
    font-weight: 600;
    color: var(--text-primary);
}

.trainer-tdee-row.trainer-tdee-active {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-weight: 600;
    color: var(--text-primary);
}

.trainer-activity-note {
    margin: 10px 0 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

.trainer-tabs-nav {
    padding-top: 0;
}

.trainer-tab-panel {
    display: none;
    animation: tabFadeIn 0.25s ease;
}

.trainer-tab-panel.active {
    display: block;
}

.trainer-exit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.trainer-exit-btn:hover {
    background: rgba(255,255,255,0.14);
    color: var(--text-primary);
}

.trainer-section {
    margin-bottom: 24px;
}

.trainer-section h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.trainer-subsection {
    margin-bottom: 14px;
}

.trainer-subsection h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.trainer-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 10px;
}

.trainer-card-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.trainer-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trainer-card li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.trainer-card li:last-child {
    border-bottom: none;
}

.trainer-card li strong {
    color: var(--accent);
}

.trainer-extra {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.trainer-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.trainer-table td {
    padding: 9px 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.trainer-table td:last-child {
    text-align: right;
    color: var(--accent);
    font-weight: 600;
}

.trainer-table tr:last-child td {
    border-bottom: none;
}

.trainer-alt td {
    font-size: 0.76rem;
    color: var(--text-muted);
    padding-left: 28px;
}

.trainer-extras {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
}

.trainer-supps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trainer-supp {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.trainer-supp strong {
    color: var(--text-primary);
}

/* Trainer selections */
.trainer-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.trainer-card:hover {
    border-color: var(--accent);
    background: rgba(240,184,64,0.04);
}

.trainer-card-selected {
    border-color: var(--accent) !important;
    background: rgba(240,184,64,0.08) !important;
    box-shadow: 0 0 0 1px var(--accent);
}

.trainer-card-selected .trainer-card-title {
    color: var(--accent);
}

.trainer-table tr[data-trainer-meal] {
    cursor: pointer;
    transition: background 0.15s ease;
}

.trainer-table tr[data-trainer-meal]:hover {
    background: rgba(240,184,64,0.06);
}

.trainer-row-selected {
    background: rgba(240,184,64,0.1) !important;
}

.trainer-row-selected td {
    color: var(--text-primary) !important;
}

.trainer-row-selected td:last-child {
    color: var(--accent) !important;
}

.trainer-nutrition {
    margin-top: 24px;
    animation: tabFadeIn 0.25s ease;
}

.trainer-validator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 10px 16px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.78rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.trainer-validator.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.trainer-validator.complete {
    background: var(--ob-highlight-bg);
    border-top-color: var(--ob-highlight-border);
}

/* Trainer extra foods section */
.main-tabs-nav.tabs-hidden {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.trainer-extras-section {
    margin-top: 24px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.trainer-extras-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition), border-radius var(--transition);
    margin-bottom: 0;
    width: 100%;
}

.trainer-extras-section.extras-open .trainer-extras-toggle {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

.trainer-extras-toggle:hover {
    background: var(--row-hover);
}

.trainer-extras-toggle-icon {
    font-size: 1.05rem;
}

.trainer-extras-toggle-text {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trainer-extras-badge {
    background: var(--accent);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.trainer-extras-chevron {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.trainer-extras-section.extras-open .trainer-extras-chevron {
    transform: rotate(180deg);
}

.trainer-extras-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0;
    border: 1.5px solid transparent;
    border-top: none;
    border-left-width: 3px;
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.trainer-extras-body.open {
    max-height: 1200px;
    padding: 14px 14px 12px;
    border-color: var(--border);
    border-left-color: var(--accent);
    border-top: none;
    background: var(--card-bg);
    overflow-y: auto;
}

.trainer-extras-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.trainer-extra-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.trainer-extra-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    appearance: auto;
}

.trainer-extra-grams-row {
    display: flex;
    gap: 8px;
}

.trainer-extra-grams {
    flex: 1;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    min-width: 0;
}

.trainer-extra-add-btn {
    padding: 10px 18px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.trainer-extra-add-btn:hover {
    opacity: 0.85;
}

.trainer-extra-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.trainer-extra-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.trainer-extra-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 0;
    flex: 1;
    word-break: break-word;
}

.trainer-extra-item-info strong {
    color: var(--text-primary);
    word-break: break-word;
}

.trainer-extra-item-macros {
    font-size: 0.72rem;
    color: var(--text-muted);
    width: 100%;
    margin-top: 4px;
}

.trainer-extra-remove {
    background: none;
    border: 1.5px solid #e74c3c;
    color: #e74c3c;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.trainer-extra-remove:hover {
    background: #e74c3c;
    color: #fff;
}

/* Trainer macro targets */
.trainer-target-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.trainer-target-ok {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.trainer-target-low,
.trainer-target-high {
    background: rgba(243, 156, 18, 0.12);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.25);
}

.trainer-target-range {
    font-weight: 400;
    font-size: 0.72rem;
    opacity: 0.8;
}

.trainer-macro-targets {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.trainer-macro-targets h4 {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.trainer-macro-targets-sub {
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.trainer-macro-target-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.trainer-macro-target-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.tmti-bar-wrap {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.tmti-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.tmti-bar-protein { background: var(--protein-accent, #3498db); }
.tmti-bar-carbs { background: var(--carbs-accent, #f39c12); }
.tmti-bar-fat { background: var(--fat-accent, #e74c3c); }

.tmti-values {
    font-size: 0.78rem;
    color: var(--text-primary);
    font-weight: 600;
}

.tmti-target {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.tmti-remain {
    font-size: 0.7rem;
    font-weight: 600;
}

.tmti-remain.target-pending {
    color: #f39c12;
}

.tmti-remain.target-reached {
    color: #2ecc71;
}

.tmti-fix-btn {
    background: none;
    border: 1px solid #f39c12;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: 4px;
    padding: 0;
    vertical-align: middle;
    line-height: 1;
    transition: background 0.2s;
}

.tmti-fix-btn:hover {
    background: rgba(243, 156, 18, 0.15);
}

.macro-fix-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.macro-fix-section {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.macro-fix-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--card-bg, rgba(255,255,255,0.05));
    font-size: 0.82rem;
}

.macro-fix-selectable {
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.macro-fix-selectable:hover {
    background: rgba(243, 156, 18, 0.15);
    transform: scale(1.01);
}
.macro-fix-selectable:active {
    transform: scale(0.98);
}

.macro-fix-addable {
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.macro-fix-addable:hover {
    background: rgba(46, 204, 113, 0.15);
    transform: scale(1.01);
}
.macro-fix-addable:active {
    transform: scale(0.98);
}

.macro-fix-meal {
    font-weight: 600;
    color: var(--text-muted, #999);
    font-size: 0.72rem;
    text-transform: uppercase;
    width: 100%;
}

.macro-fix-swap {
    flex: 1;
}

.macro-fix-add {
    flex: 1;
}

.macro-fix-diff {
    font-weight: 700;
    color: #2ecc71;
    white-space: nowrap;
}

.macro-fix-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.macro-fix-kcal {
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
}

.macro-fix-kcal.neutral {
    color: #7f8c8d;
}

.macro-fix-kcal.high {
    color: #e74c3c;
}

.macro-fix-kcal.low {
    color: #2ecc71;
}

/* ========== RESPONSIVE ONBOARDING ========== */
@media (max-width: 640px) {
    /* Prevent iOS zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }

    .onboarding {
        padding: 16px 12px;
        align-items: flex-start;
        padding-top: 32px;
    }

    .onboarding-card {
        padding: 24px 18px 20px;
    }

    .onboarding-title {
        font-size: 1.3rem;
    }

    .ob-result-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .ob-result-value {
        font-size: 1.3rem;
    }

    .goal-card {
        padding: 14px 14px;
    }
}

/* ============================================================
   SELECTION VALIDATOR BAR
   ============================================================ */
.selection-validator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 10px 16px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.78rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.selection-validator.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.selection-validator.complete {
    background: var(--ob-highlight-bg);
    border-top-color: var(--ob-highlight-border);
}

.validator-items {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.validator-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.validator-item .vi-icon {
    font-size: 0.9rem;
}

.validator-item.done {
    color: var(--deficit-color);
}

.validator-item.done .vi-icon {
    color: var(--deficit-color);
}

.validator-item.missing .vi-icon {
    color: var(--surplus-color);
    opacity: 0.8;
}

.validator-complete {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--deficit-color);
}

.validator-complete .vc-kcal {
    font-size: 0.85rem;
    opacity: 0.85;
    font-weight: 400;
}

/* Space for the bar so it doesn't overlap content */
.app-container main {
    padding-bottom: 56px;
}

/* ============================================================
   SUPPLEMENTS NOTE
   ============================================================ */
.supplements-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--tooltip-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.supplements-note-icon {
    flex-shrink: 0;
    font-size: 1rem;
    margin-top: 1px;
}

.supplements-note p {
    margin: 0;
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.supplements-note strong {
    color: var(--text-primary);
}

/* ============================================================
   TAB TOAST
   ============================================================ */
.tab-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 1100;
    padding: 10px 20px;
    background: var(--surplus-bg);
    border: 1px solid var(--surplus-color);
    color: var(--surplus-color);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.tab-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tab-toast-success {
    background: var(--deficit-bg);
    border-color: var(--deficit-color);
    color: var(--deficit-color);
}

/* ============================================================
   NUTRITION MISSING
   ============================================================ */
.nutrition-missing {
    padding: 8px 14px;
    margin-bottom: 10px;
    background: var(--maintenance-bg);
    border: 1px solid var(--maintenance-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--maintenance-color);
    line-height: 1.4;
}

/* ============================================================
   SCIENCE TOOLTIP BUTTONS
   ============================================================ */
.supp-tooltip-btn,
.extras-tooltip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    padding: 0;
    line-height: 1;
    transition: all var(--transition);
    vertical-align: middle;
    flex-shrink: 0;
}

.supp-tooltip-btn:hover,
.extras-tooltip-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* ============================================================ */
/* TRAINER PLAN TARGET CARD + NEW ELEMENTS (2400 kcal update)   */
/* ============================================================ */

/* Plan Target Card */
.trainer-plan-target-card {
    background: linear-gradient(135deg, rgba(var(--accent-rgb,251,191,36), 0.08) 0%, rgba(var(--accent-rgb,251,191,36), 0.04) 100%);
    border: 1.5px solid rgba(var(--accent-rgb,251,191,36), 0.35);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}

.trainer-plan-target-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.trainer-plan-target-icon {
    font-size: 1.2rem;
}

.trainer-plan-target-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.trainer-plan-target-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.trainer-plan-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.trainer-plan-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--input-bg, rgba(255,255,255,0.06));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    transition: border-color 0.2s;
}

.trainer-plan-input-wrap:focus-within {
    border-color: var(--accent, #fbbf24);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb,251,191,36), 0.18);
}

.trainer-plan-input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    width: 100%;
    min-width: 0;
    font-family: inherit;
}

.trainer-plan-input-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
}

/* Macro preview below inputs */
.trainer-plan-macro-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.tpmp-item {
    font-size: 0.73rem;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 500;
}

.tpmp-protein {
    background: rgba(239,68,68, 0.12);
    color: #ef4444;
}

.tpmp-carbs {
    background: rgba(59,130,246, 0.12);
    color: #3b82f6;
}

.tpmp-fat {
    background: rgba(234,179,8, 0.12);
    color: #eab308;
}

/* Fruit Selector Chips */
.trainer-fruit-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.trainer-fruit-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
    white-space: nowrap;
}

.trainer-fruit-chip {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    font-family: inherit;
}

.trainer-fruit-chip:hover {
    border-color: var(--accent, #fbbf24);
    color: var(--text-primary);
    transform: scale(1.03);
}

.trainer-fruit-chip-sel {
    background: rgba(var(--accent-rgb,251,191,36), 0.18);
    border-color: var(--accent, #fbbf24);
    color: var(--text-primary);
    font-weight: 700;
}

/* Fixed banana in breakfast */
.trainer-fruit-fixed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(var(--accent-rgb,251,191,36), 0.08);
    border-radius: 6px;
    padding: 4px 8px;
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.trainer-fruit-fixed-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Dinner scaled amounts */
.dinner-scaled-g {
    color: var(--accent, #fbbf24);
    font-weight: 700;
}

.dinner-base-g {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.extras-banner-dinner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.dinner-kcal-hint {
    font-size: 0.72rem;
    color: var(--accent, #fbbf24);
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(var(--accent-rgb,251,191,36), 0.12);
    border-radius: 12px;
}

/* Macro range hint below macro targets heading */
.trainer-macro-range-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 2px 0 10px;
    font-style: italic;
}

/* Disabled fruit chip style */
.trainer-fruit-chip-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-style: dashed;
}
.trainer-fruit-chip-disabled:hover {
    border-color: var(--border);
    color: var(--text-secondary);
    transform: none;
}

/* Trainer adjustable meals selector */
.trainer-plan-adjust-selector {
    margin-top: 4px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.trainer-adjust-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.trainer-adjust-chips {
    display: flex;
    gap: 8px;
}
.trainer-adjust-chip {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 16px;
    border: 1.5px solid var(--border);
    background: rgba(255,255,255,0.02);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}
.trainer-adjust-chip:hover {
    border-color: var(--accent, #fbbf24);
    color: var(--text-primary);
}
.trainer-adjust-chip.active {
    background: rgba(var(--accent-rgb,251,191,36), 0.12);
    border-color: var(--accent, #fbbf24);
    color: var(--accent, #fbbf24);
}

/* Search results list hover styling */
.search-result-row:hover, .smc-result-row:hover {
    background: var(--bg-primary) !important;
    border-color: var(--gold-accent) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ========== SEARCH MODAL (redesign) ========== */
.search-modal-card {
    background: var(--card-bg);
    width: 92%;
    max-width: 460px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    height: 520px;
    max-height: 85vh;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    font-family: inherit;
    color: var(--text-primary);
    overflow: hidden;
}

.smc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}
.smc-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}
.smc-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.smc-close:hover { background: rgba(255,255,255,0.12); }

.smc-search-bar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    flex-shrink: 0;
}
.smc-search-bar input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}
.smc-search-bar input:focus { border-color: var(--accent); }

.smc-results {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    padding: 10px 14px 14px;
    flex: 1;
}

.smc-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.smc-cat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 10px;
    margin-bottom: 2px;
    padding-left: 4px;
}

.smc-result-row {
    width: 100%;
    text-align: left;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.12s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    font-family: inherit;
}
.smc-result-row:hover {
    background: rgba(var(--accent-rgb, 251,191,36), 0.08);
    border-color: rgba(var(--accent-rgb, 251,191,36), 0.4);
    transform: none;
    box-shadow: none;
}
.smc-result-name { font-weight: 600; font-size: 0.88rem; }
.smc-result-kcal { font-size: 0.78rem; color: var(--text-secondary); }

/* Configure step */
.smc-configure {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
}
.smc-back {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0;
    font-family: inherit;
    flex-shrink: 0;
}
.smc-back:hover { opacity: 0.8; }

.smc-food-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    flex-shrink: 0;
}
.smc-food-cat {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.smc-food-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.smc-food-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.smc-field { flex-shrink: 0; }
.smc-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.smc-qty-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.smc-qty-wrap input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}
.smc-qty-wrap input:focus { border-color: var(--accent); }
.smc-unit {
    position: absolute;
    right: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    pointer-events: none;
}

.smc-replace-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.smc-chip {
    padding: 7px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}
.smc-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(var(--accent-rgb, 251,191,36), 0.07);
}
.smc-chip-sel {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb, 251,191,36), 0.15);
    color: var(--accent);
}

.smc-add-btn {
    width: 100%;
    padding: 13px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
    flex-shrink: 0;
    margin-top: auto;
}
.smc-add-btn:hover { opacity: 0.88; }

/* Mobile and Tablet responsive improvements */
@media (max-width: 768px) {
    /* Trainer extras section - better spacing on mobile */
    .trainer-extras-section {
        margin-top: 20px;
        margin-bottom: 16px;
    }

    /* Make extras body scrollable on mobile */
    .trainer-extras-body {
        max-height: 350px !important;
    }

    .trainer-extra-item {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 10px;
    }

    .trainer-extra-item-info {
        font-size: 0.8rem;
        width: 100%;
        order: 1;
        flex: 1;
    }

    .trainer-extra-item-macros {
        font-size: 0.7rem;
        width: 100%;
        margin-top: 6px;
        order: 3;
    }

    .trainer-extra-remove {
        order: 2;
        flex-shrink: 0;
        align-self: flex-start;
        padding: 4px 8px;
        font-size: 1rem;
    }

    /* Search modal improvements for mobile */
    .search-modal-card {
        width: 96% !important;
        max-width: 100% !important;
        height: 88vh !important;
        max-height: 88vh !important;
    }

    /* Button trigger better tap target on mobile */
    .trainer-extra-search-trigger {
        padding: 14px 12px !important;
        font-size: 0.88rem !important;
        min-height: 44px;
    }
}
