/* Proprietary data component: Bonus Terms Reality Check.
   All rules are scoped to #proprietary-data so theme styles cannot leak in. */

#proprietary-data {
    --pd-bg: #f5f7fa;
    --pd-surface: #ffffff;
    --pd-surface-soft: #eef3f7;
    --pd-text: #182230;
    --pd-muted: #5f6c7b;
    --pd-border: #d7dee7;
    --pd-accent: #245a7a;
    --pd-accent-strong: #173f59;
    --pd-accent-soft: #e7f0f5;
    --pd-warning: #9a4f0c;
    --pd-warning-bg: #fff6e8;
    --pd-danger: #a12622;
    --pd-success: #187451;
    --pd-focus: #276f9d;
    --pd-radius: 16px;
    --pd-radius-sm: 10px;
    --pd-shadow: 0 12px 34px rgba(24, 34, 48, 0.08);
    --pd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    color: var(--pd-text);
    display: block;
    font-family: var(--pd-font);
    font-size: 16px;
    line-height: 1.5;
    margin: 28px 0;
}

#proprietary-data,
#proprietary-data * {
    box-sizing: border-box;
}

/* Themes that set a display value on generic elements can defeat the UA
   [hidden] rule, so the conditional blocks need an explicit guard. */
#proprietary-data [hidden] {
    display: none !important;
}

#proprietary-data .pd-shell {
    background: var(--pd-bg);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    box-shadow: var(--pd-shadow);
    overflow: hidden;
}

#proprietary-data .pd-heading-row {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 24px 24px 8px;
}

#proprietary-data .pd-heading-copy {
    min-width: 0;
}

#proprietary-data .pd-title {
    color: var(--pd-text);
    font-family: var(--pd-font);
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 8px;
    padding: 0;
}

#proprietary-data .pd-intro {
    color: var(--pd-muted);
    font-size: 0.98rem;
    max-width: 760px;
}

#proprietary-data .pd-badge {
    background: var(--pd-accent-soft);
    border: 1px solid rgba(36, 90, 122, 0.22);
    border-radius: 999px;
    color: var(--pd-accent-strong);
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 7px 10px;
    text-transform: uppercase;
}

#proprietary-data .pd-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    padding: 16px 24px 24px;
}

#proprietary-data .pd-panel {
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius-sm);
    min-width: 0;
    padding: 20px;
}

#proprietary-data .pd-panel-title {
    color: var(--pd-text);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

#proprietary-data .pd-grid {
    display: grid;
    gap: 14px;
}

#proprietary-data .pd-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#proprietary-data .pd-field {
    min-width: 0;
}

#proprietary-data .pd-label-row {
    margin-bottom: 6px;
}

#proprietary-data .pd-label-row label {
    color: var(--pd-text);
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

#proprietary-data .pd-control-wrap {
    position: relative;
}

#proprietary-data .pd-control {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--pd-surface);
    background-image: none;
    border: 1px solid var(--pd-border);
    border-radius: 9px;
    color: var(--pd-text);
    display: block;
    font-family: var(--pd-font);
    /* 16px keeps iOS Safari from zooming the page on focus. */
    font-size: 16px;
    line-height: 1.25;
    margin: 0;
    max-width: none;
    min-height: 44px;
    padding: 10px 12px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
    width: 100%;
}

#proprietary-data select.pd-control {
    background-image: linear-gradient(45deg, transparent 50%, var(--pd-muted) 50%), linear-gradient(135deg, var(--pd-muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    padding-right: 34px;
}

#proprietary-data .pd-control:focus-visible,
#proprietary-data .pd-button:focus-visible,
#proprietary-data a:focus-visible {
    outline: 3px solid rgba(39, 111, 157, 0.28);
    outline-offset: 2px;
}

#proprietary-data .pd-control:focus {
    border-color: var(--pd-focus);
    box-shadow: 0 0 0 3px rgba(39, 111, 157, 0.12);
}

#proprietary-data .pd-control.pd-invalid,
#proprietary-data .pd-control.pd-invalid:focus {
    border-color: var(--pd-danger);
    box-shadow: 0 0 0 3px rgba(161, 38, 34, 0.12);
}

#proprietary-data .pd-suffix-wrap .pd-control {
    padding-right: 38px;
}

#proprietary-data .pd-suffix {
    color: var(--pd-muted);
    font-size: 0.92rem;
    font-weight: 700;
    pointer-events: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

#proprietary-data .pd-help {
    color: var(--pd-muted);
    font-size: 0.76rem;
    line-height: 1.35;
    margin-top: 5px;
}

#proprietary-data .pd-field-note {
    color: var(--pd-warning);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 5px;
}

#proprietary-data .pd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

#proprietary-data .pd-button {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    display: inline-block;
    font-family: var(--pd-font);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    min-height: 42px;
    padding: 10px 14px;
    text-transform: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

