/* ===== result.css — стили результатов ===== */

    /* ===== Results Section (переработанный) ===== */
    .results-section {
        margin-top: 24px;
    }

    /* Hero */
    .results-hero {
        background: var(--hero-gradient);
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-md) var(--radius-md);
        padding: 32px;
        position: relative;
        overflow: hidden;
        margin-bottom: 24px;
        transition: var(--transition);
    }

    .dark-mode .results-hero {
        background: var(--hero-gradient-dark);
    }

    .results-hero-bg {
        position: absolute;
        top: -50%;
        right: -20%;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: var(--hero-bg-circle);
        pointer-events: none;
    }

    .results-hero-bg::after {
        content: '';
        position: absolute;
        bottom: -60%;
        left: -40%;
        width: 250px;
        height: 250px;
        border-radius: 50%;
        background: var(--hero-bg-circle2);
    }

    .results-hero-content {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 28px;
    }

    .results-hero-icon {
        width: 48px;
        height: 48px;
        background: var(--hero-icon-bg);
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--hero-text);
        font-size: 24px;
        backdrop-filter: blur(4px);
    }

    .results-hero-title h2 {
        font-size: 22px;
        color: var(--hero-text);
        font-weight: 600;
    }

    .results-hero-title p {
        font-size: 13px;
        color: var(--hero-subtext);
        margin-top: 2px;
    }

    .results-hero-title p span {
        font-weight: 600;
        color: var(--hero-subtext-strong);
    }

    /* Calories hero */
    .calories-hero {
        text-align: center;
        margin-bottom: 20px;
    }

    .calories-hero .calories-value {
        font-size: 80px;
        font-weight: 800;
        font-family: 'Google Sans', 'Roboto', 'Montserrat', sans-serif;
        color: var(--hero-text);
        line-height: 1;
        margin-bottom: 4px;
        text-shadow: var(--hero-text-shadow);
    }

    .calories-hero .calories-label {
        font-size: 16px;
        color: var(--hero-label);
        font-weight: 500;
        letter-spacing: 0.5px;
    }

    /* Macro breakdown */
    .calories-breakdown {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 24px;
        padding: 16px 24px;
        background: var(--hero-macro-bg);
        backdrop-filter: blur(8px);
        border-radius: var(--radius-md);
        max-width: 480px;
        margin: 0 auto;
    }

    .dark-mode .calories-breakdown {
        background: var(--hero-macro-bg-dark);
    }

    .macro-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 14px;
        color: var(--hero-macro-text);
    }

    .macro-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .macro-item strong {
        font-size: 16px;
        color: var(--hero-macro-strong);
        font-weight: 700;
    }

    .macro-unit {
        font-size: 12px;
        color: var(--hero-macro-unit);
    }

    .macro-divider {
        width: 1px;
        height: 24px;
        background: var(--hero-divider);
    }

    /* Results grid — 2 колонки */
    .results-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-bottom: 24px;
    }

    @media (max-width: 768px) {
        .results-grid {
            grid-template-columns: 1fr;
        }
        .calories-breakdown {
            flex-direction: column;
            gap: 12px;
        }
        .macro-divider {
            width: 100%;
            height: 1px;
        }
        .calories-hero .calories-value {
            font-size: 56px;
        }
    }

    /* Result cards */
    .result-card {
        background: var(--surface);
        border-radius: var(--radius-md);
        padding: 20px;
        box-shadow: var(--elevation-1);
        transition: var(--transition);
        display: flex;
        flex-direction: column;
        border: 1px solid var(--outline-variant);
    }

    .dark-mode .result-card {
        background: var(--surface);
    }

    .result-card:hover {
        box-shadow: var(--elevation-2);
        border-color: var(--outline);
    }

    .result-card-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
        font-size: 13px;
        font-weight: 600;
        color: var(--on-surface-variant);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .result-card-header .tooltip-trigger {
        margin-left: auto;
        position: relative;
        display: inline-flex;
        align-items: center;
        cursor: pointer;
        color: var(--on-surface-variant);
        opacity: 0.5;
        transition: opacity 0.2s ease;
    }

    .result-card-header .tooltip-trigger:hover,
    .result-card-header .tooltip-trigger:focus {
        opacity: 1;
        color: var(--md-primary);
    }

    .result-card-header .tooltip-trigger .svg-icon svg {
        width: 18px;
        height: 18px;
    }

    .tooltip-text {
        visibility: hidden;
        opacity: 0;
        position: absolute;
        z-index: 100;
        top: calc(100% + 8px);
        right: 0;
        width: 260px;
        padding: 12px 14px;
        background: var(--md-primary);
        color: #fff;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.5;
        text-transform: none;
        letter-spacing: 0.2px;
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-lg);
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .tooltip-trigger:hover .tooltip-text,
    .tooltip-trigger:focus .tooltip-text {
        visibility: visible;
        opacity: 1;
    }

    .dark-mode .tooltip-text {
        background: var(--md-primary-container);
        color: var(--on-primary-container);
    }

    .result-card-header .svg-icon svg {
        width: 18px;
        height: 18px;
    }

    .result-card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .result-card-value {
        font-size: 36px;
        font-weight: 800;
        font-family: 'Google Sans', 'Roboto', 'Montserrat', sans-serif;
        color: var(--on-surface);
        line-height: 1.1;
        transition: var(--transition);
    }

    .dark-mode .result-card-value {
        color: var(--on-surface);
    }

    .result-card-unit {
        font-size: 13px;
        color: var(--on-surface-variant);
        margin-top: 2px;
    }

    .result-card-hint {
        font-size: 12px;
        color: var(--on-surface-variant);
        margin-top: 10px;
        opacity: 0.8;
    }

    /* Цвета заголовков карточек */
    .result-card-bmi .result-card-header .svg-icon svg { color: var(--success); }
    .result-card-bmr .result-card-header .svg-icon svg { color: var(--danger); }
    .result-card-fat .result-card-header .svg-icon svg { color: var(--tertiary); }
    .result-card-change .result-card-header .svg-icon svg { color: var(--warning); }
    .result-card-goal .result-card-header .svg-icon svg { color: var(--purple); }
    .result-card-tdee .result-card-header .svg-icon svg { color: var(--md-primary); }

    /* Ring chart (BMI) */
    .result-ring {
        position: relative;
        width: 100px;
        height: 100px;
        margin-bottom: 12px;
    }

    .result-ring svg {
        width: 100%;
        height: 100%;
    }

    .result-ring-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }

    .result-ring-value {
        font-size: 22px;
        font-weight: 700;
        color: var(--on-surface);
        font-family: 'Google Sans', 'Roboto', 'Montserrat', sans-serif;
        line-height: 1;
    }

    .result-ring-label {
        font-size: 11px;
        color: var(--on-surface-variant);
        margin-top: 2px;
    }

    /* Progress bars */
    .result-card-bar {
        width: 100%;
        height: 6px;
        background: var(--surface-variant);
        border-radius: 3px;
        margin-top: 12px;
        overflow: hidden;
    }

    .result-card-bar-fill {
        height: 100%;
        border-radius: 3px;
        background: linear-gradient(90deg, var(--md-primary), var(--tertiary));
        transition: width 0.6s ease;
    }

    .result-card-fat-bar {
        width: 100%;
        height: 6px;
        background: var(--surface-variant);
        border-radius: 3px;
        margin-top: 12px;
        overflow: hidden;
    }

    .result-card-fat-fill {
        height: 100%;
        border-radius: 3px;
        background: linear-gradient(90deg, var(--tertiary), var(--warning));
        transition: width 0.6s ease;
    }

    /* Trend icon */
    .result-card-trend {
        margin-top: 8px;
    }

    .result-card-trend .svg-icon svg {
        width: 32px;
        height: 32px;
    }

    .result-card-trend.trend-down .svg-icon svg { color: var(--success); }
    .result-card-trend.trend-up .svg-icon svg { color: var(--danger); }
    .result-card-trend.trend-flat .svg-icon svg { color: var(--warning); }

    /* Goal progress */
    .result-card-progress {
        width: 100%;
        height: 6px;
        background: var(--surface-variant);
        border-radius: 3px;
        margin-top: 12px;
        overflow: hidden;
    }

    .result-card-progress-fill {
        height: 100%;
        border-radius: 3px;
        background: linear-gradient(90deg, var(--purple), var(--md-primary));
        transition: width 0.6s ease;
    }

    .button-container {
        display: flex;
        gap: 12px;
    }

    @media (max-width: 600px) {
        .button-container {
            flex-direction: column;
        }
    }


    /* ===== PDF Report Styles ===== */
    #pdf-report {
        width: 800px;
        padding: 40px;
        background: var(--pdf-bg);
        color: var(--pdf-text);
        font-family: 'Google Sans', 'Roboto', 'Nunito', sans-serif;
        position: absolute;
        left: -9999px;
        top: 0;
    }

    #pdf-report .pdf-header {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 20px 24px;
        background: var(--pdf-item-bg);
        border-radius: 12px;
        margin-bottom: 24px;
        border: 1px solid var(--pdf-border);
    }

    #pdf-report .pdf-header-icon {
        width: 44px;
        height: 44px;
        background: var(--pdf-primary);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    #pdf-report .pdf-header-icon svg {
        width: 24px;
        height: 24px;
        fill: #fff;
    }

    #pdf-report .pdf-header-text {
        flex: 1;
    }

    #pdf-report .pdf-header h1 {
        font-size: 20px;
        color: var(--pdf-text);
        margin: 0;
        font-weight: 700;
    }

    #pdf-report .pdf-header p {
        font-size: 12px;
        color: var(--pdf-secondary);
        margin: 2px 0 0;
    }

    #pdf-report .pdf-section {
        margin-bottom: 24px;
    }

    #pdf-report .pdf-section-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--pdf-primary);
        margin-bottom: 12px;
        padding-bottom: 6px;
        border-bottom: 1px solid var(--pdf-border);
    }

    #pdf-report .pdf-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    #pdf-report .pdf-grid-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 12px;
    }

    #pdf-report .pdf-item {
        padding: 12px 16px;
        background: var(--pdf-item-bg);
        border-radius: 8px;
    }

    #pdf-report .pdf-item-label {
        font-size: 11px;
        color: var(--pdf-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }

    #pdf-report .pdf-item-value {
        font-size: 20px;
        font-weight: 700;
        color: var(--pdf-text);
    }

    #pdf-report .pdf-item-sub {
        font-size: 12px;
        color: var(--pdf-secondary);
        margin-top: 2px;
    }

    #pdf-report .pdf-calories-hero {
        text-align: center;
        padding: 24px;
        background: var(--pdf-hero-gradient);
        border-radius: 12px;
        margin-bottom: 24px;
    }

    #pdf-report .pdf-calories-hero .pdf-big-number {
        font-size: 56px;
        font-weight: 800;
        color: var(--hero-text);
        line-height: 1;
    }

    #pdf-report .pdf-calories-hero .pdf-big-label {
        font-size: 14px;
        color: var(--hero-subtext);
        margin-top: 4px;
    }

    #pdf-report .pdf-macro-row {
        display: flex;
        justify-content: center;
        gap: 24px;
        margin-top: 16px;
    }

    #pdf-report .pdf-macro-item {
        text-align: center;
    }

    #pdf-report .pdf-macro-value {
        font-size: 18px;
        font-weight: 700;
        color: var(--hero-text);
    }

    #pdf-report .pdf-macro-label {
        font-size: 11px;
        color: var(--hero-subtext);
        margin-top: 2px;
    }

    #pdf-report .pdf-footer {
        text-align: center;
        padding-top: 20px;
        border-top: 1px solid var(--pdf-border);
        margin-top: 28px;
        font-size: 11px;
        color: var(--pdf-outline);
    }

    #pdf-report .pdf-chart-container {
        width: 720px;
        height: 240px;
        margin: 16px auto 0;
    }

    #pdf-report .pdf-badge {
        display: inline-block;
        padding: 3px 10px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;
    }

    #pdf-report .pdf-badge-green { background: var(--pdf-badge-green-bg); color: var(--pdf-badge-green-text); }
    #pdf-report .pdf-badge-yellow { background: var(--pdf-badge-yellow-bg); color: var(--pdf-badge-yellow-text); }
    #pdf-report .pdf-badge-red { background: var(--pdf-badge-red-bg); color: var(--pdf-badge-red-text); }

    /* ===== Chart Section ===== */

    .chart-header {
        margin-bottom: 16px;
    }

    .chart-container {
        height: 350px;
        position: relative;
        background: var(--surface);
        border-radius: var(--radius-md);
        padding: 16px;
    }
    .chart-container #weightChart {
        width: 100%;
        height: 320px;
    }

    @media (max-width: 768px) {
        .chart-header {
            flex-wrap: wrap;
            gap: 8px;
        }

        .chart-header .card-badge {
            font-size: 10px;
            padding: 3px 10px;
            white-space: nowrap;
        }

        .chart-container {
            height: 260px;
            padding: 10px;
        }

        .chart-container #weightChart {
            height: 240px;
        }
    }

