/* Shared HomeDecisionLab analysis result system.
   Used by free result pages and paid report pages. Keep calculator-specific wizard
   styling in questionnaire.css/home-analysis.css. */

:root {
    --hdl-result-good: #047857;
    --hdl-result-good-bg: #ecfdf5;
    --hdl-result-good-border: #a7f3d0;
    --hdl-result-warning: #b45309;
    --hdl-result-warning-bg: #fffbeb;
    --hdl-result-warning-border: #fde68a;
    --hdl-result-risk: #b91c1c;
    --hdl-result-risk-bg: #fef2f2;
    --hdl-result-risk-border: #fecaca;
    --hdl-result-neutral: #1d4ed8;
    --hdl-result-neutral-bg: #eff6ff;
    --hdl-result-neutral-border: #bfdbfe;
    --hdl-result-ink: #0f172a;
    --hdl-result-muted: #64748b;
    --hdl-result-border: #dbe7f6;
    --hdl-result-surface: #ffffff;
    --hdl-result-soft: #f8fafc;
}

.hdl-result-shell,
.results-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 0;
}

.hdl-result-card,
.results-card,
.hdl-verdict-card {
    background: var(--hdl-result-surface);
    border: 1px solid var(--hdl-result-border);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
    margin-bottom: 22px;
    padding: clamp(18px, 3vw, 28px);
}

.hdl-result-hero,
.hdl-verdict {
    border: 1px solid var(--hdl-result-neutral-border);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    margin-bottom: 22px;
    padding: clamp(18px, 3vw, 28px);
    text-align: center;
}

.hdl-result-verdict,
.hdl-verdict-text {
    color: var(--hdl-result-ink);
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
    font-weight: 850;
    line-height: 1.15;
}

.hdl-verdict-eye,
.hdl-result-kicker,
.hdl-card-label,
.hdl-section-title {
    color: var(--hdl-result-muted);
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: uppercase;
}

.hdl-section {
    margin-bottom: 26px;
}

.hdl-section-title {
    border-bottom: 2px solid #eef2f7;
    color: var(--hdl-result-ink);
    margin-bottom: 12px;
    padding-bottom: 9px;
}

.hdl-result-grid,
.hdl-grid3,
.hdl-grid2 {
    display: grid;
    gap: 14px;
    margin-bottom: 22px;
}

.hdl-grid3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hdl-grid2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hdl-result-metric,
.hdl-result-comparison,
.hdl-result-score,
.hdl-card {
    min-width: 0;
    border: 1px solid var(--hdl-result-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, var(--hdl-result-soft) 100%);
    padding: 16px;
    text-align: center;
}

.hdl-card-value,
.hdl-result-value {
    color: var(--hdl-result-ink);
    font-size: clamp(1.08rem, 2vw, 1.45rem);
    font-weight: 850;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.hdl-result-signal,
.hdl-signal-good,
.hdl-signal-warning,
.hdl-signal-risk,
.hdl-signal-neutral {
    border: 1px solid currentColor;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 850;
    line-height: 1.2;
    padding: 7px 11px;
}

.hdl-signal-good,
.hdl-value-good {
    background: var(--hdl-result-good-bg) !important;
    color: var(--hdl-result-good) !important;
}

.hdl-signal-warning,
.hdl-value-warning {
    background: var(--hdl-result-warning-bg) !important;
    color: var(--hdl-result-warning) !important;
}

.hdl-signal-risk,
.hdl-value-risk {
    background: var(--hdl-result-risk-bg) !important;
    color: var(--hdl-result-risk) !important;
}

.hdl-signal-neutral,
.hdl-value-neutral {
    background: var(--hdl-result-neutral-bg) !important;
    color: var(--hdl-result-neutral) !important;
}

.hdl-gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hdl-gauge {
    width: 80px;
    height: 80px;
    border: 5px solid;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hdl-result-ink);
    font-size: 1.3rem;
    font-weight: 850;
}

.hdl-gauge-label {
    color: var(--hdl-result-muted);
    font-size: .68rem;
    text-align: center;
    max-width: 80px;
}

.hdl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.hdl-table th {
    border-bottom: 2px solid #e2e8f0;
    color: var(--hdl-result-muted);
    font-size: .75rem;
    font-weight: 750;
    padding: 7px 0 10px;
    text-align: right;
    text-transform: uppercase;
}

.hdl-table th:first-child {
    text-align: left;
}

.hdl-table td {
    border-bottom: 1px solid #e2e8f0;
    color: var(--hdl-result-ink);
    padding: 10px 0;
}

.hdl-table td:not(:first-child) {
    font-weight: 750;
    text-align: right;
}

.hdl-table tr:last-child td {
    border-bottom: 0;
}

.hdl-insight {
    border-left: 4px solid var(--hdl-result-neutral);
    border-radius: 0 10px 10px 0;
    background: var(--hdl-result-neutral-bg);
    color: #1e3a5f;
    font-size: .9rem;
    line-height: 1.55;
    margin: 16px 0;
    padding: 14px 16px;
}

.hdl-bar-wrap {
    margin: 12px 0;
}

.hdl-bar-label {
    display: flex;
    justify-content: space-between;
    color: var(--hdl-result-muted);
    font-size: .78rem;
    margin-bottom: 4px;
}

.hdl-bar-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5eefb;
}

.hdl-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--hdl-result-neutral), #14b8a6);
    transition: width .5s;
}

.hdl-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f4f9;
    font-size: .875rem;
    padding: 6px 0;
}

.hdl-check-row:last-child {
    border-bottom: 0;
}

.hdl-check-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .6rem;
}

.hdl-why-box {
    border: 1px solid var(--hdl-result-border);
    border-radius: 16px;
    background: #fff;
    margin-bottom: 26px;
    padding: 18px 22px;
}

.hdl-why-box ul {
    margin: 0;
    padding-left: 18px;
}

.hdl-why-box li {
    line-height: 1.48;
    margin: 10px 0;
}

.hdl-result-actions,
.hdl-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: center;
    padding-top: 16px;
}

.hdl-result-actions .btn,
.hdl-action-row .btn {
    border-radius: 10px;
    font-weight: 800;
    padding: 11px 22px;
    text-decoration: none;
}

.info-icon .tip {
    text-transform: none !important;
    letter-spacing: 0 !important;
}

@media (max-width: 760px) {
    .hdl-grid3,
    .hdl-grid2,
    .hdl-result-grid {
        grid-template-columns: 1fr;
    }

    .hdl-result-card,
    .results-card {
        border-radius: 16px;
        padding: 18px;
    }
}

@media (max-width: 520px) {
    .hdl-table {
        font-size: .82rem;
    }

    .hdl-card-value,
    .hdl-result-value {
        font-size: 1rem;
    }

    .hdl-result-actions .btn,
    .hdl-action-row .btn {
        width: 100%;
    }
}

@media print {
    * {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .site-header,
    .site-footer,
    nav,
    .hdl-result-actions,
    .hdl-action-row,
    .ha-report-toolbar,
    .feedback-widget,
    .hdl-feedback-widget {
        display: none !important;
    }

    .hdl-result-shell,
    .results-container {
        max-width: none;
        padding: 0;
    }

    .hdl-result-card,
    .results-card,
    .hdl-result-hero,
    .hdl-verdict,
    .hdl-card,
    .hdl-why-box {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
    }
}
