/* HealthCalc — uses storefront brand CSS vars (--primary, --main, --border-color) */
.health-calc {
    --hc-surface: #fff;
    --hc-surface2: #f4f6f9;
    --hc-border: var(--border-color, #e2e8f0);
    --hc-accent: var(--primary);
    --hc-accent2: var(--main);
    --hc-text: var(--main, #1e293b);
    --hc-text2: #64748b;
    /* Aliases used by HealthCalc Pro result HTML */
    --accent: var(--primary);
    --accent2: var(--main);
    --text: var(--hc-text);
    --text2: var(--hc-text2);
    --surface2: var(--hc-surface2);
    --border: var(--hc-border);
    color: var(--hc-text);
    max-width: 720px;
    margin: 0 auto;
}

.health-calc .calc-card,
.health-calc .storefront-form-card {
    background: var(--surface, var(--hc-surface));
    border: 1px solid var(--line, var(--hc-border));
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: none;
}

@media (min-width: 992px) {
    .health-calc .calc-card,
    .health-calc .storefront-form-card {
        padding: 48px;
    }
}

.health-calc .calc-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.health-calc .calc-card .subtitle {
    font-size: 0.875rem;
    color: var(--hc-text2);
    margin-bottom: 20px;
    line-height: 1.5;
}

.health-calc .form-group {
    margin-bottom: 0;
}

.health-calc .wrap-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.health-calc .toggle-group {
    display: flex;
    gap: 6px;
}

.health-calc .toggle-btn {
    flex: 1;
    padding: 9px 16px;
    background: var(--white, var(--hc-surface));
    border: 2px solid var(--line, var(--hc-border));
    border-radius: 8px;
    color: var(--hc-text2);
    cursor: pointer;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.15s;
    user-select: none;
}

.health-calc .toggle-btn:hover:not(.active) {
    border-color: var(--main);
    color: var(--main);
}

.health-calc .toggle-btn.active {
    background-color: var(--main);
    border-color: var(--main);
    color: var(--white);
    font-weight: 600;
}

.health-calc .button-submit {
    margin-top: 8px;
}

.health-calc .button-submit .tf-btn.btn-fill {
    background-color: var(--main);
    border-color: var(--main);
    color: var(--white);
}

.health-calc .button-submit .tf-btn.btn-fill .text,
.health-calc .button-submit .tf-btn.btn-fill .text-button {
    color: inherit;
}

.health-calc .result-box {
    background: color-mix(in srgb, var(--primary) 8%, #fff);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, #fff);
    border-radius: 12px;
    padding: 18px;
    margin-top: 16px;
    display: none;
}

.health-calc .result-box.show {
    display: block;
}

.health-calc .result-main {
    font-size: 2rem;
    font-weight: 800;
    color: var(--main);
}

.health-calc .result-label {
    font-size: 0.8rem;
    color: var(--hc-text2);
    margin-bottom: 4px;
}

.health-calc .result-cat {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
}

.health-calc .cat-underweight {
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
}

.health-calc .cat-normal {
    background: color-mix(in srgb, var(--primary) 20%, #fff);
    color: var(--main);
}

.health-calc .cat-overweight {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.health-calc .cat-obese {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.health-calc .result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.health-calc .result-item {
    background: var(--hc-surface2);
    border-radius: 8px;
    padding: 10px;
}

.health-calc .result-item .ri-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hc-text);
}

.health-calc .result-item .ri-lbl {
    font-size: 0.7rem;
    color: var(--hc-text2);
}

.health-calc .bp-chart {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 10px;
}

.health-calc .bp-chart th {
    background: var(--hc-surface2);
    padding: 8px 10px;
    text-align: left;
    color: var(--hc-text2);
    font-weight: 600;
}

.health-calc .bp-chart td {
    padding: 7px 10px;
    border-top: 1px solid var(--hc-border);
}

.health-calc .bp-normal { color: #047857; }
.health-calc .bp-elevated { color: #b45309; }
.health-calc .bp-high1 { color: #c2410c; }
.health-calc .bp-high2 { color: #dc2626; }
.health-calc .bp-crisis { color: #b91c1c; font-weight: 700; }

.health-calc .timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.health-calc .tl-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.health-calc .tl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 4px;
}

.health-calc .tl-content .tl-date {
    font-size: 0.75rem;
    color: var(--hc-text2);
}

.health-calc .tl-content .tl-event {
    font-size: 0.85rem;
    font-weight: 500;
}

.health-calc .prog-bar {
    height: 8px;
    background: var(--hc-border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.health-calc .prog-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--primary);
}

.health-calc .macro-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.health-calc .macro-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.health-calc .hidden {
    display: none !important;
}

.health-calc-hub .hc-tool-card {
    display: block;
    height: 100%;
    padding: 1.25rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.health-calc-hub .hc-tool-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 20%, transparent);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.health-calc-hub .hc-tool-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.health-calc-hub .hc-tool-card .hc-method {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
}