#proprietary-data .pd-button-primary,
#proprietary-data .pd-button-primary:visited {
    background: var(--pd-accent);
    color: #ffffff;
}

#proprietary-data .pd-button-primary:hover,
#proprietary-data .pd-button-primary:focus {
    background: var(--pd-accent-strong);
    color: #ffffff;
}

#proprietary-data .pd-button-secondary {
    background: var(--pd-surface);
    border-color: var(--pd-border);
    color: var(--pd-text);
}

#proprietary-data .pd-button-secondary:hover,
#proprietary-data .pd-button-secondary:focus {
    background: var(--pd-surface-soft);
    color: var(--pd-text);
}

#proprietary-data .pd-result-hero {
    background: var(--pd-accent-soft);
    border: 1px solid rgba(36, 90, 122, 0.18);
    border-radius: var(--pd-radius-sm);
    padding: 16px;
}

#proprietary-data .pd-result-label,
#proprietary-data .pd-metric-label,
#proprietary-data .pd-ratio-label,
#proprietary-data .pd-formula-title {
    color: var(--pd-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

#proprietary-data .pd-result-value {
    color: var(--pd-accent-strong);
    font-size: clamp(1.9rem, 4vw, 2.65rem);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-top: 6px;
    overflow-wrap: anywhere;
}

#proprietary-data .pd-result-note {
    color: var(--pd-muted);
    font-size: 0.84rem;
    margin-top: 8px;
}

#proprietary-data .pd-result-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}

#proprietary-data .pd-metric {
    border: 1px solid var(--pd-border);
    border-radius: 9px;
    min-width: 0;
    padding: 12px;
}

#proprietary-data .pd-metric-value {
    color: var(--pd-text);
    font-size: 1.08rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

#proprietary-data .pd-ratio-card,
#proprietary-data .pd-formula-box {
    border: 1px solid var(--pd-border);
    border-radius: 9px;
    margin-top: 12px;
    padding: 13px;
}

#proprietary-data .pd-ratio-top {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

#proprietary-data .pd-ratio-value {
    color: var(--pd-text);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

#proprietary-data .pd-meter {
    background: #e6eaf0;
    border-radius: 999px;
    height: 8px;
    margin-top: 10px;
    overflow: hidden;
}

#proprietary-data .pd-meter-fill {
    background: var(--pd-success);
    border-radius: inherit;
    height: 100%;
    transition: width 220ms ease, background-color 220ms ease;
    width: 0;
}

#proprietary-data .pd-meter-fill.is-low {
    background: var(--pd-success);
}

#proprietary-data .pd-meter-fill.is-mid {
    background: var(--pd-warning);
}

#proprietary-data .pd-meter-fill.is-high {
    background: var(--pd-danger);
}

#proprietary-data .pd-ratio-copy,
#proprietary-data .pd-formula-text,
#proprietary-data .pd-warning-copy {
    color: var(--pd-muted);
    font-size: 0.82rem;
    line-height: 1.45;
    margin-top: 8px;
}

#proprietary-data .pd-warning {
    background: var(--pd-warning-bg);
    border: 1px solid rgba(154, 79, 12, 0.26);
    border-radius: 9px;
    margin-top: 12px;
    padding: 13px;
}

#proprietary-data .pd-warning-title {
    color: var(--pd-warning);
    font-size: 0.88rem;
    font-weight: 800;
}

#proprietary-data .pd-formula-box {
    background: var(--pd-surface-soft);
}

#proprietary-data .pd-footnote,
#proprietary-data .pd-safety-note {
    color: var(--pd-muted);
    font-size: 0.79rem;
    line-height: 1.5;
    padding: 0 24px 16px;
}

#proprietary-data .pd-safety-note {
    padding-bottom: 22px;
    padding-top: 0;
}

#proprietary-data .pd-safety-note a {
    color: var(--pd-accent-strong);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

#proprietary-data .pd-noscript {
    margin-top: 14px;
}

@media (max-width: 820px) {
    #proprietary-data .pd-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 580px) {
    #proprietary-data {
        margin: 20px 0;
    }

    #proprietary-data .pd-heading-row {
        display: grid;
        gap: 10px;
        padding: 18px 16px 6px;
    }

    #proprietary-data .pd-badge {
        justify-self: start;
    }

    #proprietary-data .pd-layout {
        padding: 12px 12px 16px;
    }

    #proprietary-data .pd-panel {
        padding: 16px;
    }

    #proprietary-data .pd-grid-2,
    #proprietary-data .pd-result-grid {
        grid-template-columns: 1fr;
    }

    #proprietary-data .pd-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    #proprietary-data .pd-button {
        width: 100%;
    }

    #proprietary-data .pd-footnote,
    #proprietary-data .pd-safety-note {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #proprietary-data *,
    #proprietary-data *::before,
    #proprietary-data *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
