/* ComputeFit — Information Hierarchy v0.1.8 candidate.
 * Presentation-only corrective layer, loaded last. */

/* Shared containment. Borders remain inside each component's own box. */
.cf-fit-card,
.cf-recommendation,
.cf-me-explorer {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.cf-fit-card__main,
.cf-fit-card__facts,
.cf-fit-card__facts-row,
.cf-fit-card__actions {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.cf-fit-card__main strong {
    max-width: 100%;
    font-size: 1.65rem !important;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.28;
}

/* Every Hardware-Fit subtitle has the same quant-only visual role. */
.cf-fit-card__main > span {
    color: var(--color-secondary-text, #6a6a6a);
    font-size: 1.2rem !important;
    font-weight: 400;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Every retained badge is visually centred. */
.cf-fit-card__primary-status,
.cf-fit-card--tested .cf-evidence--tested,
.cf-fit-card--tested .cf-fit-card__fit,
.cf-evidence--vendor,
.cf-recommendation__status,
.cf-fit-card__guide,
.cf-fit-card__view-evidence {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    line-height: 1.25;
}

/* Non-measured cards: model/subtitle -> status -> secondary information. */
.cf-fit-results {
    container-type: inline-size;
}

.cf-fit-card--guidance,
.cf-fit-card--candidate {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 10px !important;
    width: 100%;
    background: #fcfcfb;
    box-shadow: none;
}

.cf-fit-card--guidance .cf-fit-card__main,
.cf-fit-card--candidate .cf-fit-card__main,
.cf-fit-card--guidance .cf-fit-card__facts,
.cf-fit-card--candidate .cf-fit-card__facts {
    width: 100%;
}

.cf-fit-card--guidance .cf-fit-card__facts,
.cf-fit-card--candidate .cf-fit-card__facts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
}

/* One exact semantic token for every No-exact-measurement status. */
.cf-fit-card__facts .cf-fit-card__primary-status,
.cf-fit-card--guidance .cf-fit-card__primary-status,
.cf-fit-card--candidate .cf-fit-card__primary-status {
    width: max-content;
    min-width: 0;
    max-width: 100%;
    min-height: 32px;
    padding: 6px 12px !important;
    border: 1px solid rgba(128, 128, 128, 0.32) !important;
    border-radius: 999px;
    color: #3c3c3c !important;
    background: #ffffff !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    line-height: 1.25 !important;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.cf-fit-card__secondary {
    max-width: 100%;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--color-secondary-text, #6a6a6a) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    letter-spacing: 0.01em;
    line-height: 1.4;
    text-align: left;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

/* At useful card widths, spend the horizontal space without compromising the
 * narrow-card stack. The facts stay one semantic column and sit against the
 * card's right padding, so the former empty right half is no longer dominant. */
@container (min-width: 430px) {
    .cf-fit-card--guidance,
    .cf-fit-card--candidate {
        grid-template-columns: minmax(145px, 1fr) minmax(225px, auto) !important;
        align-items: center !important;
        column-gap: 18px !important;
        row-gap: 8px !important;
    }

    .cf-fit-card--guidance .cf-fit-card__facts,
    .cf-fit-card--candidate .cf-fit-card__facts {
        width: auto;
        align-items: flex-end;
        text-align: right;
    }

    .cf-fit-card--guidance .cf-fit-card__secondary,
    .cf-fit-card--candidate .cf-fit-card__secondary {
        text-align: right;
    }
}

/* TESTED cards: model -> subtitle -> badges -> summary -> actions. */
.cf-fit-card--tested {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 10px !important;
    width: 100%;
}

.cf-fit-card--tested .cf-fit-card__main,
.cf-fit-card--tested .cf-fit-card__facts--tested {
    width: 100%;
}

.cf-fit-card--tested .cf-fit-card__main strong {
    max-width: 100%;
    color: var(--color-primary-text, #1b1b1b);
    font-size: 1.65rem;
    font-weight: 800;
}

.cf-fit-card--tested .cf-fit-card__facts--tested {
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start;
    gap: 8px;
}

.cf-fit-card--tested .cf-fit-card__facts-row {
    width: 100%;
    justify-content: flex-start !important;
}

.cf-fit-card--tested .cf-fit-card__facts-row--top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.cf-fit-card--tested .cf-evidence--tested,
.cf-fit-card--tested .cf-fit-card__fit {
    min-height: 30px;
    padding: 6px 11px !important;
    border-radius: 999px;
    white-space: nowrap;
}

.cf-fit-card--tested .cf-evidence--tested {
    border: 1px solid rgba(17, 106, 69, 0.22);
    color: #116a45 !important;
    background: #eaf7f1 !important;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.cf-fit-card--tested .cf-fit-card__fit {
    border: 1px solid rgba(17, 79, 199, 0.22);
    color: #114fc7 !important;
    background: #eef4ff !important;
    font-size: 1.2rem;
    font-weight: 700;
}

.cf-fit-card__facts-row--measured-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 0;
    margin: 0;
    padding: 0;
}

.cf-fit-card__facts-row--measured-summary span {
    display: inline !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--color-secondary-text, #6a6a6a) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    line-height: 1.4;
    white-space: normal !important;
}

.cf-fit-card__facts-row--measured-summary span + span::before {
    content: "\00b7";
    margin: 0 0.45em;
    color: var(--color-secondary-text, #999);
}

.cf-fit-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 10px;
    width: 100%;
    margin: 2px 0 0;
    padding-top: 8px;
    border-top: 1px solid var(--color-border, #ececec);
}

.cf-fit-card__view-evidence,
.cf-fit-card__guide {
    min-height: 32px;
    max-width: 100%;
    margin: 0 !important;
    padding: 5px 11px !important;
    border: 1px solid var(--color-border, #d8d8d8) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    font-size: 1.2rem !important;
    font-weight: 700;
    text-decoration: none !important;
    white-space: normal !important;
}

.cf-fit-card__guide-label,
.cf-fit-card__guide-arrow {
    font-size: inherit !important;
    line-height: inherit !important;
}

.cf-fit-card__view-evidence {
    color: var(--color-primary-text, #15171a);
    cursor: pointer;
}

.cf-fit-card__guide {
    gap: 0.35rem;
    color: var(--color-accent, #3b5bfd) !important;
}

/* Selected state stays inside the card's border box. */
.cf-fit-card--selected {
    border-color: rgba(49, 103, 214, 0.72) !important;
    outline: 0 !important;
    box-shadow: inset 0 0 0 1px rgba(49, 103, 214, 0.28) !important;
}

.cf-fit-card:focus-visible,
.cf-fit-card__view-evidence:focus-visible,
.cf-fit-card__guide:focus-visible {
    outline: 2px solid rgba(49, 103, 214, 0.68) !important;
    outline-offset: 2px;
}

/* Recommendation: original compact family; no hero, metric strip, or CTA. */
.cf-recommendation {
    margin: 0 0 1.1rem;
    padding: 14px 16px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
    border-radius: 7px;
    background: #ffffff;
    box-shadow: none;
    font-size: 1.2rem;
    line-height: 1.5;
}

.cf-recommendation__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 9px;
    margin-bottom: 6px;
}

.cf-recommendation__status {
    min-height: 26px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-align: center;
    text-transform: uppercase;
    white-space: normal;
}

.cf-recommendation__status--recommended {
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #ffffff;
    background: #1f6f43;
}

.cf-recommendation__config {
    min-width: 0;
    color: var(--color-primary-text, #222);
    font-size: 1.25rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.cf-recommendation__basis,
.cf-recommendation__basis--unknown {
    margin: 0 0 7px;
    color: #444;
    font-size: 1.2rem !important;
    line-height: 1.45;
}

.cf-recommendation__why {
    margin: 5px 0 6px;
    padding-left: 1.15rem;
}

.cf-recommendation__why li {
    margin: 1px 0;
    color: #555;
    font-size: 1.2rem;
    line-height: 1.45;
}

.cf-recommendation__evidence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding-top: 7px;
    border-top: 1px dashed rgba(128, 128, 128, 0.3);
    color: #555;
    font-size: 1.2rem;
}

.cf-recommendation__view,
.cf-recommendation__metrics,
.cf-recommendation__metric {
    display: none !important;
}

.cf-recommendation__confidence {
    margin: 6px 0 0;
    color: var(--color-secondary-text, #777);
    font-size: 1.2rem;
}

.cf-recommendation--unknown {
    border-color: rgba(128, 128, 128, 0.3);
    background: #fbfbfa;
}

.cf-recommendation__status--unknown {
    border: 1px solid rgba(128, 128, 128, 0.32);
    color: #4a4a4a !important;
    background: #ffffff !important;
}

.cf-recommendation__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 5px 0;
}

.cf-recommendation__chip {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 2px 9px;
    border: 1px solid rgba(128, 128, 128, 0.12);
    border-radius: 999px;
    color: #666;
    background: #f1f1f0;
    font-size: 1.2rem;
}

.cf-recommendation__why li[data-cf-reason-code="QUALITY_NOT_MEASURED"],
.cf-recommendation__why li[data-cf-reason-code="STABILITY_UNKNOWN"],
.cf-recommendation__why li[data-cf-reason-code="QUALITY_UNKNOWN"],
.cf-recommendation__why li[data-cf-reason-code="PERFORMANCE_UNKNOWN"],
.cf-recommendation__why li[data-cf-reason-code="CONTEXT_NOT_MEASURED"],
.cf-recommendation__why li[data-cf-reason-code="STABILITY_NOT_MEASURED"] {
    color: #969696 !important;
    font-weight: 400;
}

/* Evidence prose stays quiet; no isolated note label is generated. */
.cf-checker__note {
    max-width: 72ch;
    margin: 12px 0 16px;
    color: var(--color-secondary-text, #7a7a7a);
    font-size: 1.2rem;
    line-height: 1.5;
}

.cf-checker__note::before,
.cf-checker__note::after {
    content: none !important;
}

.cf-checker__note strong {
    color: #555;
    font-weight: 700;
}

/* Explorer: MODEL full row; desktop secondary controls exactly one row. */
.cf-me-explorer {
    font-size: 1.2rem;
    line-height: 1.5;
}

.cf-me-explorer__model {
    display: block !important;
    width: 100%;
    margin: 0 0 10px;
}

.cf-me-explorer__model-label {
    display: block;
    margin-bottom: 4px;
    color: #444;
    font-size: 1.2rem !important;
    font-weight: 700;
}

.cf-me-explorer__model-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 40px;
    padding: 6px 10px !important;
    border: 1px solid var(--color-border, #c8c8c8);
    border-radius: 8px;
    background: #ffffff;
    font-size: 1.2rem !important;
    font-weight: 600;
    box-sizing: border-box;
}

.cf-me-explorer__selectors {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
    width: 100%;
    margin: 0 0 10px;
}

.cf-me-explorer__selectors .cf-checker__field {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0;
}

.cf-me-explorer__selectors .cf-checker__field > span {
    margin-bottom: 3px;
    color: var(--color-secondary-text, #777);
    font-size: 1.2rem !important;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cf-me-explorer__selectors select,
.cf-me-explorer__selectors select[data-cf-me-provider-select],
.cf-me-explorer__selectors select[data-cf-me-quant-select],
.cf-me-explorer__selectors select[data-cf-me-workload-select] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 36px;
    padding: 4px 8px;
    border: 1px solid var(--color-border, #d0d0d0);
    border-radius: 6px;
    background: #ffffff;
    font-size: 1.2rem !important;
    box-sizing: border-box;
}

.cf-checker__summary,
.cf-checker__result-head,
.cf-checker__result-kicker,
[data-cf-result-count] {
    font-size: 1.2rem;
    line-height: 1.5;
}

.cf-checker__result-kicker,
[data-cf-result-count] {
    font-size: 1.2rem !important;
}

.cf-me-explorer__scope strong,
.cf-me-explorer strong,
.cf-context__scope-detail,
.cf-me-explorer table th,
.cf-me-explorer table td,
.cf-me-explorer .cf-evidence,
.cf-me-explorer .cf-context-identity {
    font-size: 1.2rem !important;
    line-height: 1.45;
}

.cf-checker__label,
.cf-checker__status {
    font-size: 1.2rem !important;
}

.cf-fit-results { margin-bottom: 4px; }
.cf-recommendation-root { margin: 4px 0 8px; }
.cf-recommendation-root + .cf-measured-explorer-root { margin-top: 22px; }

@media (max-width: 767px) {
    .cf-me-explorer__selectors {
        grid-template-columns: minmax(0, 1fr);
    }

    .cf-fit-card,
    .cf-recommendation,
    .cf-me-explorer,
    .cf-measured-explorer-root {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .cf-fit-card__primary-status,
    .cf-fit-card__view-evidence,
    .cf-fit-card__guide,
    .cf-recommendation__status {
        width: 100%;
    }

    .cf-fit-card__actions {
        align-items: stretch;
    }
}
